wlhe / uvc-gadget

enhance uvc-gadget test application
GNU General Public License v2.0
140 stars 143 forks source link

UVC: Possible USB shutdown requested from Host #7

Open Gladsonba opened 3 years ago

Gladsonba commented 3 years ago

We are using zynq Ultrascale + MPSoC with custom board. Our board has 2 USB ports(Host 2.0 and device 3.0), 2 SDI(one input and another output). Kernel version on board is 4.19.0 and In host PC 5.4.0-58-generic. Final project according to customers requirement is Streaming 1080p video taking input from SDI and taking output from USB UVC(device). Currently We are trying with connecting C922 Pro Stream Webcam to USB(host) port.This creates /dev/video0 node. Then modprobe g_webcam. This creates /dev/video1. Using the application. At host side /dev/video0 is created. When I try to display using application such as guvcview, at the device side, getting below attached log. I need some more input so that I can move forward with this project. From host side: ffplay /dev/video0 Dequeued v4l2 buffer contains corrupted data (0 bytes). From device: [ 1563.216999] VS request completed with status -18. [ 1563.229986] VS request completed with status -18. UVC: Possible USB shutdown requested from Host, seen during VIDIOC_DQBUF [ 1563.234674] VS request completed with status -18. select timeout [ 1573.292465] dwc3 fe200000.dwc3: request 00000000af72569b was not queued to ep2in [ 1573.299868] dwc3 fe200000.dwc3: request 00000000bbc4cf8d was not queued to ep2in [ 1573.307273] dwc3 fe200000.dwc3: request 00000000849239a7 was not queued to ep2in [ 1573.314668] dwc3 fe200000.dwc3: request 0000000023561ba0 was not queued to ep2in UVC: Stopping video stream. USBGITLOG.txt

wuhanstudio commented 2 years ago

I got the same error on raspberrypi 4.

UVC: Possible USB shutdown requested from Host, seen during VIDIOC_DQBUF
select timeout
UVC: Stopping video stream.

And using an older version of Raspberrypi OS fixes this issue:

2021-10-30-raspios-bullseye-armhf.img

66cavy commented 2 years ago

Hello, I'm using zynq to implement UVC. The underlying USB3.0 hardware has been enabled. Please refer to the official tutorial given by Xilinx:”https://xilinx-wiki.atlassian.net/wiki/spaces/A/pages/2046001302/Building+Linux+usb+device+drivers+with+2021.1#UVC-Gadget“; But the results I got are inconsistent with those in the tutorial. Figure 1 shows the results of the tutorial, and Figure 2 shows the results I produced according to the tutorial. Why is this? picture 1:

企业微信截图_16571035862626

picture 2:The process will be stuck in "v4l2:2 buffers allocated", and there will be no change 企业微信截图_16571035278425

wuhanstudio commented 2 years ago

Hi, @66cavy

You need to open a Camera App that reads the image from the simulated canera, so that you can see the control sequence.

66cavy commented 2 years ago

Hi, @66cavy

You need to open a Camera App that reads the image from the simulated canera, so that you can see the control sequence.

Thanks,I opened the Camera App, but there was still no response,Very outrageous!And the "Webcam gadget" device enumeration does not appear in my computer device.If I can, I will be very grateful if I can get your contact information (qq/ wechat / others)!

wuhanstudio commented 2 years ago

Actually, this repo does not work for me, thus I created my own fork that works on raspi 4.

https://github.com/wuhanstudio/adversarial-camera/tree/master/uvc-gadget

My fork reads the image from a USB camera (YUYV or MJPG), and applies some image processing, then simulates a virtual UVC device.