an75779 解决丢帧的问题

公告

大中华汽车电子生态圈社区并入开发者社区- 更多资讯点击此

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

cross mob
zjjnsst
Level 4
Level 4
10 questions asked 25 replies posted 50 sign-ins

我们使用的是36bit的gpif、36kb*3的dma buffer、传输6m20帧。这种情况下有些时候会一直报

DMA Reset Event: Commit buffer failure
Application Stopped
Application Started

然后就会丢帧

我之前看过https://community.infineon.com/t5/Knowledge-Base-Articles/Handling-Commit-Buffer-Failures-Occurred-d...

但我觉得我们需要的是提高性能而不是在出现错误后进行丢帧处理

这种问题能不能是不是能通过加大dma buffer的手段来解决,我自己试着加大但是修改buffer大小之后就不显示图像了,报错如下:

Application Started
UVC: Completed 0 frames and 0 buffers
DMA Reset Event: Frame timer overflow, time period = 200
Application Stopped

 

还有一个现象,我们这有些电脑很少报DMA Reset Event: Commit buffer failure这个错误,有的就比较容易报错,是不是这个问题也和电脑的收取uvc数据的速度有关呢

 

 

0 点赞
1 解答
zjjnsst
Level 4
Level 4
10 questions asked 25 replies posted 50 sign-ins

emmm抱歉不知道为啥节前一直刷新都没有看到回复。我会去状态机中修改的,就是好像dma有上限,我现在36kb*3有没有达到这个上限呢?

我改成同步模式后倒是不出现这个 Commit buffer failure 的问题了,估计是和电脑端收取数据的速度有关。但我还是想了解一下dmabuffer总体的大小是不是有个上限😂

在原帖中查看解决方案

0 点赞
6 回复数
zjjnsst
Level 4
Level 4
10 questions asked 25 replies posted 50 sign-ins

对了补充一下,传输的数据是YUY2

 

0 点赞
Eddyi
Level 3
Level 3
25 sign-ins 10 replies posted 10 likes given

commit buffer failure 的错误代码查一下。

修改DMA buffer size还需要修改GPIF状态机的参数:

https://community.infineon.com/t5/Knowledge-Base-Articles/Configuring-Buffer-Sizes-in-AN75779-UVC-Fi...

如果增大DMA的space还是没用,可以考虑一下是不是达到了USB传输的带宽上限。

0 点赞
Eddyi
Level 3
Level 3
25 sign-ins 10 replies posted 10 likes given

只修改DMA buffer size是不行的,还需要去状态机中修改相应参数:

https://community.infineon.com/t5/Knowledge-Base-Articles/Configuring-Buffer-Sizes-in-AN75779-UVC-Fi...

另外 Commit buffer failure 也要考虑这个错误代码是什么, 一般增大buffer size没什么帮助。

0 点赞
zjjnsst
Level 4
Level 4
10 questions asked 25 replies posted 50 sign-ins

emmm抱歉不知道为啥节前一直刷新都没有看到回复。我会去状态机中修改的,就是好像dma有上限,我现在36kb*3有没有达到这个上限呢?

我改成同步模式后倒是不出现这个 Commit buffer failure 的问题了,估计是和电脑端收取数据的速度有关。但我还是想了解一下dmabuffer总体的大小是不是有个上限😂

0 点赞
Roy_Liu
Moderator
Moderator
Moderator
5 comments on KBA First comment on KBA 10 questions asked

Commit buffer failures 通常出现在主机消耗FX3的DMA缓冲区速度较慢时,这会导致DMA缓冲区溢出情况。

可以在DMA信道配置中检查分配给DMA信道的DMA缓冲器大小。

在下面的代码中,4个(每个套接字2个)16KB的DMA通道被分配给DMA通道。如果所有4个DMA缓冲区都由传感器(连接到FX3)填充,并且主机无法读取/清空4个DMA缓冲区,此时会出现Commit buffer failure
/* Create a DMA Manual channel for sending the video data to the USB host.
*/ dmaMultiConfig.size = 16384;
dmaMultiConfig.count = 2;
dmaMultiConfig.validSckCount = 2;
dmaMultiConfig.prodSckId [0] = (CyU3PDmaSocketId_t)CY_U3P_PIB_SOCKET_0;
dmaMultiConfig.prodSckId [1] = (CyU3PDmaSocketId_t)CY_U3P_PIB_SOCKET_1;
dmaMultiConfig.consSckId [0] = (CyU3PDmaSocketId_t)(CY_U3P_UIB_SOCKET_CONS_0 | CY_FX_EP_VIDEO_CONS_SOCKET);

 

Commit buffer failures are usually seen when the host is slow to consume the DMA buffers of FX3 which leads to DMA buffer overflow condition.
The DMA buffers allocated to a DMA channel can be checked in the DMA channel configuration.
In the below code snippet, 4 (2 per producer socket) DMA channels of 16KB each are allocated to the DMA channel. If all the 4 DMA buffers are filled by the sensor (connected to FX3) and the host is not able to read/empty the 4 DMA buffers and hence the commit buffer failures are seen
/* Create a DMA Manual channel for sending the video data to the USB host. */ dmaMultiConfig.size = 16384; dmaMultiConfig.count = 2; dmaMultiConfig.validSckCount = 2; dmaMultiConfig.prodSckId [0] = (CyU3PDmaSocketId_t)CY_U3P_PIB_SOCKET_0; dmaMultiConfig.prodSckId [1] = (CyU3PDmaSocketId_t)CY_U3P_PIB_SOCKET_1; dmaMultiConfig.consSckId [0] = (CyU3PDmaSocketId_t)(CY_U3P_UIB_SOCKET_CONS_0 | CY_FX_EP_VIDEO_CONS_SOCKET);

Roy Liu
0 点赞
zjjnsst
Level 4
Level 4
10 questions asked 25 replies posted 50 sign-ins
0 点赞