USBHost_t36 Midi InputFunctions example is not working for me... Hardware issue?

Status
Not open for further replies.

parkernilson

New member
Hi there!
I am working on a Midi - CV/Gate module for my modular synth and figured the teensy 3.6 would be the perfect fit.
I am having a little bit of trouble using the t3.6 as a midi usb host, despite directly copying this example code: https://github.com/PaulStoffregen/USBHost_t36/tree/master/examples/MIDI/InputFunctions
so I figure the problem must be either in my hardware setup, or with the Teenage Engineering OP-1 (my synthesizer I am using)

When I monitor the serial connection, I see the startup message:
"USB Host InputFunctions example"
but when I connect my midi controller (either before or after the t3.6 is powered) it doesn't seem like the t3.6 is receiving any of the midi messages when I press keys on my midi controller.

I know that the OP-1 midi works because I use it with my DAW (FL Studio 12) all the time, no problem, but maybe it doesn't know how to connect to the t3.6? But that's what the usb host library is for right?

Here are links to some pictures of my hardware setup:
https://drive.google.com/open?id=1ntK5gEiG4ZWTpOQ0gf80iyFjRtm4H1yI
https://drive.google.com/open?id=16_9jHx5C8umVMBqsl82m-tURS71g9uOa

I have tested the continuity through the usb cables and the white mini usb end (connected to the synthesizer) has continuity with the usb host port on the t3.6 when everything is connected. This makes me think I must have the cables in the wrong order or something... but as far as I can tell it is supposed to go (from top to bottom in the picture) Vcc -- Red, Data- -- White, Data+ -- Green, ID (for establishing host) and Ground -- both soldered together under the green heatshrink.

I am powering the t3.6 from my laptop at the moment, but when it is finished it will be powered from the 12v rail on my modular synth, stepped down to 5v with a voltage regulator.

I copied the code directly from the example, it compiles without any errors, I've tested the continuity of the entire usb circuit from the mini usb end to the usb host port on the board, I am using arduino 1.8.5, with the teensyduino programmer, and I am using Windows 10.

thanks in advance for any help :)
 
Okay, so I've done some testing and the whole setup works great with my Casio XW-P1...
It seems that the problem must be with the OP-1. That doesn't make much sense to me, because I thought that usb midi was supposed to be uniform across devices, but I guess I will need to do some more research!
 
According to the manual, the OP-1 always sends USB MIDI:

13.7 Sequencing External Equipment
your OP-1 is always sending MIDI data out, even if you’re not in controller mode. this way you may connect the OP-1 via USB and use any of its built in sequencers for controlling software synthesizers or other connected hardware, configured to receive MIDI.

I wonder though if it needs more power than the Teensy is providing? I see there is an option to disable charging the battery, perhaps try that?

13.6 OPT mode
the OPT mode (option mode) disables USB charging of the OP-1, without having to pull the USB-cord. in COM mode, press the OPT key (T4) for getting to the OPT mode. from there, turn blue encoder to toggle USB charging on/off. OPT mode is useful when in a setup with a ground loop making noise. regardless of this setting, your unit will still charge if powered off, or if it runs out of power, as long as it remains physically connected via USB.
 
I disabled the USB charging, and the voltage across Vcc and ground on the usb rose from 4.36v to 4.5v... but still no luck. For the keyboard controller that works, the voltage is 4.6v. Does it make sense that that might be the problem? The OP-1 is just drawing too much power, and the teensy cannot provide?

The teensy doesn't appear to be communicating at all with the OP-1. Someone on reddit mentioned that because the OP-1 is capable of USB storage, the USB handshake might be different. Do you have any ideas about that?
 
I am trying the same and I am having exactly the same problem.
Setup works fine with other Midi controllers, but not with the OP-1.

@parkernilson
Did you find a solution?
Thanks!
 
I don't know anything about OP-1. Is there any chance it's running at 480 Mbit/sec and trying to use USB packets larger than 64 bytes? That size limit is the only known issue right now with USB host MIDI.
 
Paul, thank you for your answer.
It seems what you describe could be the reason. Here’s what debug mode prints when connecting the OP-1:

