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: Supplied value was not actually a reference

Part Number: TDA4VM

Tool/software:

Hi team,

I'm working on SDK 08_02_00_05(Linux+RTOS).

When testing a application, I'm facing the below error log.

root@j7-evm:/opt/vision_apps# ./btc_tpa_dl.out --cfg btc_tpa_dl.cfg 
APP: Init ... !!!
MEM: Init ... !!!
MEM: Initialized DMA HEAP (fd=4) !!!
MEM: Init ... Done !!!
IPC: Init ... !!!
IPC: Init ... Done !!!
REMOTE_SERVICE: Init ... !!!
REMOTE_SERVICE: Init ... Done !!!
    61.952107 s: GTC Frequency = 200 MHz
APP: Init ... Done !!!
    61.958635 s:  VX_ZONE_INIT:Enabled
    61.958652 s:  VX_ZONE_ERROR:Enabled
    61.958666 s:  VX_ZONE_WARNING:Enabled
    61.962714 s:  VX_ZONE_INIT:[tivxInitLocal:130] Initialization Done !!!
    61.962886 s:  VX_ZONE_INIT:[tivxHostInitLocal:86] Initialization Done for HOST !!!
Default param set! 
Parsed user params! 
Updated user params! 
end app_init_res_resize, vx_status:0 
inside mesh img creation
resolution resize init Done! 
app_init_color_conv_RGB_NV12() : ENTERING 
app_init_color_conv_RGB_NV12() : EXITING 
color_conv_RGB_NV12 Done! 
[LDC-MODULE] configure_dcc_params() : ENTERING
[LDC-MODULE] configure_dcc_params() : Setting DCC config object to NULL! 
[LDC-MODULE] configure_dcc_params() : EXITING
LDC init done!
Scaler Init Done! 
Computing checksum at 0x0000FFFFA1DB2F00, size = 785072
TIDL Init Done! 
Pre Proc Update Done! 
Pre Proc Init Done! 
APP_INIT Number of Input Tensors in draw detections 1
rci postproc Update Done! 
rci postproc Init Done! 
App Init Done! 
I am inside app_create_graph_reso_res
  Before tivxResoResizeNode !
 tivxResoResizeNode after!
 Tensor releasing Start Done!
 Tensor releasing  Done!
  app_create_graph_res_resize graph done!
app_create_graph_color_conv_RGB_NV12() : ENTERING 
Color convert RGB_NV12 node create started
Color convert node RGB_NV12 create done 
app_create_graph_color_conv_RGB_NV12() : EXITING 
 app_create_graph_color_conv_RGB_NV12 graph done!
[LDC-MODULE] app_create_graph_ldc() : ENTERING 
[LDC-MODULE] app_create_graph_ldc() : DCC config object is NULL 
output image is NULL in ldc
    62.038711 s:  VX_ZONE_ERROR:[vxSetParameterByIndex:228] Supplied value was not actually a reference
    62.038721 s:  VX_ZONE_ERROR:[vxSetParameterByIndex:305] Specified: parameter[7] type:00000000 => (nil)
    62.038728 s:  VX_ZONE_ERROR:[vxSetParameterByIndex:307] Required: parameter[7] dir:1 type:0000080f
    62.038739 s:  VX_ZONE_ERROR:[ownReleaseReferenceInt:307] Invalid reference
    62.038746 s:  VX_ZONE_ERROR:[vxGetStatus:713] Reference is NULL
status:-7
[LDC-MODULE] Unable to create LDC node without DCC config! 
[LDC-MODULE] app_create_graph_ldc() : EXITING 
LDC graph done!
App Create Graph Done! 
App Run Graph Done! 
res resize delete done!
Color_conv_RGB_NV12 delete done!
LDC delete done!
App Delete Graph Done! 
Input image release Done! 
    62.038841 s:  VX_ZONE_ERROR:[ownReleaseReferenceInt:307] Invalid reference
