From owner-freebsd-multimedia@FreeBSD.ORG Mon Mar 7 03:29:17 2005 Return-Path: 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 4DF0616A4CE for ; Mon, 7 Mar 2005 03:29:17 +0000 (GMT) Received: from deluge.cc.mcgill.ca (deluge.CC.McGill.CA [132.206.27.50]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7605B43D2D for ; Mon, 7 Mar 2005 03:29:16 +0000 (GMT) (envelope-from mat@cnd.mcgill.ca) Received: from mailscan1.cc.mcgill.ca (mailscan1.CC.McGill.CA [132.216.77.248]) by deluge.cc.mcgill.ca (8.12.11/8.12.3) with ESMTP id j273TC2M014804; Sun, 6 Mar 2005 22:29:14 -0500 (EST) Received: from cube.cnd.mcgill.ca (cube.CND.McGill.CA [132.216.25.196]) j273Shlw023030; Sun, 6 Mar 2005 22:28:44 -0500 (EST) Received: from localhost.localdomain (acid.cnd.mcgill.ca [132.216.11.151]) by cube.cnd.mcgill.ca (8.12.11/8.12.11) with ESMTP id j273SNwc016037; Sun, 6 Mar 2005 22:28:24 -0500 Received: from localhost.localdomain (acid [127.0.0.1]) j273SNLr000957; Sun, 6 Mar 2005 22:28:23 -0500 Received: (from mat@localhost) by localhost.localdomain (8.12.11/8.12.11/Submit) id j273SNqV000956; Sun, 6 Mar 2005 22:28:23 -0500 Date: Sun, 6 Mar 2005 22:28:23 -0500 From: Mathew Kanner To: Pyun YongHyeon Message-ID: <20050307032823.GH4237@cnd.mcgill.ca> References: <20050305224005.GC4237@cnd.mcgill.ca> <20050306162811.694d9c82@Magellan.Leidinger.net> <20050307025927.GB951@kt-is.co.kr> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050307025927.GB951@kt-is.co.kr> User-Agent: Mutt/1.4.2i Organization: I speak for myself, operating in Montreal, CANADA cc: freebsd-multimedia@freebsd.org cc: Alexander Leidinger cc: Mathew Kanner Subject: Re: uaudio patch, configurable buffer size X-BeenThere: freebsd-multimedia@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Multimedia discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Mar 2005 03:29:17 -0000 On Mar 06, Pyun YongHyeon wrote: > On Sun, Mar 06, 2005 at 04:28:11PM +0100, Alexander Leidinger wrote: > > On Sat, 5 Mar 2005 17:40:05 -0500 > > Mathew Kanner wrote: > > > > > Hi All, > > > I couldn't use my usb device because the default buffer size > > > (16*1024 bytes) was too much to be allocated (dma changes that > > > happened a while ago). The following is a patch to make it a tunable: > > > > > > http://www.cnd.mcgill.ca/~mat/uaudio-HEAD-buffersize-tunable.diff.gz > > > > There's an open PR about it. It changes the buffer size. AFAIR it also > > talks about changing the value of a parameter to a busdma call instead. > > I've patched the busdma call and now the device is detected here (but I > > don't hear any output...). > > > > I think you should add another set of validation code: The buffer size > > is divided by 2 in the code, so I think it should at least print a > > warning if "buffsize % 2 != 0". > > > > AFAIK no. The buffer size should be power of 2. > See pcm_getbuffersize() in sound.c. Hi Pyun, Darn, I totally forgot about the tunable in the form of hw.snd.pcm0.buffersize as is used in pcm_getbuffersize. This probably means that this patch isn't so necessary. Though there might be some value in having a tunable just for uaudio devices since we don't know the what pcm unit it will be before the devices comes (ok, they're seqeuential). Per your other e-mail, as present in the source, is having the default size of 16*1024 and doing bus_dma_tag_create with a maxsegz of 0x3fff (16*1024-1) a bug? --Mat