microsoft / MIDI

Windows MIDI Services
MIT License
300 stars 24 forks source link

[BUG] MIDI Service gets locked. #360

Open m-komo opened 1 month ago

m-komo commented 1 month ago

Describe the bug If I detach/attach a device while monitoring with midi.exe, monitor stops working and MIDI service seems to be locked.

To Reproduce

  1. Load the attached UUT_USB_MIDI_ECHO.uf2.zip firmware to the ProtoZOA.
  2. Attach the ProtoZOA to the PC and update the driver to the USB MIDI 2.0 driver (UsbMidi2.sys).
  3. Open midi.exe in two windows.
  4. From one, monitor ProtoZOA.
  5. From the other, run 'midi ep send 0x20901234' and choose ProtoZOA.
  6. Make sure the monitor shows loop-backed message '0x20901234'.
  7. Detach the ProtoZOA from the USB port. Monitor detects disconnection.
  8. Attach the ProtoZOA again. Monitor detects re-connection.
  9. Run 'midi ep send 0x20901234' again.

Monitor does not show any messages.

  1. Run 'midi ep send 0x20901234 -c 5000'.

'send' command stops in the middle of sending process. On the monitor window, press escape to stop monitoring, but monitoring cannot be terminated. And also, it is unable to restart MIDI service. It is necessary to restart OS to recover.

Expected behavior MIDI Service and Monitor command continues to work after reconnecting the device.

Installer Name or Version

Desktop (please complete the following information):

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

Application Information

MusicMaker commented 1 month ago

I have a similar issue with DP6 plug/unplug that took a day to figure out. (was working normally on DP5) This is on my own DIY MCU hardware. what worked was use "midi service stop" and then "midi service start", the service will send the discovery messages again on plug in or when the device stays plugged in.

Psychlist1972 commented 1 month ago

"And also, it is unable to restart MIDI service. It is necessary to restart OS to recover."

If the service is locked up, open Task Manager, go to Details, find MidiSrv, and then right-click "end process tree". You will not need to reboot.

sat-okada commented 1 month ago

I confirmed the same behavior as this issue. After OS has started, once I run "midi service restart", this problem does not occur even if I unplug and plug.