[alsa-devel] Question about snd_pcm_update_hw_ptr_post()

Clemens Ladisch clemens at ladisch.de
Tue Mar 4 08:27:32 CET 2008


Timur Tabi wrote:
> During playback, avail = snd_pcm_playback_avail().  Does this mean that avail is
> number of frames available in the playback DMA buffer for new data?

Yes, it's the number of free frames that the application can write.

> If so, why is avail >= runtime->stop_threshold considered an underrun condition?

When too many frames in the buffer are free, there are not enough frames
available for the hardware to play.

The default value of the stop threshold is the size of the buffer, so an
underrun happens when the buffer has been completely emptied.

> how can I adjust runtime->stop_threshold?

snd_pcm_sw_params_current()
snd_pcm_sw_params_set_stop_threshold()
snd_pcm_sw_params()


HTH
Clemens


More information about the Alsa-devel mailing list