Hi all,
following up on this thread (https://forum.pjrc.com/threads/57569-Does-Serial-Midi-≠-Class-Compliant), I did some more investigations to get clear on what the connectivity problem is.
I really like the MIO-XL for its plethora of USB host ports. I want to use it as centerpiece of my MIDI rig, involving a Yamaha MODX, Nord Stage2, Access Virus, and a Teensy 3.6.
Unfortunately, the MIO-XL does not recognize the Teensy in its MIDIx4 or MIDIx16 modes, where it provides 4 or 16 virtual ports. Only the single-port MIDI mode works. I have been in contact with the iConnectivity support to investigate the issue. First we suspected thought that the issue might be related to the Teensy being a hybrid USB device, providing MIDI and serial-port protocols, the latter for programming issues.
So I disabled the serial port device, turning the Teensy into a pure MIDI device. Still - the 4 port mode does not work, only if I bring the number of MIDI ports down to two. I know that the MIO-XL supports USB devices with more ports in general. So what could be the problem here? Here are the changes that make the Teensy work on the MIO-XL, but only with 2 ports:
In cores/teensy3/usb_desc.h:
In cores/teensy3/yield.cpp:
This is the USB descriptor in 4-port mode, stripped from the serial programming interface. The MIO-XL does not recognize this device:
This is the same USB descriptor, but stripped down to 2-ports using the above changes. This works perfectly fine on the MIO-XL:
The USB descriptors are identical, except for the additional Jack descriptors and the corresponding length fields.
I wonder if the MIO-XL's USB implementation makes additional assumptions that are not met by the Teensy's USB descriptor, although it's supposed to be class compliant. I'd be very thankful for any help, and I'm happy to spend more time investigating the issue if someone has an idea what to try.
I should add: The Yamaha MODX works perfectly fine on the MIO-XL, although it is a hybrid device with audio streaming and 3 MIDI ports:
I would really like to have more than just the two MIDI ports. What could I do to make the Teensy compatible?
I've also posted on the iConnectivity forum, hope to get more ideas there.
Best, Boris
following up on this thread (https://forum.pjrc.com/threads/57569-Does-Serial-Midi-≠-Class-Compliant), I did some more investigations to get clear on what the connectivity problem is.
I really like the MIO-XL for its plethora of USB host ports. I want to use it as centerpiece of my MIDI rig, involving a Yamaha MODX, Nord Stage2, Access Virus, and a Teensy 3.6.
Unfortunately, the MIO-XL does not recognize the Teensy in its MIDIx4 or MIDIx16 modes, where it provides 4 or 16 virtual ports. Only the single-port MIDI mode works. I have been in contact with the iConnectivity support to investigate the issue. First we suspected thought that the issue might be related to the Teensy being a hybrid USB device, providing MIDI and serial-port protocols, the latter for programming issues.
So I disabled the serial port device, turning the Teensy into a pure MIDI device. Still - the 4 port mode does not work, only if I bring the number of MIDI ports down to two. I know that the MIO-XL supports USB devices with more ports in general. So what could be the problem here? Here are the changes that make the Teensy work on the MIO-XL, but only with 2 ports:
In cores/teensy3/usb_desc.h:
Code:
#define NUM_INTERFACE 1 // <–– this was 2
// #define SEREMU_INTERFACE 1 // Serial emulation
// #define SEREMU_TX_ENDPOINT 1
// #define SEREMU_TX_SIZE 64
// #define SEREMU_TX_INTERVAL 1
// #define SEREMU_RX_ENDPOINT 2
// #define SEREMU_RX_SIZE 32
// #define SEREMU_RX_INTERVAL 2
#define MIDI_INTERFACE 0 // MIDI
#define MIDI_NUM_CABLES 2 // <–– this was 4
#define MIDI_TX_ENDPOINT 1 // <–– this was 3
#define MIDI_TX_SIZE 64
#define MIDI_RX_ENDPOINT 2 // <–– this was 4
#define MIDI_RX_SIZE 64
In cores/teensy3/yield.cpp:
Code:
if (running) return; // TODO: does this need to be atomic?
running = 1;
//if (Serial.available()) serialEvent(); // <–– commented out to silence a compile error
if (Serial1.available()) serialEvent1();
if (Serial2.available()) serialEvent2();
This is the USB descriptor in 4-port mode, stripped from the serial programming interface. The MIO-XL does not recognize this device:
Code:
Bus 001 Device 005: ID 16c0:0485 Van Ooijen Technische Informatica Teensyduino MIDI
Couldn't open device, some information will be missing
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 1.10
bDeviceClass 0 (Defined at Interface level)
bDeviceSubClass 0
bDeviceProtocol 0
bMaxPacketSize0 64
idVendor 0x16c0 Van Ooijen Technische Informatica
idProduct 0x0485 Teensyduino MIDI
bcdDevice 2.11
iManufacturer 1
iProduct 2
iSerial 3
bNumConfigurations 1
Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength 179
bNumInterfaces 1
bConfigurationValue 1
iConfiguration 0
bmAttributes 0xc0
Self Powered
MaxPower 100mA
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 0
bAlternateSetting 0
bNumEndpoints 2
bInterfaceClass 1 Audio
bInterfaceSubClass 3 MIDI Streaming
bInterfaceProtocol 0
iInterface 0
MIDIStreaming Interface Descriptor:
bLength 7
bDescriptorType 36
bDescriptorSubtype 1 (HEADER)
bcdADC 1.00
wTotalLength 127
MIDIStreaming Interface Descriptor:
bLength 6
bDescriptorType 36
bDescriptorSubtype 2 (MIDI_IN_JACK)
bJackType 1 Embedded
bJackID 1
iJack 0
MIDIStreaming Interface Descriptor:
bLength 6
bDescriptorType 36
bDescriptorSubtype 2 (MIDI_IN_JACK)
bJackType 2 External
bJackID 2
iJack 0
MIDIStreaming Interface Descriptor:
bLength 9
bDescriptorType 36
bDescriptorSubtype 3 (MIDI_OUT_JACK)
bJackType 1 Embedded
bJackID 3
bNrInputPins 1
baSourceID( 0) 2
BaSourcePin( 0) 1
iJack 0
MIDIStreaming Interface Descriptor:
bLength 9
bDescriptorType 36
bDescriptorSubtype 3 (MIDI_OUT_JACK)
bJackType 2 External
bJackID 4
bNrInputPins 1
baSourceID( 0) 1
BaSourcePin( 0) 1
iJack 0
MIDIStreaming Interface Descriptor:
bLength 6
bDescriptorType 36
bDescriptorSubtype 2 (MIDI_IN_JACK)
bJackType 1 Embedded
bJackID 5
iJack 0
MIDIStreaming Interface Descriptor:
bLength 6
bDescriptorType 36
bDescriptorSubtype 2 (MIDI_IN_JACK)
bJackType 2 External
bJackID 6
iJack 0
MIDIStreaming Interface Descriptor:
bLength 9
bDescriptorType 36
bDescriptorSubtype 3 (MIDI_OUT_JACK)
bJackType 1 Embedded
bJackID 7
bNrInputPins 1
baSourceID( 0) 6
BaSourcePin( 0) 1
iJack 0
MIDIStreaming Interface Descriptor:
bLength 9
bDescriptorType 36
bDescriptorSubtype 3 (MIDI_OUT_JACK)
bJackType 2 External
bJackID 8
bNrInputPins 1
baSourceID( 0) 5
BaSourcePin( 0) 1
iJack 0
MIDIStreaming Interface Descriptor:
bLength 6
bDescriptorType 36
bDescriptorSubtype 2 (MIDI_IN_JACK)
bJackType 1 Embedded
bJackID 9
iJack 0
MIDIStreaming Interface Descriptor:
bLength 6
bDescriptorType 36
bDescriptorSubtype 2 (MIDI_IN_JACK)
bJackType 2 External
bJackID 10
iJack 0
MIDIStreaming Interface Descriptor:
bLength 9
bDescriptorType 36
bDescriptorSubtype 3 (MIDI_OUT_JACK)
bJackType 1 Embedded
bJackID 11
bNrInputPins 1
baSourceID( 0) 10
BaSourcePin( 0) 1
iJack 0
MIDIStreaming Interface Descriptor:
bLength 9
bDescriptorType 36
bDescriptorSubtype 3 (MIDI_OUT_JACK)
bJackType 2 External
bJackID 12
bNrInputPins 1
baSourceID( 0) 9
BaSourcePin( 0) 1
iJack 0
MIDIStreaming Interface Descriptor:
bLength 6
bDescriptorType 36
bDescriptorSubtype 2 (MIDI_IN_JACK)
bJackType 1 Embedded
bJackID 13
iJack 0
MIDIStreaming Interface Descriptor:
bLength 6
bDescriptorType 36
bDescriptorSubtype 2 (MIDI_IN_JACK)
bJackType 2 External
bJackID 14
iJack 0
MIDIStreaming Interface Descriptor:
bLength 9
bDescriptorType 36
bDescriptorSubtype 3 (MIDI_OUT_JACK)
bJackType 1 Embedded
bJackID 15
bNrInputPins 1
baSourceID( 0) 14
BaSourcePin( 0) 1
iJack 0
MIDIStreaming Interface Descriptor:
bLength 9
bDescriptorType 36
bDescriptorSubtype 3 (MIDI_OUT_JACK)
bJackType 2 External
bJackID 16
bNrInputPins 1
baSourceID( 0) 13
BaSourcePin( 0) 1
iJack 0
Endpoint Descriptor:
bLength 9
bDescriptorType 5
bEndpointAddress 0x02 EP 2 OUT
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0040 1x 64 bytes
bInterval 0
bRefresh 0
bSynchAddress 0
MIDIStreaming Endpoint Descriptor:
bLength 8
bDescriptorType 37
bDescriptorSubtype 1 (GENERAL)
bNumEmbMIDIJack 4
baAssocJackID( 0) 1
baAssocJackID( 1) 5
baAssocJackID( 2) 9
baAssocJackID( 3) 13
Endpoint Descriptor:
bLength 9
bDescriptorType 5
bEndpointAddress 0x81 EP 1 IN
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0040 1x 64 bytes
bInterval 0
bRefresh 0
bSynchAddress 0
MIDIStreaming Endpoint Descriptor:
bLength 8
bDescriptorType 37
bDescriptorSubtype 1 (GENERAL)
bNumEmbMIDIJack 4
baAssocJackID( 0) 3
baAssocJackID( 1) 7
baAssocJackID( 2) 11
baAssocJackID( 3) 15
This is the same USB descriptor, but stripped down to 2-ports using the above changes. This works perfectly fine on the MIO-XL:
Code:
Bus 001 Device 006: ID 16c0:0485 Van Ooijen Technische Informatica Teensyduino MIDI
Couldn't open device, some information will be missing
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 1.10
bDeviceClass 0 (Defined at Interface level)
bDeviceSubClass 0
bDeviceProtocol 0
bMaxPacketSize0 64
idVendor 0x16c0 Van Ooijen Technische Informatica
idProduct 0x0485 Teensyduino MIDI
bcdDevice 2.11
iManufacturer 1
iProduct 2
iSerial 3
bNumConfigurations 1
Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength 115
bNumInterfaces 1
bConfigurationValue 1
iConfiguration 0
bmAttributes 0xc0
Self Powered
MaxPower 100mA
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 0
bAlternateSetting 0
bNumEndpoints 2
bInterfaceClass 1 Audio
bInterfaceSubClass 3 MIDI Streaming
bInterfaceProtocol 0
iInterface 0
MIDIStreaming Interface Descriptor:
bLength 7
bDescriptorType 36
bDescriptorSubtype 1 (HEADER)
bcdADC 1.00
wTotalLength 67
MIDIStreaming Interface Descriptor:
bLength 6
bDescriptorType 36
bDescriptorSubtype 2 (MIDI_IN_JACK)
bJackType 1 Embedded
bJackID 1
iJack 0
MIDIStreaming Interface Descriptor:
bLength 6
bDescriptorType 36
bDescriptorSubtype 2 (MIDI_IN_JACK)
bJackType 2 External
bJackID 2
iJack 0
MIDIStreaming Interface Descriptor:
bLength 9
bDescriptorType 36
bDescriptorSubtype 3 (MIDI_OUT_JACK)
bJackType 1 Embedded
bJackID 3
bNrInputPins 1
baSourceID( 0) 2
BaSourcePin( 0) 1
iJack 0
MIDIStreaming Interface Descriptor:
bLength 9
bDescriptorType 36
bDescriptorSubtype 3 (MIDI_OUT_JACK)
bJackType 2 External
bJackID 4
bNrInputPins 1
baSourceID( 0) 1
BaSourcePin( 0) 1
iJack 0
MIDIStreaming Interface Descriptor:
bLength 6
bDescriptorType 36
bDescriptorSubtype 2 (MIDI_IN_JACK)
bJackType 1 Embedded
bJackID 5
iJack 0
MIDIStreaming Interface Descriptor:
bLength 6
bDescriptorType 36
bDescriptorSubtype 2 (MIDI_IN_JACK)
bJackType 2 External
bJackID 6
iJack 0
MIDIStreaming Interface Descriptor:
bLength 9
bDescriptorType 36
bDescriptorSubtype 3 (MIDI_OUT_JACK)
bJackType 1 Embedded
bJackID 7
bNrInputPins 1
baSourceID( 0) 6
BaSourcePin( 0) 1
iJack 0
MIDIStreaming Interface Descriptor:
bLength 9
bDescriptorType 36
bDescriptorSubtype 3 (MIDI_OUT_JACK)
bJackType 2 External
bJackID 8
bNrInputPins 1
baSourceID( 0) 5
BaSourcePin( 0) 1
iJack 0
Endpoint Descriptor:
bLength 9
bDescriptorType 5
bEndpointAddress 0x02 EP 2 OUT
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0040 1x 64 bytes
bInterval 0
bRefresh 0
bSynchAddress 0
MIDIStreaming Endpoint Descriptor:
bLength 6
bDescriptorType 37
bDescriptorSubtype 1 (GENERAL)
bNumEmbMIDIJack 2
baAssocJackID( 0) 1
baAssocJackID( 1) 5
Endpoint Descriptor:
bLength 9
bDescriptorType 5
bEndpointAddress 0x81 EP 1 IN
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0040 1x 64 bytes
bInterval 0
bRefresh 0
bSynchAddress 0
MIDIStreaming Endpoint Descriptor:
bLength 6
bDescriptorType 37
bDescriptorSubtype 1 (GENERAL)
bNumEmbMIDIJack 2
baAssocJackID( 0) 3
baAssocJackID( 1) 7
I wonder if the MIO-XL's USB implementation makes additional assumptions that are not met by the Teensy's USB descriptor, although it's supposed to be class compliant. I'd be very thankful for any help, and I'm happy to spend more time investigating the issue if someone has an idea what to try.
I should add: The Yamaha MODX works perfectly fine on the MIO-XL, although it is a hybrid device with audio streaming and 3 MIDI ports:
I would really like to have more than just the two MIDI ports. What could I do to make the Teensy compatible?
I've also posted on the iConnectivity forum, hope to get more ideas there.
Best, Boris