1600x1300 resolution for CX3

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

cross mob
shhac_4101246
Level 2
Level 2

Does CX3 support 1600x1300 resolution?

We are going to use OV2311(1600x1300 RAW10), and want to have setting example to support this resolution.

Best Regards,

0 Likes
1 Solution

Edited:

This thread has been already resolved off line with the following changes, so this thread is put in closed state.

1. Change the image sensor MIPI clock from gated clock to free-running.

2. Change CyU3PMipicsiSetIntfParams second parameter to CyTrue.

View solution in original post

0 Likes
25 Replies
KandlaguntaR_36
Moderator
Moderator
Moderator
25 solutions authored 10 solutions authored 5 solutions authored

Hello,

Yes, CX3 support 1600x1300 RAW 10.

Can you please provide the following to get the MIPI configuration parameters?

1. CSI Clock

2. Number of Lane

3. THS Prepare

4. THS Zero

5. Frame Rate

6. HActive - 1600

7. HBlanking

8.VActive - 1300

9. VBlanking

10. data format - RAW10

0 Likes

Hello,

Thank you for the response.

I'm using following parameter.

1. CSI Clock - 400MHz

2. Number of Lane - 2

3. THS Prepare - 70

4. THS Zero - 90

5. Frame Rate - 15

6. HActive - 1600

7. HBlanking -  2016

8.VActive - 1300

9. VBlanking - 174

10. data format - RAW10

When I use above parameter, I got attached weird output image on eCamView.

I also tested with VLC, AMcap, I got same result.

Looks like somehow blue square image is overwritten to red square area.

Even if I use color image from image sensor(OV2311), I saw same behavior.

image1.png

image2.png

I also checked OV2311 register setting, but I could see correct image is outputted from OV2311 eva board.

So looks like OV2311 setting is okay.

Let me know if you have any suggestion to resolve this issue.

0 Likes

Since you are streaming RAW10 video format, the standard UVC host applications cannot stream RAW10 format. You need to customize the host application as needed.

Please refer this KBA - Streaming RAW10 Format Input Data to 16/24-bit Output Format in CX3 MIPI CSI-2 - KBA224387

Please confirm whether you are using the following MIPI configuration parameters;

/* Example_YUY2_Resolution0 :  */

CyU3PMipicsiCfg_t Example_YUY2_Resolution0 =

{

    CY_U3P_CSI_DF_YUV422_8_2,  /* CyU3PMipicsiDataFormat_t dataFormat */

    2,                          /* uint8_t numDataLanes */

    2, /* uint8_t pllPrd */

    123, /* uint16_t pllFbd */

    CY_U3P_CSI_PLL_FRS_250_500M, /* CyU3PMipicsiPllClkFrs_t pllFrs */

    CY_U3P_CSI_PLL_CLK_DIV_4, /* CyU3PMipicsiPllClkDiv_t csiRxClkDiv */

    CY_U3P_CSI_PLL_CLK_DIV_4, /* CyU3PMipicsiPllClkDiv_t parClkDiv */

    0,                 /* uint16_t mClkCtl */

    CY_U3P_CSI_PLL_CLK_DIV_2, /* CyU3PMipicsiPllClkDiv_t mClkRefDiv */

    1600,         /* uint16_t hResolution */

    50                         /* uint16_t fifoDelay */

};

Configure the THS Settle value to 11 using CyU3PMipicsiSetPhyTimeDelay API

0 Likes

Hello,

Thanks for your reply.
Yes, we have host application which converts YUY2 data to RAW10 video format.
Even if we use that application, we saw this overlay issue.

1. We updated our firmware to use your proposed Mipicsi setting and added CyU3PMipicsiSetPhyTimeDelay.
    With this firmware, camera app showed black screen.
    And dma callback on CX3 tried to send 2,600,000 bytes data(1600 x 1300 x 10/8).

    Is this expected behavior?

2. I added following line after CyU3PMipicsiSetIntfParams(). Is this okay?

    CyU3PMipicsiSetPhyTimeDelay(1, 11);

3. When I replaced CY_U3P_CSI_DF_YUV422_8_2 to CY_U3P_CSI_DF_RAW10, I could see video stream on camera app,
    but output image was same as before. Still seeing overwritten image.(dma callback on CX3 sent 4,160,000 bytes 1600x1300x16/8)

    Do you think this overwritten image issue is caused by setting difference between YUY2 and RAW10?

