Re: [linux-uvc-devel] How to configure an android device as a UVC Camera?
Linux UVC driver and tools
Brought to you by:
pinchartl
From: Kieran B. <kie...@id...> - 2019-06-18 11:17:55
|
Hi Avinash On 15/06/2019 14:16, Avinash Gonsalves wrote: > 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.rc > index 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.c > index 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); I don't think you should be adding things here. > 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 You must run the uvc-gadget application which controls actually processing frames to send to the host. http://git.ideasonboard.org/uvc-gadget.git -- Regards Kieran > USB-View: > /Device Descriptor: > bcdUSB: 0x0210 > bDeviceClass: 0x00 > bDeviceSubClass: 0x00 > bDeviceProtocol: 0x00 > bMaxPacketSize0: 0x40 (64) > idVendor: 0x05C6 (Qualcomm, Inc) > idProduct: 0x901D > bcdDevice: 0x0409 > iManufacturer: 0x01 > iProduct: 0x02 > iSerialNumber: 0x03 > bNumConfigurations: 0x01/ > /ConnectionStatus: DeviceConnected > Current Config Value: 0x00 > Device Bus Speed: High > Device Address: 0x09 > Open Pipes: 0/ > /Configuration Descriptor: > wTotalLength: 0x01CC > bNumInterfaces: 0x02 > bConfigurationValue: 0x01 > iConfiguration: 0x04 > bmAttributes: 0x80 (Bus Powered ) > MaxPower: 0xFA (500 Ma)/ > /Unknown Descriptor: > bDescriptorType: 0x0B > bLength: 0x08 > 08 0B 00 02 0E 03 00 05 / > /Interface Descriptor: > bInterfaceNumber: 0x00 > bAlternateSetting: 0x00 > bNumEndpoints: 0x01 > bInterfaceClass: 0x0E > bInterfaceSubClass: 0x01 > bInterfaceProtocol: 0x01 > iInterface: 0x05/ > /Unknown Descriptor: > bDescriptorType: 0x24 > bLength: 0x0D > 0D 24 01 50 01 35 00 00 6C DC 02 01 01 / > /Unknown Descriptor: > bDescriptorType: 0x24 > bLength: 0x12 > 12 24 02 01 01 02 00 00 00 00 00 00 00 00 03 02 > 00 00 / > /Unknown Descriptor: > bDescriptorType: 0x24 > bLength: 0x0D > 0D 24 05 02 01 00 40 03 40 10 01 00 00 / > /Unknown Descriptor: > bDescriptorType: 0x24 > bLength: 0x09 > 09 24 03 03 01 01 00 02 00 / > /Endpoint Descriptor: > bEndpointAddress: 0x81 IN > Transfer Type: Interrupt > wMaxPacketSize: 0x0010 (16) > bInterval: 0x08/ > /Unknown Descriptor: > bDescriptorType: 0x25 > bLength: 0x05 > 05 25 03 10 00 / > /Interface Descriptor: > bInterfaceNumber: 0x01 > bAlternateSetting: 0x00 > bNumEndpoints: 0x00 > bInterfaceClass: 0x0E > bInterfaceSubClass: 0x02 > bInterfaceProtocol: 0x00 > iInterface: 0x06/ > /Unknown Descriptor: > bDescriptorType: 0x24 > bLength: 0x10 > 10 24 01 03 58 01 82 00 03 00 00 00 01 00 04 00 / > /Unknown Descriptor: > bDescriptorType: 0x24 > bLength: 0x1B > 1B 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: 0x24 > bLength: 0x26 > 26 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: 0x24 > bLength: 0x1E > 1E 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: 0x24 > bLength: 0x0B > 0B 24 06 02 02 00 01 00 00 00 00 / > /Unknown Descriptor: > bDescriptorType: 0x24 > bLength: 0x26 > 26 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: 0x24 > bLength: 0x1E > 1E 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: 0x24 > bLength: 0x34 > 34 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: 0x24 > bLength: 0x30 > 30 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: 0x24 > bLength: 0x30 > 30 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: 0x24 > bLength: 0x06 > 06 24 0D 01 01 04 / > /Interface Descriptor: > bInterfaceNumber: 0x01 > bAlternateSetting: 0x01 > bNumEndpoints: 0x01 > bInterfaceClass: 0x0E > bInterfaceSubClass: 0x02 > bInterfaceProtocol: 0x00 > iInterface: 0x06/ > /Endpoint Descriptor: > bEndpointAddress: 0x82 IN > Transfer Type: Isochronous > wMaxPacketSize: 0x1400 (5120) > bInterval: 0x01/ > > > _______________________________________________ > Linux-uvc-devel mailing list > Lin...@li... > https://lists.sourceforge.net/lists/listinfo/linux-uvc-devel > -- Regards -- Kieran |