CX3 streaming issue over USB 2.0

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

cross mob
ajmc_3522501
Level 3
Level 3
5 likes given First like given

Hi All,

I'm having a CX3 device which is programmed to act as a UVC-CDC device(based on the sample code Cx3UvcOV5640_UVC_CDC).

The Stream is having some issue in USB 2.0 for some resolutions but it's working perfectly in USB 3.0.

Please find the observations when streaming in USB 2.0.

Resolution 640 * 180 @ 60fps is successfully streaming but the 960 *360 @15fps is having issue. Frame format used is RGB24.

When trying to stream "CB failure" occurs and CX3 tries to restart the stream repeatedly.

If the restart sequence is commented I get the following debug prints. Adequate data is not received in this case, the actual size should be ( 960 * 360 *3 = 1036800 B )

Prod = 20 Cons = 15  Prtl_Sz = 5952 Frm_Cnt = 28 Frm_Sz = 742272 B

Prod = 20 Cons = 15  Prtl_Sz = 5952 Frm_Cnt = 29 Frm_Sz = 742272 B

Prod = 20 Cons = 15  Prtl_Sz = 5952 Frm_Cnt = 30 Frm_Sz = 742272 B

The DMA configuration for CY_U3P_DMA_TYPE_MANUAL_MANY_TO_ONE is

dmaCfg.size                    = CX3_UVC_STREAM_BUF_SIZE;  //  0x8FD0 + 12 + 4

dmaCfg.count                 = CX3_UVC_STREAM_BUF_COUNT; // 3

dmaCfg.validSckCount   = CX3_UVC_SOCKET_COUNT; // 2

the endpoint configuration is

endPointConfig.pcktSize = CX3_EP_BULK_HIGH_SPEED_PKT_SIZE; // 0x200

endPointConfig.burstLen = CX3_EP_BULK_HIGH_SPEED_BURST_LEN; // 1

Could you please help me on this.

Regards

Ajay

0 Likes
1 Solution

The issue was that the sensor was sending data at a high data rate( Data in a quick burst)

So this was above the capability of USB 2.0 to capture.

Now sensor is updated so as to send 720 * 360 @ 15fps at an evenly distributed range.

With this configuration the streaming is working successfully.

Thanks for the support.

Ajay

View solution in original post

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

Please confirm whether you are receiving 960 * 360 *3 = 1036800 B in debug prints in USB 3.0 case.

Please probe HSYNC_test, VSYNC_test and PCLK pins in both USB 3.0 and USB 2.0 case for 960x360x3 bytes and find the difference between them.

0 Likes

In USB 3.0 i'm receiving the 1036800 B print.

Also probing the V sync test signal for 960 * 360 @15 fps gives 15Hz for both USB 3.0 and 2.0.

0 Likes

Is the VSYNC_active and HSYNC_active duration are same in USB 3.0 and USB 2.0?

0 Likes

Yes.

For 15FPs the V sync is 15hz and the H sync is 27Khz in both USB 3.0 and USB 2.0

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

Please share the .C file and required header files for review.

0 Likes
lock attach
Attachments are accessible only for community members.

Please find attached the uvc.c and it's header file.

0 Likes

>> When trying to stream "CB failure" occurs and CX3 tries to restart the stream repeatedly.

If the restart sequence is commented I get the following debug prints. Adequate data is not received in this case, the actual size should be ( 960 * 360 *3 = 1036800 B )

The .c file is fine.

It looks like the host is not able to stream the 960 * 360 * 3 at 15 fps. Hence, you are seeing commit buffer failurs. Can you please reduce the frame size to 10 (in USB 2.0 for debugging) and check?

0 Likes

I tried making it to 5 fps and the same issue persists.

In one or two prints i got the full frame size 1036800 B

Could you share a CX3 project that would ideally stream this data.

960 * 360 @15fps and format RGB24

0 Likes

The issue was that the sensor was sending data at a high data rate( Data in a quick burst)

So this was above the capability of USB 2.0 to capture.

Now sensor is updated so as to send 720 * 360 @ 15fps at an evenly distributed range.

With this configuration the streaming is working successfully.

Thanks for the support.

Ajay

0 Likes