[alsa-devel] What does snd_pcm_delay() actually return?

Lennart Poettering mznyfn at 0pointer.de
Fri Jun 13 20:48:32 CEST 2008

On Fri, 13.06.08 19:37, Jaroslav Kysela (perex at perex.cz) wrote:

> It means that the PCM midlevel code thinks that samples in URBs are 
> played (underrun can be detected), but they are queued in URBs.
> OK, my fault. It's exactly behaviour I proposed (URBs are extra buffers), 
> but we need to take in account the right snd_pcm_delay() output. Lennart 
> probably meant that samples are consumed too much quickly at the stream 
> start and impossibility to detect the extra buffering mechanism with the 
> current code.

Yes, this is exactly what I am experiencing. At stream start my
estimations (based on update_avail) are way off. Afterwards everything
is fine. As a dirty workaround to fix this I halve the initial sleep
time always so that I can make sure I don't sleep for too long and get
an xrun. But that's really ugly, because halving it is just a wild
guess and it isn't even necessary on PCI hardware.


Lennart Poettering                        Red Hat, Inc.
lennart [at] poettering [dot] net         ICQ# 11060553
http://0pointer.net/lennart/           GnuPG 0x1A015CC4

More information about the Alsa-devel mailing list