Open perlindgren opened 3 years ago
I think the wrapping usage is meant to be inherited right?
https://github.com/twitchyliquid64/usbd-hid/issues/8 seems similar.
If we can work out what Windows is doing, I'm happy to implement a workaround like what we did for #[quirks allow_short]
.
My understanding is the wrapping usage should be inherited (and that's the behavior of Linux/OSX). To make the generated descriptor work cross platform I can see two ways. Either add explicit syntax in the macro so that you can annotate the wrapped input
/output
(and possibly feature
as well) with usage
info, or alternatively have the macro to emit the inherited usage
. Not sure what is the best here.
I think a new quirks mode that emits the usage before each input/output element in the report would work?
Not sure how i feel about this as it might make the descriptor huge, but worth a try? wdyt?
Hmm, I worked around the problem by manually coding the descriptor, so I don't have a full picture on where its actually required for it to work cross platform. When data is later streamed, does the descriptor size make much difference you think?
If you make that change to the descriptor and use it in Windows, does it still work in Linux? Also, specifics on how your workaround was achieved would be great.
Hi. It's been a while since I fiddled with this. As I recall it worked well on both win10, osx, and linux in the end. I don't have the midi stuff up and running currently. We are traveling tomorrow, but will be back later during the week, at that point I can try to check it for you.
Since its been a while, I assume the ecosystem including the usbdevice have progressed a bit, so maybe less of a hack is needed nowadays.
/Per
There seems to be some compatibility issue with Win10 and the generated descriptor(s).
The generated descriptor looks like this.
This works well under Linux (tested under arch) and OSX. Hower under Win10 the device is not properly detected/configured (
USB Device Viewer
shows the descriptors correctly but claims the devic to be in low power state.Adding a
usage
beforeInput
solves the issue.Either MS is out of specs (the wrapping usage should be inherited) or Linux/OSX just playing nice guessing, not sure.
Maybe there is already some workaround for this problem that I missed. If not, perhaps a syntax extension to the
#[item_settings usage = 0x01, ...]
would be possible. Or maybe let the proc macro always emit inheritedusage
from the wrapping collection (in this case).Admittedly I'm a USB novice, so not sure what's best here. /Per