linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [Support query] UVC fails if defined as second function in a configfs composite driver
@ 2022-06-14 21:12 Marisol Zeledón
  2022-06-14 21:39 ` Ricardo Ribalda
  0 siblings, 1 reply; 3+ messages in thread
From: Marisol Zeledón @ 2022-06-14 21:12 UTC (permalink / raw)
  To: linux-media

Hi,

I have been trying to build a configfs - composite driver with UVC. I
have other functions such as mass storage and RNDIS included. When I
define UVC as the first function, everything seems to work fine, I see
the video device on my host computer and the device is able to send
frames to it. All other functions get triggered and work fine. The
thing is, I need UVC as the second function defined since RNDIS only
works on a Windows host if it is the first function defined (I need
this composite driver to work with a Windows host too and this is
apparently a Microsoft limitation/requirement).

- So when I define UVC as the second function, it is not able to
create the video device on the host, I get the following logs on the
Linux host's side:

[40166.930912] uvcvideo: Failed to query (GET_INFO) UVC control 2 on
unit 1: -32 (exp. 1).
[40177.294692] uvcvideo: Failed to query (GET_INFO) UVC control 2 on
unit 2: -110 (exp. 1).
[40208.014706] uvcvideo: UVC non compliance - GET_DEF(PROBE) not
supported. Enabling workaround.
[40213.134647] uvcvideo: Failed to query (129) UVC probe control :
-110 (exp. 26).
[40213.134653] uvcvideo: Failed to initialize the device (-5).

- These are the descriptors I get from the host's side:

Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               3.20
  bDeviceClass          239 Miscellaneous Device
  bDeviceSubClass         2 ?
  bDeviceProtocol         1 Interface Association
  bMaxPacketSize0         9
  idVendor           0x0955 NVidia Corp.
  idProduct          0x7020
  bcdDevice            0.02
  iManufacturer           1
  iProduct                2
  iSerial                 3
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength          317
    bNumInterfaces          4
    bConfigurationValue     1
    iConfiguration          4
    bmAttributes         0xe0
      Self Powered
      Remote Wakeup
    MaxPower                0mA
    Interface Association:
      bLength                 8
      bDescriptorType        11
      bFirstInterface         0
      bInterfaceCount         2
      bFunctionClass          2 Communications
      bFunctionSubClass       6 Ethernet Networking
      bFunctionProtocol       0
      iFunction               7
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           1
      bInterfaceClass         2 Communications
      bInterfaceSubClass      2 Abstract (modem)
      bInterfaceProtocol    255 Vendor Specific (MSFT RNDIS?)
      iInterface              5
      CDC Header:
        bcdCDC               1.10
      CDC Call Management:
        bmCapabilities       0x00
        bDataInterface          1
      CDC ACM:
        bmCapabilities       0x00
      CDC Union:
        bMasterInterface        0
        bSlaveInterface         1
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x82  EP 2 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0008  1x 8 bytes
        bInterval               9
        bMaxBurst               0
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       0
      bNumEndpoints           2
      bInterfaceClass        10 CDC Data
      bInterfaceSubClass      0 Unused
      bInterfaceProtocol      0
      iInterface              6
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0400  1x 1024 bytes
        bInterval               0
        bMaxBurst               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x01  EP 1 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0400  1x 1024 bytes
        bInterval               0
        bMaxBurst               0
    Interface Association:
      bLength                 8
      bDescriptorType        11
      bFirstInterface         2
      bInterfaceCount         2
      bFunctionClass         14 Video
      bFunctionSubClass       3 Video Interface Collection
      bFunctionProtocol       0
      iFunction               9
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        2
      bAlternateSetting       0
      bNumEndpoints           1
      bInterfaceClass        14 Video
      bInterfaceSubClass      1 Video Control
      bInterfaceProtocol      0
      iInterface              9
      VideoControl Interface Descriptor:
        bLength                13
        bDescriptorType        36
        bDescriptorSubtype      1 (HEADER)
        bcdUVC               1.00
        wTotalLength           52
        dwClockFrequency       48.000000MHz
        bInCollection           1
        baInterfaceNr( 0)       3
      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           0x00000002
          Auto-Exposure Mode
      VideoControl Interface Descriptor:
        bLength                12
        bDescriptorType        36
        bDescriptorSubtype      5 (PROCESSING_UNIT)
        bUnitID                 2
        bSourceID               1
        wMaxMultiplier      16384
        bControlSize            2
        bmControls     0x00000001
          Brightness
        iProcessing             0
        bmVideoStandards     0x 0
      VideoControl Interface Descriptor:
        bLength                 9
        bDescriptorType        36
        bDescriptorSubtype      3 (OUTPUT_TERMINAL)
        bTerminalID             3
        wTerminalType      0x0101 USB Streaming
        bAssocTerminal          0
        bSourceID               2
        iTerminal               0
      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               8
        bMaxBurst               0
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        3
      bAlternateSetting       0
      bNumEndpoints           1
      bInterfaceClass        14 Video
      bInterfaceSubClass      2 Video Streaming
      bInterfaceProtocol      0
      iInterface              0
      VideoStreaming Interface Descriptor:
        bLength                            14
        bDescriptorType                    36
        bDescriptorSubtype                  1 (INPUT_HEADER)
        bNumFormats                         1
        wTotalLength                      115
        bEndPointAddress                  132
        bmInfo                              0
        bTerminalLink                       3
        bStillCaptureMethod                 0
        bTriggerSupport                     0
        bTriggerUsage                       0
        bControlSize                        1
        bmaControls( 0)                    27
      VideoStreaming Interface Descriptor:
        bLength                            27
        bDescriptorType                    36
        bDescriptorSubtype                  4 (FORMAT_UNCOMPRESSED)
        bFormatIndex                        1
        bNumFrameDescriptors                2
        guidFormat
{59555932-0000-1000-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                            38
        bDescriptorType                    36
        bDescriptorSubtype                  5 (FRAME_UNCOMPRESSED)
        bFrameIndex                         1
        bmCapabilities                   0x00
          Still image unsupported
        wWidth                            640
        wHeight                           360
        dwMinBitRate                 18432000
        dwMaxBitRate                 55296000
        dwMaxVideoFrameBufferSize      460800
        dwDefaultFrameInterval         666666
        bFrameIntervalType                  3
        dwFrameInterval( 0)            666666
        dwFrameInterval( 1)           1000000
        dwFrameInterval( 2)           5000000
      VideoStreaming Interface Descriptor:
        bLength                            30
        bDescriptorType                    36
        bDescriptorSubtype                  5 (FRAME_UNCOMPRESSED)
        bFrameIndex                         2
        bmCapabilities                   0x00
          Still image unsupported
        wWidth                           1280
        wHeight                           720
        dwMinBitRate                 29491200
        dwMaxBitRate                 29491200
        dwMaxVideoFrameBufferSize     1843200
        dwDefaultFrameInterval        5000000
        bFrameIntervalType                  1
        dwFrameInterval( 0)           5000000
      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))
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x84  EP 4 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0400  1x 1024 bytes
        bInterval               0
        bMaxBurst               0


On the device's side I don't get any failure logs. Is there any known
limitation to the UVC driver similar to the RNDIS one in Windows
hosts? Does it forcefully need to be defined as the first function to
work?

Thank you in advance,
--
Marisol Zeledón Córdoba
Embedded Software Engineer
RidgeRun Embedded Solutions
San José, Costa Rica

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Support query] UVC fails if defined as second function in a configfs composite driver
  2022-06-14 21:12 [Support query] UVC fails if defined as second function in a configfs composite driver Marisol Zeledón
@ 2022-06-14 21:39 ` Ricardo Ribalda
  2022-06-14 22:14   ` Marisol Zeledón
  0 siblings, 1 reply; 3+ messages in thread
From: Ricardo Ribalda @ 2022-06-14 21:39 UTC (permalink / raw)
  To: Marisol Zeledón; +Cc: linux-media

Hi Marisol

Could you try increasing the trace level with:

rmmod uvcvideo
modprobe uvcvideo trace=0xffffffff

And then connect your camera.

That might give you a better idea of what is going on.

You could also use usbmon to discard that there is a problem with the
usb gadget.

Regards!

On Tue, 14 Jun 2022 at 23:31, Marisol Zeledón
<marisol.zeledon@ridgerun.com> wrote:
>
> Hi,
>
> I have been trying to build a configfs - composite driver with UVC. I
> have other functions such as mass storage and RNDIS included. When I
> define UVC as the first function, everything seems to work fine, I see
> the video device on my host computer and the device is able to send
> frames to it. All other functions get triggered and work fine. The
> thing is, I need UVC as the second function defined since RNDIS only
> works on a Windows host if it is the first function defined (I need
> this composite driver to work with a Windows host too and this is
> apparently a Microsoft limitation/requirement).
>
> - So when I define UVC as the second function, it is not able to
> create the video device on the host, I get the following logs on the
> Linux host's side:
>
> [40166.930912] uvcvideo: Failed to query (GET_INFO) UVC control 2 on
> unit 1: -32 (exp. 1).
> [40177.294692] uvcvideo: Failed to query (GET_INFO) UVC control 2 on
> unit 2: -110 (exp. 1).
> [40208.014706] uvcvideo: UVC non compliance - GET_DEF(PROBE) not
> supported. Enabling workaround.
> [40213.134647] uvcvideo: Failed to query (129) UVC probe control :
> -110 (exp. 26).
> [40213.134653] uvcvideo: Failed to initialize the device (-5).
>
> - These are the descriptors I get from the host's side:
>
> Device Descriptor:
>   bLength                18
>   bDescriptorType         1
>   bcdUSB               3.20
>   bDeviceClass          239 Miscellaneous Device
>   bDeviceSubClass         2 ?
>   bDeviceProtocol         1 Interface Association
>   bMaxPacketSize0         9
>   idVendor           0x0955 NVidia Corp.
>   idProduct          0x7020
>   bcdDevice            0.02
>   iManufacturer           1
>   iProduct                2
>   iSerial                 3
>   bNumConfigurations      1
>   Configuration Descriptor:
>     bLength                 9
>     bDescriptorType         2
>     wTotalLength          317
>     bNumInterfaces          4
>     bConfigurationValue     1
>     iConfiguration          4
>     bmAttributes         0xe0
>       Self Powered
>       Remote Wakeup
>     MaxPower                0mA
>     Interface Association:
>       bLength                 8
>       bDescriptorType        11
>       bFirstInterface         0
>       bInterfaceCount         2
>       bFunctionClass          2 Communications
>       bFunctionSubClass       6 Ethernet Networking
>       bFunctionProtocol       0
>       iFunction               7
>     Interface Descriptor:
>       bLength                 9
>       bDescriptorType         4
>       bInterfaceNumber        0
>       bAlternateSetting       0
>       bNumEndpoints           1
>       bInterfaceClass         2 Communications
>       bInterfaceSubClass      2 Abstract (modem)
>       bInterfaceProtocol    255 Vendor Specific (MSFT RNDIS?)
>       iInterface              5
>       CDC Header:
>         bcdCDC               1.10
>       CDC Call Management:
>         bmCapabilities       0x00
>         bDataInterface          1
>       CDC ACM:
>         bmCapabilities       0x00
>       CDC Union:
>         bMasterInterface        0
>         bSlaveInterface         1
>       Endpoint Descriptor:
>         bLength                 7
>         bDescriptorType         5
>         bEndpointAddress     0x82  EP 2 IN
>         bmAttributes            3
>           Transfer Type            Interrupt
>           Synch Type               None
>           Usage Type               Data
>         wMaxPacketSize     0x0008  1x 8 bytes
>         bInterval               9
>         bMaxBurst               0
>     Interface Descriptor:
>       bLength                 9
>       bDescriptorType         4
>       bInterfaceNumber        1
>       bAlternateSetting       0
>       bNumEndpoints           2
>       bInterfaceClass        10 CDC Data
>       bInterfaceSubClass      0 Unused
>       bInterfaceProtocol      0
>       iInterface              6
>       Endpoint Descriptor:
>         bLength                 7
>         bDescriptorType         5
>         bEndpointAddress     0x81  EP 1 IN
>         bmAttributes            2
>           Transfer Type            Bulk
>           Synch Type               None
>           Usage Type               Data
>         wMaxPacketSize     0x0400  1x 1024 bytes
>         bInterval               0
>         bMaxBurst               0
>       Endpoint Descriptor:
>         bLength                 7
>         bDescriptorType         5
>         bEndpointAddress     0x01  EP 1 OUT
>         bmAttributes            2
>           Transfer Type            Bulk
>           Synch Type               None
>           Usage Type               Data
>         wMaxPacketSize     0x0400  1x 1024 bytes
>         bInterval               0
>         bMaxBurst               0
>     Interface Association:
>       bLength                 8
>       bDescriptorType        11
>       bFirstInterface         2
>       bInterfaceCount         2
>       bFunctionClass         14 Video
>       bFunctionSubClass       3 Video Interface Collection
>       bFunctionProtocol       0
>       iFunction               9
>     Interface Descriptor:
>       bLength                 9
>       bDescriptorType         4
>       bInterfaceNumber        2
>       bAlternateSetting       0
>       bNumEndpoints           1
>       bInterfaceClass        14 Video
>       bInterfaceSubClass      1 Video Control
>       bInterfaceProtocol      0
>       iInterface              9
>       VideoControl Interface Descriptor:
>         bLength                13
>         bDescriptorType        36
>         bDescriptorSubtype      1 (HEADER)
>         bcdUVC               1.00
>         wTotalLength           52
>         dwClockFrequency       48.000000MHz
>         bInCollection           1
>         baInterfaceNr( 0)       3
>       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           0x00000002
>           Auto-Exposure Mode
>       VideoControl Interface Descriptor:
>         bLength                12
>         bDescriptorType        36
>         bDescriptorSubtype      5 (PROCESSING_UNIT)
>         bUnitID                 2
>         bSourceID               1
>         wMaxMultiplier      16384
>         bControlSize            2
>         bmControls     0x00000001
>           Brightness
>         iProcessing             0
>         bmVideoStandards     0x 0
>       VideoControl Interface Descriptor:
>         bLength                 9
>         bDescriptorType        36
>         bDescriptorSubtype      3 (OUTPUT_TERMINAL)
>         bTerminalID             3
>         wTerminalType      0x0101 USB Streaming
>         bAssocTerminal          0
>         bSourceID               2
>         iTerminal               0
>       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               8
>         bMaxBurst               0
>     Interface Descriptor:
>       bLength                 9
>       bDescriptorType         4
>       bInterfaceNumber        3
>       bAlternateSetting       0
>       bNumEndpoints           1
>       bInterfaceClass        14 Video
>       bInterfaceSubClass      2 Video Streaming
>       bInterfaceProtocol      0
>       iInterface              0
>       VideoStreaming Interface Descriptor:
>         bLength                            14
>         bDescriptorType                    36
>         bDescriptorSubtype                  1 (INPUT_HEADER)
>         bNumFormats                         1
>         wTotalLength                      115
>         bEndPointAddress                  132
>         bmInfo                              0
>         bTerminalLink                       3
>         bStillCaptureMethod                 0
>         bTriggerSupport                     0
>         bTriggerUsage                       0
>         bControlSize                        1
>         bmaControls( 0)                    27
>       VideoStreaming Interface Descriptor:
>         bLength                            27
>         bDescriptorType                    36
>         bDescriptorSubtype                  4 (FORMAT_UNCOMPRESSED)
>         bFormatIndex                        1
>         bNumFrameDescriptors                2
>         guidFormat
> {59555932-0000-1000-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                            38
>         bDescriptorType                    36
>         bDescriptorSubtype                  5 (FRAME_UNCOMPRESSED)
>         bFrameIndex                         1
>         bmCapabilities                   0x00
>           Still image unsupported
>         wWidth                            640
>         wHeight                           360
>         dwMinBitRate                 18432000
>         dwMaxBitRate                 55296000
>         dwMaxVideoFrameBufferSize      460800
>         dwDefaultFrameInterval         666666
>         bFrameIntervalType                  3
>         dwFrameInterval( 0)            666666
>         dwFrameInterval( 1)           1000000
>         dwFrameInterval( 2)           5000000
>       VideoStreaming Interface Descriptor:
>         bLength                            30
>         bDescriptorType                    36
>         bDescriptorSubtype                  5 (FRAME_UNCOMPRESSED)
>         bFrameIndex                         2
>         bmCapabilities                   0x00
>           Still image unsupported
>         wWidth                           1280
>         wHeight                           720
>         dwMinBitRate                 29491200
>         dwMaxBitRate                 29491200
>         dwMaxVideoFrameBufferSize     1843200
>         dwDefaultFrameInterval        5000000
>         bFrameIntervalType                  1
>         dwFrameInterval( 0)           5000000
>       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))
>       Endpoint Descriptor:
>         bLength                 7
>         bDescriptorType         5
>         bEndpointAddress     0x84  EP 4 IN
>         bmAttributes            2
>           Transfer Type            Bulk
>           Synch Type               None
>           Usage Type               Data
>         wMaxPacketSize     0x0400  1x 1024 bytes
>         bInterval               0
>         bMaxBurst               0
>
>
> On the device's side I don't get any failure logs. Is there any known
> limitation to the UVC driver similar to the RNDIS one in Windows
> hosts? Does it forcefully need to be defined as the first function to
> work?
>
> Thank you in advance,
> --
> Marisol Zeledón Córdoba
> Embedded Software Engineer
> RidgeRun Embedded Solutions
> San José, Costa Rica



-- 
Ricardo Ribalda

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Support query] UVC fails if defined as second function in a configfs composite driver
  2022-06-14 21:39 ` Ricardo Ribalda
