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 TDA4 program blocks in tivxNodeSendCommand

Part Number: TDA4VM

Dear experts,

We are work on the TDA4VM , and the SDK version is '0703".

Our graph is as below:

Video Graph (60fps) : capture Node -> display Node1-> display Node2

The video graph was running in the separate thread(task).

We gave the flag to the video graph task in another task per 50 ms(touch handle task).

The App will block in the tivxNodeSendCommand sometimes.But the other tasks were running well.

So , could you give me some advices or selutions?

Thanks !

  • Dear experts,

    We are work on the TDA4VM , and the SDK version is '0703".

    Our graph is as below:

    Video Graph (60fps) : capture Node -> display Node1-> display Node2

    The video graph was running in the separate thread(task).

    We gave the flag to the video graph task in another task per 50 ms(touch handle task).

    The video graph task will execute the “tivxNodeSendCommand” to send crop paramaters to the two display nodes.

    The App will block in the tivxNodeSendCommand sometimes durning working . But the other tasks were running well.

    So , could you give me some advices or selutions?

    Thanks !

  • Hi Wang,

    Does it get stalled/blocked permanently? 

    Since display node and this API to change parameters are running in the same task, when display task is running, this command processing might get delayed. But it will not blocked, depending on your frame time period, it might be blocked for 1 or 2 frame time period. 

    Regards,

    Brijesh

  • Hi Brijesh,

    It will got stalled and the video graph got stopped.

    I was wondering that is the IPC stopped working.(How to check it or some other methods?)

    Regards

  • Hi Wang,

    But does it get unblocked, lets say, after few ms? 

    Since this is a blocking call, so if due to some reason, display node crashed, then graph would stop. Are you seeing some crash on mcu2_0? 

    Regards,

    Brijesh

  • Hi Brijesh,

    But does it get unblocked, lets say, after few ms? 

    No,it will got stalled all the time utill A72 reboot.

    I've checked the MCU2_0 logs , these is no information about the crash on mcu2_0.

     Regards

  • Hi Wang,

    But is mcu2_0 still running? Lets say is your other display still running fine, when this issue comes? I mean is it still updating frames, or the other graph is stuck to one frame? 

    Can you please tell what all parameters are you changing with this ioctl? Also what's value that you are changing? 

    Regards,

    Brijesh 

  • Hi Brijesh,

    All the cores were working well . 

    Also , we use the Draw2D to display some icons in another separate thread(task).

    When the video graph  got stalled , the Draw2D was working well.(The icons could be changed)

    The paramaters about crop are as below:

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    params->cropPrms.width = zoom->targetWidth;
    params->cropPrms.height = zoom->targetHeight;
    params->cropPrms.startX = zoom->targetPosX;
    params->cropPrms.startY = zoom->targetPosY;
    vx_user_data_object crop_obj = vxCreateUserDataObject(context, "tivx_display_crop_params_t", sizeof(tivx_display_crop_params_t), &params->cropPrms);
    vxCopyUserDataObject(crop_obj, 0,
    sizeof(tivx_display_crop_params_t),
    &params->cropPrms, VX_WRITE_ONLY, VX_MEMORY_TYPE_HOST);
    refs[0] = (vx_reference)crop_obj;
    status = VX_FAILURE;
    printf("tivxNodeSendCommand begin\r\n");
    status = tivxNodeSendCommand(node, 0, TIVX_DISPLAY_SET_CROP_PARAMS,
    refs, 1u);
    printf("tivxNodeSendCommand end\r\n");
    vxReleaseUserDataObject(&crop_obj);
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    And the crop paramaters will be modified per 50ms.(Zoom In and Zoom out)

    Best !

  • Hi Brijesh,

    I did some test early in the morning.

    1、I created another separate task to send the display crop paramaters per 50ms(if the send command flag is active).

    The video graph task still got stalled at the function "tivxNodeSendCommand".

    Here is the MCU2_0 logs:

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    [MCU2_0] 1.849994 s: CIO: Init ... Done !!!
    [MCU2_0] 1.850064 s: ### CPU Frequency <ORG = 1000000000 Hz>, <NEW = 1000000000 Hz>
    [MCU2_0] 1.850108 s: APP: Init ... !!!
    [MCU2_0] 1.850124 s: MCU2_0 version is V7.02.006... !!!
    [MCU2_0] 1.850144 s: SCICLIENT: Init ... !!!
    [MCU2_0] 1.850347 s: SCICLIENT: DMSC FW version [21.1.1--v2021.01a (Terrific Lla]
    [MCU2_0] 1.850382 s: SCICLIENT: DMSC FW revision 0x15
    [MCU2_0] 1.850406 s: SCICLIENT: DMSC FW ABI revision 3.1
    [MCU2_0] 1.850428 s: SCICLIENT: Init ... Done !!!
    [MCU2_0] 1.850447 s: UDMA: Init ... !!!
    [MCU2_0] 1.851655 s: UDMA: Init ... Done !!!
    [MCU2_0] 1.851700 s: MEM: Init ... !!!
    [MCU2_0] 1.851733 s: MEM: Created heap (DDR_SHARED_MEM, id=0, flags=0x00000004) @ e1000000 of size 16777216 bytes !!!
    [MCU2_0] 1.851785 s: MEM: Created heap (L3_MEM, id=1, flags=0x00000000) @ 3600000 of size 131072 bytes !!!
    [MCU2_0] 1.851827 s: MEM: Created heap (DDR_NON_CACHE_ME, id=5, flags=0x00000000) @ d8000000 of size 16777216 bytes !!!
    [MCU2_0] 1.851869 s: MEM: Init ... Done !!!
    [MCU2_0] 1.851887 s: IPC: Init ... !!!
    [MCU2_0] 1.851914 s: IPC: 9 CPUs participating in IPC !!!
    [MCU2_0] 1.851949 s: IPC: Waiting for HLOS to be ready ... !!!
    [MCU2_0] 1.851972 s: cpu_id=0 check 0
    [MCU2_0] 16.025942 s: cpu_id=1 check 1
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    2、Also I tried to run the "/opt/vision_apps/vx_app_arm_ipc.out", and enter '1' , the log is ad below:

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    root@j7-evm:/opt/vision_apps# ./vx_app_arm_ipc.out
    APP: Init ... !!!
    MEM: Init ... !!!
    MEM: Initialized DMA HEAP (fd=4) !!!
    MEM: Init ... Done !!!
    IPC: Init ... !!!
    IPC: Init ... Done !!!
    REMOTE_SERVICE: Init ... !!!
    REMOTE_SERVICE: Init ... Done !!!
    0.000000 s: GTC Frequency = 0 MHz
    APP: Init ... Done !!!
    0.000000 s: VX_ZONE_INIT:Enabled
    0.000000 s: VX_ZONE_ERROR:Enabled
    0.000000 s: VX_ZONE_WARNING:Enabled
    0.000000 s: VX_ZONE_INIT:[tivxInit:71] Initialization Done !!!
    0.000000 s: VX_ZONE_INIT:[tivxHostInit:48] Initialization Done for HOST !!!
    input formate:
    1:MPU
    2:MCU2_0
    3:MCU2_1
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    Please help us to solve this problem , thanks!

    Best !

  • Hi Wang, 

    1、I created another separate task to send the display crop paramaters per 50ms(if the send command flag is active).

    In this test, are you also changing crop parameters? Can you please keep the crop parameters same for every iterations?

    Regards,

    Brijesh 

  • Hi Brijesh,

    1、In this test, are you also changing crop parameters? 

    Yes , I changed the paramaters per 50ms.

    2、Can you please keep the crop parameters same for every iterations?

    I tried to keep the paramaters same for every iteration , it still got stalled.

    Best !

  • Hi Wang,

    Strange. Btw, cropping was not supported on SDK7.3, have you added it? 

    Also do you have CCS + JTAG to connect mcu2_0 and see where it is stuck? 

    If not, can you please add some debug prints in the debug control command in display node implementation and see where it is stuck?

    Regards,

    Brijesh

  • Hello Brijesh,

    Strange. Btw, cropping was not supported on SDK7.3, have you added it? 

    Yes , We asked that question in an earlier post here.

    I added some logs to the A72 core and mcu2_0 today.

    Finally , I found that it got stalled at "./ti/tiovx/source/framework/vx_context.c" -> ownContextSendControlCmd -> line 655(status = tivxEventWait(cmd_ack_event, timeout);)

    And on mcu2_0 , it could get the corp paramaters in the function "tivxDisplayControl " . Also , the mcu2_0 core was working well.

    The codes and logs are as below:

    A72 codes:

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    obj_desc_cmd->cmd_id = (vx_enum)TIVX_CMD_NODE_CONTROL;
    obj_desc_cmd->dst_target_id = target_id;
    obj_desc_cmd->src_target_id =
    (uint32_t)tivxPlatformGetTargetId(TIVX_TARGET_HOST);
    obj_desc_cmd->num_obj_desc = 1u;
    obj_desc_cmd->obj_desc_id[0u] = node_obj_desc;
    obj_desc_cmd->flags = TIVX_CMD_FLAG_SEND_ACK;
    obj_desc_cmd->ack_event_handle = (uint64_t)(uintptr_t)cmd_ack_event;
    obj_desc_cmd->replicated_node_idx = (int32_t)replicated_node_idx;
    obj_desc_cmd->node_cmd_id = node_cmd_id;
    obj_desc_cmd->num_cmd_params = num_obj_desc;
    for (i = 0; i < num_obj_desc; i ++)
    {
    obj_desc_cmd->cmd_params_desc_id[i] = obj_desc_id[i];
    }
    status = tivxObjDescSend(target_id, obj_desc_cmd->base.obj_desc_id);
    if (status == (vx_status)VX_SUCCESS)
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    A72 logs:

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    [Graph info -> app_display_modify]cropPrms.startX = 0
    [Graph info -> app_display_modify]cropPrms.startY = 0
    [Graph info -> app_display_modify]cropPrms.width = 1280
    [Graph info -> app_display_modify]cropPrms.height = 720
    tivxNodeSendCommand begin
    ownContextSendControlCmd begin^^^^^^^^^^^^^^^^^
    tivxEventWait begin ^^^^^^^^^^^^^^^^^^
    tivxEventWait end ^^^^^^^^^^^^^^^^^^
    ownContextSendControlCmd end^^^^^^^^^^^^^^^^^
    tivxNodeSendCommand end
    app_display_sight_modify left^^^^^^^^^^^^^^^^^^^^^
    [Graph info -> app_display_modify]cropPrms.startX = 0
    [Graph info -> app_display_modify]cropPrms.startY = 0
    [Graph info -> app_display_modify]cropPrms.width = 1280
    [Graph info -> app_display_modify]cropPrms.height = 720
    tivxNodeSendCommand begin
    ownContextSendControlCmd begin^^^^^^^^^^^^^^^^^
    tivxEventWait begin ^^^^^^^^^^^^^^^^^^
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    MCU2_0 Codes :

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    static vx_status VX_CALLBACK tivxDisplayControl(
    tivx_target_kernel_instance kernel,
    uint32_t node_cmd_id, tivx_obj_desc_t *obj_desc[],
    uint16_t num_params, void *priv_arg)
    {
    vx_status status = (vx_status)VX_SUCCESS;
    uint32_t size;
    tivxDisplayParams *dispPrms = NULL;
    status = tivxGetTargetKernelInstanceContext(kernel,
    (void **)&dispPrms, &size);
    if ((vx_status)VX_SUCCESS != status)
    {
    VX_PRINT(VX_ZONE_ERROR, "Failed to Get Target Kernel Instance Context\n");
    }
    else if ((NULL == dispPrms) ||
    (sizeof(tivxDisplayParams) != size))
    {
    VX_PRINT(VX_ZONE_ERROR, "Invalid Object Size\n");
    status = (vx_status)VX_FAILURE;
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    MCU2_0 Logs

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    [MCU2_0] 124.088268 s: VX_ZONE_ERROR:[tivxDisplayProcess:1056] SemaphoreP_pen d begin^^^^^^^^^^^^^^^^^^^^^
    [MCU2_0] 124.088793 s: VX_ZONE_ERROR:[tivxDisplayProcess:1058] SemaphoreP_pen d end^^^^^^^^^^^^^^^^^^^^^
    [MCU2_0] 124.088869 s: VX_ZONE_ERROR:[tivxDisplayProcess:1063] Fvid2_dequeue end^^^^^^^^^^^^^^^^^^^^^
    [MCU2_0] 124.089020 s: VX_ZONE_ERROR:[tivxDisplayProcess:1058] SemaphoreP_pen d end^^^^^^^^^^^^^^^^^^^^^
    [MCU2_0] 124.089084 s: VX_ZONE_ERROR:[tivxDisplayProcess:1063] Fvid2_dequeue end^^^^^^^^^^^^^^^^^^^^^
    [MCU2_0] 124.103802 s: VX_ZONE_ERROR:[tivxDisplayProcess:949] tivxGetTargetKe rnelInstanceContext Begin ^^^^^^^^^^^^^
    [MCU2_0] 124.103866 s: VX_ZONE_ERROR:[tivxDisplayProcess:953] tivxGetTargetKe rnelInstanceContext End ^^^^^^^^^^^^^
    [MCU2_0] 124.103914 s: VX_ZONE_ERROR:[tivxDisplayProcess:969] tivxGetObjDescE lement Begin ^^^^^^^^^^^^^
    [MCU2_0] 124.103961 s: VX_ZONE_ERROR:[tivxDisplayProcess:973] tivxGetObjDescE lement End ^^^^^^^^^^^^^
    [MCU2_0] 124.104003 s: VX_ZONE_ERROR:[tivxDisplayProcess:992] tivxQueueGet Be gin ^^^^^^^^^^^^^
    [MCU2_0] 124.104076 s: VX_ZONE_ERROR:[tivxDisplayProcess:994] tivxQueueGet Be gin ^^^^^^^^^^^^^
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    Thanks !

  • Hi,

    Is it possible to recreate this in single camera or multi camera example on EVM? It would be easier to debug. I suspect some IPC issue.. But need to reproduce it with existing example on EVM.

    or if you have this example available on EVM, can you please share it?

    Regards,

    Brijesh

  • Hi Brijesh,

    I've solved this problem.

    It was because of the setting paramaters of the LVGL V6.0.

    We use the LVGL and Draw2D function to draw pixels for HMI.

    We set the lv_tick_inc tick(the heart beat for LVGL) to 1 before , the video graph got stalled sometimes.(All the time utill A72 reboot.)

    But 48 hours ago, we set the lv_tick_inc tick to 10 , all the problems gone. 

    And the system keeps running stably for last 48 hours.

    But we are still confused.

    Best !