Forum Rule: Always post complete source code & details to reproduce any issue!
Page 1 of 3 1 2 3 LastLast
Results 1 to 25 of 53

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

  1. #1

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

    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/US...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=1nt...80iyFjRtm4H1yI
    https://drive.google.com/open?id=16_...2m-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 :-)

  2. #2
    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!

  3. #3
    Senior Member
    Join Date
    Nov 2012
    Location
    Boston, MA, USA
    Posts
    1,107
    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.

  4. #4
    interesting. I will try that when I get home tonight

  5. #5
    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?

  6. #6
    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!

  7. #7
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    20,311
    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.

  8. #8
    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...t-status/page3).

    Thank you again for the great work and support!

  9. #9
    Does that rule out using the OP-1 with Usb host midi?
    Or is there a workaround or alternative?
    Thanks!

  10. #10
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    20,311
    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 by PaulStoffregen; 01-20-2019 at 06:58 PM.

  11. #11
    Paul, that’s awesome! Thank you so much for your efforts. Looking forward to your findings!

  12. #12
    Senior Member xxxajk's Avatar
    Join Date
    Nov 2013
    Location
    Buffalo, NY USA
    Posts
    528
    I'll have to try this with UHS3 which already contains a midi driver.

  13. #13
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    20,311
    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...

  14. #14
    Senior Member xxxajk's Avatar
    Join Date
    Nov 2013
    Location
    Buffalo, NY USA
    Posts
    528
    I totally can poop one out in like 5 minutes or less.
    :-)

  15. #15
    Senior Member xxxajk's Avatar
    Join Date
    Nov 2013
    Location
    Buffalo, NY USA
    Posts
    528
    Done, pushed two examples.
    examples -> UHS_host -> UHS_MIDI -> UHS_KINETIS_EHCI ...

  16. #16
    Senior Member xxxajk's Avatar
    Join Date
    Nov 2013
    Location
    Buffalo, NY USA
    Posts
    528
    Have to do a few more changes, so, not ready yet :-)

  17. #17
    Senior Member xxxajk's Avatar
    Join Date
    Nov 2013
    Location
    Buffalo, NY USA
    Posts
    528
    Should work without any issues. Will try here on the 2 midi keyboards I have here.

  18. #18
    Senior Member xxxajk's Avatar
    Join Date
    Nov 2013
    Location
    Buffalo, NY USA
    Posts
    528
    Works!
    Amazingly this is the first MCU able to keep up with the Arturia Minilab!

  19. #19
    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

  20. #20
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    20,311
    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

  21. #21
    Senior Member xxxajk's Avatar
    Join Date
    Nov 2013
    Location
    Buffalo, NY USA
    Posts
    528
    @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.

  22. #22
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    20,311
    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.

  23. #23
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    20,311
    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.

  24. #24
    Senior Member xxxajk's Avatar
    Join Date
    Nov 2013
    Location
    Buffalo, NY USA
    Posts
    528
    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.

  25. #25
    Senior Member xxxajk's Avatar
    Join Date
    Nov 2013
    Location
    Buffalo, NY USA
    Posts
    528
    Quote Originally Posted by PaulStoffregen View Post
    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •