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:为什么 Vx_app_sing_cam 退出、而&'x'该过程被阻止?

Guru**** 2484615 points


请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1554377/tda4vm-why-the-vx_app_sing_cam-exit-whit-x-the-process-is-blocked

器件型号:TDA4VM


工具/软件:

我正在使用 vx_app_single_cam 应用、但对其进行了修改。 流水线如下所示、当我使用来自 TDa4 的文件运行该应用时、它运行正常。 但当应用程序运行摄像头时、当我想使用输入“x"退出“退出应用程序时、该过程将阻止记录输出。

主要流程:

vx_status app_run_graph (AppObj *obj)

Vx_STATUS 状态= Vx_Success;
Vx_Uint32 I;
vx_uint32 frm_loop_cnt;
// vx_uint32 num_refs_out;

STATUS = APP_PARIL_PAIPUUP (OBJ);

/*
应用程序读取并处理相同的图像“frm_loop_cnt"次“次
输出可能会发生变化、因为在 VISS 中、参数会根据 AEWB 结果每帧更新一次
AEWB 结果在 1 帧之后可用、并在 2 帧之后应用
因此、前 2 个输出图像将具有错误的颜色
*/
frm_loop_cnt = obj->num_frams_to_run;
frm_loop_cnt += obj->num_cap_buf;

if (obj->is_interactive )

/*在交互模式循环中为 ever */
frm_loop_cnt = 0xFFFFFFFF;
}

#ifdef A72
#if defined (Linux)

appDccUpdatefromFS (obj->sensor_name、obj->sensor_WDR_mode、
obj->node_aewb、0、
obj->node_viss, 0,
obj->node_LDC、0、
obj->context);
#endif
#endif

对于 (i = 0;i < frm_loop_cnt;i++)

appPerfPointBegin(&obj->total_perf);
status = app_pipeline_run (obj、i);
appPerfPointEnd (&obj->total_perf);

if ((obj->stop_task)||(status != Vx_success))

休息;
}
}

IF (STATUS == Vx_Success)

状态= vxWaitGraph (obj->graph);
}
/*关闭管道时取消 buf */
#if 0
for (buf_id=0;buf_id num_CAP_buf-2;buf_id++)

APP_printf(“取消捕获#%d...\n“、buf_id);
graph_parameter_num = 0;
vxGraphParameterDequeueDoneRef (obj->graph、graph_parameter_num、(vx_reference*)&out_capture_frames、1、&num_refs_capture);
Graph_parameter_num++;
}
#endif
IF (STATUS == Vx_Success)

状态= appStopImageSensor (obj->sensorObj.sensor_name、obj->sensorObj.ch_mask);
}
返回状态;
}

子功能:

vx_status app_pipele_pipeup (AppObj *obj)

Vx_STATUS 状态= Vx_Success;
vx_char input_file_name[APP_MAX_FILE_PATH];
if (obj->camera_input_flag)

Status = appStartImageSensor (obj->sensorObj.sensor_name、obj->sensorObj.ch_mask);

对于 (int i = 0;i < obj->num_cap_buf;i++)

status = vxGraphParameterEnqueueReadyRef (obj->graph、0、(vx_reference *)&(obj->captureObj.raw_image_arr[i])、1);
}
printf(“[APP-MOUDLE]图形输入参数捕获节点排队。\n“);
}
暴露

//从目标上的文件输入图像
snprintf (input_file_name、app_MAX_FILE_PATH、“%s/%010d.YUV",“,obj->inputImageObj.input_file_path、obj->inputImageObj.input_file_path、100);
readScalerInput (input_file_name、obj->inputImageObj.input_image_array、app_modules_read_file、0);
status = vxGraphParameterEnqueueReadyRef (obj->graph、0、(vx_reference *)&(obj->inputImageObj.input_image_array)、1);
printf(“[APP-MOUDLE]图形输入参数来自文件的输入图像进入队列。\n“);
}

if (obj->enable_det_label_output)

status = vxGraphParameterEnqueueReadyRef (obj->graph、1、(vx_reference *)&(obj->odtidlObj.output_tensor_arr[0])、1);
printf(“[app-modle] graph output parametre odtidl tensor is enqueed.\n“);
}
返回状态;
}

vx_status app_pipeline_run (appObj *obj、vx_uint32 frm_cnt)

Vx_STATUS 状态= Vx_Success;
vx_char input_file_name[APP_MAX_FILE_PATH];

静态 vx_uint32 file_index = 0;
// vx_image image_in = NULL;

vx_uint32 num_refs_in;

if (obj->camera_input_flag)

status = vxGraphParameterDequeueDoneRef(obj->graph,
0、
(vx_reference *)&(obj->captureObj.raw_image_arr[0])、1、
&num_refs_in);
}
暴露

status = vxGraphParameterDequeueDoneRef (obj->graph、0、(vx_reference *)&(obj->inputImageObj.input_image_array)、1、&num_refs_in);
}

if (obj->enable_det_label_output)

status = vxGraphParameterDequeueDoneRef (obj->graph、1、(vx_reference *)&(obj->odtidlObj.output_tensor_arr[0])、1、&num_refs_in);
IF (STATUS == Vx_Success)

status = app_get_od_lable(“od_label",“,obj->odtidlObj.output_tensor_ar[0]、obj->odtidlObj.output_tensor_ar[0]、obj->drawDetectionObj);
}
}

if(!obj->camera_input_flag)

