cancel
Showing results for 
Search instead for 
Did you mean: 

USB Low-Full-High Speed Peripherals

Anonymous
Not applicable

Hello!

I want to implement UVC using FX3 (trying on SuperSpeed Kit). There is no problem with UVC examples from SDK, but I have no luck to modify USBVideoClass example to work with uncompressed frames. I've downloaded specs from USB.org - USB Device Class Specifications and changed format and frame descriptors as described. I've also changed Probe and Commit control structs.

Is there any example of FRAME_UNCOMPRESSED video translation?

v4l2-ctl output:

v4l2-ctl --all -d0

Driver Info (not using libv4l2):

Driver name   : uvcvideo

Card type     : FX3

Bus info      : usb-0000:00:14.0-5

Driver version: 4.15.18

Capabilities  : 0x84200001

Video Capture

Streaming

Extended Pix Format

Device Capabilities

Device Caps   : 0x04200001

Video Capture

Streaming

Extended Pix Format

Priority: 2

Video input : 0 (Camera 1: ok)

Format Video Capture:

Width/Height      : 32/24

Pixel Format      : 'BGR3'

Field             : None

Bytes per Line    : 96

Size Image        : 2304

Colorspace        : Default

Transfer Function : Default (maps to Rec. 709)

YCbCr/HSV Encoding: Default (maps to ITU-R 601)

Quantization      : Default (maps to Full Range)

Flags             :

Crop Capability Video Capture:

Bounds      : Left 0, Top 0, Width 32, Height 24

Default     : Left 0, Top 0, Width 32, Height 24

Pixel Aspect: 1/1

Selection: crop_default, Left 0, Top 0, Width 32, Height 24

Selection: crop_bounds, Left 0, Top 0, Width 32, Height 24

Streaming Parameters Video Capture:

Capabilities     : timeperframe

Frames per second: 25.000 (25/1)

Read buffers     : 0

I'm using guvcview utility to check results. And here is the log:

...

V4L2_CORE: (get_v4l2_frame) video stream must be started first

V4L2_CORE: (get_v4l2_frame) video stream must be started first

V4L2_CORE: (get_v4l2_frame) video stream must be started first

V4L2_CORE: (get_v4l2_frame) video stream must be started first

...

lsusb output:

Bus 001 Device 047: ID 04b4:4722 Cypress Semiconductor Corp.

