uaudio patch, configurable buffer size
mat at cnd.mcgill.ca
Mon Mar 7 03:29:17 GMT 2005
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 <mat at cnd.mcgill.ca> 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.
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
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?
More information about the freebsd-multimedia