When to use snd_pcm_avail instead of snd_pcm_avail_update?

3.2k Views Asked by At

ALSA functions snd_pcm_avail and snd_pcm_avail_update are very similar. Most examples seem to use snd_pcm_avail_update. When should I use snd_pcm_avail instead?

In my test program it does not seem to make a difference which function I use. What is the difference?

1

There are 1 best solutions below

0
On BEST ANSWER

snd_pcm_avail_update() does not go to the kernel to read the latest status, so the information might be out of date. This is just an optimization that is useful when used directly after a call that already has updated the status, such as poll() or snd_pcm_status().