Best Regards,

0 Likes

Answering your queries:

Yes, we have host application which converts YUY2 data to RAW10 video format.

Even if we use that application, we saw this overlay issue.

>> The host application should consider that the USB device is sending the video in RAW10 format and display the same. The standard UVC application considers the received data as YUY2 and does the conversion.

1. We updated our firmware to use your proposed Mipicsi setting and added CyU3PMipicsiSetPhyTimeDelay.
    With this firmware, camera app showed black screen.
    And dma callback on CX3 tried to send 2,600,000 bytes data(1600 x 1300 x 10/8).

    Is this expected behavior?

>> Yes, this is expected. You are receiving the exact frame size as per 1600x1300x10 bits. The standard UVC host application decodes the received image as per YUY2 format. You need to write your own code to display RAW10 data.

2. I added following line after CyU3PMipicsiSetIntfParams(). Is this okay?

    CyU3PMipicsiSetPhyTimeDelay(1, 11);

>> This is okay. Hope you have passed the second arguments of  CyU3PMipicsiSetIntfParams as CyFalse.

3. When I replaced CY_U3P_CSI_DF_YUV422_8_2 to CY_U3P_CSI_DF_RAW10, I could see video stream on camera app,
    but output image was same as before. Still seeing overwritten image.(dma callback on CX3 sent 4,160,000 bytes 1600x1300x16/8)

>> Here, you are receiving 16bits per pixel instead 10 bits per pixel. You need to remove the additional 6 bits per pixel and do the display in your custome application. This is same question 1.

    Do you think this overwritten image issue is caused by setting difference between YUY2 and RAW10?

>> It could be due to host application implementation.

Please probe the HSYNC, VSYNC and PCLK test pins and check whether the timings are correct. Measure the HACTIVE, VACTIVE and blanking times.

0 Likes

Hello,

We use our application to display RAW10 and works properly with "OV2311 sensor + FX3".

However, when we use CX3, we have this issue.

So I think host application implementation is correct. Issue is coming from CX3 side.

We also tried to use CY_U3P_CSI_DF_YUV422_8_2, but this overlay issue was still exist.

With FX3, we used MIPI clock free running setting, but somehow free running didn't work on CX3(DMA counter is not incremented), so we change sensor setting to Gate clock.

We've already checked CX3 Hardware: Frequently Asked Questions - KBA91295  and our sequence is same  as recommended sequence.

Do you think this overlay behavior is caused by this clock setting?

Best Regards,

0 Likes

Hello,

The issue occurs if width is bigger than 1360.

Let me know if you have any suggestion.

<1360x1300>

pastedImage_3.png

<1376x1300 RAW10>

pastedImage_5.png

0 Likes

Hello,

In 1376x1300 picture, we can see that the additional 16 (1376 - 1360) pixel information is overlayed.

Q: Do you think this overlay behavior is caused by this clock setting?

This overlay behavior does not depend on clock settings as far as you are seeing the frame size as 2,600,000 bytes data(1600 x 1300 x 10/8).

You can also confirm this by probing the HSYNC, VSYNC and PCLK; this will also tell the frame size. Measure the active and blanking time of every parameter.

Please confirm whether 1600x1300 is streaming fine in case of FX3 + image sensor with the same host application with images (screenshots).

0 Likes

Hello,

Thanks for your reply.

We tested with changing following parameter(Width in pixel) in CX3RDKOV5640Dscr.c and changed ISP output size on image sensor side.

  0x1E, /* Descriptor size */

  ES_UVC_CS_INTRFC_DESCR, /* Descriptor type*/

#if !hd

  0x05, /* Subtype: frame interface*/

  0x01, /* Frame Descriptor Index: 1 */

  0x00, /* No Still image capture method supported */

  0x50,0x05, /* Width in pixel: 1600 */

>In 1376x1300 picture, we can see that the additional 16 (1376 - 1360) pixel information is overlayed.

Actually, additional 16 pixel information is not overlayed.

Please see following image.

<1360 x 1300>

pastedImage_0.png

<1600x1300>

pastedImage_1.png

Left side shows same area, and when I increased width size, right side image is extended.

And right side image is overlayed on left side.(But a few pixels on left side shows correct image though).

