Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

USB MIDI support only supports BULK transfer endpoints #316

Closed
diyelectromusic opened this issue Sep 23, 2022 · 9 comments
Closed

USB MIDI support only supports BULK transfer endpoints #316

diyelectromusic opened this issue Sep 23, 2022 · 9 comments

Comments

@diyelectromusic
Copy link
Contributor

diyelectromusic commented Sep 23, 2022

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

@rsta2
Copy link
Owner

rsta2 commented Sep 23, 2022

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.

@diyelectromusic
Copy link
Contributor Author

diyelectromusic commented Sep 23, 2022

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."

@rsta2
Copy link
Owner

rsta2 commented Sep 24, 2022

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.

rsta2 added a commit that referenced this issue Sep 24, 2022
@rsta2
Copy link
Owner

rsta2 commented Sep 24, 2022

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.

@diyelectromusic
Copy link
Contributor Author

diyelectromusic commented Sep 24, 2022

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

@diyelectromusic
Copy link
Contributor Author

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. :)

@pik33
Copy link

pik33 commented Sep 25, 2022

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.

@rsta2
Copy link
Owner

rsta2 commented Sep 25, 2022

@pik33 Thanks for info!

dwhinham added a commit to dwhinham/mt32-pi that referenced this issue Sep 27, 2022
Some USB MIDI controllers use interrupt endpoints which is unsupported
by Circle (rsta2/circle#316).

Apply temporary patch to allow the use of these devices.
dwhinham added a commit to dwhinham/mt32-pi that referenced this issue Sep 28, 2022
Some USB MIDI controllers use interrupt endpoints which is unsupported
by Circle (rsta2/circle#316).

Apply temporary patch to allow the use of these devices.
@rsta2
Copy link
Owner

rsta2 commented Dec 1, 2022

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

@rsta2 rsta2 closed this as completed Dec 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants