From owner-freebsd-multimedia@FreeBSD.ORG Sun Mar 6 17:10:53 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 5CD5916A4CE for ; Sun, 6 Mar 2005 17:10:53 +0000 (GMT) Received: from deluge.cc.mcgill.ca (deluge.CC.McGill.CA [132.206.27.50]) by mx1.FreeBSD.org (Postfix) with ESMTP id DE78C43D46 for ; Sun, 6 Mar 2005 17:10:52 +0000 (GMT) (envelope-from mat@cnd.mcgill.ca) Received: from mailscan3.cc.mcgill.ca (mailscan3.CC.McGill.CA [132.216.77.250]) by deluge.cc.mcgill.ca (8.12.11/8.12.3) with ESMTP id j26HAneK008267; Sun, 6 Mar 2005 12:10:49 -0500 (EST) Received: from cube.cnd.mcgill.ca (cube.CND.McGill.CA [132.216.25.196]) j26HATvO003355; Sun, 6 Mar 2005 12:10:30 -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 j26HATKq012622; Sun, 6 Mar 2005 12:10:29 -0500 Received: from localhost.localdomain (acid [127.0.0.1]) j26HATh2000806; Sun, 6 Mar 2005 12:10:29 -0500 Received: (from mat@localhost) by localhost.localdomain (8.12.11/8.12.11/Submit) id j26HARws000805; Sun, 6 Mar 2005 12:10:27 -0500 Date: Sun, 6 Mar 2005 12:10:27 -0500 From: Mathew Kanner To: Alexander Leidinger Message-ID: <20050306171027.GE4237@cnd.mcgill.ca> References: <20050305224005.GC4237@cnd.mcgill.ca> <20050306162811.694d9c82@Magellan.Leidinger.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050306162811.694d9c82@Magellan.Leidinger.net> User-Agent: Mutt/1.4.2i Organization: I speak for myself, operating in Montreal, CANADA cc: freebsd-multimedia@freebsd.org 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: Sun, 06 Mar 2005 17:10:53 -0000 On Mar 06, 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". ok, it now rejects odd sizes. > > > Would love to hear if this works for anybody else, > > I haven't tried it yet, maybe I get time to test it in the next days. > > Can you also please have a look at PR usb/78028? It adds some info to > /dev/sndstat. For now I don't object to his first try that always producing verbose output for format discovery. The second part that adds sndstd output I think is wrong as it duplicates sndstd itself (though a little prettier). However in the long term I don't think it's the right thing. The reason (I'm guessing) he wants the verbose output all the time is to be able to choose according the devices capabilities. The problem is we always reports supporting speeds in between [4000,48000], so for example on my device which only supports 48000hz, mplayer will happily try 44100hz and produce no output. Forcing resample to 48000 (mplayer -af resample=48000 ...) works. The situation is even worse in regards to reporting soft formats as you might not get a vote in what speed the hardware device gets set at. (All the same applies to formats as well). I tried to solve this once a while ago with less that perfect results, a better solution suddenly seems more obvious, which is to pass a blank pcm_caps to a new function uaudio_queury_formats. I'll see if I can come up with anything. Thanks, --Mat