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: The delay from camera capture to eDP display is different in linux single process and multi process

Part Number: TDA4VM

plan1,capture camera data and display to eDP in single openvx process,delay is 70 ~ 80ms

plan2,capture camera data in one openvx process and  display to eDP in another  openvx process,the delay is 60 ~ 160ms,the average is 120 ~ 130ms

I am sure the sw delay from camera capture to vxProcessGraph finish in plan1 and plan2 is almost .

The the average delay of plan2 is about 50~60ms more than plan1 .  the margin of error of plan1 is about +- 5ms,but plan2 is about +-50ms. 

What is the reason? 

thanks.

  • Hi,

    Please address below queries.

    1. By single process and multi process in Plan 1 and Plan2, do you mean that in plan 1, both capture and display is in the same graph? and in plan2 capture is in one graph and display is in another?

    2. In Plan1, Does this graph only has capture node and display node?
        In Plan2, again is it only capture node in one graph and only display node in another graph?

    3. Where is the start and end point for calculating this delay? is it from output of capture node to first frame on display?

    4. In Plan 2, are you dequeuing from one graph and enqueueing into the second?

    Thanks.

  • 1.  Plan1,  capture and display  is in different  graph .  Plan2,  caputre is in one graph in process1  and display is in one graph is prcess2

    2. Yes,  only caputre node and display node in plan1 and plan2.  Plan1,  capture and display  is in  different  graph  of 1 process,   Plan2 , only capture node is in one graph  in process1,  only display node is in one graph iprocess2.

    3. I  use  the GTC timestamp to calculate the code function time consuming ,and take a  picture of ms timer and display  to calculate the capture and display delay. 

    4. In Plan2,  dequeue the capture data from caputre node  and  tivxReferenceExportHandle  in prcocess 1 ,  get it  by tivxReferenceImportHandle  and display it in process2.

    I find the delay of ipc of process1 and process2 is < 1ms,  and the time consuming  in vxProcessGraph is almost is Plan1 and Plan2 . So it is not enough to cause this problem. 

  • Hi,

    Thanks for your information and I have forwarded to the expert.

  • Hi,

    Understood the scenario in Plan 1.

    Regarding the scenario in Plan 2, Could you please clarify if it is like a producer - customer scenario between two processes where the file descriptors are being exchanged?
    Also Is it possible to share the source code in order to review it?

    Thanks and regards,

    Cherry

  • Yes, it is a server - client mode.  The  file descriptors  is exchanged by binder.

    In server process:

    vx_reference ref;

    tivx_utils_ref_ipc_msg_t ipcMsg;

    ref = (vx_reference)pmap_info->image;

    ret = tivx_utils_export_ref_for_ipc_xfer(ref, &ipcMsg);
    if (ret != VX_SUCCESS)
    {
        LOGE("tivx_utils_export_ref_for_ipc_xfer() failed for object image");

        break;
    }
    for(INT32 i=0; i<ipcMsg.numFd; i++)
    {
        fd32[i] = (int32_t)ipcMsg.fd[i];
        if(fd_desp)
        {
            fd_desp[i] = fd32[i];
        }

    send fd_desp by binder .

    In client process:

    int32_t fd[VX_IPC_MAX_VX_PLANES];
    int32_t numFd;

    vx_reference ref ;

    vx_image image;

    reveive fd by binder

    for(int32_t i =0; i<numFd; i++)
    {
        ipcMsg.fd[i] = fd[i];
    }

    ret = tivx_utils_import_ref_from_ipc_xfer(m_vxContext, &ipcMsg, &ref);
    if(ret == VX_SUCCESS)
    {
        image = (vx_image)ref;
    }

  • Thanks for your info and please expect the response until next weekday.

  • Hi,

    In this scenario, as the IPC and vxProcessGraph doesn't seem to be the issue,
    Could you measure the time when the thread is getting scheduled?
    Also the time taken from Dequeue to enqueue.

    Thanks.

  • HI, 

    I measuer the GTC time in differrnt process function. In the capture process,  as the fps is 30, the interval time of dequeue is  ablout 33.3ms, the measure interval time is same, the time taker form  dequeue to enqueue is about  40 us ~ 80 us.  I think it should be OK.

    In the display process,  I find the time of   vxProcessGraph is from  1 ms  to 21 ms  in eDP out  scenario ,  the  cycle time is about  60 s( 1800 frames),  but in n CSITx out  scenario , the time of vxProcessGraph is always about  11 ms.  It is the same in Plan1. 

    Is it a mormal condition?

    what is the difference  between  one process and muti process in tiOpenVx framework ? for example :RAM ,DMA and other HW  resource  etc . 

    thanks 

  • Thanks for your message and please expect the reply.

  • HI , Cherry

    I  find a issue about  two or more processes uses OpenVX,  

    TIOVX-1132 When two or more processes uses OpenVX, it can cause hang due to deadlock in spinlock

     Can you show the details? 

  • Hi,

    May I know where did you find this issue? Could you help post the link of it?

  • It is in  the rtos-sdk/tiovx/tiovx_release_notes.html of  SDK 08_01_00

  • Thanks and will get back to you ASAP.

  • Hi,

    The issue TIOVX-1132 was as mentioned below

    • low priority process takes spinlock
    • then high priority thread wakes up and tries to spinlock.
    • Since the spinlock is not available, it just spins/busy waits.
    • Since lower priority thread does not get chance to run, it does not releases the spinlock and higher priority thread just keeps busy waiting.

    This issue is fixed in SDK 8.1
    May I know which SDK version are you using?
    If the version is before SDK 8.1 could you try with below patch in the tiovx folder. This patch is the fix for the issue TIOVX-1132

    /cfs-file/__key/communityserver-discussions-components-files/791/TIOVX_5F00_1132_5F00_Fix.zip

  • Thanks for your reply.