[linux-uvc-devel] How to configure an android device as a UVC Camera?
Linux UVC driver and tools
Brought to you by:
pinchartl
From: Avinash G. <avi...@gm...> - 2019-06-15 13:17:15
|
Looking for some help here on how to configure an android device as a UVC webcam (on Windows Host). Similar to the post here: https://forums.xilinx.com/t5/Embedded-Processor-System-Design/ZC702-as-UVC-Device-USB-Webcam/m-p/572017#M23722 The Linux Kernel version is 4.9 and I tried the following changes: *diff --git a/rootdir/init.usb.configfs.rc b/rootdir/init.usb.configfs.rcindex 72f31edd8..84a8f90d0 100644--- a/rootdir/init.usb.configfs.rc+++ b/rootdir/init.usb.configfs.rc@@ -218,3 +232,48 @@ on property:sys.usb.ffs.ready=1 && property:sys.usb.config=rndis,adb && property symlink /config/usb_gadget/g1/functions/ffs.adb /config/usb_gadget/g1/configs/b.1/f2 write /config/usb_gadget/g1/UDC ${sys.usb.controller} setprop sys.usb.state ${sys.usb.config}++on property:sys.usb.config=uvc && property:sys.usb.configfs=1+ write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "uvc"+ rm /config/usb_gadget/g1/configs/b.1/f1+ rm /config/usb_gadget/g1/configs/b.1/f2+ rm /config/usb_gadget/g1/configs/b.1/f3+ rm /config/usb_gadget/g1/configs/b.1/f4+ rm /config/usb_gadget/g1/configs/b.1/f5+ symlink /config/usb_gadget/g1/functions/uvc.0 /config/usb_gadget/g1/configs/b.1/f1+ write /config/usb_gadget/g1/UDC ${sys.usb.controller}* On shell > setprop sys.usb.config uvc This does not enumerate the USB - UVC descriptors. So i made the following change: diff *--git a/drivers/usb/gadget/function/f_uvc.c b/drivers/usb/gadget/function/f_uvc.cindex fbc942d7a484..eeb3496d62f6 100644--- a/drivers/usb/gadget/function/f_uvc.c+++ b/drivers/usb/gadget/function/f_uvc.c@@ -739,6 +742,9 @@ uvc_function_bind(struct usb_configuration *c, struct usb_function *f) goto error; } + uvc_function_setup_continue(uvc);+ uvc_function_connect(uvc); return 0;* The driver now enumerates but is not recognised by windows, I have probably missed a setup step (uvc_function_setup?) for correct enumeration. Here's the output of the enumeration on windows application USB-View: *Device Descriptor:bcdUSB: 0x0210bDeviceClass: 0x00bDeviceSubClass: 0x00bDeviceProtocol: 0x00bMaxPacketSize0: 0x40 (64)idVendor: 0x05C6 (Qualcomm, Inc)idProduct: 0x901DbcdDevice: 0x0409iManufacturer: 0x01iProduct: 0x02iSerialNumber: 0x03bNumConfigurations: 0x01* *ConnectionStatus: DeviceConnectedCurrent Config Value: 0x00Device Bus Speed: HighDevice Address: 0x09Open Pipes: 0* *Configuration Descriptor:wTotalLength: 0x01CCbNumInterfaces: 0x02bConfigurationValue: 0x01iConfiguration: 0x04bmAttributes: 0x80 (Bus Powered )MaxPower: 0xFA (500 Ma)* *Unknown Descriptor:bDescriptorType: 0x0BbLength: 0x0808 0B 00 02 0E 03 00 05 * *Interface Descriptor:bInterfaceNumber: 0x00bAlternateSetting: 0x00bNumEndpoints: 0x01bInterfaceClass: 0x0EbInterfaceSubClass: 0x01bInterfaceProtocol: 0x01iInterface: 0x05* *Unknown Descriptor:bDescriptorType: 0x24bLength: 0x0D0D 24 01 50 01 35 00 00 6C DC 02 01 01 * *Unknown Descriptor:bDescriptorType: 0x24bLength: 0x1212 24 02 01 01 02 00 00 00 00 00 00 00 00 03 02 00 00 * *Unknown Descriptor:bDescriptorType: 0x24bLength: 0x0D0D 24 05 02 01 00 40 03 40 10 01 00 00 * *Unknown Descriptor:bDescriptorType: 0x24bLength: 0x0909 24 03 03 01 01 00 02 00 * *Endpoint Descriptor:bEndpointAddress: 0x81 INTransfer Type: InterruptwMaxPacketSize: 0x0010 (16)bInterval: 0x08* *Unknown Descriptor:bDescriptorType: 0x25bLength: 0x0505 25 03 10 00 * *Interface Descriptor:bInterfaceNumber: 0x01bAlternateSetting: 0x00bNumEndpoints: 0x00bInterfaceClass: 0x0EbInterfaceSubClass: 0x02bInterfaceProtocol: 0x00iInterface: 0x06* *Unknown Descriptor:bDescriptorType: 0x24bLength: 0x1010 24 01 03 58 01 82 00 03 00 00 00 01 00 04 00 * *Unknown Descriptor:bDescriptorType: 0x24bLength: 0x1B1B 24 04 01 02 59 55 59 32 00 00 10 00 80 00 00 AA 00 38 9B 71 10 01 00 00 00 00 * *Unknown Descriptor:bDescriptorType: 0x24bLength: 0x2626 24 05 01 00 80 02 68 01 00 40 19 01 00 C0 4B 03 00 08 07 00 2A 2C 0A 00 03 2A 2C 0A 00 40 42 0F 00 40 4B 4C 00 * *Unknown Descriptor:bDescriptorType: 0x24bLength: 0x1E1E 24 05 02 00 D0 02 68 01 00 00 C2 01 00 00 C2 01 00 20 1C 00 40 4B 4C 00 01 40 4B 4C 00 * *Unknown Descriptor:bDescriptorType: 0x24bLength: 0x0B0B 24 06 02 02 00 01 00 00 00 00 * *Unknown Descriptor:bDescriptorType: 0x24bLength: 0x2626 24 07 01 00 80 02 68 01 00 40 19 01 00 C0 4B 03 00 08 07 00 2A 2C 0A 00 03 2A 2C 0A 00 40 42 0F 00 40 4B 4C 00 * *Unknown Descriptor:bDescriptorType: 0x24bLength: 0x1E1E 24 07 02 00 D0 02 68 01 00 00 C2 01 00 00 C2 01 00 20 1C 00 40 4B 4C 00 01 40 4B 4C 00 * *Unknown Descriptor:bDescriptorType: 0x24bLength: 0x3434 24 13 03 02 01 04 00 76 00 00 3F CC 03 00 00 00 00 00 00 CC 03 00 00 00 00 00 00 CC 03 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 * *Unknown Descriptor:bDescriptorType: 0x24bLength: 0x3030 24 14 01 C0 03 C0 03 01 00 01 00 00 64 28 00 00 03 00 07 00 47 00 04 00 00 00 00 00 00 00 00 00 C2 01 00 E1 F5 05 63 17 05 00 01 63 17 05 00 * *Unknown Descriptor:bDescriptorType: 0x24bLength: 0x3030 24 14 02 80 07 C0 03 01 00 01 00 00 64 33 00 00 03 00 07 00 47 00 04 00 00 00 00 00 00 00 00 00 C2 01 00 E1 F5 05 63 17 05 00 01 63 17 05 00 * *Unknown Descriptor:bDescriptorType: 0x24bLength: 0x0606 24 0D 01 01 04 * *Interface Descriptor:bInterfaceNumber: 0x01bAlternateSetting: 0x01bNumEndpoints: 0x01bInterfaceClass: 0x0EbInterfaceSubClass: 0x02bInterfaceProtocol: 0x00iInterface: 0x06* *Endpoint Descriptor:bEndpointAddress: 0x82 INTransfer Type: IsochronouswMaxPacketSize: 0x1400 (5120)bInterval: 0x01* |