[alsa-devel] opening a device multiple times?

Ákos Maróy akos at maroy.hu
Wed Jun 29 13:47:59 CEST 2011


I'm writing a piece of code that uses ALSA audio devices, where I open
the same output device multiple times, as a simple way to have parallel
audio channels, where I can send audio data to each 'channel' (PCM
handle) simultaneously, and the ALSA layer will mix the audio together.

My experience is that this works with some audio devices (for example,
with a pulse audio - ALSA gateway), but not on some other devices (for
example, on a USB sound device, driven by ALSA). In the latter case,
snd_pcm_open() will refuse to open the audio device multiple times.

I wonder what the generic concept here is - is it generally 'OK' to open
an audio device multiple times? If not, why not? :)


More information about the Alsa-devel mailing list