-
Notifications
You must be signed in to change notification settings - Fork 275
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix names of UWP output devices when there's two or more of the same kind attached #321
base: master
Are you sure you want to change the base?
Fix names of UWP output devices when there's two or more of the same kind attached #321
Conversation
a987a64
to
e730349
Compare
…same kind attached.
e730349
to
7a852b9
Compare
I don't have two MIDI devices of the same kind. https://forum.juce.com/t/winrt-midi-output-wrong-device-names/43301 |
So, should I approve this or not? |
I would expect that loopMIDI, being a virtual device, behaves differently with individual ports. I was also in contact with the manufacturer of my MIDI interface and they said that Windows in general has issues with two identical USB devices being connected, which is where some of this confusion is coming from. loopMIDI not being a USB device would explain why it behaves differently. |
I cannot confirm that, but feel it is reasonable. |
If someone can provide some test code that compiles in visual studio then I can connect a dozen of our controllers and provide port names from debug output. |
If you use python winrt, this script outputs WinRT MIDI device names. Here is results of my Windows 10 22H2 Japanese environment.
|
I changed the USB port to which each device is connected.
|
Windows doesn't have any more problems with two of the same device than any other OS. But this is why manufacturers should actually supply a USB serial number. Edit: @trueroad this is likely why you see name changes when you plug a device into a different USB port. But naming in WinRT MIDI is...not good. The code paths to handle all the workarounds for different devices which provide names in different ways is not working the way I'd personally like to see it work. Pete |
@Psychlist1972 Do these follow the rules for the wrong naming rule? Can we use regex like |
I took a look at that code before responding earlier tonight. Problem is, it's across a number of different COM interfaces so I couldn't provide you a table of exactly how it works, because I don't yet fully understand that myself. All I can say is that when WinRT MIDI's implementation and enumeration gets pointed to Windows MIDI Services in 2024, the names will all be fixed and will be the same. That code is all OSS from the driver to the API, so anyone will be able to see how it's done. Note that there are devices which legitimately include the word "MIDI" in different positions in the name. I'm not sure how that will work with the algorithms discussed here. Pete |
The UWP API does not always appear to deliver the correct names of output devices, which is already partially worked around by the RtMidi implementation. However, when there are two MIDI devices of the same kind attached (in my case two ESI M8U XLs), the output device name is not just "MIDI" but e.g. "2 - MIDI". This patch adds support for fixing up these names as well.
Maybe @trueroad could have a look at this since they introduced the original code and might have more insight into this issue than I do.