>Please confirm whether 1600x1300 is streaming fine in case of FX3 + image sensor with the same host application with images (screenshots).

Following image is with FX3 + OV2311 with the same host application(1600x1300).

It doesn't show overlayed image and works fine.

pastedImage_2.png

>You can also confirm this by probing the HSYNC, VSYNC and PCLK; this will also tell the frame size. Measure the active and blanking time of every parameter.

Yes, we will measure these parameter ASAP.

Best Regards,

0 Likes

Edited:

1. Change the all relevant fields in Uncompressed VS frame descriptor.

The sample descriptors are for 1080p@30fps.

/* Class specific Uncompressed VS Frame Descriptor 1 - 1080p@30fps */

    0x1E,                               /* Descriptor size */

    CX3_CS_INTRFC_DESCR,                /* Descriptor type*/

    0x05,                               /* Subtype: Uncompressed frame interface*/

    0x01,                               /* Frame Descriptor Index: 1 */

    0x00,                               /* No Still image capture supported */

    0x80, 0x07,                         /* Width in pixel:  1920 */

    0x38, 0x04,                         /* Height in pixel: 1080 */

    0x00, 0x80, 0x53, 0x3B,             /* Min bit rate (bits/s): 1080 x 1920 x 2 x 30 x 8 = 995328000 */

    0x00, 0x80, 0x53, 0x3B,             /* Max bit rate (bits/s): Fixed rate so same as Min */

    0x00, 0x48, 0x3F, 0x00,             /* Maximum video or still frame size in bytes(Deprecated): 1920 x 1080 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 */

2. You are also need to change the probe control structures when you change the resolution.

Sample Probe Control Structure for 1080p@30fps

/* UVC Probe Control Setting - 1080p@30FPS */

