PaulStoffregen
Well-known member
Thanks. I've added the mac screenshot to the web page.
Hi, I'm having an issue with multiple Teensy Midi devices that I need connected to the PC at the same time. I've renamed their device names as outlined in this thread, and they are showing correct names in windows device manager, but in all apps I've tested, I can see two devices with the same name, and not two unique devices. I've tested with Unity3d using nAudio plugin, Resolume Arena, and Midi-OX. They both work correctly if only one is plugged in at a time, but need to use both together. It seems pretty random which of the two devices is used twice, and if I plug into a different usb bus, sometimes I can get them both recognised as expected. But need them to always be recognised correctly. See screen grab of Midi-Ox displaying two duplicate names, and Windows device manager showing correct names (ConanSkate and ConanLanguage are the two renamed Teensys).
View attachment 15123
I'm using Windows 10, Teensy 3.2, arduino 1.8.6
I've tried uninstalling the devices from the device manager, and restarting many times.
Was wondering if comment #23 might be useful, but wasn't sure how to implement that.
Any help greatly appreciated!
So it seems there is a hacky but simple way around my issue of multiple teensy MIDI devices on the same PC. Set one to MIDI and the other to Serial-MIDI in the arduino IDE Tools > USB type before uploading. The reason I think this is working is that in usb_desc.h USB_MIDI and USB_MIDI_SERIAL have different PRODUCT_ID values. It seems that only changing PRODUCT_NAME and MANUFACTURER_NAME are not enough to force some applications in Windows to see unique MIDI devices.
The downside of this hacky solution is that only 2 Teensy devices will work this way (being only a choice of midi or serial-midi). I could change the PRODUCT_ID value in usb_desc.h manually before uploading to each device, but that doesn't seem very clean. Does anyone know if there is there a better way of doing this?
interesting. I may have same issue as I will connect several Teensy 3.2 to my PC .. so how did you change the serial number ?? did you add any #define xySerial into names.c (in you sketch folder) ? detail: I also want to keep the USB_MIDI
// To give your project a unique name, this code must be
// placed into a .c file (its own tab). It can not be in
// a .cpp file or your main sketch (the .ino file).
#include "usb_names.h"
// Edit these lines to create your own name. The length must
// match the number of characters in your custom name.
#define MANUFACTURER_NAME {'O','p','e','n',' ','L','a','b','s'}
#define MANUFACTURER_NAME_LEN 9
#define MIDI_NAME {'N','E','K','O'}
#define MIDI_NAME_LEN 4
#define SERIAL_NUM {'E','n','c','o','d','e','r','P','a','n','e','l'}
#define SERIAL_NUM_LEN 12
// Do not change this part. This exact format is required by USB.
struct usb_string_descriptor_struct usb_string_manufacturer_name = {
2 + MANUFACTURER_NAME_LEN * 2,
3,
MANUFACTURER_NAME
};
struct usb_string_descriptor_struct usb_string_product_name = {
2 + MIDI_NAME_LEN * 2,
3,
MIDI_NAME
};
struct usb_string_descriptor_struct usb_string_serial_number = {
2 + SERIAL_NUM_LEN * 2,
3,
SERIAL_NUM
};
Perfect, thx ! I will test (in particular also on iPad), with 2 devices (currently they always get mixed up), so this idea could solve it, i will post later ! Thx.I have not noticed any side effects from it, I’m still able to program them with no problems. I found it from just looking around in the Teensy core and figured I may as well change it, it just so happens that by changing it I never ran into any problems when connecting multiple Teensy’s to the same computer like so many others had. I never knew it was a problem because I always changed it for each of the devices I’ve made.
Hi vjmuzik
I did some detailed tests today, somehow mixed feelings, here what I found (maybe helps to understand):
- i always use TyCommander to upload a new .hex file and see the results, shows the Serial number and name most easy.
- compliment to you: your code allows me to update the 'serial id' of the Teensy, i can see result in TyCommander, well done !
- but: ...each Teensy seems to have a unique Serial ID already, which is great, i did not know before (maybe @PaulStoffregen can confirm)
- so there seems no need for me to update this value manually, what is the benefit? . Your skech works (i tested), but maybe did not solve the mixing-up issue
- you were right, only letters and numbers are allowed in SERIAL_NUM ; )
- what i also found: Win7/10 does not refresh any renamed devices (as wrote earlier), but easy workaround i found: delete entry in device manger (via context menu), unplug and replug .. Windows immediately finds the new hardware with updated device name, works well.
the problems i have with your solution (manually update Serial number of Teensy):
- you overwrite a unique number
- what looks good in first moment: updating the serial id forces Windows to update the device name .. but this happens NOT via refresh, it happened because you generate a new device - same what happens with any Teensy you connect first time (device name doesn't matter, also 2 same named ARE 2 different devices).
- what I do not like most: any self made serial number (which is not a number) produce a '?' in teensy identity (at least in TyCommander), and even more worse: the Teensy 3.2 gets interpreted as a Teensy 3.1. It looks like that a serial number higher 3.000.000 about produces a Teensy 3.2. So i feel: better not touch it
see screenshot #1 (made with a serial id 'TEST', if i would use e.g. '2' then the ? does not apper, would be '2' .. but still a Teensy 3.1):
View attachment 16114
My takeaways (user may comment, maybe I am wrong :
- no need to update any serial number, each Teensy is unique already. Best prove: connect 2 devices with same device name (and same sketch) together and open TyCommander.
I see always 2 devices with unique id’s see screenshot #2:.
View attachment 16115
The fact that some apps may mix-up devices with same name seems to be a fault of the apps, not of the Teensy. To overcome this problem a simple rename of the device is maybe a more clean solution than patching a serial id i feel, right ?. Patching the serial id does not make it more unique, it forces only that the name is refreshed in Windows (the old is still installed). In case a application (which is not same 'clever' as TyCommander) will struggle with 2 devices (with same device name): maybe better to give them a other name i feel.
My coin, any feedback welcome
Well, I did the thing of setting one of the devices to serial+MIDI, and the other to MIDI, and that works. Not at all scalable, as I'd like to eventually add a third board, but it works for now....
I'm running Win 7, Reaper,PreSonus, a MIO-10 and Midisport 8X8 interfaces and an assortment of other usbMidi gear and ran into similar headaches when adding Teensy usbMidi devices to the mix.
When adding a Teensy (3.2 - 4.0) usbMidi device to the mix, discovered that it needs to be instantiated LAST during system startup - or else. Also needs to be removed prior to shutdown otherwise you end up in a BSOD situation.
If a Teensy 2.0 USBmidi is added to the mix, it still needs to be instantiated LAST however no BSOD with shutdown. I'm not nerdy enough to understand why the difference, just mentioning as I think Win 7 doesn't quite see eye to eye with Teensy usbMidi.