Support proxying devices with isochronous IN endpoints
With these changes, I'm able to proxy a few Logitech USB web cameras at a low resolution (160x120 pixels) via dwc3.
Proxying with a higher resolution fails to produce a picture on the host: I think because the transfer rate is too low and all the frames get dropped.
I have not tried other UDCs besides dwc3 yet.
Also fixes #13.
Tested proxying with dwc2 on Raspberry Pi 4: the initial enumeration works, but attempting to stream a picture fails with ioctl(USB_RAW_IOCTL_EP_ENABLE): Cannot allocate memory and dwc2 fe980000.usb: dwc2_hsotg_ep_enable: No suitable fifo found.
I think this happens due to the hardware limitations (no FIFOs for the used packet size?).
I think failing to proxy the device in this case is fine. However, I filed #24 for a possible improvement.
Hi @xairy
Thanks for the PR! Glad to see ISOC is supported now!
Overall the PR looks good to me, I will find devices to test before merging, thanks again!
You're welcome!
I recommend using a DWC3-based device for testing, if you have one. Raspberry Pi with its dwc2, unfortunately, doesn't work. Other UDCs I haven't tested.
I found this document listing some vendors that are using DWC3, I will try if I can get any of them. In the mean time, May I know the model of the device that you used for testing? thanks!
I use a ThinkPad X1 Carbon 6th Gen laptop, but getting DWC3 enabled there is tricky: https://xairy.io/articles/thinkpad-xdci. I believe that ROCK Pi uses DWC3, but I haven't tried it myself.
Using a laptop with DWC3 sounds cool! but unfortunately a bit too expensive 😓.
I got a rockpi 4c+ recently, but it doesn't looks like the OTG port works out of the box, I will find some time to see how to fix it
I borrowed an NXP i.MX8MP recently, and it also uses dwc3, I will find some time to get a USB camera or something else to test this PR :)
I am able to proxy the USB webcam with 1920*1080 resolution!
Just out of curiosity, did you run the usb-proxy in a serial console environemt or a ssh environment?
In serial console environment, I am not able to proxy high resolution(I think it is because of the printed messages are too much), while using ssh works a lot better
That's awesome!
I was running the proxy locally in a Terminal. Perhaps, the DWC3 controller in my laptop is just slow.
I see, I am merging the PR now, thanks again for this awesome PR! Glad to see ISOC is now supported!