rsta2 / circle

A C++ bare metal environment for Raspberry Pi with USB (32 and 64 bit)

Home Page:https://circle-rpi.readthedocs.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

USB MIDI support only supports BULK transfer endpoints

diyelectromusic opened this issue · comments

commented

It would appear that there are several common USB MIDI controllers (e.g. those by Novation) that seem to present an INTERRUPT endpoint rather than a BULK endpoint. This means that they are ignored in usbmidi.cpp due to the check for just BULK endpoints.

It would appear that if this is changed to BULK or INTERRUPT then these controllers will work, but not really understanding how USB works, I don't know the implications of this change...

The check happens here: https://github.com/rsta2/circle/blob/master/lib/usb/usbmidi.cpp#L112

For more discussion and some details, see this thread as part of MiniDexed: probonopd/MiniDexed#258

Kevin

According to the USB MIDI class spec. 1.0 only bulk endpoints are used for MIDI streaming. If these devices use interrupt endpoints, this is not class conform. Nevertheless, if these devices work with standard operating systems, there should be a way to get them working with Circle too. I suppose that the test for bulk endpoints in the USB MIDI driver can be modified to except interrupt endpoints too. I do not think, that this will cause problems elsewhere. I will modify the driver tomorrow.

commented

I think a later version of the spec allowed support for interrupt endpoints, but as I say, I'm not really a USB person! See: https://www.usb.org/sites/default/files/USB%20MIDI%20v2_0.pdf

"5.3 MIDI Streaming Endpoint Descriptors
The following paragraphs outline the descriptors that fully characterize the endpoint(s) used for
transporting MIDI data streams to and from the USB MIDI function. Devices may use Bulk or
Interrupt Endpoints for transporting MIDI data streams."

Yes, but according to the "Class-specific AC Interface Descriptor" (see B.3.2) in the USB MIDI class 1.0 spec. both given devices support the revision 1.0 of the class spec. The field bcdADC is 0x100. I don't think the USB MIDI driver in Circle does work with devices at all, which are compatible with the 2.0 spec. This is not supported.

The USB MIDI driver has been updated on the develop branch to allow to use Interrupt EPs.

This driver may work with USB MIDI controllers, which support the USB MIDI Class 2.0 spec., because these devices should support a special mode for 1.0 hosts. But this has not been tested by myself, because I do not own such a USB MIDI controller. My previous comment regarding USB MIDI 2.0 support may be wrong.

commented

The USB MIDI driver has been updated on the develop branch to allow to use Interrupt EPs.

Well as I say, I don't really know USB, so I guess we'll have to see how people get on! :)

Many thanks - will take a look.

I know this approach works with my Novation Launchpad Mini (although rather than masking as you've done for the test, I just tested for either 0x02 or 0x03) which is the descriptor I referenced in that other thread.

Kevin

commented

Yes, but according to the "Class-specific AC Interface Descriptor" (see B.3.2) in the USB MIDI class 1.0 spec. both given devices support the revision 1.0 of the class spec. The field bcdADC is 0x100. I don't think the USB MIDI driver in Circle does work with devices at all, which are compatible with the 2.0 spec. This is not supported.

Ah yes, I see what you mean. So the Novation ought to have bcdADC to 0x200 if it wants to use INTERRUPT endpoints... Hmmm. :)

The Novation Impulse 61 has bcdADC = 1.00 and then Transfer Type = Interrupt. Didn't work in MiniDexed before, the updated experimental build now works.

@pik33 Thanks for info!

This issue has been fixed in Circle 45. @diyelectromusic thank you for finding the problem.