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.

TDA4VH-Q1: Questions regarding graphs parameters and node parameters

Part Number: TDA4VH-Q1

Tool/software:

Hi TI,

We want to log viss/ldc output images continuously with as much FPS as we can get. I want to access both viss and ldc output buffers. Questions:

1. Is it possible to access buffers set by tivxSetNodeParameterNumBufByIndex() api while the graph is running? I have read tiovx graph pipeline documentation and there it is mentioned that the application can only access  graph parameter buffers. Just wanted to confirm.

2. In my graph the capture node output is the graph parameter. I tried making viss node output image (params idx = 6) also as graph parameter but the output I am getting is as below(attached a recording) and I am getting some errors also.(attached terminal ss)

I have read the FAQ on how to create viss node output as graph parameters and I am following exact same steps as mentioned in the single cam patch in my application.

The buffer queue depth for both capture and viss output is 4.

code snippet for enqueue dequeue is below:

/*!
    * CMS Graph pipeline enqueue references : pipe up + execute first reference
    * Pipe up -> Enqueue input references (NUM_BUFS - 1) times but do not trigger graph execution
    * Execute first reference -> after pipe up, now enqueue a buffer to trigger graph scheduling
    */
   for (buf_id = 0; buf_id < NUM_BUFS; buf_id++)
   {
      status = vxGraphParameterEnqueueReadyRef(class_ii_iv_graph_obj_ptr->graph,
                                               class_ii_iv_graph_obj_ptr->captureObj.graph_parameter_index,
                                               (vx_reference *)&class_ii_iv_graph_obj_ptr->captureObj.raw_image_out_arr[buf_id],
                                               1);
      if (status != VX_SUCCESS)
      {
         GEN3_DBG_PRINTF_ERR("ERROR: graph enqueue failed for capt cl2 cl4 out arr[%d], status = %d\n", buf_id, status);
      }
      status = vxGraphParameterEnqueueReadyRef(class_ii_iv_graph_obj_ptr->graph,
                                                class_ii_iv_graph_obj_ptr->vissObj.graph_parameter_index,
                                                (vx_reference *)&class_ii_iv_graph_obj_ptr->vissObj.out_arr[buf_id],
                                                1);
      if (status != VX_SUCCESS)
      {
         GEN3_DBG_PRINTF_ERR("ERROR: graph enqueue failed for capt cl2 cl4 out arr[%d], status = %d\n", buf_id, status);
      }
   }
 
   /* dequeue first and then after alternate executed reference from graph parameter.
    * check TIVX_OBJ_DESC_QUEUE_MAX_DEPTH if do not want to use dequeue.
    * enqueue back first or alternate reference into graph parameter after dequeue.
    */
   while (!class_ii_iv_graph_obj_ptr->stop_task_graph)
   {
      for (buf_id = 0; buf_id < NUM_BUFS; buf_id++)
      {
         /* Dequeue one image buffer */
         status = vxGraphParameterDequeueDoneRef(class_ii_iv_graph_obj_ptr->graph,
                                                 class_ii_iv_graph_obj_ptr->captureObj.graph_parameter_index,
                                                 (vx_reference *)&raw_image_temp,
                                                 1,
                                                 &num_refs);
         if (status != VX_SUCCESS)
         {
            GEN3_DBG_PRINTF_ERR("ERROR: graph dequeue failed for capt cl2 cl4 out arr[%d], status = %d\n", buf_id, status);
         }
         /* Dequeue one image buffer */
         status = vxGraphParameterDequeueDoneRef(class_ii_iv_graph_obj_ptr->graph,
                                                   class_ii_iv_graph_obj_ptr->vissObj.graph_parameter_index,
                                                   (vx_reference *)&viss_out_temp,
                                                   1,
                                                   &num_refs);
         if (status != VX_SUCCESS)
         {
            GEN3_DBG_PRINTF_ERR("ERROR: graph dequeue failed for viss cl2 cl4 out arr[%d], status = %d\n", buf_id, status);
         }
 
          status = vxGraphParameterEnqueueReadyRef(class_ii_iv_graph_obj_ptr->graph,
                                                  class_ii_iv_graph_obj_ptr->captureObj.graph_parameter_index,
                                                  (vx_reference *)&class_ii_iv_graph_obj_ptr->captureObj.raw_image_out_arr[buf_id],
                                                  1);
         if (status != VX_SUCCESS)
         {
            GEN3_DBG_PRINTF_ERR("ERROR: graph enqueue failed for capt cl2 cl4 out arr[%d], status = %d\n", buf_id, status);
         }
         status = vxGraphParameterEnqueueReadyRef(class_ii_iv_graph_obj_ptr->graph,
                                                   class_ii_iv_graph_obj_ptr->vissObj.graph_parameter_index,
                                                   (vx_reference *)&class_ii_iv_graph_obj_ptr->vissObj.out_arr[buf_id],
                                                   1);
         if (status != VX_SUCCESS)
         {
            GEN3_DBG_PRINTF_ERR("ERROR: graph enqueue failed for viss cl2 cl4 out arr[%d], status = %d\n", buf_id, status);
         }
      }
   }

regards,

Lalit

  • Hi Lalit,

    1. Is it possible to access buffers set by tivxSetNodeParameterNumBufByIndex() api while the graph is running? I have read tiovx graph pipeline documentation and there it is mentioned that the application can only access  graph parameter buffers. Just wanted to confirm.

    No, only graph parameters buffers are accessible.

    Please refer to the patch attached below for multi_cam_app to make ldc output as graph parameter.

    https://e2e.ti.com/cfs-file/__key/communityserver-discussions-components-files/791/ldc_5F00_graph_5F00_parameter.patch

    Regards,
    Gokul

  • Hi Gokul, 

    Thanks for the reply. 

    I will try with ldc output also but is it not possible to create viss output also as graph parameter together with capture output ?

    Why am I getting the output like above , can you clarify what is happening in this case?

    Thanks,

    Lalit

  • Hi Lalit,

    it not possible to create viss output also as graph parameter together with capture output ?

    It is possible, but creating graph parameter for every nodes will have a performance issue in case of pipelining because the pipeline is stalled until you dequeue and enqueue the graph parameter.

    If the requirement is to save the output to files then use the following parameters in multi_cam_demo .cfg file

    Why am I getting the output like above , can you clarify what is happening in this case?

    Not sure, but the object you use for enqueue and dequeue is different ideally that should not be the case.

    Please refer to the patch and make changes to you code accordingly.

    Regards,
    Gokul

  • Hi Gokul,

    I can see that the multi cam app is adding a file write node in the graph based on these flags. I looked at the kernel for this node.

    Just a quick question, since this node performs file IO on large image files, does this blocks/slow down the graph ?

    regards,
    Lalit

  • Hi Lalit,

    Yes it does slows down the graph, and it depends on the storage media you use to save the file, there is a option to control when to save to file and you can specify number of frames to store and no. of frames to skip.

    Regards,
    Gokul