Part Number: TDA4VEN-Q1
Other Parts Discussed in Thread: TDA4VH
Hi TI Experts,
We built our tiovx application on the TDA4VEN 11.01 SDK.
Goal: How to efficiently transfer image data between different tiovx graphs
Background:
The design of the pipeline is as below:

the main pipeline has extremely high requirements for latency and frame rate (~60 fps), while the processing time of the output from multiple sub-pipelines (TIDL Node, Custom Node) is approximately between 50 and 300 ms.
In order to meet the frame rate and latency requirements of the main pipeline, we plan to place the main pipeline and the sub-pipelines in different tiovx graph. Then we discovered an example in edgeai-tiovx-apps app_tiovx_linux_multi_graph_test.c.
/*
* Note that in below loop graph on and 2 are running sequentially
* to run them in parellel, you need to decuple them by creating
* seperate threads for enqueue/dequeue of each graph
*/
for (int i = 0; i < APP_NUM_ITERATIONS; i++) {
//Graph1 Execution
inbuf1 = v4l2_decode_dqueue_buf(v4l2_decode_handle);
outbuf1 = tiovx_modules_acquire_buf(out_buf_pool1);
tiovx_modules_enqueue_buf(inbuf1);
tiovx_modules_enqueue_buf(outbuf1);
inbuf1 = tiovx_modules_dequeue_buf(in_buf_pool1);
outbuf1 = tiovx_modules_dequeue_buf(out_buf_pool1);
v4l2_decode_enqueue_buf(v4l2_decode_handle, inbuf1);
//Graph2 Execution
inbuf2 = tiovx_modules_acquire_buf(in_buf_pool2);
outbuf2 = tiovx_modules_acquire_buf(out_buf_pool2);
//Swap input2 mem with output1 to feed graph1 out to graph2
tiovx_modules_buf_swap_mem(outbuf1, inbuf2);
tiovx_modules_release_buf(outbuf1);
tiovx_modules_enqueue_buf(inbuf2);
tiovx_modules_enqueue_buf(outbuf2);
inbuf2 = tiovx_modules_dequeue_buf(in_buf_pool2);
outbuf2 = tiovx_modules_dequeue_buf(out_buf_pool2);
kms_display_render_buf(kms_display_handle, outbuf2);
tiovx_modules_release_buf(inbuf2);
tiovx_modules_release_buf(outbuf2);
}
But the tiovx_modules_buf_swap_mem() method used here cannot solve my problem. Becasue the output buffers of AwebNode will be used in serveral output pipelines, one of the pipelines uses the buffer, while the other one cannot use meanwhile.
It seems that a feasible approach would be to create a separate buffer by copying for each pipelines. However, since the image data is quite large and the number of our sub-pipelines may increase, this copying process would result in significant CPU consumption.
So, we would like to ask if the experts from TI have any good suggestions about this problem?
regards,
Jialin