Basically, the problem is this.  The MTP/AV protocol takes messages
like this:

   Dn B1 ... Bn

Where Dn is the device number, and B1..Bn are the midi message bytes.
This, at least, is what I gather from talking to Michael Mayers, the
original driver developer.

You may see the problem now.  When multiple threads talk to the device
at once, you have a problem:

A:  Dn B1 ,, ,, B2 ...
B:        Dn B1 ,, ...

The userland solution, when writing raw midi, is to just put a mutex
on the device and never write an incomplete message.

That is, of course, not an acceptable solution, and it also doesn't
work when you're using the ALSA sequencer interface (at least from the
API calls I've seen).  Fixing it in the driver requires interpreting
much MIDI, possibly buffering, and has some problems (what if someone
writes an incomplete message and dies?).

I'd like to hear recommendations; I have a particular interest in
seeing this work and am more than willing to submit patches.

-- 
Ryan Pavlik <[EMAIL PROTECTED]>

"Hey! Captain talks-too-much, quiet time is now."


-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com
_______________________________________________
Alsa-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/alsa-devel

Reply via email to