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.

PROCESSOR-SDK-J721E: Single Camera Application Changes for New Camera

Part Number: PROCESSOR-SDK-J721E

Hi,

          We are using Jacinto 7 board and RTOS SDK(version : 07_02_00_06).  We are going to run the single camera application.  Our camera will sent RAW8 bit monochrome data as output.  Since we need monochrome data to be displayed, we modified the single camera application.

Our graph contains only 2 nodes : capture ---> display.  The code modification is shown below.

------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

APP_PRINTF("Creating graph \n");

obj->graph = vxCreateGraph(obj->context);
if(status == VX_SUCCESS)
{
status = vxGetStatus((vx_reference) obj->graph);
}
APP_ASSERT(vx_true_e == tivxIsTargetEnabled(TIVX_TARGET_VPAC_VISS1));

APP_PRINTF("Initializing params for capture node \n");

/* Setting to num buf of capture node */
APP_PRINTF("Initializing params for capture node \n");
obj->num_cap_buf = NUM_BUFS;//4

if(vx_false_e == yuv_cam_input)
{
raw_image = tivxCreateRawImage(obj->context, &sensorParams.sensorInfo.raw_params);

/* allocate Input and Output refs, multiple refs created to allow pipelining of graph */
for(buf_id=0; buf_id<obj->num_cap_buf; buf_id++)
{
if(status == VX_SUCCESS)
{
obj->cap_frames[buf_id] = vxCreateObjectArray(obj->context, (vx_reference)raw_image, num_capture_frames);
status = vxGetStatus((vx_reference) obj->cap_frames[buf_id]);

}
}
if(status == VX_SUCCESS)
{
status = tivxReleaseRawImage(&raw_image);
}
}

/* Config initialization */
tivx_capture_params_init(&local_capture_config);
local_capture_config.numInst = 1U;
local_capture_config.numCh = 1U;
local_capture_config.instId[CAPT_INST_ID] = CAPT_INST_ID;
local_capture_config.instCfg[CAPT_INST_ID].enableCsiv2p0Support = (uint32_t)vx_true_e;
local_capture_config.instCfg[CAPT_INST_ID].numDataLanes =
sensorParams.sensorInfo.numDataLanes;

local_capture_config.timeout = 33;
local_capture_config.timeoutInitial = 500;


APP_PRINTF("local_capture_config.numDataLanes = %d \n", local_capture_config.instCfg[CAPT_INST_ID].numDataLanes);

for (loopCnt = 0U ;
loopCnt < local_capture_config.instCfg[CAPT_INST_ID].numDataLanes ;
loopCnt++)
{
local_capture_config.instCfg[CAPT_INST_ID].dataLanesMap[loopCnt] = sensorParams.sensorInfo.dataLanesMap[loopCnt];
APP_PRINTF("local_capture_config.dataLanesMap[%d] = %d \n",
loopCnt,
local_capture_config.instCfg[CAPT_INST_ID].dataLanesMap[loopCnt]);
}

capture_config = vxCreateUserDataObject(obj->context, capture_user_data_object_name, sizeof(tivx_capture_params_t), &local_capture_config);

APP_PRINTF("capture_config = 0x%p \n", capture_config);

APP_PRINTF("Creating capture node \n");

obj->capture_node = tivxCaptureNode(obj->graph, capture_config, obj->cap_frames[0]);

APP_PRINTF("obj->capture_node = 0x%p \n", obj->capture_node);

if(status == VX_SUCCESS)
{
status = vxReleaseUserDataObject(&capture_config);
}
if(status == VX_SUCCESS)
{
status = vxSetNodeTarget(obj->capture_node, VX_TARGET_STRING, TIVX_TARGET_CAPTURE1);

}


obj->display_param_obj = vxCreateUserDataObject(obj->context, "tivx_display_params_t", sizeof(tivx_display_params_t), &obj->display_params);

display_image = (vx_image)vxGetObjectArrayItem(obj->cap_frames[0], 0);
obj->displayNode = tivxDisplayNode(obj->graph, obj->display_param_obj, display_image);


if(status == VX_SUCCESS)
{
status = vxSetNodeTarget(obj->displayNode, VX_TARGET_STRING, TIVX_TARGET_DISPLAY1);
APP_PRINTF("Display Set Target done\n");

}

int graph_parameter_num = 0;