res resize deinit done!
rgb to nv12 done!
LDC deinit done!
Scaler deinit Done! 
Pre-Proc deinit Done! 
TIDL deinit Done! 
Post_proc deinit Done! 
TIDL unload Done! 
ImgProc unload Done! 
RCIPostProc unload Done! 
Resolution Resize unload Done! 
HWA unload Done! 
    62.039379 s:  VX_ZONE_WARNING:[vxReleaseContext:1050] Found a reference 0xffffad795c28 of type 00000813 at external count 1, internal count 0, releasing it
    62.039387 s:  VX_ZONE_WARNING:[vxReleaseContext:1052] Releasing reference (name=object_array_104) now as a part of garbage collection
    62.039397 s:  VX_ZONE_WARNING:[vxReleaseContext:1050] Found a reference 0xffffad72e9a8 of type 0000080f at external count 1, internal count 0, releasing it
    62.039403 s:  VX_ZONE_WARNING:[vxReleaseContext:1052] Releasing reference (name=image_105) now as a part of garbage collection
    62.039428 s:  VX_ZONE_WARNING:[vxReleaseContext:1050] Found a reference 0xffffad6fc080 of type 00000816 at external count 1, internal count 0, releasing it
    62.039436 s:  VX_ZONE_WARNING:[vxReleaseContext:1052] Releasing reference (name=user_data_object_106) now as a part of garbage collection
    62.039457 s:  VX_ZONE_WARNING:[vxReleaseContext:1050] Found a reference 0xffffad72ec60 of type 0000080f at external count 1, internal count 0, releasing it
    62.039464 s:  VX_ZONE_WARNING:[vxReleaseContext:1052] Releasing reference (name=image_108) now as a part of garbage collection
    62.039485 s:  VX_ZONE_WARNING:[vxReleaseContext:1050] Found a reference 0xffffad790740 of type 0000080d at external count 1, internal count 0, releasing it
    62.039493 s:  VX_ZONE_WARNING:[vxReleaseContext:1052] Releasing reference (name=scalar_132) now as a part of garbage collection
Context released! 
App De-init Done! 
    62.039525 s:  VX_ZONE_INIT:[tivxHostDeInitLocal:100] De-Initialization Done for HOST !!!
    62.043893 s:  VX_ZONE_INIT:[tivxDeInitLocal:193] De-Initialization Done !!!
APP: Deinit ... !!!
REMOTE_SERVICE: Deinit ... !!!
REMOTE_SERVICE: Deinit ... Done !!!                                                                                   
IPC: Deinit ... !!!                                                                                                   
IPC: DeInit ... Done !!!                                                                                              
MEM: Deinit ... !!!                                                                                                   
MEM: Alloc's: 18 alloc's of 2513008 bytes                                                                             
MEM: Free's : 18 free's  of 2513008 bytes 
MEM: Open's : 0 allocs  of 0 bytes 
MEM: Deinit ... Done !!!
APP: Deinit ... Done !!!
root@j7-evm:/opt/vision_apps# 

Attaching my app_create_graph function.

static vx_status app_create_graph(AppObj *obj)
{
    vx_status status = VX_SUCCESS;
    vx_char output_file_name[APP_MAX_FILE_PATH];
    //vx_graph_parameter_queue_params_t graph_parameters_queue_params_list[2];
    //vx_int32 graph_parameter_index;
    obj->graph = vxCreateGraph(obj->context);
    status = vxGetStatus((vx_reference)obj->graph);

    if(status == VX_SUCCESS)
    {
        status = vxSetReferenceName((vx_reference)obj->graph, "OpenVxGraph");
    }

    if(status == VX_SUCCESS)
    {
        status = app_create_graph_res_resize(obj->graph, &obj->resResizeObj, obj->input.arr[0]);
        APP_PRINTF(" app_create_graph_res_resize graph done!\n");
    }
    if(status == VX_SUCCESS)
    {
        status = app_create_graph_color_conv_RGB_NV12(obj->graph, &obj->colorConvRGBNV12Obj, obj->resResizeObj.output_image_arr);
        APP_PRINTF(" app_create_graph_color_conv_RGB_NV12 graph done!\n");
    }

    vx_image src_image1 = (vx_image)vxGetObjectArrayItem(obj->colorConvRGBNV12Obj.dst_image_arr, 0);
    snprintf(output_file_name, APP_MAX_FILE_PATH, "%s/cc_output.bmp", obj->output_file_path);
    tivx_utils_save_vximage_to_bmpfile(output_file_name, src_image1);
    if(status == VX_SUCCESS)
    {
        status = app_create_graph_ldc(obj->graph, &obj->ldcObj, obj->colorConvRGBNV12Obj.dst_image_arr);
        APP_PRINTF("LDC graph done!\n");
    }
    if(status == VX_SUCCESS)
    {
        status = app_create_graph_scaler(obj->context, obj->graph, &obj->scalerObj, obj->ldcObj.output_arr);
    }
    if(status == VX_SUCCESS)
    {
        status = app_create_graph_pre_proc(obj->graph, &obj->preProcObj, obj->scalerObj.output[0].arr);
    }
    if(status == VX_SUCCESS)
    {
        status = app_create_graph_tidl(obj->context, obj->graph, &obj->tidlObj, obj->preProcObj.output_tensor_arr);
        APP_PRINTF("TIDL Create Done! \n");
    }
    if(status == VX_SUCCESS)
    {
        status = app_rci_create_graph_postproc(obj->graph, &obj->rcipostprocObj, obj->tidlObj.output_tensor_arr);
        APP_PRINTF("RCI Create Postproc Done!\n");
    }
    
    
    return status;
}

