Teensy USB MIDI Device descriptor query?

submo

Member
Hello,

I'm trying to get my head around theUSB descriptors for my Teensy 4, particularly for a MIDI device. I think I'm getting there, but I have a quick question....

I've read the MIDI 1.0 USB Device class definition, and on the example device it gives, it says to also include an Audio Control Interface Descriptor (page 38, section B3), and says this is mandatory.

I've dug through the core Teensy 4 files:

usb_desc.h & usb_desc.c

but it seems to me that the Audio Control Interface descriptor is not included when the Teensy is set to a MIdi device?

Just curious why it's not included, and what the consequences are? Or maybe it is included, and I've just missed it?

TIA
 
So I noticed that this file (on line 122):


It says that adding the AC interface has caused MIDI to fail on Linux. So I guess the AC interface has continually been omitted because of this.

So just for my own personal curiosity, I decided to add the AC interface back to the Core teensy4 usb_desc.c Midi Interface, and all is good (seems to work on Windows, and my Linux based Akai MPC). Needed to tweak some things in usb_desc.h to get the interface Numbers to tally up (which may have been the problem in the first place?), but it seems to work OK so far.

I probably need to test some more to make sure MIDI is still good, and I still don't know the purpose of the AC interface, and if I'm honest, I'm not really sure what I'm doing, but its been kinda fun digging around.
 
Last edited:
Also spotted another slight discrepancy between Teensy4's MIDI descriptor & MIDI 1.0

In this file, on lines 931 & again at 1945:

Code:
LSB(7+(6+6+9+9)*MIDI_NUM_CABLES),       // wTotalLength
MSB(7+(6+6+9+9)*MIDI_NUM_CABLES),

The Teensy's "wTotalLength" doesn't seem to include the length of its Endpoints, where as in the MIDI 1.0 example, the length of the Endpoints are included. I changed it to the following and it seems to work OK.

Code:
LSB(7+((6+6+9+9)*MIDI_NUM_CABLES)+(9+4+MIDI_NUM_CABLES)*2),        // wTotalLength
MSB(7+((6+6+9+9)*MIDI_NUM_CABLES)+(9+4+MIDI_NUM_CABLES)*2),

I guess this is not critical though, as it seemed to work ok before.
 
Back
Top