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.

TDA4AL-Q1: camera running ok, log print frame rate 0

Part Number: TDA4AL-Q1

Hi TI Team,

 

As title, ISX031 camera running ok,but fps is 0.

CPU:  c7x_2: HEAP:    DDR_LOCAL_MEM: size =   16777216 B, free =   16772608 B ( 99 % unused)
CPU:  c7x_2: HEAP:           L2_MEM: size =     458752 B, free =     458752 B (100 % unused)
CPU:  c7x_2: HEAP:           L1_MEM: size =      16384 B, free =      16384 B (100 % unused)
CPU:  c7x_2: HEAP:  DDR_SCRATCH_MEM: size =   67108864 B, free =   67108864 B (100 % unused)


GRAPH: app_multi_cam_graph (#nodes =   2, #executions =     96)
 NODE:       CAPTURE1:             capture_node: avg =  33326 usecs, min/max =  33204 /  39888 usecs, #executions =         96
 NODE:          A72-0:       capture_write_node: avg =      0 usecs, min/max =      0 /      0 usecs, #executions =         96

 PERF:           FILEIO: avg =      0 usecs, min/max = 4294967295 /      0 usecs, #executions =          0
 PERF:            TOTAL: avg =      0 usecs, min/max =      0 /      0 usecs, #executions =         98

 PERF:            TOTAL:    0. 0 FPS

 

all log is below:

autosar_12_07_1.log

 

Best Regards,

Daohong

  • Hi Daohong,

    What is capture_write_node? Is it writing capture output to some file? Does it work fine if you disable this node? 

    Yes, the capture seems to be working fine, but maybe some write_node seems to be creating problem.

    Regards,

    Brijesh

  • Hi Brijesh,

    As you said, I disabled capture_write_node, but fps is still 0

    Summary of CPU load,
    ====================
    
    CPU: mpu1_0: TOTAL LOAD =   0.26 % ( HWI =   0. 0 %, SWI =   0. 0 % )
    CPU: mcu2_0: TOTAL LOAD =  36. 0 % ( HWI =   0. 0 %, SWI =   0. 0 % )
    CPU: mcu2_1: TOTAL LOAD =  36. 0 % ( HWI =   0. 0 %, SWI =   0. 0 % )
    CPU:  c7x_1: TOTAL LOAD =   0. 0 % ( HWI =   0. 0 %, SWI =   0. 0 % )
    CPU:  c7x_2: TOTAL LOAD =   0. 0 % ( HWI =   0. 0 %, SWI =   0. 0 % )
    
    
    HWA performance statistics,
    ===========================
    
    
    
    DDR performance statistics,
    ===========================
    
    DDR: READ  BW: AVG =      3 MB/s, PEAK =   3852 MB/s
    DDR: WRITE BW: AVG =    646 MB/s, PEAK =   2361 MB/s
    DDR: TOTAL BW: AVG =    649 MB/s, PEAK =   6213 MB/s
    
    
    Detailed CPU performance/memory statistics,
    ===========================================
    
    DDR_SHARED_MEM: Alloc's: 17 alloc's of 79872216 bytes 
    DDR_SHARED_MEM: Free's : 0 free's  of 0 bytes 
    DDR_SHARED_MEM: Open's : 17 allocs  of 79872216 bytes 
    DDR_SHARED_MEM: Total size: 536870912 bytes 
    
    CPU: mcu2_0: TASK:           IPC_RX:   0. 0 %
    CPU: mcu2_0: TASK:       REMOTE_SRV:   0.31 %
    CPU: mcu2_0: TASK:        LOAD_TEST:   0. 0 %
    CPU: mcu2_0: TASK:       TIVX_CPU_0:   0. 0 %
    CPU: mcu2_0: TASK:        TIVX_V1NF:   0. 0 %
    CPU: mcu2_0: TASK:      TIVX_V1LDC1:   0. 0 %
    CPU: mcu2_0: TASK:       TIVX_V1SC1:   0. 0 %
    CPU: mcu2_0: TASK:      TIVX_V1MSC2:   0. 0 %
    CPU: mcu2_0: TASK:       TIVXVVISS1:   0. 0 %
    CPU: mcu2_0: TASK:       TIVX_CAPT1:   0. 7 %
    CPU: mcu2_0: TASK:       TIVX_CAPT2:   0. 0 %
    CPU: mcu2_0: TASK:       TIVX_DISP1:   0. 0 %
    CPU: mcu2_0: TASK:       TIVX_DISP2:   0. 0 %
    CPU: mcu2_0: TASK:       TIVX_CSITX:   0. 0 %
    CPU: mcu2_0: TASK:       TIVX_CAPT3:   0. 0 %
    CPU: mcu2_0: TASK:       TIVX_CAPT4:   0. 0 %
    CPU: mcu2_0: TASK:       TIVX_CAPT5:   0. 0 %
    CPU: mcu2_0: TASK:       TIVX_CAPT6:   0. 0 %
    CPU: mcu2_0: TASK:       TIVX_CAPT7:   0. 0 %
    CPU: mcu2_0: TASK:       TIVX_CAPT8:   0. 0 %
    CPU: mcu2_0: TASK:      TIVX_DPM2M1:   0. 0 %
    CPU: mcu2_0: TASK:      TIVX_DPM2M2:   0. 0 %
    CPU: mcu2_0: TASK:      TIVX_DPM2M3:   0. 0 %
    CPU: mcu2_0: TASK:      TIVX_DPM2M4:   0. 0 %
    
    CPU: mcu2_0: HEAP:    DDR_LOCAL_MEM: size =   16777216 B, free =   16713472 B ( 99 % unused)
    CPU: mcu2_0: HEAP:           L3_MEM: size =     524288 B, free =     524032 B ( 99 % unused)
    
    CPU: mcu2_1: TASK:           IPC_RX:   0. 0 %
    CPU: mcu2_1: TASK:       REMOTE_SRV:   0. 0 %
    CPU: mcu2_1: TASK:        LOAD_TEST:   0. 0 %
    CPU: mcu2_1: TASK:       TIVX_CPU_1:   0. 0 %
    CPU: mcu2_1: TASK:         TIVX_SDE:   0. 0 %
    CPU: mcu2_1: TASK:         TIVX_DOF:   0. 0 %
    CPU: mcu2_1: TASK:      IPC_TEST_RX:   0. 0 %
    CPU: mcu2_1: TASK:      IPC_TEST_TX:   0. 0 %
    CPU: mcu2_1: TASK:      IPC_TEST_TX:   0. 0 %
    CPU: mcu2_1: TASK:      IPC_TEST_TX:   0. 0 %
    CPU: mcu2_1: TASK:      IPC_TEST_TX:   0. 0 %
    
    CPU: mcu2_1: HEAP:    DDR_LOCAL_MEM: size =   16777216 B, free =   16773120 B ( 99 % unused)
    CPU: mcu2_1: HEAP:           L3_MEM: size =     524288 B, free =     524288 B (100 % unused)
    
    CPU:  c7x_1: TASK:           IPC_RX:   0. 0 %
    CPU:  c7x_1: TASK:       REMOTE_SRV:   0. 0 %
    CPU:  c7x_1: TASK:        LOAD_TEST:   0. 0 %
    CPU:  c7x_1: TASK:      TIVX_C71_P1:   0. 0 %
    CPU:  c7x_1: TASK:      TIVX_C71_P2:   0. 0 %
    CPU:  c7x_1: TASK:      TIVX_C71_P3:   0. 0 %
    CPU:  c7x_1: TASK:      TIVX_C71_P4:   0. 0 %
    CPU:  c7x_1: TASK:      TIVX_C71_P5:   0. 0 %
    CPU:  c7x_1: TASK:      TIVX_C71_P6:   0. 0 %
    CPU:  c7x_1: TASK:      TIVX_C71_P7:   0. 0 %
    CPU:  c7x_1: TASK:      TIVX_C71_P8:   0. 0 %
    CPU:  c7x_1: TASK:      IPC_TEST_RX:   0. 0 %
    CPU:  c7x_1: TASK:      IPC_TEST_TX:   0. 0 %
    CPU:  c7x_1: TASK:      IPC_TEST_TX:   0. 0 %
    CPU:  c7x_1: TASK:      IPC_TEST_TX:   0. 0 %
    CPU:  c7x_1: TASK:      IPC_TEST_TX:   0. 0 %
    
    CPU:  c7x_1: HEAP:    DDR_LOCAL_MEM: size =  268435456 B, free =  268435200 B ( 99 % unused)
    CPU:  c7x_1: HEAP:           L3_MEM: size =    3964928 B, free =    3964928 B (100 % unused)
    CPU:  c7x_1: HEAP:           L2_MEM: size =     458752 B, free =     458752 B (100 % unused)
    CPU:  c7x_1: HEAP:           L1_MEM: size =      16384 B, free =      16384 B (100 % unused)
    CPU:  c7x_1: HEAP:  DDR_SCRATCH_MEM: size =  385875968 B, free =  385875968 B (100 % unused)
    
    CPU:  c7x_2: TASK:           IPC_RX:   0. 0 %
    CPU:  c7x_2: TASK:       REMOTE_SRV:   0. 0 %
    CPU:  c7x_2: TASK:        LOAD_TEST:   0. 0 %
    CPU:  c7x_2: TASK:         TIVX_CPU:   0. 0 %
    CPU:  c7x_2: TASK:      IPC_TEST_RX:   0. 0 %
    CPU:  c7x_2: TASK:      IPC_TEST_TX:   0. 0 %
    CPU:  c7x_2: TASK:      IPC_TEST_TX:   0. 0 %
    CPU:  c7x_2: TASK:      IPC_TEST_TX:   0. 0 %
    CPU:  c7x_2: TASK:      IPC_TEST_TX:   0. 0 %
    
    CPU:  c7x_2: HEAP:    DDR_LOCAL_MEM: size =   16777216 B, free =   16772608 B ( 99 % unused)
    CPU:  c7x_2: HEAP:           L2_MEM: size =     458752 B, free =     458752 B (100 % unused)
    CPU:  c7x_2: HEAP:           L1_MEM: size =      16384 B, free =      16384 B (100 % unused)
    CPU:  c7x_2: HEAP:  DDR_SCRATCH_MEM: size =   67108864 B, free =   67108864 B (100 % unused)
    
    
    GRAPH: app_multi_cam_graph (#nodes =   1, #executions =     82)
     NODE:       CAPTURE1:             capture_node: avg =  33207 usecs, min/max =  33116 /  38702 usecs, #executions =         82
    
     PERF:           FILEIO: avg =      0 usecs, min/max = 4294967295 /      0 usecs, #executions =          0
     PERF:            TOTAL: avg =      0 usecs, min/max =      0 /      0 usecs, #executions =         84
    
     PERF:            TOTAL:    0. 0 FPS

    Best Regards,

    Daohong

  • Can you please check and confirm that you are using below APIs?

    appPerfPointBegin(&obj->total_perf);

    appPerfPointEnd(&obj->total_perf);

    Regards,

    Brijesh

  • Hi Brijesh,

       yes, we use  appPerfPointBegin and  appPerfPointEnd

    static vx_status app_run_graph_for_one_frame_pipeline(AppObj *obj, vx_int32 frame_id)
    {
        vx_status status = VX_SUCCESS;
    
        APP_PRINTF("app_run_graph_for_one_pipeline: frame %d beginning\n", frame_id);
        appPerfPointBegin(&obj->total_perf);
    
        ImgMosaicObj *imgMosaicObj = &obj->imgMosaicObj;
        CaptureObj *captureObj = &obj->captureObj;
    
        /* checksum_actual is the checksum determined by the realtime test
            checksum_expected is the checksum that is expected to be the pipeline output */
        uint32_t checksum_actual = 0;
    
        /* This is the number of frames required for the pipeline AWB and AE algorithms to stabilize
            (note that 15 is only required for the 6-8 camera use cases - others converge quicker) */
        uint8_t stability_frame = 15;
    
        if(obj->pipeline < 0)
        {
            /* Enqueue outpus */
            if ((obj->en_out_img_write == 1) || (obj->test_mode == 1))
            {
                status = vxGraphParameterEnqueueReadyRef(obj->graph, imgMosaicObj->graph_parameter_index, (vx_reference*)&imgMosaicObj->output_image[obj->enqueueCnt], 1);
            }
    
            /* Enqueue inputs during pipeup dont execute */
            if (status == VX_SUCCESS)
            {
                status = vxGraphParameterEnqueueReadyRef(obj->graph, captureObj->graph_parameter_index, (vx_reference*)&obj->captureObj.raw_image_arr[obj->enqueueCnt], 1);
            }
            obj->enqueueCnt++;
            obj->enqueueCnt   = (obj->enqueueCnt  >= CAPTURE_BUFFER_Q_DEPTH)? 0 : obj->enqueueCnt;
            obj->pipeline++;
        }
    
        if((obj->pipeline == 0) && (status == VX_SUCCESS))
        {
            if((obj->en_out_img_write == 1) || (obj->test_mode == 1))
            {
                status = vxGraphParameterEnqueueReadyRef(obj->graph, imgMosaicObj->graph_parameter_index, (vx_reference*)&imgMosaicObj->output_image[obj->enqueueCnt], 1);
            }
    
            /* Execute 1st frame */
            if(status == VX_SUCCESS)
            {
                status = vxGraphParameterEnqueueReadyRef(obj->graph, captureObj->graph_parameter_index, (vx_reference*)&obj->captureObj.raw_image_arr[obj->enqueueCnt], 1);
            }
            obj->enqueueCnt++;
            obj->enqueueCnt   = (obj->enqueueCnt  >= CAPTURE_BUFFER_Q_DEPTH)? 0 : obj->enqueueCnt;
            obj->pipeline++;
        }
    
        if((obj->pipeline > 0) && (status == VX_SUCCESS))
        {
            vx_object_array capture_input_arr;
            vx_image mosaic_output_image;
            uint32_t num_refs;
    
            /* Dequeue input */
            status = vxGraphParameterDequeueDoneRef(obj->graph, captureObj->graph_parameter_index, (vx_reference*)&capture_input_arr, 1, &num_refs);
    
            if ((obj->en_out_3rd_write == 1) && (obj->write_file == 1)) {
                if (status == VX_SUCCESS)
                {
                    vx_size num_items;
                    vx_status status = vxQueryObjectArray((vx_object_array)capture_input_arr, VX_OBJECT_ARRAY_NUMITEMS, &num_items, sizeof(vx_size));
                    printf("--frame = %d --status = %d, num_items = %ld\n",  frame_id, status, num_items);
                    if (status == VX_SUCCESS)
                    {
                        for (int index = 0; index < num_items; index++)
                        {
                            vx_image image = (vx_image)vxGetObjectArrayItem(capture_input_arr, index);
                            //writeRawImage(obj->output_file_path, (tivx_raw_image) image, frame_id, index);
                            writeYUVImage(obj->output_file_path, image, frame_id, index);
                            // vxReleaseImage(&image);
                        }
                    }
                }
            }
    
            if((obj->en_out_img_write == 1) || (obj->test_mode == 1))
            {
                vx_char output_file_name[APP_MAX_FILE_PATH];
    
                /* Dequeue output */
                if (status == VX_SUCCESS)
                {
                    status = vxGraphParameterDequeueDoneRef(obj->graph, imgMosaicObj->graph_parameter_index, (vx_reference*)&mosaic_output_image, 1, &num_refs);
                }
                if ((status == VX_SUCCESS) && (obj->test_mode == 1) && (frame_id > TEST_BUFFER))
                {
                    /* calculate the checksum of the mosaic output */
    
                    if ((app_test_check_image(mosaic_output_image, checksums_expected[obj->sensorObj.sensor_index][obj->sensorObj.num_cameras_enabled-1],
                                            &checksum_actual) != vx_true_e) && (frame_id > stability_frame))
                    {
                        test_result = vx_false_e;
                        /* in case test fails and needs to change */
                        populate_gatherer(obj->sensorObj.sensor_index, obj->sensorObj.num_cameras_enabled-1, checksum_actual);
                    }
                }
    
                if (obj->en_out_img_write == 1) {
                    appPerfPointBegin(&obj->fileio_perf);
                    snprintf(output_file_name, APP_MAX_FILE_PATH, "%s/mosaic_output_%010d_%dx%d.yuv", obj->output_file_path, (frame_id - CAPTURE_BUFFER_Q_DEPTH), imgMosaicObj->out_width, imgMosaicObj->out_height);
                    if (status == VX_SUCCESS)
                    {
                        status = writeMosaicOutput(output_file_name, mosaic_output_image);
                    }
                    appPerfPointEnd(&obj->fileio_perf);
                }
                /* Enqueue output */
                if (status == VX_SUCCESS)
                {
                    status = vxGraphParameterEnqueueReadyRef(obj->graph, imgMosaicObj->graph_parameter_index, (vx_reference*)&mosaic_output_image, 1);
                }
            }
    
            /* Enqueue input - start execution */
            if (status == VX_SUCCESS)
            {
                status = vxGraphParameterEnqueueReadyRef(obj->graph, captureObj->graph_parameter_index, (vx_reference*)&capture_input_arr, 1);
            }
            obj->enqueueCnt++;
            obj->dequeueCnt++;
    
            obj->enqueueCnt = (obj->enqueueCnt >= CAPTURE_BUFFER_Q_DEPTH)? 0 : obj->enqueueCnt;
            obj->dequeueCnt = (obj->dequeueCnt >= CAPTURE_BUFFER_Q_DEPTH)? 0 : obj->dequeueCnt;
        }
    
        appPerfPointEnd(&obj->total_perf);

  • Hi Qin,

    Total FPS is calculating using appPerfPointBegin and  appPerfPointEnd APIs, so if you are calling these APIs and capture is running fine and capture output is graph parameter, we should get exactly matching Total FPS. 

    Can you try getting dequeue period, vxGraphParameterDequeueDoneRef?, maybe somehow, it is so small that avg is becoming 0 and so it is printing fps as 0. How many buffers are you allocating for the capture output and are you printing the graph performance after running it for sufficiently larger time?  

    Regards,

    Brijesh

  • Hi Brijesh,

    gets the Time,but the time is 0,begin_time and end_time is 0

    static vx_status app_run_graph_for_one_frame_pipeline(AppObj *obj, vx_int32 frame_id)
    {
        vx_status status = VX_SUCCESS;
        uint64_t frame_begin_time = 0;
        uint64_t frame_end_time = 0;
        // APP_PRINTF("app_run_graph_for_one_pipeline: frame %d beginning\n", frame_id);
        APP_PRINTF("app_run_graph_for_one_pipeline: frame %d beginning, obj->pipeline = %d, en_out_img_write = %d, enqueueCnt = %d,  \n",
            frame_id, obj->pipeline, obj->en_out_img_write, obj->enqueueCnt);
        appPerfPointBegin(&obj->total_perf);
    
    
    
        frame_begin_time = appLogGetTimeInUsec();
    //
        printf("frame_begin_time = %ld!!!\n",frame_begin_time);
    
        ImgMosaicObj *imgMosaicObj = &obj->imgMosaicObj;
        CaptureObj *captureObj = &obj->captureObj;
    
        /* checksum_actual is the checksum determined by the realtime test
            checksum_expected is the checksum that is expected to be the pipeline output */
        uint32_t checksum_actual = 0;
    
        /* This is the number of frames required for the pipeline AWB and AE algorithms to stabilize
            (note that 15 is only required for the 6-8 camera use cases - others converge quicker) */
        uint8_t stability_frame = 15;
    
        if(obj->pipeline < 0)
        {
            /* Enqueue outpus */
            if ((obj->en_out_img_write == 1) || (obj->test_mode == 1))
            {
                status = vxGraphParameterEnqueueReadyRef(obj->graph, imgMosaicObj->graph_parameter_index, (vx_reference*)&imgMosaicObj->output_image[obj->enqueueCnt], 1);
            }
    
            /* Enqueue inputs during pipeup dont execute */
            if (status == VX_SUCCESS)
            {
                status = vxGraphParameterEnqueueReadyRef(obj->graph, captureObj->graph_parameter_index, (vx_reference*)&obj->captureObj.raw_image_arr[obj->enqueueCnt], 1);
            }
            obj->enqueueCnt++;
            obj->enqueueCnt   = (obj->enqueueCnt  >= CAPTURE_BUFFER_Q_DEPTH)? 0 : obj->enqueueCnt;
            obj->pipeline++;
        }
    
        if((obj->pipeline == 0) && (status == VX_SUCCESS))
        {
            if((obj->en_out_img_write == 1) || (obj->test_mode == 1))
            {
                status = vxGraphParameterEnqueueReadyRef(obj->graph, imgMosaicObj->graph_parameter_index, (vx_reference*)&imgMosaicObj->output_image[obj->enqueueCnt], 1);
            }
    
            /* Execute 1st frame */
            if(status == VX_SUCCESS)
            {
                status = vxGraphParameterEnqueueReadyRef(obj->graph, captureObj->graph_parameter_index, (vx_reference*)&obj->captureObj.raw_image_arr[obj->enqueueCnt], 1);
            }
            obj->enqueueCnt++;
            obj->enqueueCnt   = (obj->enqueueCnt  >= CAPTURE_BUFFER_Q_DEPTH)? 0 : obj->enqueueCnt;
            obj->pipeline++;
        }
    
        if((obj->pipeline > 0) && (status == VX_SUCCESS))
        {
            vx_object_array capture_input_arr;
            vx_image mosaic_output_image;
            uint32_t num_refs;
    
            /* Dequeue input */
            status = vxGraphParameterDequeueDoneRef(obj->graph, captureObj->graph_parameter_index, (vx_reference*)&capture_input_arr, 1, &num_refs);
    
            if ((obj->en_out_3rd_write == 1) && (obj->write_file == 1)) {
                if (status == VX_SUCCESS)
                {
                    vx_size num_items;
                    vx_status status = vxQueryObjectArray((vx_object_array)capture_input_arr, VX_OBJECT_ARRAY_NUMITEMS, &num_items, sizeof(vx_size));
                    printf("--frame = %d --status = %d, num_items = %ld\n",  frame_id, status, num_items);
                    if (status == VX_SUCCESS)
                    {
                        for (int index = 0; index < num_items; index++)
                        {
                            vx_image image = (vx_image)vxGetObjectArrayItem(capture_input_arr, index);
                            //writeRawImage(obj->output_file_path, (tivx_raw_image) image, frame_id, index);
                            writeYUVImage(obj->output_file_path, image, frame_id, index);
                            // vxReleaseImage(&image);
                        }
                    }
                }
            }
    
            if((obj->en_out_img_write == 1) || (obj->test_mode == 1))
            {
                vx_char output_file_name[APP_MAX_FILE_PATH];
    
                /* Dequeue output */
                if (status == VX_SUCCESS)
                {
                    status = vxGraphParameterDequeueDoneRef(obj->graph, imgMosaicObj->graph_parameter_index, (vx_reference*)&mosaic_output_image, 1, &num_refs);
                }
                if ((status == VX_SUCCESS) && (obj->test_mode == 1) && (frame_id > TEST_BUFFER))
                {
                    /* calculate the checksum of the mosaic output */
    
                    if ((app_test_check_image(mosaic_output_image, checksums_expected[obj->sensorObj.sensor_index][obj->sensorObj.num_cameras_enabled-1],
                                            &checksum_actual) != vx_true_e) && (frame_id > stability_frame))
                    {
                        test_result = vx_false_e;
                        /* in case test fails and needs to change */
                        populate_gatherer(obj->sensorObj.sensor_index, obj->sensorObj.num_cameras_enabled-1, checksum_actual);
                    }
                }
    
                if (obj->en_out_img_write == 1) {
                    appPerfPointBegin(&obj->fileio_perf);
                    snprintf(output_file_name, APP_MAX_FILE_PATH, "%s/mosaic_output_%010d_%dx%d.yuv", obj->output_file_path, (frame_id - CAPTURE_BUFFER_Q_DEPTH), imgMosaicObj->out_width, imgMosaicObj->out_height);
                    if (status == VX_SUCCESS)
                    {
                        status = writeMosaicOutput(output_file_name, mosaic_output_image);
                    }
                    appPerfPointEnd(&obj->fileio_perf);
                }
                /* Enqueue output */
                if (status == VX_SUCCESS)
                {
                    status = vxGraphParameterEnqueueReadyRef(obj->graph, imgMosaicObj->graph_parameter_index, (vx_reference*)&mosaic_output_image, 1);
                }
            }
    
            /* Enqueue input - start execution */
            if (status == VX_SUCCESS)
            {
                status = vxGraphParameterEnqueueReadyRef(obj->graph, captureObj->graph_parameter_index, (vx_reference*)&capture_input_arr, 1);
            }
            obj->enqueueCnt++;
            obj->dequeueCnt++;
    
            obj->enqueueCnt = (obj->enqueueCnt >= CAPTURE_BUFFER_Q_DEPTH)? 0 : obj->enqueueCnt;
            obj->dequeueCnt = (obj->dequeueCnt >= CAPTURE_BUFFER_Q_DEPTH)? 0 : obj->dequeueCnt;
        }
    
        frame_end_time = appLogGetTimeInUsec();
        appPerfPointEnd(&obj->total_perf);
        printf("frame_end_time = %ld!!!\n",frame_end_time);
        
        printf("Time = %lu!!!!\n",frame_end_time - frame_begin_time);
    
    #if 0
        if(frame_end_time - frame_begin_time > 1000*1000ull/30*3)
        {
            g_frame_lost_times++;
            APP_PRINTF("[APP][Multi] PERF total consecutive 2 frames lost %d times\n",g_frame_lost_times);
        }
        if(frame_end_time - frame_begin_time > 1000*1000ull/30*2)
        {
            g_frame_lost_num++;
            g_frame_lost_rate[0] = (g_frame_lost_num*10000)/(obj->total_perf.num)/100;
            g_frame_lost_rate[1] = ((g_frame_lost_num*10000)/(obj->total_perf.num))%100;
            APP_PRINTF("[APP][Multi] PERF total frame lost num is %d,frame lost rate is %d.%d\n",g_frame_lost_num,g_frame_lost_rate[0],g_frame_lost_rate[1]);
        }
        else
        {
            g_frame_lost_rate[0] = (g_frame_lost_num*10000)/(obj->total_perf.num)/100;
            g_frame_lost_rate[1] = ((g_frame_lost_num*10000)/(obj->total_perf.num))%100;
        }
    
        //mask Multi_fps          : 0x0011xxxx
        //mask Multi_lost_rate    : 0x0012xxxx
        //mask Multi_lost_times   : 0x0014xxxx
    
        //send ipc msg about camera_info per 30 frame to mcu1_0
        if((frame_id%30) == 0)
        {
    
            com_data_t send_data;
            memset(&send_data, 0, sizeof(com_data_t));    
            uint32_t fps[2]={0,0};
    
            appPerfPointGetFPS(fps,&obj->total_perf);
    
            fps[0] &= 0x000000ff;
            fps[1] &= 0x000000ff;
    
    //        APP_PRINTF("[APP][Multi] perf geted fps[0] = %d ,fps[1] = %d\n",fps[0],fps[1]);
            uint32_t msg_fps = (fps[0] | (fps[1]<< 8));
    
            send_data.data.playload = (msg_fps & 0x0000ffff) | 0x00110000;
            status = appIpcSendNotify(1/*mcu1_0*/, &send_data, sizeof(com_data_t));
    //        APP_PRINTF("[APP][Multi] IPC:CPU[%s] Sent msg_fps 0x%x to CPU [%s],status is %d\n", appIpcGetCpuName(0),msg_fps, appIpcGetCpuName(1),status);
            
            uint32_t msg_lost_rate = ((g_frame_lost_rate[0] & 0x000000ff) | ((g_frame_lost_rate[1] & 0x000000ff) << 8));
    
            send_data.data.playload = (msg_lost_rate & 0x0000ffff) | 0x00120000;
            status = appIpcSendNotify(1, &send_data, sizeof(com_data_t));
    //        APP_PRINTF("[APP][Multi]IPC:CPU[%s] Sent msg_lost_rate 0x%x to CPU [%s],status is %d\n", appIpcGetCpuName(0),msg_lost_rate, appIpcGetCpuName(1),status);
    
            uint32_t msg_lost_times = (g_frame_lost_times & 0x000000ff);
            send_data.data.playload = (msg_lost_times | 0x00140000);
            status = appIpcSendNotify(1, &send_data, sizeof(com_data_t));
    //        APP_PRINTF("[APP][Multi] IPC:CPU[%s] Sent msg_lost_times 0x%x to CPU [%s],status is %d\n", appIpcGetCpuName(0),msg_lost_times, appIpcGetCpuName(1),status);
        }
    
        //reset perf count per 150 frames (5s)
        if(frame_id%150 == 0)
        {
            APP_PRINTF("[APP][Multi] reset perf count and frame lost num/rate count in frame No %d\n",frame_id);
            appPerfPointReset(&obj->total_perf);
            g_frame_lost_num = 0;
            g_frame_lost_rate[0] = 0;
            g_frame_lost_rate[1] = 0;
        }
    #endif
        return status;
    }

  • Hi Qin,

    Can you please check if APP_LOG_USE_GLOBAL_TIME macro is enabled in utils/console_io/src/app_log_linux.c file and GTC is running? You can check the status of GTC at offset 0xA90000.

    Regards,

    Brijesh 

  • Hi Brijesh,

    APP_LOG_USE_GLOBAL_TIME macro is disenabled

    Regards,

    Daohong

  • Hi Qin,

    Can you please enable this macro and then try it out?

    Not sure why this macro is disabled. It should have been enabled even on Linux by default in SDK.

    Regards,

    Brijesh 

  • Hi Brijesh,

    I'm sorry,but  time is till 0 after I enable this macro.

    Regards,

    Daohong

  • ok, then can you check if GTC timer is running? Please share the value at 0xA90000 offset. 

    Regards,

    Brijesh

  • Hi Brijesh

        How to get  0xA90000 offset value ?   Is there any example ?

  • Hi Qin,

    You can use devmem2 or k3conf utility to get its value. I am suspecting that GTC is not running and so fps is 0. So lets make sure first that GTC is running.

    Regards,

    Brijesh

  • Hi brijesh, 

         Thank you very much, We will check it self