uint8_t const gl1080pProbeCtrl[CX3_APP_MAX_PROBE_SETTING] = {

    0x00, 0x00,                         /* bmHint : No fixed parameters */

    0x01,                               /* Use 1st Video format index */

    0x01,                               /* 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, 0x48, 0x3F, 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

};

Please share your probe control structures for 1360x1300 and 1600x1300 resolutions.

Can you please share the CX3 firmware atleast snippets - DMA Channel Creation; DMACallback?

Please let me know what is the reference firmware you have used for this application - looks like you used OV5640.

0 Likes

Hi,

Thanks for your checking.

We are using Denebola – USB 3.0 UVC Reference Design Kit (RDK) for the reference.

We modified CX3RDKOV5640 and added some functions for our product requirement.

Here is the 1600x1300 probe setting.

   0x00, 0x00, /* bmHint : No fixed parameters */

   0x01, /* Use 1st Video format index */

   0x01, /* Use 1st Video frame index */

   0x2a,0x2c,0x0a,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,0x7a,0x3f,0x00, /* Max video frame size in bytes = 1920 x 1080 x 2 */

   0x00, 0x90, 0x00, 0x00 /* No. of bytes device can rx in single payload: 36KB */

And this is our descriptor.

  0x1E, /* Descriptor size */

  ES_UVC_CS_INTRFC_DESCR, /* Descriptor type*/

  0x05, /* Subtype: frame interface*/

  0x01, /* Frame Descriptor Index: 1 */

  0x00, /* No Still image capture method supported */

  0x40,0x06, /* Width in pixel: 1600 */

  0x14,0x05, /* Height in pixel: 1300 */

  0x00,0x30,0xc1,0x1d, /* Min bit rate (bits/s): 1600 x 1300 x No Of Bits per Pixel x FrameRate = 499200000 */

  0x00,0x30,0xc1,0x1d, /* Max bit rate (bits/s): Fixed rate so same as Min */

  0x00,0x7a,0x3f,0x00, /* Maximum video or still frame size in bytes(Deprecated): 1600 x 1300 x 2 */

  0x2a,0x2c,0x0a,0x00, /* Default frame interval (in 100ns units): (1/30)x10^7 */

  0x01, /* Frame interval type : No of discrete intervals */

  0x2a,0x2c,0x0a,0x00, /* Frame interval 3: Same as Default frame interval */

We didn't modify DMA Channel creation and DMACallback from CX3RDKOV5640.

Is it possible to test 1600 x XXX resolution at your side with CX3?

Best Regards,

0 Likes

Please share /* Class specific Uncompressed VS format descriptor */ and MIPI Configuration structure as well.

Sample is here.

/* Class specific Uncompressed VS format descriptor */

    0x1B,                               /* Descriptor size */

    CX3_CS_INTRFC_DESCR,                /* Class-specific VS interface Type */

    0x04,                               /* Subtype : VS_FORMAT_UNCOMPRESSED */

    0x01,                               /* Format desciptor index */

    0x04,                               /* Number of Frame Descriptors that follow this descriptor: 3 */

   

    /* GUID, globally unique identifier used to identify streaming-encoding format: YUY2  */

    0x59, 0x55, 0x59, 0x32,             /*MEDIASUBTYPE_YUY2 GUID: 32595559-0000-0010-8000-00AA00389B71 */

    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: 2 (1080p) */

    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 */

* Example_YUY2_Resolution0 :  */

CyU3PMipicsiCfg_t Example_YUY2_Resolution0 =

{

    CY_U3P_CSI_DF_YUV422_8_2,  /* CyU3PMipicsiDataFormat_t dataFormat */

    2,                          /* uint8_t numDataLanes */

    2, /* uint8_t pllPrd */

    123, /* uint16_t pllFbd */

    CY_U3P_CSI_PLL_FRS_250_500M, /* CyU3PMipicsiPllClkFrs_t pllFrs */

    CY_U3P_CSI_PLL_CLK_DIV_4, /* CyU3PMipicsiPllClkDiv_t csiRxClkDiv */

    CY_U3P_CSI_PLL_CLK_DIV_4, /* CyU3PMipicsiPllClkDiv_t parClkDiv */

    0,                 /* uint16_t mClkCtl */

    CY_U3P_CSI_PLL_CLK_DIV_2, /* CyU3PMipicsiPllClkDiv_t mClkRefDiv */

    1920,         /* uint16_t hResolution */

    50                         /* uint16_t fifoDelay */

};

0 Likes

Edited.

#We are using CY_U3P_CSI_DF_RAW10

Here is our configuration.

Please review these parameter and let me know if you find anything.

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

/* GUID, globally unique identifier used to identify streaming-encoding format: YUY2  */
0x59, 0x55, 0x59, 0x32,             /*MEDIASUBTYPE_YUY2 GUID: 32595559-0000-0010-8000-00AA00389B71 */
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: 2 (720p) */
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 */

CyU3PMipicsiCfg_t is as follows.

    CY_U3P_CSI_DF_RAW10,  /* CyU3PMipicsiDataFormat_t dataFormat */

    2,                          /* uint8_t numDataLanes */

    2, /* uint8_t pllPrd */

    123, /* uint16_t pllFbd */

    CY_U3P_CSI_PLL_FRS_250_500M, /* CyU3PMipicsiPllClkFrs_t pllFrs */

    CY_U3P_CSI_PLL_CLK_DIV_4, /* CyU3PMipicsiPllClkDiv_t csiRxClkDiv */

    CY_U3P_CSI_PLL_CLK_DIV_4, /* CyU3PMipicsiPllClkDiv_t parClkDiv */

    0,                 /* uint16_t mClkCtl */

    CY_U3P_CSI_PLL_CLK_DIV_2, /* CyU3PMipicsiPllClkDiv_t mClkRefDiv */

    1600,         /* uint16_t hResolution */

    50                         /* uint16_t fifoDelay */

0 Likes

Please share the HSYNC, VSYNC and PCLK active and blanking times.

You can also print MIPI errors as follows:

CyU3PMipicsiGetErrors( CyTrue, &errCnts);

if (errCnts.crcErrCnt|errCnts.ctlErrCnt|errCnts.eidErrCnt|errCnts.frmErrCnt|errCnts.mdlErrCnt|errCnts.recSyncErrCnt|errCnts.recrErrCnt|errCnts.unrSyncErrCnt|errCnts.unrcErrCnt)

CyU3PDebugPrint(4,"\n\rMipi Errors: %d %d %d %d %d %d %d %d %d",errCnts.crcErrCnt,errCnts.ctlErrCnt, errCnts.eidErrCnt, errCnts.frmErrCnt, errCnts.mdlErrCnt, errCnts.recSyncErrCnt, errCnts.recrErrCnt, errCnts.unrSyncErrCnt, errCnts.unrcErrCnt );

Note that if the frame size printed by the CX3 is as expected; VSYNC, HSYNC and PCLK are proper; and there is no mipi errors that means the CX3 is working properly. Cx3 is sending the da

Please confirm on the MIPI transmitter side or Host application in case of resolution more than 1360x1300.

0 Likes

Hello KandlaguntaR_36,

Thanks for the reply.

So these parameters(MIPIcsi, probe setting, descriptor) look okay?

We just checked CyU3PMipicsiGetErrors error again.

At the beginning, CX3 shows error several times, but after a few seconds, CX3 doesn't output MIPI error even if I open host application and start capturing.

#We call CyU3MipicsiGetErrors every 200ms, and I could see 6 times error(means 1.2 sec from booting)

  Error log is as bellow.

      unrSyncErrCnt:211

          fmrErrCnt:236

          mdlErrCnt:3

          crcErrCnt:31

          ctlErrCnt:64

          eidErrCnt:83

      recSyncErrCnt:96

      unrSyncErrCnt:211

          fmrErrCnt:236

          mdlErrCnt:3

          crcErrCnt:31

          ctlErrCnt:64

          eidErrCnt:83

      recSyncErrCnt:96

Is this expected behavior?

If not, what is causing this error? Image sensor setting?

FYI, I did see same error with official CX3RDKOV5640 firmware.

0 Likes

>> At the beginning, CX3 shows error several times, but after a few seconds, CX3 doesn't output MIPI error even if I open host application and start capturing.

Does it mean the CX3 is not printing the Mipi error at all (OR) there are zero errors after streaming has started?

0 Likes

Hello,

>Does it mean the CX3 is not printing the Mipi error at all (OR) there are zero errors after streaming has started?]

