Two of the same Teensy "MIDI" devices on Windows at the same time (BUG?)

SteveBar

Well-known member
When I connect two of the same Teensy based MIDI controllers to Windows they show up with the same PRODUCT_NAME even if they have different PRODUCT_NAMEs.

Details:
Using Windows "Device Manger", under the category of "Sound, video and games controllers", the devices show up with their different names (as expected). Tip: under the "View" menu you can "Show hidden devices", this show all previous attached devices with ghosted icons.

However most, if not all, of the MIDI applications don't seem to use the PRODUCT_NAME to differ between connected devices. So we hacked the PRODUCT_ID and had a different number for each of the devices. Now all the MIDI applications show the proper PRODUCT_NAMEs.

Paul - it would be REALLY useful to be able to change the PRODUCT_ID in my code (see below). However if I need to change the PRODUCT_ID based on a user setting that uniquely names the specific device (if they had more than one), then this needs to happen at run time not compile time. It would be awesome if there was a pre-enumeration call back that provided the opportunity to 'quickly' set all these parameters!

BTW we have been using a "-" and "A"-"Z" as a unique naming convention for our users (i.e. "Widget-A" or "Widget-B"...). "Widget" is the default name.


Code:
#define MANUFACTURER_NAME {'C','o','m','p','a','n','y'}
#define MANUFACTURER_NAME_LEN 7
struct usb_string_descriptor_struct usb_string_manufacturer_name = {
    2 + MANUFACTURER_NAME_LEN * 2,
    3,
    MANUFACTURER_NAME
};

#define PRODUCT_NAME   {'W','i','d','g','e','t', 0,0}   // leave last 2 chars empty for unique name
#define PRODUCT_NAME_LEN  8
struct usb_string_descriptor_struct usb_string_product_name = {
    2 + PRODUCT_NAME_LEN * 2,
    3,
    PRODUCT_NAME
};

#define SERIAL_NO {'0','0','0','0','2','1'}  // 1st 4 digits = the HW_UNIT_NUMBER_EEPROM_ADDY
#define SERIAL_NO_LEN 6
struct usb_string_descriptor_struct usb_string_serial_number = {
    2 + SERIAL_NO_LEN * 2,
    3,
    SERIAL_NO
};

#define PRODUCT_ID {'5','2','4','6','5'}  // upto 65535
#define PRODUCT_ID_LEN 6
struct usb_string_descriptor_struct usb_string_serial_number = {
    2 + PRODUCT_ID_LEN * 2,
    3,
    PRODUCT_ID
};
 
Last edited:
I think this is not a bug but shortcomings in Windows' class compliant USB-MIDI driver.

I've run into the same issue with Windows not being able to see two identical cheap class compliant usb-MIDI interface "cables". Same happens with say two identical Teensy 4.0 usbMIDI devices.

A while back, playing around, discovered that Windows will see two T4.0 usbMIDI devices if one is configured as USB type MIDI x 4 and the other is USB type MIDI x 16.

Sifting through C:\Program Files (x86)\Arduino\hardware\ teensy4\usb_desc.h starting line 428, noted that aside from different #define MIDI_NUM_CABLES, the only other difference is #define BCD_DEVICE 0xXXX.

Food for thought?
 
I think this is not a bug but shortcomings in Windows' class compliant USB-MIDI driver.

I've run into the same issue with Windows not being able to see two identical cheap class compliant usb-MIDI interface "cables". Same happens with say two identical Teensy 4.0 usbMIDI devices.

A while back, playing around, discovered that Windows will see two T4.0 usbMIDI devices if one is configured as USB type MIDI x 4 and the other is USB type MIDI x 16.

Sifting through C:\Program Files (x86)\Arduino\hardware\ teensy4\usb_desc.h starting line 428, noted that aside from different #define MIDI_NUM_CABLES, the only other difference is #define BCD_DEVICE 0xXXX.

Food for thought?

Thanks for the advice still looking into it.
Here's a link to a similar thread - https://forum.pjrc.com/threads/69114-Identify-Teensy-variants-from-USB-connection
Steve
 
I think this is not a bug but shortcomings in Windows' class compliant USB-MIDI driver.

I've run into the same issue with Windows not being able to see two identical cheap class compliant usb-MIDI interface "cables". Same happens with say two identical Teensy 4.0 usbMIDI devices.

A while back, playing around, discovered that Windows will see two T4.0 usbMIDI devices if one is configured as USB type MIDI x 4 and the other is USB type MIDI x 16.

Sifting through C:\Program Files (x86)\Arduino\hardware\ teensy4\usb_desc.h starting line 428, noted that aside from different #define MIDI_NUM_CABLES, the only other difference is #define BCD_DEVICE 0xXXX.

Food for thought?

Yeah, I dunno. I have one device that's Teensy 3.6 based, MIDI x 16 and another that is Teensy 4.0 based MIDI x 4 and the program I'm using ( gig performer 4 ) gives them both the same device name. It might be noteworthy that the name given is arbitrarily chosen from the two devices... likely which ever device got enumerated first at startup.

It would be helpful to be able to prevent this without clobbering Teensy Loader's auto detection of the boards.
 
Agreed, but I think that a straightened paper-clip sized hole over a Prog button is a small price to pay.

Thinking of the range of MIDI types, what about making the MIDI_NAME unique to each MIDI type as opposed to current MIDI_NAME is kind of Global across the MIDI type range. Have not got around to playing with it yet, currently deep in the rabbithole of re-location.
 
Back
Top