[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,

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.

[My problem]

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

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


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? 
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


Enabled the UVC gadget and made my own test code to evaluate the transfer throughput on the USB3.0 port.

Test platform:
.	Xilinx ZCU106 evaluation board connected to PC through USB3.0 cable
.	Xilinx ZCU106 evaluation board would emulate a webcam through USB UVC gadget

My test app:
.	Capture 3840x2160@60 video and scale to 1920x1080@60
.	Queue the frames to UVC gadget driver
Host PC side:
.	X86 PC with Ubuntu 18.04LTS OS
.	Use ffplay to capture and display frame from ZCU106
# ffplay /dev/video2 -video_size 1920x1080 -framerate 30



Best regards,

Watson Chow
Design Manager
Avnet Technology Hong Kong Limited
 






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

  Powered by Linux