power-of-two buffer size. (was: Re: [LAD] [ANN] LV2 beta3)

Fons Adriaensen fons at kokkinizita.net
Sat May 12 08:08:14 UTC 2007


On Sat, May 12, 2007 at 09:39:44AM +0200, Jens M Andreasen wrote:

> A power of two is fine for PCI boards, but is it also optimal for say
> USB audio? 
> 
> IIRC, USB happens once every millisecond so I for one would have thought
> that numbers like 48, 96 or 44 and 45 would pop up naturally  

The driver layer is supposed to handle that. Unfortunately ALSA
seems to have problems with this. The simple solution is to use
a three-period buffer size (-n 3), at least at 48 kHz. 

At 44.1 kHz the number of samples transferred each millisecond is
not a constant. So either that turns into a non-constant period size
or the driver layer has to handle the repackaging.


-- 
FA

Follie! Follie! Delirio vano è questo !





More information about the Linux-audio-dev mailing list