uaudio patch, configurable buffer size

Pyun YongHyeon yongari at kt-is.co.kr
Wed Mar 9 03:43:54 GMT 2005


On Tue, Mar 08, 2005 at 07:37:00AM -0500, Mathew Kanner wrote:
 > On Mar 08, Kazuhito HONDA wrote:
 > > Hello,
 > > 
 > > `he' is me, isn't he?
 > > 
 > > I haven't found that FreeBSD has the sampling rate converter.
 > > So I have made several ugly solutions for uaudio.
 > > But when uaudio can use the sampling rate converter, 
 > > they should be canceled.
 > 
 > 	Hi Kazuhito,
 > 	FreeBSD does have a format/sample rate converter in the
 > kernel, refer to hw.snd.report_soft_formats in the snd(4).  However,

I believe the kernel format converter should be used in the last
resort. The conversion consumes extra CPU cycles in kernel and
it would generate "audio hiccups" under high network or disk I/Os.
Accessing hardware buffer in kernel needs a Giant lock or device
supplied lock and the conversion needs manipulations of every bytes
of audio streams.
Also audio application could be fooled with hw.snd.report_soft_formats
and the application will think that the hardware supports almost every
format. That would impose unnecessary burden on pcm(4).
There are some comments in OSS Programmer's Guide too.(See page 31.)

 > it won't work with uaudio until we probe the capabilities properly.

Yes. Reporting correct hardware capabilities is prerequisit to correct
operation of audio hardware.

 > See my other e-mail to you a couple of minutes ago.
 > 	--Mat
-- 
Regards,
Pyun YongHyeon
http://www.kr.freebsd.org/~yongari	|	yongari at freebsd.org


More information about the freebsd-multimedia mailing list