7 Replies Latest reply on May 25, 2020 11:55 PM by YiZ_31

    CX3 DMA callback error when increasing frame rate

    xixi_4541316

       

       

      I use the cycx3_uvc_ov5640 project example in the CX3 platform (SDK1.3.3) for development. The sensor information is Raw10, its resolution is 1152 * 852, and the MIPI rate is 600M. When the frame time reduces from 25ms to 7ms per frame, the DMA callback is abnormal, and the abnormal log is as follows: glDMATxCount = 13 glDmaDone = 1, the normal log should be glDMATxCount = 0 glDmaDone = 0, because I read the two values after the frame transfer is completed. After an abnormal value occurs, the DMA callback function no longer enters,and the firmware is stuck and must be reloaded. There are no other exception logs such as "DMA commit buf fail". And the sensor is still working well.Does the DMA channel have time or data limit? How to modify or configure it? The attachment is the application code.

       


       

       

      328/5000

       

      Thanks,

      wader

        • 1. Re: CX3 DMA callback error when increasing frame rate
          YiZ_31

          Hi,

           

          当7ms每帧的时候也就是帧率达到了142fps

          您有根据这个公式计算过? 4lane MIPI最大带宽不超过2.4Gbps

          Image throughput = bits per pixel × (Horizontal resolution + Horizontal blanking) × (Vertical resolution + vertical blanking) × frames per second

          • 2. Re: CX3 DMA callback error when increasing frame rate
            xixi_4541316

            Hi,

                 感谢回答,确实没关注GPIF最大带宽2.4Gbps限制问题,实际帧率需要再确认一下。7ms是我统计sensor出图的时间,实际时间受PC端算法的影响,应用方式是PC端触发,sensor再采图。

            • 3. Re: CX3 DMA callback error when increasing frame rate
              YiZ_31

              可以量一下行场信号的波形

              • 4. Re: CX3 DMA callback error when increasing frame rate
                xixi_4541316

                关于帧率,我们的应用是:”sensor连续出6帧+pc algo处理“,循环操作,总时间应该是6*7+10=52ms,数据量应该远小于GPIF带宽2.4Gbps。

                出现问题的现象是:概率性glDMATxCount、glDmaDone不为0,也就是DMA生产者、消费者事件次数不一致或是事件次数未满一帧,此时sensor还在连续出图,行场信号正常。

                解决方法:只有CX3中reset DMA操作才能恢复收图

                这个现象在有些开发板上不明显,有些概率比较高(采图时间从25ms降低到7ms),所以想请教一下问题的原因是什么?DMA这块设置是否有限制或是优化的选项?

                • 5. Re: CX3 DMA callback error when increasing frame rate
                  YiZ_31

                  Hi,

                   

                  你可以发一下你具体的log吗?

                  发生这种现象时,图像传输会卡住?还是只是丢帧?

                  • 6. Re: CX3 DMA callback error when increasing frame rate
                    xixi_4541316

                    出现DMA错误时日志如下:

                    last glDMATxCount=0 glDmaDone=0!!!   //6帧采完打印一次,正常值均为0,由DMA callback函数采完一帧时清0

                    gFrameg_frame_trans_cnt [3168] frames!!!   //固件中打印当前采集的帧数,每次增加6帧

                    HollywoodB: capture image by different mode

                    [10:59:56.365]

                    Normal image capture [6] phase!!!

                    dma rest: 0, reset time = 0!!!

                    last glDMATxCount=4 glDmaDone=0!!!   //出现异常时的DMA callback次数,一帧是27次

                    gFrameg_frame_trans_cnt [3173] frames!!!  //只收到5帧

                    HollywoodB: capture image by different mode

                    [10:59:57.440]

                    Normal image capture [6] phase!!!  //PC下发采图命令

                    dma rest: 0, reset time = 0!!!

                    last glDMATxCount=22 glDmaDone=-1!!!  //glDmaDone=-1表示DMA callback生产者和消费者次数不匹配

                    gFrameg_frame_trans_cnt [3173] frames!!! //帧数未增加,DMA卡死,此时量sensor行场信号是正常的。

                    HollywoodB: capture image by different mode

                    [10:59:58.534]

                    Normal image capture [6] phase!!!

                    dma rest: 0, reset time = 0!!!

                    last glDMATxCount=0 glDmaDone=0!!!

                    gFrameg_frame_trans_cnt [3173] frames!!!

                    HollywoodB: capture image by different mode

                    [10:59:59.611]

                    Normal image capture [6] phase!!!

                    dma rest: 0, reset time = 0!!!

                     

                    看起来是先丢帧然后引起卡死,“CyU3PDmaMultiChannelCommitBuffer ”这个函数没看到调用失败。

                    以上信息请参考~

                    • 7. Re: CX3 DMA callback error when increasing frame rate
                      YiZ_31

                      正常来说我们处理Prod与Cons不匹配的方法就是进行DMA reset。但是DMA reset只是会引起丢帧,但是不会卡死。