Hello,
In the project to develop a webcam functionality on an IMX6 device, I would like to first test the basics through the g_webcam gadget and the UVC gadget test application.
Setup is:
Host: PC running Ubuntu 12.04 (kernel 3.5)
Device: IMX6 SabreSD device running a kernel version 3.0.35 (Ubuntu 11.04 File System) , g_webcam gadget loaded successfully (/dev/video0 created), and the test app (from git://git.ideasonboard.org/uvc-gadget.git)
running through uvc-gadget –d /dev/video0
Device connected to the host through its USB OTG interface.
On my host, the USB device (gadget webcamera) is correctly seen, but it seems that at the end the init is failing (uvc_video_init() failing) and so uvc_probe is failing.
[ 1948.348158] usb 1-1: new high-speed USB device number 4 using ehci_hcd
[ 1948.713758] usb 1-1: New USB device found, idVendor=1d6b, idProduct=0102
[ 1948.713763] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[ 1948.713767] usb 1-1: Product: Webcam gadget
[ 1948.713770] usb 1-1: Manufacturer: Linux Foundation
[ 1948.724520] uvcvideo: Probing generic UVC device 1
[ 1948.724526] uvcvideo: Found format YUV 4:2:2 (YUYV).
[ 1948.724529] uvcvideo: - 640x360 (15.0 fps)
[ 1948.724532] uvcvideo: - 1280x720 (2.0 fps)
[ 1948.724534] uvcvideo: Found format MJPEG.
[ 1948.724537] uvcvideo: - 640x360 (15.0 fps)
[ 1948.724540] uvcvideo: - 1280x720 (2.0 fps)
[ 1948.724544] uvcvideo: Found a Status endpoint (addr81).
[ 1948.724546] uvcvideo: Found UVC 1.00 device Webcam gadget (1d6b:0102)
[ 1948.724552] uvcvideo: Added control 00000000-0000-0000-0000-000000000001/2 to device 1 entity 1
[ 1948.724555] uvcvideo: Adding mapping 'Exposure, Auto' to control 00000000-0000-0000-0000-000000000001/2.
[ 1948.724559] uvcvideo: Added control 00000000-0000-0000-0000-000000000101/2 to device 1 entity 2
[ 1948.724562] uvcvideo: Adding mapping 'Brightness' to control 00000000-0000-0000-0000-000000000101/2.
[ 1948.724565] uvcvideo: Scanning UVC chain: OT 3 <- PU 2 <- IT 1
[ 1948.724569] uvcvideo: Found a valid video chain (1 -> 3).
[ 1953.724337] uvcvideo: UVC non compliance - GET_DEF(PROBE) not supported. Enabling workaround.
[ 1958.724420] uvcvideo: Failed to query (129) UVC probe control : -110 (exp. 26).
[ 1958.724427] uvcvideo: Failed to initialize the device (-5).
On my IMX6 device, I see from the test app that I am receiving some request (UVC_GET_DEF => req 87) that seems to be answered, I see a response through Wireshark, but for some reason it is marked as
Malformed packet there.
On my device I have the following traces from the test app.
open succeeded, file descriptor = 3
device is fsl-usb2-udc on bus gadget
bRequestType a1 bRequest 87 wValue 0100 wIndex 0001
wLength 001a
streaming request (req 87 cs 01)
and from a dmesg on the IMX6 device:
g_webcam gadget: uvc_function_bind
g_webcam gadget: Webcam Video Gadget
g_webcam gadget: g_webcam ready
Suspend udc for OTG auto detect
USB Gadget resume begins
fsl_udc_resume, Wait for wakeup thread finishes
dr_controller_run: udc out low power mode
USB Gadget resume ends
fsl-usb2-udc: bind to driver g_webcam
fsl_gadget_disconnect_event: udc enter low power mode
USB Charger Disconnected.
otg udc vbus rising wakeup
try_wake_up_udc: udc out low power mode
USB Charger Connected.
g_webcam gadget: high speed config #1: Video
g_webcam gadget: uvc_function_set_alt(0, 0)
g_webcam gadget: uvc_function_set_alt(1, 0)
g_webcam gadget: uvc_function_set_alt(1, 0)
g_webcam gadget: uvc_function_set_alt(1, 0)
Before I start adding traces almost everywhere ;-), is there someone who may already have faced similar issue? Did people already used the g_webcam gadget on the IMX6 SabreSD or any IMX6 based board?
Could it be any compatibility problem between my host running a kernel 3.5 and my device running a kernel 3.0? Some old known bugs I am missing fixes in the old kernels I am using? Is there something not correctly configured from the application side? I am pretty new to the USB / V4L2 and UVC, so is there something special I should check first?
Thanks & Regards
I am going to do same work .Now connect the IMX to host PC(windows7). It has not any response .could you introduce how to config the kernel let the OTG work as device ?
Hi Matthieu,
I know this post is quite old but I would like to help you with your question.
The problem is usually caused by a timeout event triggered on the host PC when the USB device is not able to configure itself on time. This is a known issue on some Ubuntu version were the timeout value is set to 1000ms, in the case of Windows drivers this timeout has been increased to 5000ms (see Bug #241753 “uvcvideo module randomly fails to load” : Bugs : “linux-ubuntu-modules-2.6.24” package ...).
You may try to increase the timeout of your host PC or try to load the g_webcam module into the webcam test application so the application can configure the UVC device quickly.
Best Regards,
-Marco