Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 27 Oct 2005 13:34:48 +0200
From:      Alexander Leidinger <Alexander@Leidinger.net>
To:        Kazuhito HONDA <kazuhito@ph.noda.tus.ac.jp>
Cc:        freebsd-multimedia@freebsd.org, skywizard@MyBSD.org.my
Subject:   Re: uaudio and Digigram UAX220
Message-ID:  <20051027133448.vptim01kwoco8wcw@netchild.homeip.net>
In-Reply-To: <20051027.040902.343165902.kazuhito@ph.noda.tus.ac.jp>
References:  <4358CB6F.2080901@intersonic.se> <20051021235357.0c169e05.skywizard@MyBSD.org.my> <435B4EBE.5030502@intersonic.se> <20051027.040902.343165902.kazuhito@ph.noda.tus.ac.jp>

next in thread | previous in thread | raw e-mail | index | archive | help
Kazuhito HONDA <kazuhito@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!





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20051027133448.vptim01kwoco8wcw>