[LAD] Weird USB MIDI sysex problem

Clemens Ladisch clemens at ladisch.de
Sat Aug 31 17:04:31 UTC 2013


Gordon JC Pearce wrote:
> On Sat, Aug 31, 2013 at 11:34:33AM +0200, Clemens Ladisch wrote:
>> Gordon JC Pearce wrote:
>>> The only exception is if I send something not a multiple of three
>>> bytes but terminate the transfer with 0xf7, it will send
>>> everything including the 0xf7 - but this kills the sysex transfer.
>>
>> _Every_ SysEx message must be terminated with F7.
>
> The CZ1000 expects seven bytes to start the sysex transfer, at which
> point it will reply with a message and wait for an acknowledge.  The
> the PC should start to send the patch data, but it's quite important
> not to send that too soon otherwise the CZ will misbehave in various
> interesting ways.  Once all the patch data is send - with breaks for
> acks in between - the final 0xf7 is sent to terminate the sysex dump.

So the messages used by the CZ1000 in this protocol are not actually
MIDI messages.

>>> Is it really impossible to just send raw bytes over a USB MIDI cable?
>>
>> It is possible to send MIDI messages over a USB MIDI cable.
>
> According to the USB MIDI spec there is an event packet to send just
> single bytes.

There are devices that do not support this single-byte packet.

> This isn't implemented in the kernel,

It's used for real-time messages.

> it would be incredibly handy for sysex transfers, debugging and the
> like.
>
> Perhaps the answer is just to ditch alsa and poke the USB device with
> libusb?

Or change the driver to always use single-byte packets (modify the first
"if" in snd_usbmidi_transmit_byte).

> With a bit of testing, I've determined that at least the USB
> interfaces I have at hand do not support sysex.  They will pass some
> interestingly "interpreted" version of sysex, which is of course
> corrupted and unreadable by the device.

In what way corrupted?


Regards,
Clemens


More information about the Linux-audio-dev mailing list