CX3 NIR USB camera is not generating frames properly for 30FPS and 1280x720 resolution

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

cross mob
nawinksharma
Level 1
Level 1
First reply posted First question asked First like given

Hi,

While flashing CX3 NIR USB camera for 30FPS and 1280x720 resolution , I am not getting proper frames.

I have attached the frame screenshot, Image sensor configuration and  Log generated related to the issue:

Screenshot from 2021-02-18 14-46-21.pngScreenshot (5).png

Screenshot (6).png

Please Help with this.

Regards!

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

EDITTED

Hello,

The multiply value of unit clock setting in CX3 receiver configuration tab of MIPI configuration Utility can be lowered from 124 to 90. It need not be set to such a high value for this particular setting. It can also be reduced below 90.

Also, from the UART debug logs, I find that the size of the frame is varying. This could mean that there is a mismatch between sensor configuration and the configuration of CX3 MIPI block. Can you please check if the image sensor configuration settings are proper with the image sensor vendor?

Also, can you please comment the print used for calculating the frame size from the firmware and manually calculate the frame size and then print it? For manually calculating and printing the frame size, the following approach can be used:

1. Inside CY_U3P_DMA_CB_PROD_EVENT, check if a full or partial buffer is received. As you might be knowing, the frame should end with a partial buffer. So, the last buffer corresponding to a frame will be partial buffer. The check for the same is already added in the firmware to add appropriate UVC headers for full and partial buffers corresponding to a frame. 

2. Declare a global variable which can hold the size of the frame (in bytes) completely and a flag (to signal frame completion). Initialize the global variable for frame size as 0 and flag as CyFalse.

3. Increase the global variable with the size of the DMA buffer received if flag is CyFalse. If the buffer received is a partial buffer, then increase the global variable with the size of the DMA buffer received (partial buffer) and also set the flag to CyFalse.

4. In the infinite for loop, check for flag status. If the flag is CyTrue, then print the value of the global variable, set the flag to CyFalse and the global variable to 0.

Please try this and share the UART debug logs for us to confirm if there are any variations in frame size.

Can you also check the streaming on a Windows PC and let us know if there are any improvements in the variation of frame size? 

At the host side, each pixel will have 6 additional padded bits. So, a custom host application should be used to remove this added bits from each pixel to retrieve the original video stream.

Best Regards,
Jayakrishna

View solution in original post

0 Likes
3 Replies
JayakrishnaT_76
Moderator
Moderator
Moderator
First question asked 1000 replies posted 750 replies posted

Hello,

Please let me know if CX3 is packing or padding the incoming data from the image sensor. I assume that your application is UVC compliant. Please correct me if I am wrong.

Best Regards,
Jayakrishna

CX3 is padding 6 bits to raw-10 data.

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

EDITTED

Hello,

The multiply value of unit clock setting in CX3 receiver configuration tab of MIPI configuration Utility can be lowered from 124 to 90. It need not be set to such a high value for this particular setting. It can also be reduced below 90.

Also, from the UART debug logs, I find that the size of the frame is varying. This could mean that there is a mismatch between sensor configuration and the configuration of CX3 MIPI block. Can you please check if the image sensor configuration settings are proper with the image sensor vendor?

Also, can you please comment the print used for calculating the frame size from the firmware and manually calculate the frame size and then print it? For manually calculating and printing the frame size, the following approach can be used:

1. Inside CY_U3P_DMA_CB_PROD_EVENT, check if a full or partial buffer is received. As you might be knowing, the frame should end with a partial buffer. So, the last buffer corresponding to a frame will be partial buffer. The check for the same is already added in the firmware to add appropriate UVC headers for full and partial buffers corresponding to a frame. 

2. Declare a global variable which can hold the size of the frame (in bytes) completely and a flag (to signal frame completion). Initialize the global variable for frame size as 0 and flag as CyFalse.

3. Increase the global variable with the size of the DMA buffer received if flag is CyFalse. If the buffer received is a partial buffer, then increase the global variable with the size of the DMA buffer received (partial buffer) and also set the flag to CyFalse.

4. In the infinite for loop, check for flag status. If the flag is CyTrue, then print the value of the global variable, set the flag to CyFalse and the global variable to 0.

Please try this and share the UART debug logs for us to confirm if there are any variations in frame size.

Can you also check the streaming on a Windows PC and let us know if there are any improvements in the variation of frame size? 

At the host side, each pixel will have 6 additional padded bits. So, a custom host application should be used to remove this added bits from each pixel to retrieve the original video stream.

Best Regards,
Jayakrishna
0 Likes