I have found so much information about this, but it is either very old information, or not very clear information, or not all information, or...
My goal is to use my RPi 4B as an OTG Midi Device: I want my PC (or whatever other Midi device that you connect Midi devices to) to recognize my RPi as a Midi Device and send/recv data to/from it so a program I create can process this Midi data.
I read that on the RPi 4B, you can use the USB-C connecter (for powering it) can be used as an USB2 OTG port as well. I want to try this out, but I am not sure how: my PC will not be able to power the Pi with 3A, so I need to power it another way. I read that I can attach a stable 5V/3A source to pins 2 and 4, and the GND to pin 6. Now... if I do this AND connect a PC to the USB-C connector... the PC will probably also provide 5V (albeit lower power), will this be an issue? Can this destroy the RPi (or the PC) or an official RPi HAT?
If this should work (and I would expect so, because otherwise I don't understand how OTG over the normal means of connecting power would be a good idea), how do I go and make the RPi act as a Midi Device?
Simple thought that comes to mind: can I simply solder the two USB2 data wires (and the GND) on the USB-C connector DATA pins and keep the official power adapter as a power source at the same time?
I found old information where they told me to add these lines to config.txt (two separate posts, so I am not even sure if both lines are necessary):On the other hand, on the bottom of my config.txt, I can see It looks like the first thing I found is now legacy and I should now simply use this? And it is already enabled?
I have tried both ways, and it doesn't work. It only seems to work when I use the first way and then run the command. Then my test program shows a Midi device called f:midi as both Midi input and output, so I assume/hope that if I connect a PC to it, it will recognize this device. But I will only try this if I am sure I will not destroy my hardware.
But then... somewhere else, I read that g_midi is legacy too. What should I use instead?
As you can read, I found lots of incoherent information and got 'something' to work, but not good enough.
My goal is to use my RPi 4B as an OTG Midi Device: I want my PC (or whatever other Midi device that you connect Midi devices to) to recognize my RPi as a Midi Device and send/recv data to/from it so a program I create can process this Midi data.
I read that on the RPi 4B, you can use the USB-C connecter (for powering it) can be used as an USB2 OTG port as well. I want to try this out, but I am not sure how: my PC will not be able to power the Pi with 3A, so I need to power it another way. I read that I can attach a stable 5V/3A source to pins 2 and 4, and the GND to pin 6. Now... if I do this AND connect a PC to the USB-C connector... the PC will probably also provide 5V (albeit lower power), will this be an issue? Can this destroy the RPi (or the PC) or an official RPi HAT?
If this should work (and I would expect so, because otherwise I don't understand how OTG over the normal means of connecting power would be a good idea), how do I go and make the RPi act as a Midi Device?
Simple thought that comes to mind: can I simply solder the two USB2 data wires (and the GND) on the USB-C connector DATA pins and keep the official power adapter as a power source at the same time?
I found old information where they told me to add these lines to config.txt (two separate posts, so I am not even sure if both lines are necessary):
Code:
dtoverlay=dwc2modules-load=dwc2,g_midi
Code:
[cm4]# Enable host mode on the 2711 built-in XHCI USB controller.# This line should be removed if the legacy DWC2 controller is required# (e.g. for USB device mode) or if USB support is not required.otg_mode=1
I have tried both ways, and it doesn't work. It only seems to work when I use the first way and then run the command
Code:
sudo modprobe g_midi
But then... somewhere else, I read that g_midi is legacy too. What should I use instead?
As you can read, I found lots of incoherent information and got 'something' to work, but not good enough.
Statistics: Posted by scippie — Sun Dec 24, 2023 11:08 pm