[alsa-devel] Trying to understand alsa

Fons Adriaensen fons at linuxaudio.org
Thu Jan 12 22:50:38 CET 2012


On Thu, Jan 12, 2012 at 09:44:11PM +0000, Jonathan Andrews wrote:
 
> What I want to do is tell ALSA to hold a buffer of 3 of my packets (3 x
> 1024Bytes, thats 512 x 16 bit samples) while I feed extra packets (1K
> Byte, 512 samples per buffer) in for playback.  The packets are arriving
> at roughly the correct rate, I just need a buffer to  iron out any
> jitter in network transmit, do I have to do this myself ?

Unless data is arriving on average at *exactly* the sample
rate of the ALSA device your buffering will sooner or later
underrun or overrun. ALSA itself can't handle this use case,
it requires adaptive resampling and it's not easy.

Ciao,

-- 
FA

Vor uns liegt ein weites Tal, die Sonne scheint - ein Glitzerstrahl.



More information about the Alsa-devel mailing list