[alsa-devel] cloning snd_seq_t (or creating one from client id)

Clemens Ladisch clemens at ladisch.de
Mon Mar 31 14:29:27 CEST 2014


Tobias Schlemmer wrote:
> I'm surprised that the upcoming version of RtMidi uses one ALSA client
> per MIDI port.
>
> I found out that sequencer handles (snd_seq_t) are not thread safe.

A sequencer client use a common buffer for the events of all ports.

> Could you provide some way to implement multithreaded ALSA clients?

Multiple threads would have to synchronize the buffer accesses in some
way.  How exactly merging and distributing of events from/to multiple
ports is handled (even when some thread does not react) is a policy that
cannot be imposed by the ALSA library.


Regards,
Clemens


More information about the Alsa-devel mailing list