/* input @ node index 1, becomes graph parameter 0 */
add_graph_parameter_by_node_index(obj->graph, obj->capture_node, 1);

/* set graph schedule config such that graph parameter @ index 0 is enqueuable */
graph_parameters_queue_params_list[graph_parameter_num].graph_parameter_index = graph_parameter_num;
graph_parameters_queue_params_list[graph_parameter_num].refs_list_size = obj->num_cap_buf;
graph_parameters_queue_params_list[graph_parameter_num].refs_list = (vx_reference*)&(obj->cap_frames[0]);

if(status == VX_SUCCESS)
{
status = tivxSetGraphPipelineDepth(obj->graph, obj->num_cap_buf);

}

/* Schedule mode auto is used, here we dont need to call vxScheduleGraph
* Graph gets scheduled automatically as refs are enqueued to it
*/
if(status == VX_SUCCESS)
{
status = vxSetGraphScheduleConfig(obj->graph,
VX_GRAPH_SCHEDULE_MODE_QUEUE_AUTO,
params_list_depth,
graph_parameters_queue_params_list
);
}
APP_PRINTF("vxSetGraphScheduleConfig done\n");

if(status == VX_SUCCESS)
{
status = vxVerifyGraph(obj->graph);

}


if(status == VX_SUCCESS)
{
status = tivxExportGraphToDot(obj->graph, ".", "single_cam_graph");
}

------------------------------------------------------------------------------------------------------------------------------------------------------------------------------  

'obj->displayNode = tivxDisplayNode(obj->graph, obj->display_param_obj, display_image);' 

While executing the above line, we are getting the error as shown below.

206.454487 s: VX_ZONE_ERROR:[vxSetParameterByIndex:257] Invalid type 0x00000817!
206.454494 s: VX_ZONE_ERROR:[vxSetParameterByIndex:306] Specified: parameter[1] type:00000817 => 0x5d02b8
206.454500 s: VX_ZONE_ERROR:[vxSetParameterByIndex:308] Required: parameter[1] dir:0 type:0000080f

1. Can you please verify why the creation of display node is failing and what changes we need to do accordingly?

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

status = tivxGraphParameterEnqueueReadyRef(obj->graph, 0, (vx_reference*)&(obj->cap_frames[buf_id]), 1, TIVX_GRAPH_PARAMETER_ENQUEUE_FLAG_PIPEUP);

While executing the above line in app_run_graph, we are getting one more error as shown below.

309.248011 s:  VX_ZONE_ERROR:[tivxGraphParameterEnqueueReadyRef:251] Reference enqueue not supported at graph parameter index 0

2. We don't know why this error is occuring and is this error because of display node failure or something else?

Please reply as soon as possible .

Thanks,

MURALIDHARAN

  • Hi Muralidharan,

    I think display node does not support raw_images data structure. Can you use vx_image with U8 data format to capture image and then to display it?

    Regards,

    Brijesh 

  • Hi,

              We changed the data format to U8.  Error is resolved in creation of display node.  Now we are getting the error while executing below line of single camera application code in app_create_graph function.

    status = vxVerifyGraph(obj->graph);

    The error occurred is shown below.

    225.703947 s: VX_ZONE_ERROR:[tivxAddKernelCaptureValidate:163] image format is invalid
    225.703954 s: VX_ZONE_ERROR:[ownGraphNodeKernelValidate:531] node kernel validate failed for kernel com.ti.capture at index 0
    225.703960 s: VX_ZONE_ERROR:[vxVerifyGraph:1930] Node kernel Validate failed
    225.703966 s: VX_ZONE_ERROR:[vxVerifyGraph:2098] Graph verify failed

    1. Can you please check why verify graph is failing?

    ----------------------------------------------------------------------------------------------------------------------------------------------------------

    status = tivxGraphParameterEnqueueReadyRef(obj->graph, 0, (vx_reference*)&(obj->cap_frames[buf_id]), 1, TIVX_GRAPH_PARAMETER_ENQUEUE_FLAG_PIPEUP);

    While executing the above line in app_run_graph, we are getting one more error as shown below.

    309.248011 s:  VX_ZONE_ERROR:[tivxGraphParameterEnqueueReadyRef:251] Reference enqueue not supported at graph parameter index 0

    2. We don't know why this error is occuring and is this error because of display node failure or something else?