Closed MusicMaker closed 1 month ago
There's a discord thread on this here: https://discord.com/channels/980245825202552942/1198866304736702555
If Workbench on Linux is showing all zeroes, I would think something is incorrect here.
This needs investigation, as all the other MIDI devices I've tried here show correct GTBs.
@AmeNote-Michael @MusicMaker and I have a long thread on this in discord and they've been debugging this quite a bit. We're not 100%, but looking at your driver code, it appears that you're asking for too much data here and ignoring the header size values.
In https://github.com/microsoft/MIDI/blob/main/src/api/Drivers/USBMIDI2/Driver/Device.cpp#L1343 you have a comment that you guess at the size/number of the GTBs. But you should be able to get that information from the header. Later at 1393, instead of using the bytes transferred to calculate the number of group terminal blocks, you should use the size you read from the header and allocate a buffer based on that. (this does change how the code is structured). I suspect the request that goes over requests enough to fill the entire buffer, which is why we get a bunch of garbage data after the GTBs.
Per the USB MIDI 2.0 spec:
wTotalLength
is "Total number of bytes returned for the class-specific Group Terminal Block descriptors. Includes the combined length of this header descriptor and all Group Terminal Block descriptors. "
Not sure why this works with Roland, NI, and other devices I have, but it's not working with Muzak's code which does work with Linux which handles the header and GTBs as two requests with two separate buffers.
Please confirm what Windows uses for bmRequestType and wLength
I suspect wLength is coming from the total buffer size that gets allocated and that's something our WDF code is doing on our behalf. But I would defer to others with more USB/WDF knowledge than I have. But it would make sense given that the allocated buffer is larger than needed, and we get a bunch of garbage data after your GTB.
bmRequestType I'm not sure of.
@AmeNote-Michael just loaded beta Waldorf Iridium firmware and it runs into the same driver bug. So I have a test case here we can use to verify the fix.
Bug discovered in setting size of GTB when fetching. Testing needed to verify.
Fixed in latest driver source.
Reopening until we ship to customers
Updated driver now uses index in Endpoints to determine if a GTB definition should be returned. This should provide the expected function.
@MusicMaker seems you are willing to use test signed drivers and do testing that way based on other posts. You also had raised this issue.
Can you please confirm this issue has been resolved with latest test signed driver.
@MusicMaker seems you are willing to use test signed drivers and do testing that way based on other posts. You also had raised this issue.
Can you please confirm this issue has been resolved with latest test signed driver.
Unless you've shared it separately, the test signed driver has only been shared with AMEI, not with the public. I'm fine with sharing it with MusicMaker, but not otherwise publicly, because putting your PC into a mode to enable test signed drivers always causes a percentage of people to brick their PCs or end up in bitlocker recovery mode because they didn't follow all the steps. It's a very unforgiving process.
@Psychlist1972 of course you are correct.
@MusicMaker if you are willing to run your system in test signed mode for which I could send you a driver to test with, resolving this issue will need to wait until after Attestation signed driver which we are hoping will be within the next week.
Sorry, I had been working on other issues and now catching up emails. Yes, I could try the test driver. I am not aware of using bit-locker on Canary builds, unless windows enables that.
How to get hold of this updated test driver ? Is there a link to download it ?
Please test with today's driver release, when you get a chance. Thanks!
Closing this as fixed in the August 2024 driver release. If you test and find that not to be the case, we will reopen.
Thanks a lot ! will go trough regression with the new driver.
Regressed. the driver correctly respects bNumGrpTrmBlock now. It is also resilient having the wrong total length of all GTB data in the GTB header.
Describe the bug
To Reproduce
Refer USB MIDI 2.0 specification B.10 page 44. On an Ubuntu 23.10 machine. Use libsub (latest git version) with a control transfer as specified in the USB specification. Retrieve the GTB from the device . It confirms the device returns the correct information as per the USB MIDI 2.0 specification:
Group Terminal Block Header Descriptor bLength: 05h bDescriptorType: 26h bDescriptorSubType: 01h wTotalLength: 0012h Group Terminal Block Descriptor bLength: 0Dh bDescriptorType: 26h bDescriptorSubType: 02 bGrpTermBlkID: 01h bGrpTermBlkType: 00h nGroupTrm: 00h nNumGroupTrm: 01h iBlockItem 04h bMIDIProtocol: 11h wMaxInputBandWith: 0001h wMaxOutputBandWith: 0000h
Expected behavior
Screenshots Command: midi.exe endpoint properties
GTB portion of from command: midi.exe endpoint properties --verbose Reference; MIDI Workbench (on Linux) shows zero's (right), Linux tool output (left)
Installer Name or Version
Device information, if this is with an external MIDI device:
Additional context Please confirm what Windows uses for bmRequestType and wLength in the call to retrieve the descriptor ? Any possibility to publish any corrections/errata that should be in and updated USB MIDI 2.0 specification, even unofficial ?