Replies: 6 comments 18 replies
-
Cool..I will check this out. |
Beta Was this translation helpful? Give feedback.
-
What structure would you recommend to generalize and implement other gadget classes, like USB TMC? |
Beta Was this translation helpful? Give feedback.
-
The USB MIDI gadget support is now on the develop branch and will be part of the next release. The branch usb-gadget has been removed. |
Beta Was this translation helpful? Give feedback.
-
Hi @rsta2, this is interesting for MiniDexed. I have 2 quick questions:
|
Beta Was this translation helpful? Give feedback.
-
Does the USB gadget device have to be umidi1? If I try other device names then it doesn't seem to get registered on a plug and play event... But if it is umidi1 then what happens if both gadget and host support is built in for a run-time configuration option? doesn't host use umidi1 onwards too? Kevin |
Beta Was this translation helpful? Give feedback.
-
If your question was, if there is a RPi model check in the Circle gadget
library: No it isn't. In any way users must be careful, when they want to use
the USB gadget mode, because powering the RPi may be difficult (bus-powering may
not deliver enough current, and a separate power supply must have exactly the
same voltage as the USB bus). And one must not connect a RPi, which is in USB
host mode to an other USB host (e.g. a PC). Please read sample/29-miniorgan/
README ("USB GADGET MODE" section) and give this info to your users!
Rene
|
Beta Was this translation helpful? Give feedback.
-
There is an initial USB MIDI gadget support on the branch usb-gadget. This allows to connect the Raspberry Pi models (3)A(+), Zero (2) (W) and 4B directly to a host computer (e.g. for running a sequencer program). Before the Raspberry Pi was always the USB host with Circle and required an additional USB MIDI serial adapter for that purpose.
The sample/29-miniorgan and the test/usb-midi-send are prepared to work as a MIDI gadget. Please read the README files in the sample's / test's directory for details and infos about the required configuration. Beside the define
USB_GADGET_MODE
, which enables the gadget mode in the samples, you have to define your USB vendor ID asUSB_GADGET_VENDOR_ID
in Config.mk or include/circle/sysconfig.h. Please note that Circle does not support OTG protocols, so the USB controller always works in host or gadget mode and the connected peer must work in the opposite mode.Adapting your own application to be used as an USB MIDI gadget should not be difficult. You have to create an object of the class
CUSBMIDIGadget
(see include/circle/usb/gadget/usbmidigadget.h) instead ofCUSBHCIDevice
and callInitialize()
andUpdatePlugAndPlay()
on it as before in host mode. You have to add the library lib/usb/gadget/libusbgadget.a to yourLIBS
variable. The USB MIDI API deviceumidi1
has the same interface in host mode. There is a shared base classCUSBController
forCUSBHCIDevice
andCUSBMIDIGadget
, so it is easy to implement host and gadget mode in one application and to select it on user configuration.I tested this support successfully with a PC/Linux 6.3.9 and a Windows 10 host. Nevertheless problems are still possible, because it's a development version.
Feedback is welcome. If you have questions, please ask them here!
Beta Was this translation helpful? Give feedback.
All reactions