When I dumped obj->colorConvRGBNV12Obj.dst_image_arr the output is not expected but it's not NULL. Attaching the dump below.

But when the same is passed to app_create_graph_ldc function which is the next node, I'm facing the error.

output image is NULL in ldc
62.038711 s: VX_ZONE_ERROR:[vxSetParameterByIndex:228] Supplied value was not actually a reference
62.038721 s: VX_ZONE_ERROR:[vxSetParameterByIndex:305] Specified: parameter[7] type:00000000 => (nil)
62.038728 s: VX_ZONE_ERROR:[vxSetParameterByIndex:307] Required: parameter[7] dir:1 type:0000080f
62.038739 s: VX_ZONE_ERROR:[ownReleaseReferenceInt:307] Invalid reference
62.038746 s: VX_ZONE_ERROR:[vxGetStatus:713] Reference is NULL

What could be the reason for this behaviour? How to resolve this?

Regards,

Chaitanya Prakash Uppala

  • Hi Prakash,

    Seems like the ldcObj->output_arr has not been created properly, check if you are calling create_ldc_outputs()  inside app_init_ldc(). Parameter 7 refers to output_img.

    Regards,
    Gokul

  • Hi Gokul,

    Thanks for the prompt response.

    check if you are calling create_ldc_outputs()  inside app_init_ldc(). Parameter 7 refers to output_img.

    Yes, it is being called.

    Default param set!
    Parsed user params!
    Updated user params!
    end app_init_res_resize, vx_status:0
    inside mesh img creation
    resolution resize init Done!
    app_init_color_conv_RGB_NV12() : ENTERING
    app_init_color_conv_RGB_NV12() : EXITING
    color_conv_RGB_NV12 Done!
    [LDC-MODULE] configure_dcc_params() : ENTERING
    [LDC-MODULE] configure_dcc_params() : Setting DCC config object to NULL!
    [LDC-MODULE] configure_dcc_params() : EXITING
    exiting create_ldc_outputs function
    LDC init done!
    Scaler Init Done!
    Computing checksum at 0x0000FFFF85A32F00, size = 785072
    TIDL Init Done!
    Pre Proc Update Done!
    Pre Proc Init Done!
    APP_INIT Number of Input Tensors in draw detections 1

    Regards,

    Chaitanya Prakash Uppala

  • Hi Prakash,

    print the status value of output_img  "status = vxGetStatus((vx_reference)output_img);" before calling tivxVpacLdcNode()

    Regards,
    Gokul

  • Hi Gokul,

    Please find the below log.

    app_create_graph_color_conv_RGB_NV12() : EXITING
    app_create_graph_color_conv_RGB_NV12 graph done!
    [LDC-MODULE] app_create_graph_ldc() : ENTERING
    [LDC-MODULE] app_create_graph_ldc() : DCC config object is NULL
    output image is NULL in ldc
    51.506078 s: VX_ZONE_ERROR:[vxGetStatus:713] Reference is NULL
    printing the status of output image:-7
    51.506151 s: VX_ZONE_ERROR:[vxSetParameterByIndex:228] Supplied value was not actually a reference
    51.506159 s: VX_ZONE_ERROR:[vxSetParameterByIndex:305] Specified: parameter[7] type:00000000 => (nil)
    51.506165 s: VX_ZONE_ERROR:[vxSetParameterByIndex:307] Required: parameter[7] dir:1 type:0000080f
    51.506176 s: VX_ZONE_ERROR:[ownReleaseReferenceInt:307] Invalid reference
    51.506182 s: VX_ZONE_ERROR:[vxGetStatus:713] Reference is NULL
    status of ldcObj->node:-7
    [LDC-MODULE] Unable to create LDC node without DCC config!
    [LDC-MODULE] app_create_graph_ldc() : EXITING
    LDC graph done!

    Regards,

    Chaitanya Prakash Uppala

  • Hi Prakash,

    If it is returning -7 then the reference is not created properly.

    Backtrace and print the status until where it is getting 0 which is success. 

    Ex. put the print statement where the ldcObj->output_arr is getting created. check if it is created properly. If not go one level down and so.

    Regards,
    Gokul