mt32-pi icon indicating copy to clipboard operation
mt32-pi copied to clipboard

USB gadget mode

Open fayep opened this issue 4 years ago • 5 comments

I just got the MiSTer PI hat and it is great in regular cores but it does not appear in eg. ScummVM or Basilisk. If I could plug a USB cable from the MiSTer USB (not user) port to the Pi directly and have it detected as a MIDI class device directly using USB gadget mode that would be amazing. It seems like overkill to need to purchase and attach 2 USB to MIDI adaptors, one to the Mister and one to the Pi so that they can exchange data. I think this would also render the the MT32 PI instantly usable with other devices compatible with USB midi. https://github.com/atomic-penguin/linux/blob/master/drivers/usb/gadget/f_midi.c might be a good starting place?

fayep avatar Apr 07 '21 19:04 fayep

The real place to request this would be rsta2/Circle, and it was brought up already here https://github.com/rsta2/circle/issues/11 and here https://github.com/rsta2/circle/issues/202

I agree this would be a nice idea, but I just don't have the skills/experience to do it and it would be an enormous amount of work - the RPi USB interface has no public documentation so we're pretty lucky to have it working at all under baremetal.

As a workaround for the MiSTer use case I do have network MIDI (RTP-MIDI/AppleMIDI) almost working, so with a little bit of extra software on the MiSTer Linux side it might be possible to do things that way.

dwhinham avatar Apr 07 '21 20:04 dwhinham

Only if you are using a PI B or plug a USB ethernet in though? I will take a look at this at the weekend and see how much work is involved. Thanks for the pointer to Circle

fayep avatar Apr 07 '21 23:04 fayep

No, it'll support Wi-Fi too which the 3A+ has - I've actually had some very good results so far in my testing with Wi-Fi re: latency, much better than I expected.

No problem - if Circle did end up picking up gadget mode support I'd jump on supporting it here too, of course; would be a nice touch.

dwhinham avatar Apr 07 '21 23:04 dwhinham

So I've found this http://www.isticktoit.net/?p=1383, so at least we know there's stuff working with relatively modern kernels. That should make things a little easier, hopefully.

fayep avatar Apr 08 '21 03:04 fayep

Any more information on this? I would love to be able to use my MiSTer mt32-pi with my PC or RetroPie via just a USB cable.

c0d3h4x0r avatar Feb 19 '22 01:02 c0d3h4x0r