@ 2022-06-14 22:14   ` Marisol Zeledón
  0 siblings, 0 replies; 3+ messages in thread
From: Marisol Zeledón @ 2022-06-14 22:14 UTC (permalink / raw)
  To: Ricardo Ribalda; +Cc: linux-media

Hi Ricardo,

Thank you for your response. I increased the trace level as advised
but didn't get any more useful information:

[27751.660199] uvcvideo: Probing generic UVC device 2
[27751.660306] uvcvideo: Found format YUV 4:2:2 (YUYV).
[27751.660310] uvcvideo: - 640x360 (15.0 fps)
[27751.660312] uvcvideo: - 1280x720 (2.0 fps)
[27751.660317] uvcvideo: Found a Status endpoint (addr 83).
[27751.660320] uvcvideo: Found UVC 1.00 device Linux for Tegra (0955:7020)
[27751.660327] uvcvideo: Added control
00000000-0000-0000-0000-000000000001/2 to device 2 entity 1
[27751.660428] uvcvideo: Failed to query (GET_INFO) UVC control 2 on
unit 1: -32 (exp. 1).
[27756.893967] uvcvideo: Adding mapping 'Exposure, Auto' to control
00000000-0000-0000-0000-000000000001/2.
[27756.893973] uvcvideo: Added control
00000000-0000-0000-0000-000000000101/2 to device 2 entity 2
[27762.013921] uvcvideo: Failed to query (GET_INFO) UVC control 2 on
unit 2: -110 (exp. 1).
[27762.013930] uvcvideo: Adding mapping 'Brightness' to control
00000000-0000-0000-0000-000000000101/2.
[27762.013934] uvcvideo: Scanning UVC chain: OT 3 <- PU 2 <- IT 1
[27762.013939] uvcvideo: Found a valid video chain (1 -> 3).
[27792.733672] uvcvideo: UVC non compliance - GET_DEF(PROBE) not
supported. Enabling workaround.
[27797.853646] uvcvideo: Failed to query (129) UVC probe control :
-110 (exp. 26).
[27797.853652] uvcvideo: Failed to initialize the device (-5).

In contrast, here is the log when UVC is successful (defined as first
function in the composite driver):

[27916.011570] uvcvideo: Probing generic UVC device 2
[27916.011666] uvcvideo: Found format YUV 4:2:2 (YUYV).
[27916.011669] uvcvideo: - 640x360 (15.0 fps)
[27916.011670] uvcvideo: - 1280x720 (2.0 fps)
[27916.011674] uvcvideo: Found a Status endpoint (addr 81).
[27916.011676] uvcvideo: Found UVC 1.00 device Linux for Tegra (0955:7020)
[27916.011681] uvcvideo: Added control
00000000-0000-0000-0000-000000000001/2 to device 2 entity 1
[27916.012026] uvcvideo: Adding mapping 'Exposure, Auto' to control
00000000-0000-0000-0000-000000000001/2.
[27916.012029] uvcvideo: Added control
00000000-0000-0000-0000-000000000101/2 to device 2 entity 2
[27916.012181] uvcvideo: Adding mapping 'Brightness' to control
00000000-0000-0000-0000-000000000101/2.
[27916.012183] uvcvideo: Scanning UVC chain: OT 3 <- PU 2 <- IT 1
[27916.012190] uvcvideo: Found a valid video chain (1 -> 3).
[27916.013757] uvcvideo: UVC device initialized.

I have also used usbmon since I've tried some USB sniffing tools to
try and figure out the problem. Please let me know of any more
comments or ideas.

Regards,

On Tue, Jun 14, 2022 at 3:39 PM Ricardo Ribalda <ribalda@chromium.org> wrote:
>
> Hi Marisol
>
> Could you try increasing the trace level with:
>
> rmmod uvcvideo
> modprobe uvcvideo trace=0xffffffff
>
> And then connect your camera.
>
> That might give you a better idea of what is going on.
>
> You could also use usbmon to discard that there is a problem with the
> usb gadget.
>
> Regards!
>
> On Tue, 14 Jun 2022 at 23:31, Marisol Zeledón
> <marisol.zeledon@ridgerun.com> wrote:
> >
> > Hi,
> >
> > I have been trying to build a configfs - composite driver with UVC. I
> > have other functions such as mass storage and RNDIS included. When I
> > define UVC as the first function, everything seems to work fine, I see
> > the video device on my host computer and the device is able to send
> > frames to it. All other functions get triggered and work fine. The
> > thing is, I need UVC as the second function defined since RNDIS only
> > works on a Windows host if it is the first function defined (I need
> > this composite driver to work with a Windows host too and this is
> > apparently a Microsoft limitation/requirement).
> >
> > - So when I define UVC as the second function, it is not able to
> > create the video device on the host, I get the following logs on the
> > Linux host's side:
> >
> > [40166.930912] uvcvideo: Failed to query (GET_INFO) UVC control 2 on
> > unit 1: -32 (exp. 1).
> > [40177.294692] uvcvideo: Failed to query (GET_INFO) UVC control 2 on
> > unit 2: -110 (exp. 1).
> > [40208.014706] uvcvideo: UVC non compliance - GET_DEF(PROBE) not
> > supported. Enabling workaround.
> > [40213.134647] uvcvideo: Failed to query (129) UVC probe control :
> > -110 (exp. 26).
> > [40213.134653] uvcvideo: Failed to initialize the device (-5).
> >
> > - These are the descriptors I get from the host's side:
> >
> > Device Descriptor:
> >   bLength                18
> >   bDescriptorType         1
> >   bcdUSB               3.20
> >   bDeviceClass          239 Miscellaneous Device
> >   bDeviceSubClass         2 ?
> >   bDeviceProtocol         1 Interface Association
> >   bMaxPacketSize0         9
> >   idVendor           0x0955 NVidia Corp.
> >   idProduct          0x7020
> >   bcdDevice            0.02
> >   iManufacturer           1
> >   iProduct                2
> >   iSerial                 3
> >   bNumConfigurations      1
> >   Configuration Descriptor:
> >     bLength                 9
> >     bDescriptorType         2
> >     wTotalLength          317
> >     bNumInterfaces          4
> >     bConfigurationValue     1
> >     iConfiguration          4
> >     bmAttributes         0xe0
> >       Self Powered
> >       Remote Wakeup
> >     MaxPower                0mA
> >     Interface Association:
> >       bLength                 8
> >       bDescriptorType        11
> >       bFirstInterface         0
> >       bInterfaceCount         2
> >       bFunctionClass          2 Communications
> >       bFunctionSubClass       6 Ethernet Networking
> >       bFunctionProtocol       0
> >       iFunction               7
> >     Interface Descriptor:
> >       bLength                 9
> >       bDescriptorType         4
> >       bInterfaceNumber        0
> >       bAlternateSetting       0
> >       bNumEndpoints           1
> >       bInterfaceClass         2 Communications
> >       bInterfaceSubClass      2 Abstract (modem)
> >       bInterfaceProtocol    255 Vendor Specific (MSFT RNDIS?)
> >       iInterface              5
> >       CDC Header:
> >         bcdCDC               1.10
> >       CDC Call Management:
> >         bmCapabilities       0x00
> >         bDataInterface          1
> >       CDC ACM:
> >         bmCapabilities       0x00
> >       CDC Union:
> >         bMasterInterface        0
> >         bSlaveInterface         1
> >       Endpoint Descriptor:
> >         bLength                 7
> >         bDescriptorType         5
> >         bEndpointAddress     0x82  EP 2 IN
> >         bmAttributes            3
> >           Transfer Type            Interrupt
> >           Synch Type               None
> >           Usage Type               Data
> >         wMaxPacketSize     0x0008  1x 8 bytes
> >         bInterval               9
> >         bMaxBurst               0
> >     Interface Descriptor:
> >       bLength                 9
> >       bDescriptorType         4
> >       bInterfaceNumber        1
> >       bAlternateSetting       0
> >       bNumEndpoints           2
> >       bInterfaceClass        10 CDC Data
> >       bInterfaceSubClass      0 Unused
> >       bInterfaceProtocol      0
> >       iInterface              6
> >       Endpoint Descriptor:
> >         bLength                 7
> >         bDescriptorType         5
> >         bEndpointAddress     0x81  EP 1 IN
> >         bmAttributes            2
> >           Transfer Type            Bulk
> >           Synch Type               None
> >           Usage Type               Data
> >         wMaxPacketSize     0x0400  1x 1024 bytes
> >         bInterval               0
> >         bMaxBurst               0
> >       Endpoint Descriptor:
> >         bLength                 7
> >         bDescriptorType         5
> >         bEndpointAddress     0x01  EP 1 OUT
> >         bmAttributes            2
> >           Transfer Type            Bulk
> >           Synch Type               None
> >           Usage Type               Data
> >         wMaxPacketSize     0x0400  1x 1024 bytes
> >         bInterval               0
> >         bMaxBurst               0
> >     Interface Association:
> >       bLength                 8
> >       bDescriptorType        11
> >       bFirstInterface         2
> >       bInterfaceCount         2
> >       bFunctionClass         14 Video
> >       bFunctionSubClass       3 Video Interface Collection
> >       bFunctionProtocol       0
> >       iFunction               9
> >     Interface Descriptor:
> >       bLength                 9
> >       bDescriptorType         4
> >       bInterfaceNumber        2
> >       bAlternateSetting       0
> >       bNumEndpoints           1
> >       bInterfaceClass        14 Video
> >       bInterfaceSubClass      1 Video Control
> >       bInterfaceProtocol      0
> >       iInterface              9
> >       VideoControl Interface Descriptor:
> >         bLength                13
> >         bDescriptorType        36
> >         bDescriptorSubtype      1 (HEADER)
> >         bcdUVC               1.00
> >         wTotalLength           52
> >         dwClockFrequency       48.000000MHz
> >         bInCollection           1
> >         baInterfaceNr( 0)       3
> >       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           0x00000002
> >           Auto-Exposure Mode
> >       VideoControl Interface Descriptor:
> >         bLength                12
> >         bDescriptorType        36
> >         bDescriptorSubtype      5 (PROCESSING_UNIT)
> >         bUnitID                 2
> >         bSourceID               1
> >         wMaxMultiplier      16384
> >         bControlSize            2
> >         bmControls     0x00000001
> >           Brightness
> >         iProcessing             0
> >         bmVideoStandards     0x 0
> >       VideoControl Interface Descriptor:
> >         bLength                 9
> >         bDescriptorType        36
> >         bDescriptorSubtype      3 (OUTPUT_TERMINAL)
> >         bTerminalID             3
> >         wTerminalType      0x0101 USB Streaming
> >         bAssocTerminal          0
> >         bSourceID               2
> >         iTerminal               0
> >       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               8
> >         bMaxBurst               0
> >     Interface Descriptor:
> >       bLength                 9
> >       bDescriptorType         4
> >       bInterfaceNumber        3
> >       bAlternateSetting       0
> >       bNumEndpoints           1
> >       bInterfaceClass        14 Video
> >       bInterfaceSubClass      2 Video Streaming
> >       bInterfaceProtocol      0
> >       iInterface              0
> >       VideoStreaming Interface Descriptor:
> >         bLength                            14
> >         bDescriptorType                    36
> >         bDescriptorSubtype                  1 (INPUT_HEADER)
> >         bNumFormats                         1
> >         wTotalLength                      115
> >         bEndPointAddress                  132
> >         bmInfo                              0
> >         bTerminalLink                       3
> >         bStillCaptureMethod                 0
> >         bTriggerSupport                     0
> >         bTriggerUsage                       0
> >         bControlSize                        1
> >         bmaControls( 0)                    27
> >       VideoStreaming Interface Descriptor:
> >         bLength                            27
> >         bDescriptorType                    36
> >         bDescriptorSubtype                  4 (FORMAT_UNCOMPRESSED)
> >         bFormatIndex                        1
> >         bNumFrameDescriptors                2
> >         guidFormat
> > {59555932-0000-1000-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                            38
> >         bDescriptorType                    36
> >         bDescriptorSubtype                  5 (FRAME_UNCOMPRESSED)
> >         bFrameIndex                         1
> >         bmCapabilities                   0x00
> >           Still image unsupported
> >         wWidth                            640
> >         wHeight                           360
> >         dwMinBitRate                 18432000
> >         dwMaxBitRate                 55296000
> >         dwMaxVideoFrameBufferSize      460800
> >         dwDefaultFrameInterval         666666
> >         bFrameIntervalType                  3
> >         dwFrameInterval( 0)            666666
> >         dwFrameInterval( 1)           1000000
> >         dwFrameInterval( 2)           5000000
> >       VideoStreaming Interface Descriptor:
> >         bLength                            30
> >         bDescriptorType                    36
> >         bDescriptorSubtype                  5 (FRAME_UNCOMPRESSED)
> >         bFrameIndex                         2
> >         bmCapabilities                   0x00
> >           Still image unsupported
> >         wWidth                           1280
> >         wHeight                           720
> >         dwMinBitRate                 29491200
> >         dwMaxBitRate                 29491200
> >         dwMaxVideoFrameBufferSize     1843200
> >         dwDefaultFrameInterval        5000000
> >         bFrameIntervalType                  1
> >         dwFrameInterval( 0)           5000000
> >       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))
> >       Endpoint Descriptor:
> >         bLength                 7
> >         bDescriptorType         5
> >         bEndpointAddress     0x84  EP 4 IN
> >         bmAttributes            2
> >           Transfer Type            Bulk
> >           Synch Type               None
> >           Usage Type               Data
> >         wMaxPacketSize     0x0400  1x 1024 bytes
> >         bInterval               0
> >         bMaxBurst               0
> >
> >
> > On the device's side I don't get any failure logs. Is there any known
> > limitation to the UVC driver similar to the RNDIS one in Windows
> > hosts? Does it forcefully need to be defined as the first function to
> > work?
> >
> > Thank you in advance,
> > --
> > Marisol Zeledón Córdoba
> > Embedded Software Engineer
> > RidgeRun Embedded Solutions
> > San José, Costa Rica
>
>
>
> --
> Ricardo Ribalda



-- 

Marisol Zeledón Córdoba
Embedded Software Engineer
RidgeRun Embedded Solutions
San José, Costa Rica

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-06-14 22:14 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-14 21:12 [Support query] UVC fails if defined as second function in a configfs composite driver Marisol Zeledón
2022-06-14 21:39 ` Ricardo Ribalda
2022-06-14 22:14   ` Marisol Zeledón

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).