Closed jboone closed 3 years ago
This is what the symptoms look like in wireshark. Request: Response:
Here is my UAC2 example: https://github.com/hansfbaier/luna/blob/uac2/examples/usb/usb2_audio.py
Hi, has there been any progress on this so far? We're running into the same problem and I just want to make sure that I'm not duplicating any effort if I start digging into this.
@zyp No I have not investigated this. I will steer clear. Thanks for looking into that!
Per https://github.com/greatscottgadgets/luna/blob/main/luna/gateware/usb/usb2/control.py#L201, support for control responses larger than 64B is simply not implemented yet.
I hacked together a working solution, but I've got a meeting coming up in a few minutes, so I don't have time to clean it up into something PR-worthy right now, but here's the patch if anybody wants a go: https://paste.jvnv.net/view/D81fZ
Sorry for the late replay. We already know that this is missing.
@ktemkin even had some hints on IRC and Twitter (?) how this is supposed to be fixed.
@zyp Wow you're awesome, thanks!
@zyp What application is that screenshot from?
@hansfbaier Total Phase Data Center.
@twam I'd appreciate an URL to those hints so I can adapt my solution accordingly.
I asked about the issue on 2021-02-08 in #luna-usb on FreeNode. The 1bitsquared discord (https://1bitsquared.com/pages/chat) has a history of that in the #luna channel. I can also provide you a log/screenshots if you reach out via @twamueller on Twitter or twam@twam.info on mail.
Relevant line from the chat history:
there's a
InTransferManager
meant to be used in the control EP that's currently not patched in properly
I've now made an attempt at doing that, but that's a more involved change than my workaround from yesterday and I have not managed to get everything to work correctly, so I think I'll pass on this for now and stick with the workaround until somebody have time to solve it properly.
@zyp I tried the fix, but got this:
[ 2988.184141] usb 5-4: new high-speed USB device number 16 using xhci_hcd
[ 2988.333853] usb 5-4: unable to read config index 0 descriptor/start: -71
[ 2988.333857] usb 5-4: can't read configurations, error -71
[ 2988.460145] usb 5-4: new high-speed USB device number 17 using xhci_hcd
[ 2988.609851] usb 5-4: unable to read config index 0 descriptor/start: -71
[ 2988.609854] usb 5-4: can't read configurations, error -71
This should be fixed, as of https://github.com/greatscottgadgets/luna/commit/bf54d334eda178c7eacb3f5df6097876e130e11e.
I'm optimistically closing the issue, but I very much welcome all testing. :)
Thanks a lot! This is awesome news! I'll try to give it a test on the week-end!
Thank you so much, Kate! I am thrilled to give it a go!
I tried with the MIDI interface example (which I pushed to the pull request yesterday), and the get configuration request gets NAK'ed as it seems:
Sorry for the late feedback, but also works for me like a charm.
I'm having trouble with a long USB 2.0 configuration descriptor -- 75 bytes.
Initially, I was seeing my Linux host complaining in
dmesg
about being unable to read the descriptor, after I'd added another interface with two alternate settings. Here's how the problematic descriptor looks:I built a test case based on FullDeviceTest that demonstrates the problem in simulation:
If I set
try_config_length
to 32 or less, the test case passes. If 33 or larger, it fails. Examining the simulation output in GTKWave, I tracked the apparent culprit to this line in ConstantStreamGenerator, which appears to be sized wrong (5 bits wide) for the intent ofmax_length_width
, which I take to express the number of bits used to representmax_length
. Indeed, if I change that line from:...to:
...the test case passes. That is, until I reach
try_config_length
of 64, which fails for a different reason which I imagine is a separate issue.If I were to guess, this is a wMaxPacketSize0 issue, but that's just intuition speaking, not real data.
I'm holding off submitting a pull request, because I'm skeptical my ConstantStreamGenerator change is the extent of what's necessary. I just don't grasp the code well enough yet to know that the change I made was the appropriate one, as the meaning of
max_length
andmax_length_width
seem a bit muddled in my brain...