espressif / esp-iot-solution

Espressif IoT Library. IoT Device Drivers, Documentations And Solutions.
Apache License 2.0
1.91k stars 763 forks source link

usb_stream: ID 0c45:6366 Microdia Webcam support (AEGHB-66) #250

Closed Draghtnod closed 1 year ago

Draghtnod commented 1 year ago

I am trying to get this Webcam working. It seems to be 'smart' and outputs a different Configuration Descriptor on the PC than on the ESP. Unfortunately, only 2 uncompressed formats are supported in this "comparibility" mode. Does maybe someone have a hint, how this "compatibility" mode is triggered?

Check usb_stream.c here. The Descriptors are read right after reset and some basic usb port configuration.

Device/Configuration Descriptors on ESP:

Click to expand ``` I (1353) UVC_STREAM: UVC Streaming Config Succeed, Version: 0.4.3 I (1883) UVC_STREAM: Port=1 init succeed I (1883) UVC_STREAM: Waiting USB Connection I (1883) UVC_STREAM: USB Streaming Starting I (1883) uvc_demo: usb streaming start succeed I (2133) UVC_STREAM: line 506 HCD_PORT_EVENT_CONNECTION I (2143) UVC_STREAM: Resetting Port I (2203) UVC_STREAM: Setting Port FIFO I (2203) UVC_STREAM: Getting Port Speed I (2203) UVC_STREAM: Port speed = 1 I (2203) UVC_STREAM: USB Speed: full-speed I (2213) UVC_STREAM: Default pipe endpoint MPS update to 64 I (2213) UVC_STREAM: Set Device Addr = 1 I (2223) UVC_STREAM: Set Device Addr Done I (2223) UVC_STREAM: get device desc I (2233) UVC_STREAM: get device desc, actual_num_bytes:26 *** Device descriptor *** bLength 18 bDescriptorType 1 bcdUSB 2.00 bDeviceClass 0xef bDeviceSubClass 0x2 bDeviceProtocol 0x1 bMaxPacketSize0 64 idVendor 0xc45 idProduct 0x6366 bcdDevice 0.02 iManufacturer 2 iProduct 1 iSerialNumber 3 bNumConfigurations 1 I (2263) UVC_STREAM: get short config desc I (2263) UVC_STREAM: get config desc, actual_num_bytes:16 I (2273) UVC_STREAM: get full config desc 463 I (2303) UVC_STREAM: get full config desc, actual_num_bytes:471 *** Configuration descriptor *** bLength 9 bDescriptorType 0x2 wTotalLength 463 bNumInterfaces 4 bConfigurationValue 1 iConfiguration 0 bmAttributes 0x80 bMaxPower 128mA *** Interface Association Descriptor: Video *** bLength 8 bDescriptorType 0xb bFirstInterface 0 bInterfaceCount 2 bFunctionClass 0xe bFunctionSubClass 0x3 bFunctionProtocol 0x0 iFunction 5 *** Interface descriptor *** bLength 9 bDescriptorType 0x4 bInterfaceNumber 0 bAlternateSetting 0 bNumEndpoints 1 bInterfaceClass 0xe (Video) bInterfaceSubClass 0x1 bInterfaceProtocol 0x0 iInterface 5 *** Endpoint descriptor *** bLength 7 bDescriptorType 0x5 bEndpointAddress 0x83 EP 3 IN bmAttributes 0x3 INT wMaxPacketSize 0x10 16 bInterval 6 *** Interface descriptor *** bLength 9 bDescriptorType 0x4 bInterfaceNumber 1 bAlternateSetting 0 bNumEndpoints 0 bInterfaceClass 0xe (Video) bInterfaceSubClass 0x2 bInterfaceProtocol 0x0 iInterface 5 I (2383) UVC_STREAM: Found video stream format descriptor, subtype: 1 *** Class-specific VS Interface Descriptor *** bLength 0xe bDescriptorType 0x24 bDescriptorSubType 1 bNumFormats 1 wTotalLength 133 bEndpointAddress 129 bFunctionProtocol 0 bmInfo 0x2 bTerminalLink 2 bStillCaptureMethod 0 bTriggerSupport 0 bTriggerUsage 1 bControlSize 0 bmaControls 0x1b I (2413) UVC_STREAM: Found video stream format descriptor, subtype: 4 I (2423) UVC_STREAM: Found video stream format descriptor, subtype: 5 I (2433) UVC_STREAM: Found video stream format descriptor, subtype: 5 I (2443) UVC_STREAM: Found video stream format descriptor, subtype: 3 I (2443) UVC_STREAM: Found video stream format descriptor, subtype: 13 *** Interface descriptor *** bLength 9 bDescriptorType 0x4 bInterfaceNumber 1 bAlternateSetting 1 bNumEndpoints 1 bInterfaceClass 0xe (Video) bInterfaceSubClass 0x2 bInterfaceProtocol 0x0 iInterface 0 *** Endpoint descriptor *** bLength 7 bDescriptorType 0x5 bEndpointAddress 0x81 EP 1 IN bmAttributes 0x5 ISOC wMaxPacketSize 0x80 128 bInterval 1 *** Interface descriptor *** bLength 9 bDescriptorType 0x4 bInterfaceNumber 1 bAlternateSetting 2 bNumEndpoints 1 bInterfaceClass 0xe (Video) bInterfaceSubClass 0x2 bInterfaceProtocol 0x0 iInterface 0 *** Endpoint descriptor *** bLength 7 bDescriptorType 0x5 bEndpointAddress 0x81 EP 1 IN bmAttributes 0x5 ISOC wMaxPacketSize 0x100 256 bInterval 1 *** Interface descriptor *** bLength 9 bDescriptorType 0x4 bInterfaceNumber 1 bAlternateSetting 3 bNumEndpoints 1 bInterfaceClass 0xe (Video) bInterfaceSubClass 0x2 bInterfaceProtocol 0x0 iInterface 0 *** Endpoint descriptor *** bLength 7 bDescriptorType 0x5 bEndpointAddress 0x81 EP 1 IN bmAttributes 0x5 ISOC wMaxPacketSize 0x200 512 bInterval 1 *** Interface descriptor *** bLength 9 bDescriptorType 0x4 bInterfaceNumber 1 bAlternateSetting 4 bNumEndpoints 1 bInterfaceClass 0xe (Video) bInterfaceSubClass 0x2 bInterfaceProtocol 0x0 iInterface 0 *** Endpoint descriptor *** bLength 7 bDescriptorType 0x5 bEndpointAddress 0x81 EP 1 IN bmAttributes 0x5 ISOC wMaxPacketSize 0x258 600 bInterval 1 *** Interface descriptor *** bLength 9 bDescriptorType 0x4 bInterfaceNumber 1 bAlternateSetting 5 bNumEndpoints 1 bInterfaceClass 0xe (Video) bInterfaceSubClass 0x2 bInterfaceProtocol 0x0 iInterface 0 *** Endpoint descriptor *** bLength 7 bDescriptorType 0x5 bEndpointAddress 0x81 EP 1 IN bmAttributes 0x5 ISOC wMaxPacketSize 0x320 800 bInterval 1 *** Interface descriptor *** bLength 9 bDescriptorType 0x4 bInterfaceNumber 1 bAlternateSetting 6 bNumEndpoints 1 bInterfaceClass 0xe (Video) bInterfaceSubClass 0x2 bInterfaceProtocol 0x0 iInterface 0 *** Endpoint descriptor *** bLength 7 bDescriptorType 0x5 bEndpointAddress 0x81 EP 1 IN bmAttributes 0x5 ISOC wMaxPacketSize 0x3bc 956 bInterval 1 *** Interface Association Descriptor: Audio *** bLength 8 bDescriptorType 0xb bFirstInterface 2 bInterfaceCount 2 bFunctionClass 0x1 bFunctionSubClass 0x0 bFunctionProtocol 0x0 iFunction 4 *** Interface descriptor *** bLength 9 bDescriptorType 0x4 bInterfaceNumber 2 bAlternateSetting 0 bNumEndpoints 0 bInterfaceClass 0x1 (Audio) bInterfaceSubClass 0x1 bInterfaceProtocol 0x0 iInterface 4 *** Audio control header descriptor *** bLength 9 bDescriptorType 0x24 bDescriptorSubtype 0x1 bcdADC 0x100 wTotalLength 41 bInCollection 1 Interface number[0] = 3 *** Audio control input terminal descriptor *** bLength 12 bDescriptorType 0x24 bDescriptorSubtype 0x2 bTerminalID 1 wTerminalType 0x201 bAssocTerminal 0 bNrChannels 1 wChannelConfig 0x0000 iChannelNames 0 iTerminal 0 *** Audio control feature unit descriptor *** bLength 11 bDescriptorType 0x24 bDescriptorSubtype 0x6 bUnitID 2 bSourceID 1 bControlSize 2 bmaControls[ch0] 0x1 iFeature 2 *** Audio control output terminal descriptor *** bLength 9 bDescriptorType 0x24 bDescriptorSubtype 0x3 bTerminalID 3 wTerminalType 0x101 bAssocTerminal 0 bSourceID 2 iTerminal 0 *** Interface descriptor *** bLength 9 bDescriptorType 0x4 bInterfaceNumber 3 bAlternateSetting 0 bNumEndpoints 0 bInterfaceClass 0x1 (Audio) bInterfaceSubClass 0x2 bInterfaceProtocol 0x0 iInterface 0 *** Interface descriptor *** bLength 9 bDescriptorType 0x4 bInterfaceNumber 3 bAlternateSetting 1 bNumEndpoints 1 bInterfaceClass 0x1 (Audio) bInterfaceSubClass 0x2 bInterfaceProtocol 0x0 iInterface 0 *** Audio stream general descriptor *** bLength 7 bDescriptorType 0x24 bDescriptorSubtype 0x1 bTerminalLink 3 bDelay 1 wFormatTag 1 *** Audio control header descriptor *** bLength 11 bDescriptorType 0x24 bDescriptorSubtype 0x2 bFormatType 1 bNrChannels 1 bSubframeSize 2 bBitResolution 16 bSamFreqType 1 tSamFreq[0] 16000 *** Endpoint descriptor *** bLength 9 bDescriptorType 0x5 bEndpointAddress 0x84 EP 4 IN bmAttributes 0x5 ISOC wMaxPacketSize 0x20 32 bInterval 4 I (2843) UVC_STREAM: Set Device Configuration = 1 I (2853) UVC_STREAM: Set Device Configuration Done I (2853) UVC_STREAM: Probe MJPEG payload size = 256 I (2863) UVC_STREAM: SET_CUR Probe I (2873) UVC_STREAM: SET_CUR Probe Done I (2873) UVC_STREAM: GET_CUR Probe bmHint: 0001 bFormatIndex: 1 bFrameIndex: 7 dwFrameInterval: 333333 wKeyFrameRate: 0 wPFrameRate: 0 wCompQuality: 0 wCompWindowSize: 0 wDelay: 50349 dwMaxVideoFrameSize: 268435969 dwMaxPayloadTransferSize: 33807 dwClockFrequency: 0 bmFramingInfo: 0 bPreferredVersion: 0 bMinVersion: 0 bMaxVersion: 0 bInterfaceNumber: 0 I (2903) UVC_STREAM: GET_CUR Probe Done, actual_num_bytes:34 I (2913) UVC_STREAM: SET_CUR COMMIT I (2923) UVC_STREAM: SET_CUR COMMIT Done I (2923) UVC_STREAM: Set Device Interface = 1, Alt = 2 I (2933) UVC_STREAM: Set Device Interface Done I (2933) UVC_STREAM: usb stream task start I (2933) UVC_STREAM: uvc stream urb ready I (2943) UVC_STREAM: Sample processing task started I (2943) UVC_STREAM: Creating uvc in(isoc) pipe itf = 1-2, ep = 0x81 I (2953) UVC_STREAM: uvc streaming.. ```

