microsoft / MIDI

Windows MIDI Services
MIT License
289 stars 23 forks source link

[BUG] Cannot Force USB MIDI 1.0 Device to USB MIDI 2.0 driver if Device Also has USB Audio #302

Open AmeNote-Michael opened 4 months ago

AmeNote-Michael commented 4 months ago

Describe the bug Connecting a USB MIDI 1.0 device that also has USB Audio such as the iConnectMIDI 2+ only presents single device in Device Manager which is not capable of updating driver to USBMidi2.sys (the new driver) as it expects to connect to an audio capable driver. This is possibly due to how the USB descriptors are built for the device as same problem does not occur on Yamaha devices (they seem to present two interfaces, one audio and one MIDI).

To Reproduce Install iConnectMIDI 2+ to host computer and examine Device Manager. Try to update the device manually through "Have Disk" to the new USBMidi2.sys driver.

Expected behavior Driver can successfully update to USBMIDI2.sys driver for MIDI. Additional device instance for audio portion of device present.

Screenshots See attached capture from USBView and relevant Device Manager device details prior to trying to update driver to USBMidi2.sys. When trying to update driver, following message is presented: Windows found drivers for your device but encountered an error while attempting to install them.

Installer Name or Version Driver version based on Pull Request #301 from branch Issues_181_198_286_288_289.

Desktop (please complete the following information):

Device information, if this is with an external MIDI device:

Application Information Device Manager PocketMIDI Sound Settings control panel

Additional context USBView iConnectMIDI2.0 - [Port3] USB Composite Device.txt [DeviceDescriptor - iConnectMIDI2 Pre Driver Update.txt](https://github.com/microsoft/MIDI/files/14625271/DeviceDescriptor.-.iConnectMIDI2.Pre.Driver.Update.txt)

AmeNote-Michael commented 4 months ago

Note that I change the Insider build to Canary, force update and reboot. System reboots and indicates insider build Canary selected, but the build number is still above number.

Issue persists.

Psychlist1972 commented 4 months ago

I have an iConnectivity 4+ in a closet somewhere and will try it out.

Psychlist1972 commented 4 months ago

Note that if the device is expecting a single driver to do both MIDI and Audio, then this device only runs as a USB Audio 1.0 device on Windows, when it comes to audio and our in-box drivers.

Psychlist1972 commented 4 months ago

But this may be a device where we have to rely on the vendor driver.

Psychlist1972 commented 4 months ago

Yeah, this looks like it's going to be a vendor-driver thing. The device is just doing too much here that is in a big gray area, is discontinued, doesn't do MIDI 2.0, and also will work fine with the vendor drivers or (right now with the old and new both installed) even our old class drivers from what I can see.

Added the "important test scenario" tag to make sure we check this again once we're running in the intended shipping configuration.

AmeNote-Michael commented 4 months ago

@Psychlist1972 I think it may be pre-mature to close this issue. This may be a common practice for devices that have USB MIDI and USB Audio combined in interface or device. Yes iConnectMIDI series is closed, but it just happens to be what I have convenient to test with. It will be same on their ConnectAudio 4, and likely same for Focusrite and Presonus interfaces - iConnectivity based their descriptor structure on learnings from others - I suspect there are a lot of interfaces on market this could be an issue with.

Psychlist1972 commented 4 months ago

@Psychlist1972 I think it may be pre-mature to close this issue. This may be a common practice for devices that have USB MIDI and USB Audio combined in interface or device. Yes iConnectMIDI series is closed, but it just happens to be what I have convenient to test with. It will be same on their ConnectAudio 4, and likely same for Focusrite and Presonus interfaces - iConnectivity based their descriptor structure on learnings from others - I suspect there are a lot of interfaces on market this could be an issue with.

But how many devices with MIDI will have usable USB Audio 1.0 on Windows? I would think they'd be USB Audio 2.0, and if used in scenarios where MIDI makes sense, they'd also have their own ASIO driver for the audio side. If the single driver must do both MIDI 1.0 and USB Audio 2.0, there's no scenario with Windows class drivers where that would work.

Our MIDI 1.0 driver is packaged with USB Audio 1.0-only in the same binary. USB Audio 2.0 is a completely separate driver.

Unless the device is set up to appear as two different interfaces on Windows, like the MIDI 2.0 + Audio devices do, I'm not seeing any way this will work without resorting to vendor drivers.

That said, if there are other devices which present like the iConnectMIDI Stuff, I'd like to know.

AmeNote-Michael commented 4 months ago

I will check against my PlayAudio12 - it is USB MIDI 1.0 with USB Audio 2.0 - I will see what it does.

Again, when we built the devices, we used devices from Focusrite and Presonus to learn from. Could not tell you which, etc. It was so many years ago.

Psychlist1972 commented 4 months ago

Reopening for now.

AmeNote-Michael commented 4 months ago

Tried with a device that has USB Audio 2.0. In this case, I do get the two items listed in the Device Manager, however I am still unable to change the driver for the MIDI from USBAudio.sys to the new USBMIDI2.sys driver. It comes back and says Windows found drivers for your device but encountered an error while attempting to install them..

Been having system problems, including windbg not properly launching. Will continue to try later. USBView.PlayAUDIO12.-.Port3.USB.Composite.Device (1).txt

AmeNote-Michael commented 4 months ago

So was able to retest with device that had USB Audio 2.0 and USB MIDI 1.0 Composite. Specifically the PlayAudio12 from iConnectivity.

I was able to get the USBMidi2.sys driver to load and use Console app to get full properties. What was interesting was that I could not get it to properly load the USB Audio 2.0 class compliant audio drivers at same time. Once I load the the iConnectivity Vendor driver it goes back to a single device in Device Manager and no matter what I do, I cannot seem to get it back.

We really need to check on further devices with this type of configuration.

Attached is output of PlayAudio12 Properties from console app FYI - it has a lot of GTBs defined cause device has 32 total virtual cables defined - 16 in and 16 out.

PlayAudio12-Properties.txt

AmeNote-Michael commented 4 months ago

Can confirm that PlayAudio12 uses USB Audio 2.0 and the iConnectMIDI4+ uses USB Audio 1.0.

image