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.

TDA4VM: FVID csirx

Part Number: TDA4VM

Tool/software:

HI TI

Software Platform: ti-processor-sdk-rtos-j721e-evm-08_01_00_13

We would like to monitor the frame rate of the surround-view cameras within the FVID and Csirx driver modules. When FVID or Csirx fails to receive data from the cameras, we need MCU2_0 to output relevant logs. The purpose is to facilitate problem location when the application layer does not receive the frame rate information.

Could you please advise on how to add the relevant logs?

Thank you.

  • Hi, 

    Inside the capture node target implementation, i.e. in ${PSDKRA}/video_io/kernels/video_io/capture/vx_capture_target.c , in the function tivxCaptureProcess(), you can see timestamp being associated with every capture instance. 

    This timestamp could be used to begin with.

    Also, there a captDrvCallback() in the same file. This is a callback function from the DMA completion from the driver. i.e. everytime a DMA completion happens for a frame from a sensor, this is called. You can track the fps here too.

    These are 2 places in the TIOVX capture node, where you can track fps of R5 core.

    Regards,

    Nikhil

  • HI TI

    Please, could you specify how to add code to this function to implement monitoring of the driver's frame rate? Could you provide a patch? Thank you.

    static vx_status VX_CALLBACK tivxCaptureProcess(
        tivx_target_kernel_instance kernel,
         tivx_obj_desc_t* obj_desc[],
        uint16_t num_params, void* priv_arg)
    {
        vx_status status = (vx_status)VX_SUCCESS;
        tivxCaptureParams* prms = NULL;
        tivx_obj_desc_object_array_t* output_desc;
        vx_uint32 size, chId = 0U;
        vx_enum state;
        uint64_t timestamp = 0U;
        uint8_t timeoutExceeded = CAPTURE_TIMEOUT_VALID;
    
            if ((num_params != TIVX_KERNEL_CAPTURE_MAX_PARAMS)
            || (NULL == obj_desc[TIVX_KERNEL_CAPTURE_INPUT_ARR_IDX])
            || (NULL == obj_desc[TIVX_KERNEL_CAPTURE_OUTPUT_IDX])
            )
        {
            status = (vx_status)VX_FAILURE;
        }
        
        ......
    }
        

  • Hi,

    To begin with, can you print the value of "obj_desc[TIVX_KERNEL_CAPTURE_OUTPUT_IDX]->timestamp" at the location below in this function?

    Check the value printed on the console and see if the difference between the prev and the curr value is 33 msec

    With this you can calculate the FPS of the capture on R5 core.

    Regards,

    Nikhil

  • Hi TI,

    After conducting experiments based on the timestamp logging you previously suggested, I found that the logs are generated at the application level (TIOVX application). However, this is not what I intended to investigate, as the timestamp logs are of little significance when the application malfunctions, providing no help for troubleshooting.

    What I aim to do is to add logs for frame rate monitoring at the driver level, ensuring that the driver (low-level software) is functioning correctly and receiving data (frames).

    For instance, logs for interrupts, registers, CSIRX, etc.

  • Hi,

    Sorry, I did not understand your requirement here. 

    The earlier said piece of code runs on the MCU2_0 and currently the logs you see on the terminal is being read from a buffer in the DDR.

    This is how the SDK prints out the remote core logs. 

    May I know what do you mean by logs as per your usecase? How and where do you want to view this?

    Regards,

    Nikhil

  • HI TI

    I want to obtain the frame rate at the driver level, with the software architecture as shown in the diagram below. Whenever MIPI outputs a frame to the platform, the platform driver should be able to capture the frame rate.

  • Hi,

    The same timestamp mentioned above is also available in the driver as well, which you could use to calculate the FPS 

    Please check the variable "timeStamp = gCsirxCommonObj.getTimeStamp(NULL);" in  CsirxDrv_udmaCQEventCb() in PDK/packages/ti/drv/csirx/src/csirx_drvUdma.c

    Regards,

    Nikhil