15:32:55.223 -> USB Host Testing
15:32:55.223 -> sizeof Device = 36
15:32:55.223 -> sizeof Pipe = 96
15:32:55.223 -> sizeof Transfer = 64
15:32:55.223 -> power up USBHS PHY
15:32:55.267 -> port change: 10001803
15:32:55.267 -> connect
15:32:55.343 -> begin reset
15:32:55.416 -> port change: 18001205
15:32:55.416 -> port enabled
15:32:55.416 -> end recovery
15:32:55.416 -> new_Device: 480 Mbit/sec
15:32:55.416 -> new_Pipe

I was hoping there would be a solution, as user flocked seemed to get it working (see thread https://forum.pjrc.com/threads/43450-Teensy-3-6-USB-MIDI-host-development-status/page3).

Thank you again for the great work and support!
 
Does that rule out using the OP-1 with Usb host midi?
Or is there a workaround or alternative?
Thanks!
 
Good news, turns out a friend here in the Portland area has an OP-1 and they're willing to let me use at a bi-weekly electronics meetup.

I'm still getting over a cold right now, so it's unlikely I'll make it out there this week. Will probably have to wait until Feb 4th.
 
Last edited:
Is there any ready-to-run example in the UHS3 library using EHCI and MIDI?

Or would there be any example in ~2 weeks? Sounds like a guy here in Portland is planning to bring quite a good number of USB MIDI products to test...
 
Nice!
I tried using the UHS3 examples.

I connected a fairly standard midi controller (Akai LPK): Serial monitor prints “device connected” and LED on teensy lights up when pressing keys on the controller.

When connecting the OP-1 none of that happens. No message of connection, no LED lighting up.

However, I am still learning and I am not 100% sure what exactly is supposed to happen in your examples if everything worked ;)
 
Ran the USB_MIDI_dump example here with the 3 USB MIDI devices I own.

Midiplus AKM320 keyboard - works
AKAI LPD8 drumpad - works
Novation Launchpad - not detected


"works" means it prints a bunch of hex numbers that look reasonable - but I didn't put any work into decoding & verifying they are really correct
 
@uleria It might not be reporting as standard midi, or isn't a standard midi device.
If it just doesn't report as midi, but actually is midi, then the vid and pid can be used to select the device.
Check your user manual too. There might be a way to place it into standard midi mode.

@PaulStoffregen that's correct. It is just a hex dump of the packets.
 
More testing with USB_MIDI_dump example and a Teensy 3.2 acting as a MIDI device running File > Examples > Teensy > USB_MIDI > Buttons.

Tried USB Type "MIDI", "MIDIx4", "Serial + MIDI", "Serial + MIDI + Audio". All seem to work.

Garbage data is printed after good MIDI messages.

Not very responsive though. I'm seeing 4 messages per packet, even when I wait quite some time between button presses.
 
Dunno why Teensy 3.2 is waiting (far longer than it should) and sending 4 messages together in 1 packet.

When I plug the same Teensy 3.2 running the USB MIDI "Buttons" example into my Linux PC and run 'aseqdump -p "Teensy MIDI"', I see the note on & note off messages arrive immediately as I press and release the button.


Edit: tried running File > Examples > USBHost_t36 > MIDI > InputFunctions on the Teensy 3.6, and plugged the Teensy 3.2 in to the host port. Same code on the 3.2 - the individual button press & release appear quickly.

Hard to say if this is a problem on the Teensy 3.2 side or a UHS3 issue... but it's definitely not responsive with UHS3 as it is on Linux, Mac, Windows and with USBHost_t36.
 
Novation Launchpad isn't a regular midi device.
Seems to require special protocol from the quick look at various open source attempts to get it to operate on Linux.

Basically, if you can place the device into a midi mode, it should just work, although some broken products won't reveal that they are midi.
 
Dunno why Teensy 3.2 is waiting (far longer than it should) and sending 4 messages together in 1 packet.

When I plug the same Teensy 3.2 running the USB MIDI "Buttons" example into my Linux PC and run 'aseqdump -p "Teensy MIDI"', I see the note on & note off messages arrive immediately as I press and release the button.


Edit: tried running File > Examples > USBHost_t36 > MIDI > InputFunctions on the Teensy 3.6, and plugged the Teensy 3.2 in to the host port. Same code on the 3.2 - the individual button press & release appear quickly.

Hard to say if this is a problem on the Teensy 3.2 side or a UHS3 issue... but it's definitely not responsive with UHS3 as it is on Linux, Mac, Windows and with USBHost_t36.

The actual core of UHS3 is quite fast. I'd have to say if it acts that way across everything, then it is UHS3, else it is the t3.2 code.
 
Status
Not open for further replies.
Back
Top