Skip to content
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

[BUG] Sending messages without monitoring causes Green Screen with the USB MIDI 2.0 driver #307

Open
m-komo opened this issue Apr 11, 2024 · 8 comments
Assignees
Labels
area-service-or-api 🖥️ Related to the Windows Service, core API, abstractions, etc. area-usb-driver 💻 Related to the USB MIDI 2.0 driver bug 🐞 Something isn't working critical ‼️ Critical to be fixed/implemented before next major release dp6-fixed 🥳 Fixed/implemented in Developer Preview 6 needs-investigation 🔍 Needs to be investigated before considering or solving.

Comments

@m-komo
Copy link
Collaborator

m-komo commented Apr 11, 2024

Describe the bug
Sending a lots of messages without monitoring causes Green Screen.
This issue only occurs if the device is running with the USB MIDI 2.0 driver (UsbMidi2.sys)

To Reproduce

  1. Update ProtoZOA with the attached firmware.
  2. Attach ProtoZOA to PC and update the driver to the USB MIDI 2.0 driver (UsbMidi2.sys).
  3. Open console and make sure there is no monitoring command (midi endpoint monitor) running.
  4. Run "midi endpoint send-message 0x40123456 0x00000000 -p 0 -c 125000 -i".
  5. Choose "ZOA-216" as an endpoint.
  6. Repeat step 4 to 5 several times.

Green Screen occurs.
I faced two types of Green Screen, "ATTEMPTED_SWITCH_FROM_DPC" and "KERNEL_SECURITY_CHECK_FAILURE".

Expected behavior
No Green Screen.

Installer Name or Version

  • Service: Windows.MIDI.Services.Developer.Preview.5.x64.1.0.24066.2126.exe
  • Driver: Updated_USBMIDI2_10.0.1.4.zip

Desktop (please complete the following information):

  • OS: Windows 11
  • OS Build: 26100.1

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

@m-komo m-komo added the bug 🐞 Something isn't working label Apr 11, 2024
@Psychlist1972 Psychlist1972 added area-usb-driver 💻 Related to the USB MIDI 2.0 driver area-service-or-api 🖥️ Related to the Windows Service, core API, abstractions, etc. needs-investigation 🔍 Needs to be investigated before considering or solving. labels Apr 11, 2024
@MusicMaker
Copy link

MusicMaker commented Apr 14, 2024

https://www.windowslatest.com/2024/04/06/windows-11-24h2-build-26100-causes-undocumented-issues-blocks-some-apps/
FYI 26001 is reported to be buggy with several GSODs.. I can't even do Windows update to it anymore ATM. (stuck at an older version which by itself is also a known issue and suggests a clean install)

@MusicMaker
Copy link

MusicMaker commented Apr 15, 2024

Finally installed 26100.1 (after using a network cable and several retires)

Loaded that FW in an off the shelf RP2040 board , assigned the midi preview 5 driver and ran that command many times. it sens the data, Cannot reproduce the GSOD.

@MusicMaker
Copy link

MusicMaker commented Apr 15, 2024

Got two crashes now of Windows 11. (auto reboots)... but not when running the command but with that RP2040 connected after running the commands. need further check if related. Now fully reproduceable. indeed an GSOD

@Psychlist1972
Copy link
Contributor

Thank you for the repro and the crash dump, @MusicMaker.

https://www.windowslatest.com/2024/04/06/windows-11-24h2-build-26100-causes-undocumented-issues-blocks-some-apps/ FYI 26001 is reported to be buggy with several GSODs.. I can't even do Windows update to it anymore ATM. (stuck at an older version which by itself is also a known issue and suggests a clean install)

If you want to get off the Canary train, I was told Dev channel has the ACX / USB updates in it now, so USB MIDI 2 will work on it.

@MusicMaker
Copy link

MusicMaker commented Apr 15, 2024

Indeed. noticed the Dev channel works too. Regress it with next canary build....

@Psychlist1972 Psychlist1972 added the critical ‼️ Critical to be fixed/implemented before next major release label Apr 16, 2024
@AmeNote-Michael
Copy link
Collaborator

Needs further investigation and analysis.

@garydan42 thinking about it, the act of midi endpoint send-message will put driver into "run" state which will process the USB IN buffer and into double buffer. As there is no monitor or application, nothing will be feeding from double buffer. In code, the reaction is to drop data but then request to handle existing data.

We should actually respond with discarding oldest data and then putting new data in buffer. What is the design pattern for this?

However, does not explain GSOD - just noting what we should be doing.

@Psychlist1972 Psychlist1972 added the dp6-fixed 🥳 Fixed/implemented in Developer Preview 6 label May 22, 2024
@AmeNote-Michael
Copy link
Collaborator

@garydan42 This issue is due to the "Run" state being set when a send-message occurs but nothing is reading from driver. If the device has data provided and the driver is in run state, driver will populate the double buffer stream for UMP IN with UMP data. If there is nothing reading from the UMP Data from that stream, it will eventually fill.

I suspect we should just drop old data - but what is design pattern here? How do I ensure I am not conflicting on memory with other software that may be accessing stream? Is it same as when dealing with buffer for write?

@garydan42
Copy link
Collaborator

garydan42 commented Jul 3, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-service-or-api 🖥️ Related to the Windows Service, core API, abstractions, etc. area-usb-driver 💻 Related to the USB MIDI 2.0 driver bug 🐞 Something isn't working critical ‼️ Critical to be fixed/implemented before next major release dp6-fixed 🥳 Fixed/implemented in Developer Preview 6 needs-investigation 🔍 Needs to be investigated before considering or solving.
Projects
Status: 💻 Complete
Development

No branches or pull requests

5 participants