Device Descriptor:

  bLength                18

  bDescriptorType         1

  bcdUSB               2.10

  bDeviceClass          239 Miscellaneous Device

  bDeviceSubClass         2 ?

  bDeviceProtocol         1 Interface Association

  bMaxPacketSize0        64

  idVendor           0x04b4 Cypress Semiconductor Corp.

  idProduct          0x4722

  bcdDevice            0.00

  iManufacturer           1 Cypress

  iProduct                2 FX3

  iSerial                 0

  bNumConfigurations      1

  Configuration Descriptor:

    bLength                 9

    bDescriptorType         2

    wTotalLength          198

    bNumInterfaces          2

    bConfigurationValue     1

    iConfiguration          0

    bmAttributes         0x80

      (Bus Powered)

    MaxPower              400mA

    Interface Association:

      bLength                 8

      bDescriptorType        11

      bFirstInterface         0

      bInterfaceCount         2

      bFunctionClass         14 Video

      bFunctionSubClass       3 Video Interface Collection

      bFunctionProtocol       0

      iFunction               0

    Interface Descriptor:

      bLength                 9

      bDescriptorType         4

      bInterfaceNumber        0

      bAlternateSetting       0

      bNumEndpoints           1

      bInterfaceClass        14 Video

      bInterfaceSubClass      1 Video Control

      bInterfaceProtocol      0

      iInterface              0

      VideoControl Interface Descriptor:

        bLength                13

        bDescriptorType        36

        bDescriptorSubtype      1 (HEADER)

        bcdUVC               1.00

        wTotalLength           80

        dwClockFrequency       48.000000MHz

        bInCollection           1

        baInterfaceNr( 0)       1

      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           0x00000000

      VideoControl Interface Descriptor:

        bLength                12

        bDescriptorType        36

        bDescriptorSubtype      5 (PROCESSING_UNIT)

      Warning: Descriptor too short

        bUnitID                 2

        bSourceID               1

        wMaxMultiplier      16384

        bControlSize            3

        bmControls     0x00000000

        iProcessing             0

        bmVideoStandards     0x1c

          PAL - 625/50

          SECAM - 625/50

          NTSC - 625/50

      VideoControl Interface Descriptor:

        bLength                28

        bDescriptorType        36

        bDescriptorSubtype      6 (EXTENSION_UNIT)

        bUnitID                 3

        guidExtensionCode         {ffffffff-ffff-ffff-ffff-ffffffffffff}

        bNumControl             0

        bNrPins                 1

        baSourceID( 0)          2

        bControlSize            3

        bmControls( 0)       0x00

        bmControls( 1)       0x00

        bmControls( 2)       0x00

        iExtension              0

      VideoControl Interface Descriptor:

        bLength                 9

        bDescriptorType        36

        bDescriptorSubtype      3 (OUTPUT_TERMINAL)

        bTerminalID             4

        wTerminalType      0x0101 USB Streaming

        bAssocTerminal          0

        bSourceID               3

        iTerminal               0

      Endpoint Descriptor:

        bLength                 7

        bDescriptorType         5

        bEndpointAddress     0x82  EP 2 IN

        bmAttributes            3

          Transfer Type            Interrupt

          Synch Type               None

          Usage Type               Data

        wMaxPacketSize     0x0040  1x 64 bytes

        bInterval               8

    Interface Descriptor:

      bLength                 9

      bDescriptorType         4

      bInterfaceNumber        1

      bAlternateSetting       0

      bNumEndpoints           0

      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                       71

        bEndPointAddress                  131

        bmInfo                              0

        bTerminalLink                       4

        bStillCaptureMethod                 1

        bTriggerSupport                     1

        bTriggerUsage                       0

        bControlSize                        1

        bmaControls( 0)                    27

      VideoStreaming Interface Descriptor:

        bLength                            27

        bDescriptorType                    36

        bDescriptorSubtype                  4 (FORMAT_UNCOMPRESSED)

        bFormatIndex                        1

        bNumFrameDescriptors                1

        guidFormat                            {7deb36e4-4f52-ce11-9f53-0020af0ba770}

        bBitsPerPixel                      24

        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                             32

        wHeight                            24

        dwMinBitRate                   460800

        dwMaxBitRate                   921600

        dwMaxVideoFrameBufferSize        2304

        dwDefaultFrameInterval         400000

        bFrameIntervalType                  1

        dwFrameInterval( 0)            400000

Binary Object Store Descriptor:

  bLength                 5

  bDescriptorType        15

  wTotalLength           22

  bNumDeviceCaps          2

  USB 2.0 Extension Device Capability:

    bLength                 7

    bDescriptorType        16

    bDevCapabilityType      2

    bmAttributes   0x00000002

      Link Power Management (LPM) Supported

  SuperSpeed USB Device Capability:

    bLength                10

    bDescriptorType        16

    bDevCapabilityType      3

    bmAttributes         0x00

    wSpeedsSupported   0x000e

      Device can operate at Full Speed (12Mbps)

      Device can operate at High Speed (480Mbps)

      Device can operate at SuperSpeed (5Gbps)

    bFunctionalitySupport   3

      Lowest fully-functional device speed is SuperSpeed (5Gbps)

    bU1DevExitLat           0 micro seconds

    bU2DevExitLat           0 micro seconds

Device Status:     0x0000

  (Bus Powered)

0 Likes
1 Solution
abhinavg_21
Moderator
Moderator

Hi,

Please try to stream the video using example firmware that comes along with the FX3SDK "C:\Program Files (x86)\Cypress\EZ-USB FX3 SDK\1.3\firmware\uvc_examples\cyfxuvcinmem" and share the the result.

Have you installed the "v4l2_utils" on the PC?

If still its not working try to change descriptors in AN75779 according to your image sensor & video requirement.

Thanks & Regards

Abhinav

View solution in original post

0 Likes
3 Replies