peterbay / uvc-gadget

uvc-gadget with resolution changing and video controls
GNU General Public License v2.0
81 stars 24 forks source link

uvc-gatget don't work on raspberry pi 4 R1.4 #30

Open minoru86 opened 2 years ago

minoru86 commented 2 years ago

I implemented this uvc-gatget on a raspberry pi4 4GB R1.2 and it worked fine. When I tried to run uvc-gadget on raspberry pi4 8GB R1.4 in the same way, the uvc-gadget device disappeared when I accessed the UVC camera from the PC connected via USB. It exists as a device in /dev/ video1 until I access the UVC camera (for example, select the camera in guvcview), but the device disappears as soon as I access it. The following log remains in syslog, but I don't understand what is wrong and it doesn't work as uvc-gadget. How can I get it to work with R1.4 ?

cat /proc/cpuinfo Hardware: BCM2711 Revision: d03114 Model: Raspberry Pi 4 Model B Rev 1.4

lsb_release -a Distributor ID : Raspbian Description : Raspbian GNU/Linux 10 (buster) Release : 10

syslog raspberrypi kernel: [ 369.645143] configfs-gadget gadget: uvc: uvc_function_set_alt(1, 1) raspberrypi kernel: [ 369.645159] configfs-gadget gadget: uvc: reset UVC raspberrypi kernel: [ 370.263179] configfs-gadget gadget: uvc: VS request completed with status -61. raspberrypi kernel: [ 370.842185] configfs-gadget gadget: uvc: VS request completed with status -61. raspberrypi kernel: [ 371.845535] configfs-gadget gadget: uvc: uvc_function_disable() raspberrypi piwebcam[433]: UVC: Possible USB shutdown requested from Host, seen during VIDIOC_DQBUF raspberrypi piwebcam[433]: UVC: Possible USB shutdown requested from Host, seen during VIDIOC_DQBUF raspberrypi piwebcam[433]: PROCESSING: Select timeout raspberrypi piwebcam[433]: UVC GADGET SHUTDOWN raspberrypi piwebcam[433]: DEVICE_V4L2: STREAM OFF success raspberrypi piwebcam[433]: DEVICE_V4L2: Uninit device raspberrypi piwebcam[433]: DEVICE_UVC: STREAM OFF success raspberrypi piwebcam[433]: UVC GADGET EXIT

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

minoru86 commented 2 years ago

Hi, wuhanstudio.Thank you for your reply. I also tried Bullseye, but changed to Buster because the camera driver specs weren't what I wanted. (Because the MJPG format could not be used with the V2 camera) Do you know a version uvc-gadget works fine with Buster ?

wuhanstudio commented 2 years ago

Hi, I did not try buster, but this one may work as the problem is caused by the new DWC3 driver:

https://www.spinics.net/lists/linux-usb/msg213221.html

https://downloads.raspberrypi.org/raspios_oldstable_lite_armhf/images/raspios_oldstable_lite_armhf-2021-12-02/