uaudio and Digigram UAX220

Alexander Leidinger Alexander at Leidinger.net
Thu Oct 27 04:35:00 PDT 2005


Kazuhito HONDA <kazuhito at ph.noda.tus.ac.jp> wrote:

> I had a patch which make USB audio device treat 24-bit on FreeBSD.
> It was attached to this mail.
> But cyclic noise will interrupt,
> though FreeBSD sound system can play/record sound source.
> It may result from USB system in FreeBSD,
> and the patch in (http://home.c2i.net/hselasky/isdn4bsd/privat/usb/)
> will resolve this noise problem.

I don't think we will use the new USB stack if NetBSD/OpenBSD doesn't use it
too. Apart from that, the patch looks nice. If nobody beats me, I try to
commit it at the weekend (no promises, I'm moving and the PC will be moved
at the weekend...).

Some comments inline.

> --- uaudio.c.orig	Thu Apr 28 02:16:27 2005
> +++ uaudio.c	Tue Sep  6 23:10:09 2005

> @@ -3876,7 +3900,7 @@ uaudio_query_formats(device_t dev, u_int
> 			}
> 		}
>
> -		if ((pn > 8*2) || (rn > 8*2))
> +		if ((pn > 12*2) || (rn > 12*2))
> 			break;
> 	}
> 	pfmt[pn] = 0;
> --- uaudio_pcm.c.orig	Thu Apr 28 02:16:27 2005
> +++ uaudio_pcm.c	Tue Sep  6 23:10:32 2005
> @@ -51,13 +51,13 @@ struct ua_info {
> 	struct ua_chinfo pch, rch;
> };
>
> -static u_int32_t ua_playfmt[8*2+1]; /* 8 format * (stereo or mono) + 
> endptr */
> +static u_int32_t ua_playfmt[12*2+1]; /* 8 format * (stereo or mono) 
> + endptr */

Wouldn't it be better to use a named constant instead of the hardcoded value?
We would only have to change one place instead of several in case we need to
change it. Additionally it is more descriptive for the casual reader.

Note: you forgot to change the number in the comments... in the recording
part too.

> -static struct pcmchan_caps ua_playcaps = {8000, 48000, ua_playfmt, 0};
> +static struct pcmchan_caps ua_playcaps = {8000, 96000, ua_playfmt, 0};

You also enhanced the capabilities for playing and recording. I'm not very
familiar with this (sound system capabilities handling and the USB audio
standard), but isn't this a property of the underlying hardware and should
be probed?

Bye,
Alexander.

-- 
http://www.Leidinger.net  Alexander @ Leidinger.net: PGP ID = B0063FE7
http://www.FreeBSD.org     netchild @ FreeBSD.org  : PGP ID = 72077137
DAMN IT, I GOTTA GET OUTTA HERE!




More information about the freebsd-multimedia mailing list