[alsa-devel] snd_pcm_delay, hw buffers and driver api (v2)

Clemens Ladisch clemens at ladisch.de
Fri Aug 14 14:13:00 CEST 2009

Kai Vehmanen wrote:
> ...
> In both cases, this value (hw_ptr) shows the status of sending data to an 
> separate entity, and one that has its own buffer (multiple ms) before the 
> actual DAC/ADC.
> So when application developer uses snd_pcm_delay(), the result is not 
> quite what the ALSA API says: ...

snd_pcm_avail() returns the free part of the buffer.
snd_pcm_delay() returns the filled part of the buffer plus
the additional delay imposed by the device.

The additional delay can be set by the driver in
pcm_substream->runtime->delay.  (Currently, only
the USB audio driver bothers to set this.)


More information about the Alsa-devel mailing list