microsoft / MIDI

Windows MIDI Services
MIT License
285 stars 23 forks source link

[BUG] UMP packet split across USB transaction is corrupted. #312

Open m-komo opened 2 months ago

m-komo commented 2 months ago

Describe the bug If a USB MIDI 2.0 device sends a UMP message consisting of multiple 32-bits word across multiple USB transactions, received UMP messages are corrupted.

To Reproduce

  1. Update ProtoZOA with the attached firmware (ZOA-ExceedMPS.uf2.zip).
  2. Update the driver to the USB MIDI 2.0 driver (UsbMidi2.sys).
  3. Open midi.exe in two windows.
  4. From one, monitor "ZOA-ExceedMPS".
  5. From the other, send NOOP (0x00000000) to "ZOA-ExceedMPS". 'midi endpoint send-message 0x00000000'

With this firmware, the device sends following UMP packets when the device receives NOOP (0x00000000).

0x10F80000
0x40900100 0x00010000
0x40900200 0x00020000
0x40900300 0x00030000
0x40900400 0x00040000
0x40900500 0x00050000
0x40900600 0x00060000
0x40900700 0x00070000
0x510d0001 0x02030405 0x06070809 0x0a0b0c0d
0x40900800 0x00080000

Since the max packet size of the device endpoint is 64 bytes, MT5 message is split into two USB transaction. image

As a result, received messages are corrupted like as below: Received Messages

Expected behavior All sent messages are displayed on the monitor as is.

Log files I have attached a USB transaction log file. ExceedMPS.usb.zip

Installer Name or Version

Desktop (please complete the following information):

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

AmeNote-Michael commented 2 months ago

Driver does not currently properly handle a UMP message across multiple USB packets. Resolution is to not advance the received Index until ump Packet is complete. To be implemented and tested for next attestation release.

AmeNote-Michael commented 1 week ago

This issue still needs regression testing as of Test Signed driver.