3 Jun
2010
3 Jun
'10
2:48 p.m.
John Lindgren wrote:
On Thu, 2010-06-03 at 08:40 +0200, Clemens Ladisch wrote:
Alsa-lib is not thread safe.
From http://alsa-project.org/main/index.php/Main_Page:
ALSA has the following significant features: ... SMP and thread-safe design.
So, that's a big lie?
That applies to the kernel code.
Most functions in alsa-lib must not be called at the same time on the same device handle. (Don't ask me where this is documented.)
... poll()
Would it work to simply call snd_pcm_wait?
Yes. (I usually suggest poll because the code that writes audio data often wants to be informed of some other event. If your writing loop doesn't need to be interrupted, snd_pcm_wait works just fine.)
Regards, Clemens