From owner-freebsd-multimedia@FreeBSD.ORG Thu Oct 27 11:35:00 2005 Return-Path: X-Original-To: freebsd-multimedia@freebsd.org Delivered-To: freebsd-multimedia@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2108916A41F for ; Thu, 27 Oct 2005 11:35:00 +0000 (GMT) (envelope-from Alexander@Leidinger.net) Received: from www.ebusiness-leidinger.de (jojo.ms-net.de [84.16.236.246]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6549A43D45 for ; Thu, 27 Oct 2005 11:34:59 +0000 (GMT) (envelope-from Alexander@Leidinger.net) Received: from Andro-Beta.Leidinger.net (p54A5CFD6.dip.t-dialin.net [84.165.207.214]) (authenticated bits=0) by www.ebusiness-leidinger.de (8.13.1/8.13.1) with ESMTP id j9RBF5Tm052256; Thu, 27 Oct 2005 13:15:06 +0200 (CEST) (envelope-from Alexander@Leidinger.net) Received: from localhost (localhost [127.0.0.1]) by Andro-Beta.Leidinger.net (8.13.3/8.13.3) with ESMTP id j9RBYmJe067869; Thu, 27 Oct 2005 13:34:49 +0200 (CEST) (envelope-from Alexander@Leidinger.net) Received: from pslux.cec.eu.int (pslux.cec.eu.int [158.169.9.14]) by netchild.homeip.net (Horde MIME library) with HTTP; Thu, 27 Oct 2005 13:34:48 +0200 Message-ID: <20051027133448.vptim01kwoco8wcw@netchild.homeip.net> X-Priority: 3 (Normal) Date: Thu, 27 Oct 2005 13:34:48 +0200 From: Alexander Leidinger To: Kazuhito HONDA References: <4358CB6F.2080901@intersonic.se> <20051021235357.0c169e05.skywizard@MyBSD.org.my> <435B4EBE.5030502@intersonic.se> <20051027.040902.343165902.kazuhito@ph.noda.tus.ac.jp> In-Reply-To: <20051027.040902.343165902.kazuhito@ph.noda.tus.ac.jp> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format="flowed" Content-Disposition: inline Content-Transfer-Encoding: 7bit User-Agent: Internet Messaging Program (IMP) H3 (4.0.3) / FreeBSD-4.11 X-Virus-Scanned: by amavisd-new Cc: freebsd-multimedia@freebsd.org, skywizard@MyBSD.org.my Subject: Re: uaudio and Digigram UAX220 X-BeenThere: freebsd-multimedia@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Multimedia discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Oct 2005 11:35:00 -0000 Kazuhito HONDA 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!