snprintf (input_file_name、app_MAX_FILE_PATH、“%s/%010d.YUV",“,obj->inputImageObj.input_file_path、obj->inputImageObj.input_file_path、file_index + 101);
readScalerInput (input_file_name、obj->inputImageObj.input_image_array、app_modules_read_file、0);
}

// vx_object_array image_arr = vxCreateObjectArray (obj->context、(vx_reference) obj->imgMosaicObj.output_image[0]、0);

// snprintf (YUV_nv12_image_fname_1、MAX_FNAME、“%s%04d.YUV",“,"scaler_1_"、"scaler_1_",“,file_index“file_index)、);
// snprintf (YUV_nv12_image_fname_2、MAX_FNAME、“%s%04d.YUV",“,"scaler_2_"、"scaler_2_",“,file_index“file_index)、);

// snprintf (DOF_RGB、MAX_FNAME、“%s%04d.ppm",“,"dofrgb_1_"、"dofrgb_1_",“,file_index“file_index)、);

// snprintf (DOF_FICILD、MAX_FNAME、“%s%04d.PGM",“,"dofconf_1_"、"dofconf_1_",“,file_index“file_index)、);
//// snprintf(检测,MAX_FNAME、“%s%04d.YUV",“,"detec_1_"、"detec_1_",“,file_index“file_index)、);
// snprintf (pyra_l0、MAX_FNAME、“%s%04d.bmp",“,"bilmot_l0_"、"bilmot_l0_",“,file_index“file_index)、);
// snprintf (pyra_L1、MAX_FNAME、“%s%04d.bmp",“,"pyram_L1_"、"pyram_L1_",“,file_index“file_index)、);
// snprintf (pyra_L2、MAX_FNAME、“%s%04d.bmp",“,"pyram_l2_"、"pyram_l2_",“,file_index“file_index)、);
// snprintf (pyra_L3、MAX_FNAME、“%s%04d.bmp",“,"pyram_l3_"、"pyram_l3_",“,file_index“file_index)、);
// snprintf (post_od_name、MAX_FNAME、“%s%04d",“,"post_od_"、"post_od_",“,file_index“file_index)、);
// snprintf (draw_detection、MAX_FNAME、“%s%04d.YUV",“,"drap_od_"、"drap_od_",“,file_index“file_index)、);

#if 0
//写入金字塔输出
vx_object_array 金字塔_array = NULL;
VX 金字塔;
Pyram_array =(vx_object_array) vxGetReferenceFromDelay (obj->PyramidObj.Pyram_delay、0);
Pyramid =(vx_Pyram)vxGetObjectArrayItem ((vx_object_array) Pyram_array、0);

writePyramidOutput (pyra_l0、金字塔、0);
writePyramidOutput (pyra_L1、金字塔、1);
writePyramidOutput (pyra_L2、金字塔、2);
writePyramidOutput (pyra_L3、金字塔、3);
vxReleasePyramid(&Pyramid);
vxReleaseObjectArray (&bally_array);
#endif

#if 0
writeDofVizRGBOutput (DOF_RGB、obj->dofvizObj.flow_vector_field_img[0]);
writeDofVizConfidenceOutput (DOF_Confidence、obj->dofvizObj.Confidence_img[0]);
#endif

#if 0
writeScalerOutput (YUV_nv12_image_fname_1、obj->scalerObj.output[0].arr);
writeScalerOutput (YUV_nv12_image_fname_2、obj->scalerObj.output[1].arr);
writeScalerOutput (draw_detection, obj->drawDetectionObj.output_image_arr);
#endif

printf(“[frame-count]:%d .\n“、frm_cnt);

/*获取已消耗的输入参考,等待引用可用
*/

/*回收排队的输入和输出引用“loop_cnt"次“次*/
// if (i < frm_loop_cnt)
//{
if (obj->camera_input_flag)

status = vxGraphParameterEnqueueReadyRef (obj->graph、0、(vx_reference *)&(obj->captureObj.raw_image_arr[0])、1);
}
暴露

status = vxGraphParameterEnqueueReadyRef (obj->graph、0、(vx_reference *)&(obj->inputImageObj.input_image_array)、1);
}

if (obj->enable_det_label_output && status == Vx_Success)

status = vxGraphParameterEnqueueReadyRef (obj->graph、1、(vx_reference *)&(obj->odtidlObj.output_tensor_arr[0])、1);
}
//}
file_index++;

返回状态;
}

此致、

郑 CB

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    尊敬的 Cheng:

    您能否使用 num_cap_buf 来进行 odtidlObj.output_tensor_arr 管道 工程、并且对于捕获和 tidl 输出图参数具有相同的缓冲器。

    还可以获取 vxWaitGraph() API 的返回值并检查图形的状态、或者检查应用程序是否卡在 vxWaitGraph() API 中。

    尝试打印 tiovx/source/framework/vx_graph.c 内的图形->状态  

    我怀疑状态处于 vx_graph_State_running、但卡滞。

    此致、
    Gokul

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    尊敬的 Gokul:

    我在 vxWaitGraph 函数中添加打印后的第一行状态,似乎进程没有退出图形,也没有输出。

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    尊敬的 Cheng:

    您能否使用 num_cap_buf 对 odtidlObj.output_tensor_arr 进行管道调试 、并对捕获和 tidl 输出图参数具有相同的缓冲区。

    您是否尝试过此操作。

    我在 vxWaitGraph 函数中添加打印件、在第一行状态后、似乎进程没有退出图形、也没有输出。

    我可以更改代码和打印的值吗?

    此致、
    Gokul