cycx3_uvcdscr.c problems

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Minwan
Level 1
Level 1
10 sign-ins 5 replies posted 5 sign-ins

Hi,

I am interfacing an Omnivision image sensor (OV9734) with the CX3 bridge .

The image sensor and current cx3 receiver configuration are like below:

Minwan_0-1623250419603.png

Minwan_1-1623250520997.png

But I have two questions:

1.  Why do the following problems occur:

Minwan_2-1623250814114.png

2.I have read the KBA: Streaming RAW10 Format Input Data to 16/24-bit Output Format in CX3 MIPI CSI-2 - KBA224387,

then I realized that I should replace CY_U3P_CSI_DF_RAW10 with CY_U3P_CSI_DF_YUV422_8_2, but I have no ideal how to change  the UVC Descriptor and probe control structures of my firmware and how to calculate the parameter of re-writing . So can I use the code in the example OV5640? This is the code I copied from OV5640:

/* Class specific Uncompressed VS format descriptor */
0x1B, /* Descriptor size */
CX3_CS_INTRFC_DESCR, /* Class-specific VS interface Type */
0x04, /* Subtype : VS_FORMAT */
0x01, /* Format desciptor index */
0x04, /* Number of Frame Descriptors that follow this descriptor: 4 */

/* GUID, globally unique identifier used to identify streaming-encoding format*/
0X59,0X55,0X59,0X32,
0X00,0X00,0X10,0X00,
0X80,0X00,0X00,0XAA,
0X00,0X38,0X9B,0X71,

0x10, /* Number of bits per pixel: 16*/
0x01, /* Optimum Frame Index for this stream: 1 (5M) */
0x00, /* X dimension of the picture aspect ratio; Non-interlaced */
0x00, /* Y dimension of the pictuer aspect ratio: Non-interlaced */
0x00, /* Interlace Flags: Progressive scanning, no interlace */
0x00, /* duplication of the video stream restriction: 0 - no restriction */

/* Class specific Uncompressed VS Frame Descriptor 3 - 720p */
0x1E, /* Descriptor size */
CX3_CS_INTRFC_DESCR, /* Descriptor type*/
0x05, /* Subtype: frame interface*/
0x03, /* Frame Descriptor Index: 3 */
0x00, /* No Still image capture method supported */
0x00,0x05, /* Width in pixel: 1280 */
0xd0,0x02, /* Height in pixel: 720 */
0x00,0x00,0x5e,0x1a, /* Min bit rate (bits/s): 1280 x 720 x No Of Bits per Pixel x FrameRate = 442368000 */
0x00,0x00,0x5e,0x1a, /* Max bit rate (bits/s): Fixed rate so same as Min */
0x00,0x20,0x1c,0x00, /* Maximum video or still frame size in bytes(Deprecated): 1280 x 720 x 2 */
0x15,0x16,0x05,0x00, /* Default frame interval (in 100ns units): (1/30)x10^7 */
0x01, /* Frame interval type : No of discrete intervals */
0x15,0x16,0x05,0x00, /* Frame interval 3: Same as Default frame interval */

/* UVC Probe Control Setting - 720p*/
uint8_t const gl720pProbeCtrl[CX3_UVC_MAX_PROBE_SETTING] = {
0x00, 0x00, /* bmHint : No fixed parameters */
0x01, /* Use 1st Video format index */
0x03, /* Use 1st Video frame index */
0x15,0x16,0x05,0x00, /* Desired frame interval in 100ns = (1/30)x10^7 */
0x00, 0x00, /* Key frame rate in key frame/video frame units */
0x00, 0x00, /* PFrame rate in PFrame / key frame units */
0x00, 0x00, /* Compression quality control */
0x00, 0x00, /* Window size for average bit rate */
0x00, 0x00, /* Internal video streaming i/f latency in ms */
0x00,0x20,0x1c,0x00, /* Max video frame size in bytes = 1920 x 1080 x 2 */
#ifdef CX3_UVC_1_0_SUPPORT
0x00, 0x90, 0x00, 0x00 /* No. of bytes device can rx in single payload: 36KB */
#else
/* UVC 1.1 Probe Control has additional fields from UVC 1.0 */
0x00, 0x90, 0x00, 0x00, /* No. of bytes device can rx in single payload: 36KB */
0x00, 0x60, 0xE3, 0x16, /* Device Clock */
0x00, /* Framing Information - Ignored for uncompressed format*/
0x00, /* Preferred payload format version */
0x00, /* Minimum payload format version */
0x00 /* Maximum payload format version */
#endif
};

Regards

 

 

0 Likes
1 Solution
JayakrishnaT_76
Moderator
Moderator
Moderator
First question asked 1000 replies posted 750 replies posted

Hello,

Please change the following parameters in the CX3 Receiver Configuration tab of MIPI Configuration Utility as mentioned below:

1. Output Parallel clock divider to 4

2. FIFO delay to 200

Please find my comments for your questions below:

1. You see an error as mentioned in your description because there is no resolution in your configuration that can be supported over USB 2.0. This error can be ignored. But the camera will support only USB 3.0.

2. As per my understanding, you would like to pack the incoming data into 16 bits. Please correct me if my understanding is wrong. For this, you cannot use the descriptors that comes along with the SDK example for interfacing OV5640 with CX3. You need to follow the KBA and modify the descriptors accordingly. Please find the calculations done below for your requirement:

a. 1280*720*10 = x*720*16

x = 800

This will be the width of frame field in the UVC frame descriptor. The height of frame can be kept as 720 itself

b. Frame size = (1280*720*10)/8 bytes = (800*720*16)/8bytes = 1152000 bytes = 0x119400

This value can be populated in the frame size field of the descriptors. The same value should be populated in the probe control structure (max frame size in bytes field of probe control structure)

c. Min and Max bit rates can be populated with the same value. This can be calculated as follows:

Bit rate = 800*720*16*30 = 276480000bps = 0x107AC000

Please let me know if you have any queries on the calculations done above.

Best Regards,
Jayakrishna

View solution in original post

0 Likes
14 Replies