This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

AM62P-Q1: How to detect frame freeze on camera video flow

Part Number: AM62P-Q1

Tool/software:

Hello TI,

Our product connect 4 cameras and 1 display.

The video pipeline is as following.

Camera1 +Camera2 + Camera3 + Camera4 --> CSI -->GPU --> DSS --> Display

The four camera images will be merge to one image by GPU and input to DSS.

We know that DSS has frame freeze detection feature.

But we can't detect frame freeze issue with DSS when one camera image flow occur frame freeze.

So , how to detect frame freeze on camera video flow?

Best regards

Chunfu

  • Hi Chunfu,

    Let me check internally and get back to you next week.

    Thank you.

    Jianzhong

  • Hi Chunfu,

    You should be able to detect CSI frame freeze by timing the DMA callback of the CSIRX driver. For example, you can add some code at this line to get the time when DMA callback is invoked: https://git.ti.com/cgit/ti-linux-kernel/ti-linux-kernel/tree/drivers/media/platform/ti/j721e-csi2rx/j721e-csi2rx.c?h=ti-linux-6.6.y#n747.

        pthread_mutex_lock(&freeze_detect_timer_mutex); 
        last_dma_callback_time = time(NULL); 
        pthread_mutex_unlock(&freeze_detect_timer_mutex); 
    

    Then in your application code, periodically check how much time is elapsed since last CSIRX DMA callback:

        current_time = time(NULL); 
        pthread_mutex_lock(&freeze_detect_timer_mutex); 
        time_elapsed = difftime(current_time, last_dma_callback_time)
        pthread_mutex_unlock(&freeze_detect_timer_mutex); 
        
        /* periodically check lapsed time since last DMA callback:
         * CSIRX_DMA_CALLBACK_TIMEOUT can be several frame durations, e.g. 16.66msec * 5
         * for 5 frames at 60fps
        */
        if(it is time to check DMA call back timeout) {
            if( time_elapsed > CSIRX_DMA_CALLBACK_TIMEOUT) {
                // CSI DMA call back time out, streaming likely frozen, take action
            }
        }

    Regards,

    Jianzhong