[alsa-devel] [PATCH 1/1] ALSA: usb-audio: add support for Akai MPD16

Krzysztof Foltman wdev at foltman.com
Thu May 20 09:49:14 CEST 2010

On 05/20/2010 08:26 AM, Clemens Ladisch wrote:

>  Not that it really matters, but if the port variable were unsigned,
>  you could just check for "port <= 1".


>  It is possible that ALSA's buffer does not yet contain the entire
>  SysEx message; in this case, the driver would send off the partial
>  message without the 0x10 in the first byte.

In that case, the length wouldn't be updated to include the partial 
message, so it would send all the previous messages in the transmit 
buffer, but not the new (incomplete) message, and it would lose the 
incomplete message (because the code would then expect the message to 
end up at offset 0 instead of transfer_buffer_length, which isn't 

Anyway, the only correct solution is - as you say - to keep peeking 
until skippable content or a full valid SysEx is found. There are still 
some nasty corner cases here, too (for example, a SysEx that's longer 
than accepted maximum), but it should work. I'll try to implement it 
that way.

>  This MIDI port isn't an external port (which would imply that any
>  random device could be connected to it).  There is no macro for
>  internal ports; just use PORT_INFO(... _MIDI_GENERIC | _HARDWARE).

True. It isn't the other end of a MIDI socket, it's a USB version of the 
MIDI output of the device.

What about the oversized comment block about MPD16 SysEx messages - 
should it remain in the source file, or should I move it to a text file 
or remove it altogether?

Thanks  for the comments/ideas!


More information about the Alsa-devel mailing list