[alsa-devel] Races in alsa-lib with threads

Trent Piepho tpiepho at gmail.com
Tue Nov 13 21:36:57 CET 2012

On Tue, Nov 13, 2012 at 3:23 PM, Clemens Ladisch <clemens at ladisch.de> wrote:
> Trent Piepho wrote:
>> Consider snd_pcm_writei(), most of the time is usually spent blocked
>> waiting for a period to elapse.  It is perfectly ok to call
>> snd_pcm_delay() during this time.  But if one isn't allowed to make
>> any other pcm calls during snd_pcm_writei() then this can't be done.
> Then use non-blocking mode.  Blocking mode is suitable only for
> applications that do not want to access the device while waiting.

So you get the same problem with snd_pcm_wait().  Or snd_pcm_drain().
Any alsa-lib function than can block will exclude other threads from
alsa-lib for much longer than necessary.

More information about the Alsa-devel mailing list