microsoft / MIDI

Windows MIDI Services
MIT License
301 stars 24 forks source link

[BUG] MIDI Service gets stuck. #245

Closed m-komo closed 1 month ago

m-komo commented 8 months ago

Describe the bug If I send an undefined system common message, such as 0xF4 or 0xF5, MIDI Service seems to get stuck. If this happens, MidiSrv cannot be stop/restart and restarting OS is required.

To Reproduce

  1. Set the Roland UM-ONE mk2 to class-compliant mode and short INPUPT and OUTPUT to loop back messages.
  2. Attach the UM-ONE to PC.
  3. Open the Device Manager and load the USB MIDI 2.0 driver (USBMidi2.sys) manually against the attached UM-ONE.
  4. Open midi.exe in two windows.
  5. From one, monitor UM-ONE.
  6. From the other, run following command: 'midi endpoint send-message 0x10F40000'
  7. On the monitor window, press escape to stop monitoring.

Monitoring cannot be terminated. If I run another send-message command, it seems to be stuck. And finally, it is necessary to restart OS to recover.

Expected behavior MIDI Service and midi console continue to work.

Installer Name or Version Windows.MIDI.Services.Developer.Preview.4.x64.1.0.24022.2031.exe

Desktop (please complete the following information):

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

Application Information

Psychlist1972 commented 8 months ago

Thank you @m-komo

@AmeNote-Michael this may be related to the other translation bugs you were seeing in the driver.

m-komo commented 6 months ago

The issue persists on the DP5.

m-komo commented 6 months ago

This issue is caused by all of the following undefined system common/realtime messages (not only by 0xF4 and 0xF5).

AmeNote-Michael commented 5 months ago

This could be a logic error in handling undefined messages. Shall investigate for next attestation signed driver. Thank you for input.

AmeNote-Michael commented 5 months ago

Should just pass the message along as a system common / realtime and not drop message.

AmeNote-Michael commented 3 months ago

This issue is resolved in latest USB MIDI 2.0 driver which now properly handles System Common and Real Time messages which in some cases would get caught in an endless loop.

AmeNote-Michael commented 2 months ago

@sat-okada discovered that case 0xfd still not being handled in latest test signed driver.

I verified this is the case, logic missing to handle 0xfd. To be corrected.

AmeNote-Michael commented 2 months ago

This issue is resolved and can be closed with driver release.

Sho-KDM commented 1 month ago

We tested with new driver(10.0.1.5). However, this issue is still existing when we send 0xFD (0x10FD0000). In that case, we need to force reboot OS for recovering.

Installer Name or Version

Desktop (please complete the following information):

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

Application Information

AmeNote-Michael commented 2 weeks ago

@Sho-KDM thank you for the update - can you please create a new issue specific to the case for 0xfd. Looking into code, somehow update for the writing to USB missed this case. As this is a closed issue, would like to have a new issue opened to resolve. I am currently checking the fix.

Sho-KDM commented 2 weeks ago

@AmeNote-Michael I cretaed new issue #397. Could you check that?

@m-komo If there is something missing thing, could you add that as comment?