Device/Configuration Descriptors on PC:

Click to expand Have a look at wTotalLength of the Configuration Descriptor vs the one above. ``` Bus 001 Device 013: ID 0c45:6366 Microdia Webcam Vitade AF Couldn't open device, some information will be missing Device Descriptor: bLength 18 bDescriptorType 1 bcdUSB 2.00 bDeviceClass 239 Miscellaneous Device bDeviceSubClass 2 bDeviceProtocol 1 Interface Association bMaxPacketSize0 64 idVendor 0x0c45 Microdia idProduct 0x6366 Webcam Vitade AF bcdDevice 0.02 iManufacturer 2 Sonix Technology Co., Ltd. iProduct 1 Webcam iSerial 3 Webcam bNumConfigurations 1 Configuration Descriptor: bLength 9 bDescriptorType 2 wTotalLength 0x034f bNumInterfaces 4 bConfigurationValue 1 iConfiguration 0 bmAttributes 0x80 (Bus Powered) MaxPower 128mA Interface Association: bLength 8 bDescriptorType 11 bFirstInterface 0 bInterfaceCount 2 bFunctionClass 14 Video bFunctionSubClass 3 Video Interface Collection bFunctionProtocol 0 iFunction 5 Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 0 bAlternateSetting 0 bNumEndpoints 1 bInterfaceClass 14 Video bInterfaceSubClass 1 Video Control bInterfaceProtocol 0 iInterface 5 VideoControl Interface Descriptor: bLength 13 bDescriptorType 36 bDescriptorSubtype 1 (HEADER) bcdUVC 1.00 wTotalLength 0x004d dwClockFrequency 15.000000MHz bInCollection 1 baInterfaceNr( 0) 1 VideoControl Interface Descriptor: bLength 9 bDescriptorType 36 bDescriptorSubtype 3 (OUTPUT_TERMINAL) bTerminalID 2 wTerminalType 0x0101 USB Streaming bAssocTerminal 0 bSourceID 4 iTerminal 0 VideoControl Interface Descriptor: bLength 26 bDescriptorType 36 bDescriptorSubtype 6 (EXTENSION_UNIT) bUnitID 4 guidExtensionCode {28f03370-6311-4a2e-ba2c-6890eb334016} bNumControls 8 bNrInPins 1 baSourceID( 0) 3 bControlSize 1 bmControls( 0) 0x0f iExtension 0 VideoControl Interface Descriptor: bLength 18 bDescriptorType 36 bDescriptorSubtype 2 (INPUT_TERMINAL) bTerminalID 1 wTerminalType 0x0201 Camera Sensor bAssocTerminal 0 iTerminal 0 wObjectiveFocalLengthMin 0 wObjectiveFocalLengthMax 0 wOcularFocalLength 0 bControlSize 3 bmControls 0x0000200e Auto-Exposure Mode Auto-Exposure Priority Exposure Time (Absolute) Roll (Absolute) VideoControl Interface Descriptor: bLength 11 bDescriptorType 36 bDescriptorSubtype 5 (PROCESSING_UNIT) Warning: Descriptor too short bUnitID 3 bSourceID 1 wMaxMultiplier 0 bControlSize 2 bmControls 0x0000177f Brightness Contrast Hue Saturation Sharpness Gamma White Balance Temperature Backlight Compensation Gain Power Line Frequency White Balance Temperature, Auto iProcessing 0 bmVideoStandards 0x7f None NTSC - 525/60 PAL - 625/50 SECAM - 625/50 NTSC - 625/50 PAL - 525/60 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x83 EP 3 IN bmAttributes 3 Transfer Type Interrupt Synch Type None Usage Type Data wMaxPacketSize 0x0010 1x 16 bytes bInterval 6 Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 1 bAlternateSetting 0 bNumEndpoints 0 bInterfaceClass 14 Video bInterfaceSubClass 2 Video Streaming bInterfaceProtocol 0 iInterface 5 VideoStreaming Interface Descriptor: bLength 15 bDescriptorType 36 bDescriptorSubtype 1 (INPUT_HEADER) bNumFormats 2 wTotalLength 0x01f3 bEndpointAddress 0x81 EP 1 IN bmInfo 0 bTerminalLink 2 bStillCaptureMethod 2 bTriggerSupport 0 bTriggerUsage 0 bControlSize 1 bmaControls( 0) 0 bmaControls( 1) 0 VideoStreaming Interface Descriptor: bLength 11 bDescriptorType 36 bDescriptorSubtype 6 (FORMAT_MJPEG) bFormatIndex 1 bNumFrameDescriptors 7 bFlags 0 Fixed-size samples: No bDefaultFrameIndex 1 bAspectRatioX 0 bAspectRatioY 0 bmInterlaceFlags 0x00 Interlaced stream or variable: No Fields per frame: 1 fields Field 1 first: No Field pattern: Field 1 only bCopyProtect 0 VideoStreaming Interface Descriptor: bLength 30 bDescriptorType 36 bDescriptorSubtype 7 (FRAME_MJPEG) bFrameIndex 1 bmCapabilities 0x00 Still image unsupported wWidth 1920 wHeight 1080 dwMinBitRate 995469360 dwMaxBitRate 995469360 dwMaxVideoFrameBufferSize 4147789 dwDefaultFrameInterval 333333 bFrameIntervalType 1 dwFrameInterval( 0) 333333 VideoStreaming Interface Descriptor: bLength 30 bDescriptorType 36 bDescriptorSubtype 7 (FRAME_MJPEG) bFrameIndex 2 bmCapabilities 0x00 Still image unsupported wWidth 640 wHeight 480 dwMinBitRate 147597360 dwMaxBitRate 147597360 dwMaxVideoFrameBufferSize 614989 dwDefaultFrameInterval 333333 bFrameIntervalType 1 dwFrameInterval( 0) 333333 VideoStreaming Interface Descriptor: bLength 30 bDescriptorType 36 bDescriptorSubtype 7 (FRAME_MJPEG) bFrameIndex 3 bmCapabilities 0x00 Still image unsupported wWidth 1024 wHeight 768 dwMinBitRate 377628720 dwMaxBitRate 377628720 dwMaxVideoFrameBufferSize 1573453 dwDefaultFrameInterval 333333 bFrameIntervalType 1 dwFrameInterval( 0) 333333 VideoStreaming Interface Descriptor: bLength 30 bDescriptorType 36 bDescriptorSubtype 7 (FRAME_MJPEG) bFrameIndex 4 bmCapabilities 0x00 Still image unsupported wWidth 1280 wHeight 720 dwMinBitRate 442509360 dwMaxBitRate 442509360 dwMaxVideoFrameBufferSize 1843789 dwDefaultFrameInterval 333333 bFrameIntervalType 1 dwFrameInterval( 0) 333333 VideoStreaming Interface Descriptor: bLength 30 bDescriptorType 36 bDescriptorSubtype 7 (FRAME_MJPEG) bFrameIndex 5 bmCapabilities 0x00 Still image unsupported wWidth 1280 wHeight 1024 dwMinBitRate 629286960 dwMaxBitRate 629286960 dwMaxVideoFrameBufferSize 2622029 dwDefaultFrameInterval 333333 bFrameIntervalType 1 dwFrameInterval( 0) 333333 VideoStreaming Interface Descriptor: bLength 30 bDescriptorType 36 bDescriptorSubtype 7 (FRAME_MJPEG) bFrameIndex 6 bmCapabilities 0x00 Still image unsupported wWidth 2048 wHeight 1536 dwMinBitRate 1510090800 dwMaxBitRate 1510090800 dwMaxVideoFrameBufferSize 6292045 dwDefaultFrameInterval 333333 bFrameIntervalType 1 dwFrameInterval( 0) 333333 VideoStreaming Interface Descriptor: bLength 30 bDescriptorType 36 bDescriptorSubtype 7 (FRAME_MJPEG) bFrameIndex 7 bmCapabilities 0x00 Still image unsupported wWidth 320 wHeight 240 dwMinBitRate 37005360 dwMaxBitRate 37005360 dwMaxVideoFrameBufferSize 154189 dwDefaultFrameInterval 333333 bFrameIntervalType 1 dwFrameInterval( 0) 333333 VideoStreaming Interface Descriptor: bLength 10 bDescriptorType 36 bDescriptorSubtype 3 (STILL_IMAGE_FRAME) bEndpointAddress 0x00 EP 0 OUT bNumImageSizePatterns 1 wWidth( 0) 1920 wHeight( 0) 1080 bNumCompressionPatterns 0 VideoStreaming Interface Descriptor: bLength 27 bDescriptorType 36 bDescriptorSubtype 4 (FORMAT_UNCOMPRESSED) bFormatIndex 2 bNumFrameDescriptors 7 guidFormat {32595559-0000-0010-8000-00aa00389b71} bBitsPerPixel 16 bDefaultFrameIndex 1 bAspectRatioX 0 bAspectRatioY 0 bmInterlaceFlags 0x00 Interlaced stream or variable: No Fields per frame: 2 fields Field 1 first: No Field pattern: Field 1 only bCopyProtect 0 VideoStreaming Interface Descriptor: bLength 30 bDescriptorType 36 bDescriptorSubtype 5 (FRAME_UNCOMPRESSED) bFrameIndex 1 bmCapabilities 0x00 Still image unsupported wWidth 640 wHeight 480 dwMinBitRate 122880000 dwMaxBitRate 122880000 dwMaxVideoFrameBufferSize 614400 dwDefaultFrameInterval 400000 bFrameIntervalType 1 dwFrameInterval( 0) 400000 VideoStreaming Interface Descriptor: bLength 30 bDescriptorType 36 bDescriptorSubtype 5 (FRAME_UNCOMPRESSED) bFrameIndex 2 bmCapabilities 0x00 Still image unsupported wWidth 1024 wHeight 768 dwMinBitRate 125829120 dwMaxBitRate 125829120 dwMaxVideoFrameBufferSize 1572864 dwDefaultFrameInterval 1000000 bFrameIntervalType 1 dwFrameInterval( 0) 1000000 VideoStreaming Interface Descriptor: bLength 30 bDescriptorType 36 bDescriptorSubtype 5 (FRAME_UNCOMPRESSED) bFrameIndex 3 bmCapabilities 0x00 Still image unsupported wWidth 1280 wHeight 720 dwMinBitRate 147456000 dwMaxBitRate 147456000 dwMaxVideoFrameBufferSize 1843200 dwDefaultFrameInterval 1000000 bFrameIntervalType 1 dwFrameInterval( 0) 1000000 VideoStreaming Interface Descriptor: bLength 30 bDescriptorType 36 bDescriptorSubtype 5 (FRAME_UNCOMPRESSED) bFrameIndex 4 bmCapabilities 0x00 Still image unsupported wWidth 1280 wHeight 1024 dwMinBitRate 104857600 dwMaxBitRate 104857600 dwMaxVideoFrameBufferSize 2621440 dwDefaultFrameInterval 2000000 bFrameIntervalType 1 dwFrameInterval( 0) 2000000 VideoStreaming Interface Descriptor: bLength 30 bDescriptorType 36 bDescriptorSubtype 5 (FRAME_UNCOMPRESSED) bFrameIndex 5 bmCapabilities 0x00 Still image unsupported wWidth 1920 wHeight 1080 dwMinBitRate 165888000 dwMaxBitRate 165888000 dwMaxVideoFrameBufferSize 4147200 dwDefaultFrameInterval 2000000 bFrameIntervalType 1 dwFrameInterval( 0) 2000000 VideoStreaming Interface Descriptor: bLength 30 bDescriptorType 36 bDescriptorSubtype 5 (FRAME_UNCOMPRESSED) bFrameIndex 6 bmCapabilities 0x00 Still image unsupported wWidth 320 wHeight 240 dwMinBitRate 36864000 dwMaxBitRate 36864000 dwMaxVideoFrameBufferSize 153600 dwDefaultFrameInterval 333333 bFrameIntervalType 1 dwFrameInterval( 0) 333333 VideoStreaming Interface Descriptor: bLength 30 bDescriptorType 36 bDescriptorSubtype 5 (FRAME_UNCOMPRESSED) bFrameIndex 7 bmCapabilities 0x00 Still image unsupported wWidth 2048 wHeight 1536 dwMinBitRate 251658240 dwMaxBitRate 251658240 dwMaxVideoFrameBufferSize 6291456 dwDefaultFrameInterval 2000000 bFrameIntervalType 1 dwFrameInterval( 0) 2000000 VideoStreaming Interface Descriptor: bLength 10 bDescriptorType 36 bDescriptorSubtype 3 (STILL_IMAGE_FRAME) bEndpointAddress 0x00 EP 0 OUT bNumImageSizePatterns 1 wWidth( 0) 1920 wHeight( 0) 1080 bNumCompressionPatterns 0 VideoStreaming Interface Descriptor: bLength 6 bDescriptorType 36 bDescriptorSubtype 13 (COLORFORMAT) bColorPrimaries 1 (BT.709,sRGB) bTransferCharacteristics 1 (BT.709) bMatrixCoefficients 4 (SMPTE 170M (BT.601)) Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 1 bAlternateSetting 1 bNumEndpoints 1 bInterfaceClass 14 Video bInterfaceSubClass 2 Video Streaming bInterfaceProtocol 0 iInterface 0 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x81 EP 1 IN bmAttributes 5 Transfer Type Isochronous Synch Type Asynchronous Usage Type Data wMaxPacketSize 0x0080 1x 128 bytes bInterval 1 Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 1 bAlternateSetting 2 bNumEndpoints 1 bInterfaceClass 14 Video bInterfaceSubClass 2 Video Streaming bInterfaceProtocol 0 iInterface 0 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x81 EP 1 IN bmAttributes 5 Transfer Type Isochronous Synch Type Asynchronous Usage Type Data wMaxPacketSize 0x0100 1x 256 bytes bInterval 1 Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 1 bAlternateSetting 3 bNumEndpoints 1 bInterfaceClass 14 Video bInterfaceSubClass 2 Video Streaming bInterfaceProtocol 0 iInterface 0 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x81 EP 1 IN bmAttributes 5 Transfer Type Isochronous Synch Type Asynchronous Usage Type Data wMaxPacketSize 0x0320 1x 800 bytes bInterval 1 Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 1 bAlternateSetting 4 bNumEndpoints 1 bInterfaceClass 14 Video bInterfaceSubClass 2 Video Streaming bInterfaceProtocol 0 iInterface 0 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x81 EP 1 IN bmAttributes 5 Transfer Type Isochronous Synch Type Asynchronous Usage Type Data wMaxPacketSize 0x0b20 2x 800 bytes bInterval 1 Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 1 bAlternateSetting 5 bNumEndpoints 1 bInterfaceClass 14 Video bInterfaceSubClass 2 Video Streaming bInterfaceProtocol 0 iInterface 0 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x81 EP 1 IN bmAttributes 5 Transfer Type Isochronous Synch Type Asynchronous Usage Type Data wMaxPacketSize 0x1320 3x 800 bytes bInterval 1 Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 1 bAlternateSetting 6 bNumEndpoints 1 bInterfaceClass 14 Video bInterfaceSubClass 2 Video Streaming bInterfaceProtocol 0 iInterface 0 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x81 EP 1 IN bmAttributes 5 Transfer Type Isochronous Synch Type Asynchronous Usage Type Data wMaxPacketSize 0x1400 3x 1024 bytes bInterval 1 Interface Association: bLength 8 bDescriptorType 11 bFirstInterface 2 bInterfaceCount 2 bFunctionClass 1 Audio bFunctionSubClass 0 bFunctionProtocol 0 iFunction 4 Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 2 bAlternateSetting 0 bNumEndpoints 0 bInterfaceClass 1 Audio bInterfaceSubClass 1 Control Device bInterfaceProtocol 0 iInterface 4 AudioControl Interface Descriptor: bLength 9 bDescriptorType 36 bDescriptorSubtype 1 (HEADER) bcdADC 1.00 wTotalLength 0x0029 bInCollection 1 baInterfaceNr(0) 3 AudioControl Interface Descriptor: bLength 12 bDescriptorType 36 bDescriptorSubtype 2 (INPUT_TERMINAL) bTerminalID 1 wTerminalType 0x0201 Microphone bAssocTerminal 0 bNrChannels 1 wChannelConfig 0x0000 iChannelNames 0 iTerminal 0 AudioControl Interface Descriptor: bLength 11 bDescriptorType 36 bDescriptorSubtype 6 (FEATURE_UNIT) bUnitID 2 bSourceID 1 bControlSize 2 bmaControls(0) 0x0001 Mute Control bmaControls(1) 0x0002 Volume Control iFeature 0 AudioControl Interface Descriptor: bLength 9 bDescriptorType 36 bDescriptorSubtype 3 (OUTPUT_TERMINAL) bTerminalID 3 wTerminalType 0x0101 USB Streaming bAssocTerminal 0 bSourceID 2 iTerminal 0 Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 3 bAlternateSetting 0 bNumEndpoints 0 bInterfaceClass 1 Audio bInterfaceSubClass 2 Streaming bInterfaceProtocol 0 iInterface 0 Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 3 bAlternateSetting 1 bNumEndpoints 1 bInterfaceClass 1 Audio bInterfaceSubClass 2 Streaming bInterfaceProtocol 0 iInterface 0 AudioStreaming Interface Descriptor: bLength 7 bDescriptorType 36 bDescriptorSubtype 1 (AS_GENERAL) bTerminalLink 3 bDelay 1 frames wFormatTag 0x0001 PCM AudioStreaming Interface Descriptor: bLength 29 bDescriptorType 36 bDescriptorSubtype 2 (FORMAT_TYPE) bFormatType 1 (FORMAT_TYPE_I) bNrChannels 1 bSubframeSize 2 bBitResolution 16 bSamFreqType 7 Discrete tSamFreq[ 0] 8000 tSamFreq[ 1] 11025 tSamFreq[ 2] 16000 tSamFreq[ 3] 22050 tSamFreq[ 4] 24000 tSamFreq[ 5] 44100 tSamFreq[ 6] 48000 Endpoint Descriptor: bLength 9 bDescriptorType 5 bEndpointAddress 0x84 EP 4 IN bmAttributes 5 Transfer Type Isochronous Synch Type Asynchronous Usage Type Data wMaxPacketSize 0x0190 1x 400 bytes bInterval 4 bRefresh 0 bSynchAddress 0 AudioStreaming Endpoint Descriptor: bLength 7 bDescriptorType 37 bDescriptorSubtype 1 (EP_GENERAL) bmAttributes 0x01 Sampling Frequency bLockDelayUnits 0 Undefined wLockDelay 0x0000 ```
leeebo commented 1 year ago

@Draghtnod That's because the camera vendors usually provide different configurations for USB Fullspeed and Highspeed, ESP32S3 supports only Fullspeed mode, so the descriptor for this mode is printed.

The descriptors got on PC are Highspeed configs. To get Fullspeed descriptors from PC, you can add a USB Fullspeed isolator before USB interface, force it not work in Highspeed mode.

Draghtnod commented 1 year ago

@leeebo Thank you, this explains a lot. I guess my only option then is to buy a different camera. :(