microsoft / MIDI

Windows MIDI Services
MIT License
298 stars 24 forks source link

[BUG] Green screen appears when assigned USB MIDI 2.0 driver to a UMP device #181

Open dmiura opened 8 months ago

dmiura commented 8 months ago

Applies To Driver?

Describe the bug When try to assign the USB MIDI 2.0 driver to a UMP device, sometimes blue screen appeared. There may be one out of three successful attempts.

To Reproduce ZoB.uf2.zip Please find attached binary which is a firmware of ProtoZOA. It can reproduce this bug. Note: this firmware has One Group Terminal Block with 16 Group Terminals.

Psychlist1972 commented 8 months ago

Thanks. Assigned to @AmeNote-Michael

Psychlist1972 commented 8 months ago

@dmiura have you tried with any other MIDI 2.0 devices, by any chance? (Don't name them here if they are confidential, please). I want to make sure the issue isn't specific to the ProtoZOA. I have a synth behind me that connects with the new driver and sends/receives UMP without problems.

Psychlist1972 commented 7 months ago

@dmiura actually, the fact that you mentioned a Blue Screen makes me wonder. Was it a green screen or a blue screen? If blue, that means you aren't running the Insider Canary build that is required to support the new USB MIDI 2.0 class driver.

AmeNote-Michael commented 7 months ago

@dmiura I have tried multiple plug / unplugs of the ProtoZOA code you provided with driver. I am up to about 25 times without Green Screen - same question @Psychlist1972 had, are you sure you were running on a system with Canary build?

Were you running an application at same time? I tried to have MIDI Monitor from console app running a couple of times, but of course this needs to be restarted every unplug / plug cycle. Still I had not had a crash.

dmiura commented 7 months ago

@Psychlist1972 , @AmeNote-Michael

have you tried with any other MIDI 2.0 devices

Yes, we tried with another MIDI 2.0 device, but this issue didn't occur.

Was it a green screen or a blue screen?

It was Green screen.

are you sure you were running on a system with Canary build?

Yes, we were running on the system with Canary build.

Were you running an application at same time?

No, there was no running application.

We will check it again, then I will post if we found additional hint.

AmeNote-Michael commented 7 months ago

@dmiura thank you for the video. Please confirm you are using latest version of driver. The Attestation signed one or one you compiled on your own?

As indicated, I am not getting the same result. Therefore can you please reproduce again and then send resulting crash dump file created by restart (let green screen finish gathering info and send resulting file). I will also try again to reproduce.

Also, have you tried same on a Mac?

Lastly, if willing, you able to share your descriptor code for ZoB? Are you using the latest tusb_ump files from midi2.dev or your own implementation?

Michael

dmiura commented 7 months ago

@AmeNote-Michael

I've been writing this report instead of other member who are checking driver behavior.

Please confirm you are using latest version of driver.

usbmidi2.inf_amd64_d320d9eba1fe0f4b\USBMidi2.sys DriverVer = 12/14/2023,10.0.1.3 This driver was attached Developer Preview 2

The Attestation signed one or one you compiled on your own? Unzip USBMIDI2_10.0.1.3.zip, signature is "Microsoft Corporation"

As indicated, I am not getting the same result

Sometime, it occurred after 10 - 20 seconds, when updated driver. It means it doesn't occur everytime.

Therefore can you please reproduce again and then send resulting crash dump file created by restart (let green screen finish gathering info and send resulting file). I will also try again to reproduce.

I uploaded Criticalfdump.txt in this comment. Criticalfdump.txt

Also, have you tried same on a Mac?

There is no problem on Mac

Lastly, if willing, you able to share your descriptor code for ZoB?

Uploaded usb_descriptors.cpp. usb_descriptors.cpp.zip

Are you using the latest tusb_ump files from midi2.dev or your own implementation?

We are using tusb_ump files downloaded from https://github.com/midi-mma/tinyUSB_ProtoZOA We will try tusb_ump files from midi2.dev.

Psychlist1972 commented 6 months ago

If this is related to power management like the other green screen issues, this should be fixed in the next attestation-signed driver.

masahirokakishita commented 5 months ago

I met Green Screen on Developer Preview 5, when I update USBMIDI2_10.0.1.4 to ZoB by Device Manager. It's occurred once three times. Windows 11 version is 24H2 26063.1 System Log by Event viewer is enclosed.

systemlog.txt

masahirokakishita commented 5 months ago

Memory dump file at Green Screen. MEMORYDUMP.txt

AmeNote-Michael commented 5 months ago

Issue due to improper call in D0Exit power management routine. The D0Entry and D0Exit are not required for this driver implementation anymore as the management of continuous reader moved to Run / Pause state functions managed by KS_Stream. This update is in pull request #301: https://github.com/microsoft/MIDI/pull/301

Psychlist1972 commented 3 months ago

Reopening until we ship to customers.

AmeNote-Michael commented 1 month ago

There is currently an issue with USBAudio.sys (original MIDI driver) that when you update to USBMidi2.sys, a timeout occurs that USB Midi2.sys does not understand causing crash.

Workaround for the issue is to disconnect the USB device immediately after update to USBMidi2.sys, prior to green screen. Then wait about 10s before re-connecting the USB device.

By removing the USB device, it will force the USB Stack to remove the driver fully and cancel any related resources including the timer.

When you re-insert the USB device, it should install USBMidi2.sys and continue from there.

NOTE: this is regardless if a USB MIDI 1.0 or USB MIDI 2.0 device, the error is going from using the USBAUDIO.sys driver and updating to USBMidi2.sys driver.

Psychlist1972 commented 1 month ago

To add to what @Amenote-Michael has said:

This is a fix we need to deploy in Windows. There's nothing the new driver can do here.

Psychlist1972 commented 1 month ago

Assigning to @garydan42 to track when this fix goes into public Windows builds. Changed area to reflect where the problem resides.

Psychlist1972 commented 2 weeks ago

Related Issue #198