Can't get 2 Teensy 4.0's to communicate MIDI with each other over USB

JoeK

Member
I feel like this is going to end up being something simple that I'm missing, but I'm stumped.

I have built 2 units that use Teensy 4.0.
Each unit is supplied power from a wall adapter, so each Teensy has the VUSB pads cut.

Unit A uses only the Teensy Device USB (Serial + MIDI Type).

Unit B has both the Teensy Device USB (Serial + MIDI Type) and USB Host (USBHost_t36.h) with D+, D- connected to Teensy, +5V from the power plane and GND from the ground plane.

When I connect Unit A to a computer, it is registered as a MIDI Device and I've verified MIDI is being sent into a DAW.

On Unit B, if I connect a class-compliant USB Keyboard into the USB Host port, the Keyboard becomes powered and I've verified MIDI is being sent from the keyboard into Unit B's midi event handlers.

So separately, they both work as intended plugged into other commercial hardware, but if I connect Unit A (Device) into Unit B (Host), I can't get any of Unit B's midi event handlers to respond to Unit A at all.
 
Found what I didn't know.

For USB MIDI Coms sent from one Teensy 4.0 to another, in the Host USB Teensy use:
Code:
MIDIDevice_BigBuffer usbMidiHost(midiHost);
Instead of:
Code:
MIDIDevice usbMidiHost(midiHost);

Working fine now.
 
Should be better documented, but
And to answer the question about buffers, you can create instances of either "MIDIDevice" or "MIDIDevice_BigBuffer" in your program. The BigBuffer class is required for 480 speed devices to work. Both use exactly 2 transmit buffers in a ping-pong style, where the size is 64 bytes for the normal and 512 for the BigBuffer version.
 
Should be better documented, but

Yeah, it did take me a while to revisit looking at the USBHost library since there was so much success already with the code and other devices (for about the past year). I did look back into the installed Teensyduino examples at one point, but didn't run across anything like that in there. I've since found other forum posts about it, now that I know what I'm looking for, but I wish my regular searching would have come up with it a lot earlier.
 
.... with D+, D- connected to Teensy, +5V from the power plane and GND from the ground plane.

Can you show us photos of the hardware connections? We could make a lot of blind guesses about the problem, but if the problem is a mistake or misunderstanding with the wiring, a couple quick photos are pretty much essential to really help solve it.
 
Back
Top