[alsa-devel] Timing Info

Clemens Ladisch clemens at ladisch.de
Thu Jun 17 17:36:59 CEST 2010

Paul Dugas wrote:
> On Sun, Jun 13, 2010 at 10:10 AM, Clemens Ladisch <clemens at ladisch.de> wrote:
> > Set SND_PCM_TSTAMP_ENABLE to generate a timestamp whenever the hardware
> > position is updated.  Call snd_pcm_status to read the position and the
> > corresponding timestamp.
> I've re-read this a number of times and have been fiddling with code
> that dumps the status at various points but I'm still not grasping the
> concept here.  Can comeone point me to an explanation of the delay,
> avail, and avail_max values?

The avail value tells you how many frames are available, i.e., can be
written, in the output buffer.  The largest value that this had since
the last snd_pcm_status call is avail_max.

The delay value is the time that will elapse before the next frame that
you write into the buffer will actually be output by the hardware.  This
is not only the time until the hardware reads this frame out of the
buffer (which could be computed from avail) but also any processing
after that.


More information about the Alsa-devel mailing list