Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 7 of 7

Thread: USBHost_t36 and High Speed USB MIDI messages

  1. #1
    Member
    Join Date
    Feb 2020
    Location
    Dublin, Ireland
    Posts
    81

    USBHost_t36 and High Speed USB MIDI messages

    Hi,
    I have a simple program outputting MIDI messages over USB running on both a T3.6 and a T4.0 (Teensyduino 1.56, Arduino 1.8.19) - both tested. When I run the USBHost_t36 MIDI InputFunctions example on a T4.1 with USB host, or on a MicroMod Teensy on an ATP carrier board, it detects the messages from the T3.6 but not from the T4.0. Is this a known limitation, or am I doing something wrong?
    All the best,
    Alan

  2. #2
    Senior Member
    Join Date
    Apr 2020
    Location
    DFW area in Texas
    Posts
    362
    Quote Originally Posted by AlanK View Post
    ...or am I doing something wrong?
    Post your source code (even if it is an unmodified example) & we can take a look to see if we can spot the possible cause. As a point of reference, I can attest to the fact that I have made use of the USB MIDI capability for both input & output MIDI messages successfully.

    Mark J Culross
    KD5RXT

  3. #3
    Member
    Join Date
    Feb 2020
    Location
    Dublin, Ireland
    Posts
    81
    Thanks Mark,

    The code for the transmitter is simply:

    Code:
    void setup() {
    }
    
    
    void loop() {
      while (usbMIDI.read()) { }
      usbMIDI.sendNoteOn(38, 100, 10);
      delay(200);
    }
    USB type is Serial+MIDI.

    The code for the receiver is the unmodified InputFunctions example (again, Serial+MIDI). Works fine for T3.6 sending messages to T4.1 or TMM, but not for T4.0 sending messages. T4.0 is sending MIDI messages - no doubt about that.

    All the best,

    Alan

  4. #4
    Member
    Join Date
    Feb 2020
    Location
    Dublin, Ireland
    Posts
    81
    Hi,

    With USBHOST_PRINT_DEBUG defined, the output when the T4.0 Serial+MIDI device is connected to the TMM USB Host is given below. If the T4.0 is changed to a MIDI device, there's a similar result with Descriptor 36 = ??? and Descriptor 37 = ???. I presume this is connected to the issue raised here Teensy 4.1 serial host can't recognize another teensy (pjrc.com)

    All the best,

    Alan


    new_Device: 480 Mbit/sec
    new_Pipe
    enumeration:
    enumeration:
    enumeration:
    Device Descriptor:
    12 01 00 02 EF 02 01 40 C0 16 89 04 79 02 01 02 03 01
    VendorID = 16C0, ProductID = 0489, Version = 0279
    Class/Subclass/Protocol = 239 / 2 / 1
    Number of Configurations = 1
    enumeration:
    enumeration:
    Manufacturer: Teensyduino
    enumeration:
    Product: Teensy MIDI
    enumeration:
    Serial Number: 7364090
    enumeration:
    Config data length = 149
    enumeration:
    Configuration Descriptor:
    09 02 95 00 03 01 00 C0 32
    NumInterfaces = 3
    ConfigurationValue = 1
    08 0B 00 02 02 02 01 00
    Interface Association = 0 through 1
    Class / Subclass / Protocol = 2 / 2 / 0
    09 04 00 00 01 02 02 01 00
    Interface = 0
    Number of endpoints = 1
    Class/Subclass/Protocol = 2 / 2 / 1
    05 24 00 10 01
    05 24 01 01 01
    04 24 02 06
    05 24 06 00 01
    07 05 82 03 10 00 05
    Endpoint = 2 IN
    Type = Interrupt
    Max Size = 16
    Polling Interval = 5
    09 04 01 00 02 0A 00 00 00
    Interface = 1
    Number of endpoints = 2
    Class/Subclass/Protocol = 10 / 0 / 0
    07 05 03 02 00 02 00
    Endpoint = 3 OUT
    Type = Bulk
    Max Size = 512
    Polling Interval = 0
    07 05 83 02 00 02 00
    Endpoint = 3 IN
    Type = Bulk
    Max Size = 512
    Polling Interval = 0
    09 04 02 00 02 01 03 00 00
    Interface = 2
    Number of endpoints = 2
    Class/Subclass/Protocol = 1 / 3 / 0
    07 24 01 00 01 25 00
    06 24 02 01 01 00
    06 24 02 02 02 00
    09 24 03 01 03 01 02 01 00
    09 24 03 02 04 01 01 01 00
    09 05 04 02 00 02 00 00 00
    Endpoint = 4 OUT
    Type = Bulk
    Max Size = 512
    Polling Interval = 0
    05 25 01 01 01
    09 05 84 02 00 02 00 00 00
    Endpoint = 4 IN
    Type = Bulk
    Max Size = 512
    Polling Interval = 0
    05 25 01 01 03
    enumeration:
    USBHub memory usage = 960
    USBHub claim_device this=200031E0
    USBHub memory usage = 960
    USBHub claim_device this=200035A0
    Descriptor 11 = IAD
    Descriptor 4 = INTERFACE
    MIDIDevice claim this=20003960
    len = 132
    Descriptor 36 = ???
    Descriptor 36 = ???
    Descriptor 36 = ???
    Descriptor 36 = ???
    Descriptor 5 = ENDPOINT
    Descriptor 4 = INTERFACE
    MIDIDevice claim this=20003960
    len = 97
    Descriptor 5 = ENDPOINT
    Descriptor 5 = ENDPOINT
    Descriptor 4 = INTERFACE
    MIDIDevice claim this=20003960
    len = 74
    Interface is MIDI
    type: 36, len: 7
    MIDI Header (ignored)
    type: 36, len: 6
    MIDI IN Jack (ignored)
    type: 36, len: 6
    MIDI IN Jack (ignored)
    type: 36, len: 9
    MIDI OUT Jack (ignored)
    type: 36, len: 9
    MIDI OUT Jack (ignored)
    type: 5, len: 9
    MIDI Endpoint: 4
    tx_size = 512
    type: 37, len: 5
    MIDI Endpoint Jack Association (ignored)
    type: 5, len: 9
    MIDI Endpoint: 84
    rx_size = 512
    type: 37, len: 5
    MIDI Endpoint Jack Association (ignored)
    Descriptor 36 = ???
    Descriptor 36 = ???
    Descriptor 36 = ???
    Descriptor 36 = ???
    Descriptor 36 = ???
    Descriptor 5 = ENDPOINT
    Descriptor 37 = ???
    Descriptor 5 = ENDPOINT
    Descriptor 37 = ???

  5. #5
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    Posts
    10,328
    Note: I know very very little on MIDI, but as I mentioned on the USB Serial issue of plugging in a t4 into host and try a different class, it may be similar issue with midi...
    Which is where I first saw classes with (BigBuffer)

    So you might try changing MIDIDevice to MIDIDevice_BigBuffer

    And see if that helps.

  6. #6
    Member
    Join Date
    Feb 2020
    Location
    Dublin, Ireland
    Posts
    81
    Thanks Kurt,

    That works perfectly. Would be good if it was included in comments in USBHost_t36 examples,

    All the best,

    Alan

  7. #7
    Member
    Join Date
    Feb 2020
    Location
    Dublin, Ireland
    Posts
    81
    Hi,

    This may be useful for someone. I can confirm that the PCB layout shown below for a USB Host connector for a T4.1 (2 layer PCB, 1.6 mm thick, USB connector on bottom of board) works at 480 Mbps. The D- and D+ traces are 1.6 mm wide with a 0.4 mm gap between them (should give, for that board, roughly 90 ohm impedance as required, but one trace is 3.5 mm longer than the other).

    Click image for larger version. 

Name:	PCB_USBhost.gif 
Views:	6 
Size:	29.6 KB 
ID:	27277

    All the best,

    Alan
    Last edited by AlanK; 01-20-2022 at 01:20 PM.

Posting Permissions

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