Florian Winter wrote:
> Suppose, an ALSA playback device is opened in blocking mode, and one
> thread calls snd_pcm_writei. If the snd_pcm_writei call blocks, because
> the internal buffer of the ALSA device is full, is there a way by which
> another thread can interrupt the call, so it returns immediately without
> writing any data to the device?

No.  As far as the user-space library is concerned, ALSA is not thread
safe.

You have to use non-blocking mode and poll() so that you can send a
message through a file descriptor (e.g. pipe or eventfd).


Regards,
Clemens

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Alsa-user mailing list
Alsa-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/alsa-user

Reply via email to