Yes, after initialization, MIPI error count is not incremented at all. All counter are zero errors.

Best Regards,

0 Likes

All the descriptors are correct in your firmware.

0 Likes

I have tested 1600x1200 YUY2 @30fps using Ascella Kit (CX3 + Thine ISP RDK). It is streaming as expected.

Please share the HSYNC, VSYNC, and PCLK waveforms; active and blanking duration of each.

Can you please check on the Camera side it is sending the image incorrectly?

0 Likes

Could you please provide us locations of HSYNC, VSYNC, PCLK through holes?

As PCB diagram is not disclosed, we don’t know which through holes should be connected to oscilloscope.

0 Likes

Question: Does CX3 have any test signals that can be brought to test pins for debugging?

Answer: Yes. You can provide a test point for the following signals. This is helpful in debugging the MIPI CSI-2 receiver configuration for various image sensors. Ensure that these test points are provided closer to the pins to avoid a longer trace length.

                                                                                                  

CX3 pin#

Denebola Kit Test Point

Test Signal Name

H8TP16PCLK test signal
G6TP18HSYNC test signal
H5TP20VSYNC test signal

Reference: This is Question 10 in CX3 Hardware: Frequently Asked Questions - KBA91295

0 Likes

Hello,

Thanks for your reply.

We checked the Denebola board, but we did find only TP28 and TP29.

Can you please tell us the location on Denebola board?

Best Regards,

0 Likes

Hello,

I am sorry.

The Test Points are not taken out for HSYNC, VSYNC and PCLK test pins.

Please set the System Clock settings to 400 MHz.

This can be done with the following code:

Replace the DeviceIniti API with the following snippet and test 1376x1300 and 1600x1300 resolution

    /* Initialize the device */

CyU3PSysClockConfig_t clockConfig;

clockConfig.setSysClk400  = CyTrue;

clockConfig.cpuClkDiv     = 2;

clockConfig.dmaClkDiv     = 2;

clockConfig.mmioClkDiv    = 2;

clockConfig.useStandbyClk = CyFalse;

clockConfig.clkSrc         = CY_U3P_SYS_CLK;

    status = CyU3PDeviceInit (&clockConfig);

    if (status != CY_U3P_SUCCESS)

    {

          goto handle_fatal_error

    }

Regards,

Sridhar

0 Likes

Edited:

This thread has been already resolved off line with the following changes, so this thread is put in closed state.

1. Change the image sensor MIPI clock from gated clock to free-running.

2. Change CyU3PMipicsiSetIntfParams second parameter to CyTrue.

0 Likes

Hi KandlaguntaR_36,

Any update on this?

0 Likes