6 Replies Latest reply on Jul 4, 2018 3:26 AM by srdr

    DMA Reset Event: Commit buffer failure

    292502909_3132151

      Hi, I have some questions about AN75779.

      In this project,I open /*DEBUG_PRINT_FRAME_COUNT*/ like

      DEBUG_PRINT_FRAME_COUNT.jpg

       

      and the debug show

      20180621.jpg.

      and I can see the video by VirtualDub .

       

      But after normal operation for some time,the debug show:

       

       

      UVC: Completed 1289 frames and 0 buffers

      UVC: Completed 1318 frames and 37 buffers

      DMA Reset Event: Commit buffer failure

      Application Stopped

      Application Started

      UVC: Completed 0 frames and 0 buffers

      DMA Reset Event: Commit buffer failure

      Application Stopped

      Application Started

      UVC: Completed 0 frames and 0 buffers

      DMA Reset Event: Commit buffer failure

      Application Stopped

      Application Started

      UVC: Completed 0 frames and 0 buffers

      DMA Reset Event: Commit buffer failure

      Application Stopped

      Application Started

      UVC: Completed 0 frames and 0 buffers

      DMA Reset Event: Commit buffer failure

      Application Stopped

      Application Started

      UVC: Completed 0 frames and 0 buffers

      DMA Reset Event: Commit buffer failure

      Application Stopped

      Application Started

      UVC: Completed 0 frames and 0 buffers

      DMA Reset Event: Commit buffer failure

      Application Stopped

      Application Started

      UVC: Completed 0 frames and 0 buffers

      DMA Reset Event: Commit buffer failure

      Application Stopped

      Application Started

      UVC: Completed 0 frames and 0 buffers

      DMA Reset Event: Commit buffer failure

      Application Stopped

      Application Started

      UVC: Completed 0 frames and 0 buffers

      DMA Reset Event: Commit buffer failure

      Application Stopped

      Application Started

      UVC: Completed 0 frames and 0 buffers

      DMA Reset Event: Commit buffer failure

      Application Stopped

      Application Started

      UVC: Completed 0 frames and 0 buffers

      DMA Reset Event: Commit buffer failure

      Application Stopped

      Application Started

      UVC: Completed 0 frames and 0 buffers

      DMA Reset Event: Commit buffer failure

      Application Stopped

      Application Started

      UVC: Completed 0 frames and 0 buffers

      DMA Reset Event: Commit buffer failure

      Application Stopped

      Application Started

      UVC: Completed 0 frames and 0 buffers

      DMA Reset Event: Commit buffer failure

      Application Stopped

      Application Started

      UVC: Completed 0 frames and 0 buffers

      DMA Reset Event: Commit buffer failure

      Application Stopped

      Application Started

      UVC: Completed 0 frames and 0 buffers

      DMA Reset Event: Commit buffer failure

      Application Stopped

      Application Started

      UVC: Completed 0 frames and 0 buffers

      DMA Reset Event: Commit buffer failure

      Application Stopped

      Application Started

      UVC: Completed 0 frames and 0 buffers

      DMA Reset Event: Commit buffer failure

      Application Stopped

      Application Started

      UVC: Completed 0 frames and 0 buffers

      DMA Reset Event: Commit buffer failure

      Application Stopped

      Application Started

      UVC: Completed 0 frames and 0 buffers

      DMA Reset Event: Commit buffer failure

      Application Stopped

      Application Started

      UVC: Completed 0 frames and 0 buffers

      DMA Reset Event: Commit buffer failure

      Application Stopped

      Application Started

      UVC: Completed 0 frames and 0 buffers

      DMA Reset Event: Commit buffer failure

      Application Stopped

      Application Started

      UVC: Completed 0 frames and 0 buffers

      DMA Reset Event: Commit buffer failure

      Application Stopped

      Application Started

      UVC: Completed 0 frames and 0 buffers

      DMA Reset Event: Commit buffer failure

      Application Stopped

      Application Started

      UVC: Completed 0 frames and 0 buffers

      DMA Reset Event: Commit buffer failure

      Application Stopped

      Application Started

      UVC: Completed 0 frames and 0 buffers

      DMA Reset Event: Commit buffer failure

      Application Stopped

      Application Started

      UVC: Completed 0 frames and 0 buffers

      DMA Reset Event: Commit buffer failure

      Application Stopped

      Application Started

      UVC: Completed 0 frames and 0 buffers

      DMA Reset Event: Commit buffer failure

      Application Stopped

      Application Started

      UVC: Completed 0 frames and 0 buffers

      DMA Reset Event: Commit buffer failure

      Application Stopped

      Application Started

      UVC: Completed 0 frames and 0 buffers

      DMA Reset Event: Commit buffer failure

      Application Stopped

      Application Started

      UVC: Completed 0 frames and 0 buffers

      DMA Reset Event: Commit buffer failure

      Application Stopped

      Application Started

      UVC: Completed 0 frames and 0 buffers

      DMA Reset Event: Commit buffer failure

      Application Stopped

      Application Started

      UVC: Completed 0 frames and 0 buffers

      DMA Reset Event: Commit buffer failure

      Application Stopped

      Application Started

      UVC: Completed 0 frames and 0 buffers

      DMA Reset Event: Commit buffer failure

      Application Stopped

      Application Started

      UVC: Completed 0 frames and 0 buffers

      DMA Reset Event: Commit buffer failure

      Application Stopped

      Application Started

      UVC: Completed 0 frames and 0 buffers

      DMA Reset Event: Commit buffer failure

      Application Stopped

      Application Started

      UVC: Completed 0 frames and 0 buffers

      DMA Reset Event: Commit buffer failure

      Application Stopped

      Application Started

      UVC: Completed 0 frames and 0 buffers

      DMA Reset Event: Commit buffer failure

      Application Stopped

      Application Started

      UVC: Completed 0 frames and 0 buffers

      DMA Reset Event: Commit buffer failure

      Application Stopped

      Application Stopped after 40 Commit buffer failures

      UVC: Completed 0 frames and 0 buffers

      UVC: Completed 0 frames and 0 buffers

      UVC: Completed 0 frames and 0 buffers

      UVC: Completed 0 frames and 0 buffers

      UVC: Completed 0 frames and 0 buffers

      UVC: Completed 0 frames and 0 buffers

      UVC: Completed 0 frames and 0 buffers

       

       

      And no video display ......What causes this phenomenon? How can I solve this problem.

        • 2. Re: DMA Reset Event: Commit buffer failure
          292502909_3132151

          hi,srdr. I read this Invalid Sequence Error in Multi-Channel Commit Buffer - KBA218830

          and I tried 

          Set a flag (say, commit_buffer_failure) in the CyFxUvcApplnDmaCallback() function,

              when CyU3PDmaMultiChannelCommitBuffer() API fails to return CY_U3P_SUCCESS.

          • 3. Re: DMA Reset Event: Commit buffer failure
            292502909_3132151

            hi,srdr. I read this Invalid Sequence Error in Multi-Channel Commit Buffer - KBA218830

            and I tried:

            Set a flag (say, commit_buffer_failure) in the CyFxUvcApplnDmaCallback() function,

                when CyU3PDmaMultiChannelCommitBuffer() API fails to return CY_U3P_SUCCESS........

            The problem has been reduced, but sometime it will appear again.

            I want to try the plan A:Increase the DMA buffer space allocated in the firmware.

            But I don't know how to do it.Can you tell me what should i do.Or is there any other way to solve this problem?

            Thank you in advance.

            • 4. Re: DMA Reset Event: Commit buffer failure
              srdr

              Can you please share the snippet of DMA Channel creation along with MACRO definition? I will help you to modify the same.

               

              Regards,

              Sridhar

              • 5. Re: DMA Reset Event: Commit buffer failure
                292502909_3132151

                Hello,Sridhar. There

                    /* Create a DMA Manual channel for sending the video data to the USB host. */

                    dmaMultiConfig.size           = CY_FX_UVC_STREAM_BUF_SIZE;

                    dmaMultiConfig.count          = CY_FX_UVC_STREAM_BUF_COUNT;

                    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);

                    dmaMultiConfig.prodAvailCount = 0;

                    dmaMultiConfig.prodHeader     = 12;                 /* 12 byte UVC header to be added. */

                    dmaMultiConfig.prodFooter     = 4;                  /* 4 byte footer to compensate for the 12 byte header. */

                    dmaMultiConfig.consHeader     = 0;

                    dmaMultiConfig.dmaMode        = CY_U3P_DMA_MODE_BYTE;

                    dmaMultiConfig.notification   = CY_U3P_DMA_CB_PROD_EVENT | CY_U3P_DMA_CB_CONS_EVENT;

                    dmaMultiConfig.cb             = CyFxUvcApplnDmaCallback;

                    apiRetStatus = CyU3PDmaMultiChannelCreate (&glChHandleUVCStream, CY_U3P_DMA_TYPE_MANUAL_MANY_TO_ONE,

                            &dmaMultiConfig);

                    if (apiRetStatus != CY_U3P_SUCCESS)

                    {

                        /* Error handling */

                        CyU3PDebugPrint (4, "DMA Channel Creation Failed, Error Code = %d\n", apiRetStatus);

                        CyFxAppErrorHandler (apiRetStatus);

                    }

                 

                MACRO definition:

                /* UVC Video Streaming Endpoint Packet Size */

                #define CY_FX_EP_BULK_VIDEO_PKT_SIZE    (0x400)         /* 1024 Bytes */

                 

                 

                /* UVC Video Streaming Endpoint Packet Count */

                #define CY_FX_EP_BULK_VIDEO_PKTS_COUNT  (0x10)          /* 16 packets (burst of 16) per DMA buffer. */

                 

                 

                /* DMA buffer size used for video streaming. */

                #define CY_FX_UVC_STREAM_BUF_SIZE       (CY_FX_EP_BULK_VIDEO_PKTS_COUNT * CY_FX_EP_BULK_VIDEO_PKT_SIZE)  /* 16 KB */

                 

                 

                /* Maximum video data that can be accommodated in one DMA buffer. */

                #define CY_FX_UVC_BUF_FULL_SIZE         (CY_FX_UVC_STREAM_BUF_SIZE - 16)

                 

                 

                /* Number of DMA buffers per GPIF DMA thread. */

                #define CY_FX_UVC_STREAM_BUF_COUNT      (4)

                 

                Here are some other information about my sensor : Resolution 1280x720@30fps, YUV2. Use the 16 bit gpif interface for the uvc project and I switched my gpif interface from 8 bit to 16 bit, change the ADDR_COUNT_LIMITER and DATA_COUNTER_LIMITER

                to the value of 8183 in cyfxgpif2config.h by GPIF II Designer.

                 

                Thanks for your help

                 

                • 6. Re: DMA Reset Event: Commit buffer failure
                  srdr

                  Set the CY_FX_UVC_STREAM_BUF_SIZE  = 36K and CY_FX_UVC_STREAM_BUF_COUNT   = 3.

                   

                  Also modify the ADDR_COUNT_LIMITER and DATA_COUNT_LIMITER to (((36K-16) /2) -1 )

                   

                  Then modify No. of bytes device can rx in single payload in probe control structure to 0x9000 as follows:

                   

                  "0x00, 0x90, 0x00, 0x00,      /* No. of bytes device can rx in single payload = 36 KB */"