cancel
Showing results for 
Search instead for 
Did you mean: 

USB Superspeed Peripherals

KeWa_2323766
New Contributor II

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

 

0 Likes
6 Replies
Hemanth
Moderator
Moderator

Hi,

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?

Regards,

Hemanth
0 Likes
KeWa_2323766
New Contributor II

Hemanth,

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.  

KeWa_2323766_0-1620224320960.png

 

0 Likes
KeWa_2323766
New Contributor II

With 25kB, LD_DATA_COUNT= LD_ADDR_COUNT=8527  is also modified in GPIF state machine

0 Likes
Hemanth
Moderator
Moderator

Hi,

Okay. So, with 25kB buffer size, you are able to stream the video. Please confirm if this is correct.

Regards,

Hemanth
0 Likes
KeWa_2323766
New Contributor II

Hemanth,

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

0 Likes
Hemanth
Moderator
Moderator

Hi,

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.

Regards,

Hemanth
0 Likes