Re: [BUG REPORT] usb: dwc3: Bug while setting the USB transfer bandwidth on UVC gadget driver

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Watson,

(please teach your mailer to break lines at 80 columns)

"Chow, Watson" <Watson.Chow@xxxxxxxxx> writes:
> Hi,
>
> I'm using the SoC (Xilinx MPSoC) with DWC3 USB controller. I need to
> emulate my hardware to work like a USB camera and so make use of the
> USB UVC gadget driver - g_webcam.

which Kernel version are you running?

> Refer to this link and the driver source code, I find 3 parameters to
> configure the ISOC transfer bandwidth.
>
> https://docs.microsoft.com/en-us/windows-hardware/drivers/usbcon/transfer-data-to-isochronous-endpoints#isochronous-transfer-example
>
> They are:
>
> streaming_maxpacket : range [1 - 3072] 
> streaming_maxburst : range [0 - 15]
> streaming_interval : [1 - 16]
>
> So, I load the driver in this way
>
> # modprobe g_webcam streaming_maxpacket=3072 streaming_maxburst=9 streaming_interval=2
>
> Create my own app base on
> https://github.com/wlhe/uvc-gadget
>
> Test result
>
> In my evaluation, I can set the combination of parameters up to
> this. The streaming is ok.
>
> # modprobe g_webcam streaming_maxpacket=3072 streaming_maxburst=9 streaming_interval=2

streaming_maxburst=15 should work here too.

> This should be around 900Mbit/sec. Far less than 5Gbps bandwidth of
> USB3.0

IIRC Isoc endpoints can't take the full bus bandwidth, I don't remember
the exact limit but I think it's 80% of full bandwidth. Still, that
should be around 4Gbit/sec

> When I increase the parameter combination to:
> # modprobe g_webcam streaming_maxpacket=3072 streaming_maxburst=10 streaming_interval=2
>
> I get the below error message and everything stop.
>
> [ 1089.751559] g_webcam gadget: uvc: VS request completed with status -18.

> 1. This error is somehow related to the underflow of the transfer
> queue. Is my understanding correct?

that means the controller lost an isoc interval. There is still
discussion going on regarding isoc intervals in dwc3. It turns out the
HW doesn't make scheduling super easy for SW :-)

> If so, how to solve?
> 2.	My goal is to utilize the full bandwidth of USB3.0. How can I achive?
>
> [Some background information and my test setup]
>
> I started from the Xilinx TRD here.
>
> https://xilinx-wiki.atlassian.net/wiki/spaces/A/pages/541786361/Zynq+UltraScale+MPSoC+VCU+TRD+2020.1+-+Xilinx+Low+Latency+PS+DDR+NV12+HDMI+Audio+Video+Capture+and+Display
>
> With kernel version v5.4:
> https://github.com/Xilinx/linux-xlnx/tree/xlnx_rebase_v5.4_2020.2

v5.4 is super old, please test with v5.12 or the latest v5.13-rc. Also,
when reporting dwc3 bugs, make sure to include regdump and trace events
as described in dwc3 documentation

-- 
balbi

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux