UVC based application for FX3 is created based on the framework of AN75779. 24bit GPIF is used(D23:D0) . image is 800*600. Pixel depth is 24bit/pixel, i.e. 3Byte/pixel. Since it is 24bits/pixel raw image, GUID for RGB888 is used for media type and RGB888 will be debayered in host. DMA buffer keeps the same: 16kB, 4 counts, 2 sockets. Only change the GPIF bus to 24bits, LD_DATA_COUNT, LD_ADDR_COUNT to 5455. However, it can't stream.
But according to KBA226722,
S= 800*600*3= 1,440,000 byte,
F= int(S/(16384-16))= 1440000/16368 = 87
P= fraction of S/(16384-16) * 16368 = 0.976594*16368 = 15984
It should be working.
I noticed that in KBA226722 , it mentioned in item 5 "If exact line data (i.e nothing is appended at the end of the line data) is intended to be sent to the Host, then make sure that line size in bytes is divisible by GPIF bus width (in bytes)." I don't quite get this point.
Help is needed on the proper setting of DMA configuration and GPIF state machine data and address count value.
Thanks in advance
Solved! Go to Solution.
Counter values look correct for 24-bit GPIF bus width.
Item 5 in KBA226722 means that, you will have to make sure line size in bytes is exactly divisible by GPIF bus width in bytes. If this is not true, then there will be padding of extra bytes at the end of each line.
In your case line size is 800 *3 bytes which is divisible by 3 bytes. So, above condition is satisfied.
Can you please let me know if you have verified using UART debugprints that, for a frame, 87 full DMA buffers and 1 partial buffer is seen?
Thank you for your reply.
I checked frame completion and buffer commit and found that there is no data received. But, if change buffer size to be 25*1KB = 25kB and change the No. of bytes device can rx in single payload to be 25kB, it will be able to stream video data.
I am able to stream video when using 25kB. But AN75799 says bulk transfer is optimized at 16kB to get max frame rate. So, I am wondering why 16kB does not work. I am trying to use less memory for video streaming so that other modules can use some without causing problem
From the UART logs you shared previously, I see that video streaming is not happening because of commitbuffer failures occurring continuously.
commitbuffer failures occur when the rate of filling of buffers is greater than the rate at which host empties the same.
So, if you want to try to make streaming work with 16kB buffer size, you can try increasing the total horizontal time on the video parallel interface (that is, you will have to increase horizontal blanking time - which causes decrease in vertical blanking). Also when you do this, make sure that you maintain minimum of ~350us of vertical blanking.
By increasing the total horizontal time, the rate at which DMA buffers get filled decreases.
I increased the horizontal blanking to the maximum allowed value 1.206us, the vertical blanking is the same which is 450us. It still does not work for 16kB DMA buffer.
1. Can you please let me know what is your horizontal active time when you increased the blanking to 1.206us?
2. As an experiment, with the same modified blanking value, can you try streaming lesser line size, that is, less than 800px? - For this you need to change the descriptor info as well as the sensor config.
Sorry for the late reply. The active horizontal time is 11.76us.
I am modifying the image format to be 640*480 to see whether 16kB will be working.
I changed image frame size to 640*480. It still does not work with 16kB. It only works with 25kB. i.e,
in GPIF, LD_DATA_COUNT = =LD_ADDR_COUNT = 8527,
in UVC.h, #define CY_FX_EP_BULK_VIDEO_PKTS_COUNT (0x19) /* 25 packets (burst of 25) per DMA buffer. */
I tried another configuration: image frame size: 640*480. pixel depth: 16bit/pixel. GPIF data bus : 16 bit ( 8 MSB bits are trimmed off) . With this configuration, 16kB can stream video to host application Virtual Dub or eCamview . But, we need stream the video with pixels of its original 24 bits, not only the 16 LSB bits. Thank you.
1. Can you please let me know if the device is operating in USB 2.0 or USB 3.0 mode.
2. From above discussion, I think you are using the following setting for testing. Please confirm.
Hactive: 11.76us Hblanking: 1.206us.
The device runs in USB3.0 mode. I tested both 16kB and 25kB with Hactive: 11.76us Hblanking: 1.206us when image size set to 800*600.
Even after increasing the Hblanking to maximum and decreasing the resolution, if you see commit buffer failure, then I think the only way is to increase the DMA buffer size.
Also please try with different video players to see the difference.
I tried VirtualDub and eCamview. If you have recommendations of video player that work differently with these two software, it would be very helpful.