Jens M Andreasen wrote:
int err =
snd_rawmidi_open(/*in*/NULL,/*out*/&handle_out,
device,0);
The code above will wait forever if the device is already taken.
Opening the device with SND_RAWMIDI_NONBLOCK as last argument will get
you past that point, but then the write operation may fail (returning
negative) or return less bytes than you asked for to be written.
You can open the device with SND_RAWMIDI_NONBLOCK and then set it to
blocking mode with "snd_rawmidi_nonblock(handle_out, 0);".
HTH
Clemens