TDA4VEN-Q1: TDA4 VEN graph

Part Number: TDA4VEN-Q1
Other Parts Discussed in Thread: TDA4VH

When I was building the graph, I found that the version of SDK11 was different from previous versions. I am not sure if there is a problem with my building method. I will send some code via email to show how to build it. Please help me confirm if this can be done

  • Hi,

    Could you please clarify which graph you are referring to? Additionally, please provide more details on what you mean by the VEN graph.

    Regards,

    Karthik

  • Hi,Karthik

    As shown in the figure, there are two graphs. A and B.
    In graph A, the output images of LDC are used for display.
    In graph B, the same outputted images from LDC are used as inputs to the scaler.
    graph A:
     graph A = vxCreateGraph(context);
     app_create_graph_ldc(context,graph A,capture_out);
     app_create_graph_display(context,graph A,ldc_output_images);
    graph B:
     graph B = vxCreateGraph(context);
     app_create_graph_scaler(context,graph B, ldc_output_images)
    It can be implemented in versions prior to SDK 11. But how to achieve direct data transfer between two graphs without the need for data copying after the SDK 11 version
    SDK11 Error message:
    I have added other methods to solve this problem in SDK11. but I am worried that there may be problems. Can you help me check if my implementation plan is feasible?
    Because the code cannot be uploaded here, I will send it via email.
  • Dear Karthik.

    Customer sends the code over email as company policy, forward to you just now. Please check if you need more.

    thanks a lot!

    yong

  • Hi,

    I need few clarifications,

    Why 2 different graphs are required ? 

    If both the graphs are running at same rate then you can have the application in a single graph.

    And can you mention the (NUM_CH) number of cameras that you are using.

    Still if you want 2 different graphs then i would recommend to create 3 different graphs like below,

    Because in the previous 2 graphs ldc output graph parameter will be dequeued after display node, so the scaler input will be lagged by one frame.

    Let me know which one you are going to use either single graph or 3 graph. Making it as a single graph would work without issue in 11.

    Regards,
    Gokul

  • This is a 4-channel camera. Because each image has a different usage scenario and frame rate, multiple graphs are used

    Three graphs is a good idea, I'll give it a try later. The main issue now is how to transfer data between each graph? In the example I provided, I copied the address of vx_image. Is it feasible?

  • There are more follow-up functions, possibly more graphs. The key is how to achieve zero copy between them.

  • Hi,

    I have created a patch for avp4 demo ( which will not run on tda4ven but it will be reference for your application ).

    In the modified avp4 demo 3 graphs are created main_graph (capture) srv_graph and od_graph. You can check how the buffers are exchanged across graphs without buffer copy.

    https://e2e.ti.com/cfs-file/__key/communityserver-discussions-components-files/1062/8535.avp4_5F00_3_5F00_graphs.patch

    If you want to evaluate this patch on other device ( TDA4AL, TDA4VH ) then disable dof (enable_dof 0) and hist  enable_hist 0) in the app_avp4.cfg file.

    Regards,
    Gokul

  • I looked at the modification points, but there are 3 graphs in one thread.

    The execution of viss_graph requires waiting for the completion of sv_graph and do_graph vxGraphParameterDequeueDoneref()

    .This is not what I hoped for,Can we change it to each graph executing on its own thread.

    I hope it's like this:

    static vx_status app_run_viss_graph_for_one_frame_pipeline(AppObj *obj, vx_int32 frame_id)
    {
            vxGraphParameterDequeueDoneRef(obj->graph, obj->viss_graph_parameter_index, (vx_reference*)&viss_output_img, 1, &num_refs);
            vxGraphParameterEnqueueReadyRef(obj->graph, obj->viss_graph_parameter_index, &viss_output_img, 1);
    }
    static vx_status app_run_srv_graph_for_one_frame_pipeline(AppObj *objvx_int32 frame_id)
    {
                vxGraphParameterEnqueueReadyRef(obj->srv_graph, obj->srv_graph_parameter_index, &viss_output_obj_arr, 1);
                vxGraphParameterDequeueDoneRef(obj->srv_graph, obj->srv_graph_parameter_index, (vx_reference*)&viss_output_obj_arr, 1, &num_refs);
    }
    static vx_status app_run_od_graph_for_one_frame_pipeline(AppObj *objvx_int32 frame_id)
    {
                vxGraphParameterEnqueueReadyRef(obj->od_graph, obj->ldc_graph_parameter_index, &viss_output_img, 1);
                vxGraphParameterDequeueDoneRef(obj->od_graph, obj->ldc_graph_parameter_index, (vx_reference*)&viss_output_img, 1, &num_refs);
    }

  • Hi,

    I hope it's like this:

    No, You cannot enqueue same reference to an output of a node at the same time to a input of another node.

    The execution of viss_graph requires waiting for the completion of sv_graph and do_graph vxGraphParameterDequeueDoneref()

    No, viss_graph does not wait because it has it own buffers to process for example if APP_BUFFER_Q_DEPTH is 8 then 4 buffers are for viss_graph and the other 4 are for sv and od grpah. In the initial pipeup phase you will be giving 8 buffers to viss_node and dequeue one by one to do the pipeup enqueue for od and srv graph.

    Now viss_node has 4 buffers and sv/od graph's first node has 4 buffers.

    dequeue viss_node buffer -> enqueue to od/sv graph ( viss_graph is still left with 3 buffers for processing )
    dequeue buffer from od/sv graph -> enqueue back to viss_graph ( this will give make the buffer again to 4)

    And the dequeue from od/sv graph will be done once srv_node and ldc_node ( first node of the respective graph) completes the execution.

    So for dequeue (od/srv) you don't have to wait for the entire graph to complete just after the completion of first node it dequeues.

    Regards,
    Gokul

  • Hi,

    Assuming it takes 200 milliseconds to process SRV, does your statement still hold true and can Viss_graph maintain a frame rate of 30

    Regards

  • Hi,

    Assuming it takes 200 milliseconds to process SRV, does your statement still hold true and can Viss_graph maintain a frame rate of 30

    No, it will  not maintain 30 fps. I have assumed all the graphs runs at same fps. And the entire pipeline will not at 30 fps if srv takes 200ms

    What is your usecase ?  Do you want to run each graphs at different fps ? Then you might have to drop few frames to srv node by not enqueuing some frames to the node.
    Refer to this patch for running od_graph at 15 fps and srv graph at 30 fps. 
    https://e2e.ti.com/cfs-file/__key/communityserver-discussions-components-files/1062/1184.avp4_5F00_15_5F00_30_5F00_srv_5F00_ldc_5F00_parallel_5F00_execution.patch

    Regards,
    Gokul