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.

Compiler/TDA4VM: TDA4VM

Part Number: TDA4VM

Tool/software: TI C/C++ Compiler

HI TI Members,

i tried to add a display node to my demo which turns bmp image to greyscale , to diaplay the input- and outputimage.

The Demo runs successfully with single display node for input image. But the Error appears in command status in function verifygraph in  function create_graph when I add the display node for output image in yuv420 format.

the log file shows as below.

Could you give me some tips?

Best Regards

Yuchen 

  • #include "Displaymodule.h"
    
    #define MAX_NUM_BUF (3u)
    
    
    
    typedef struct {
    
        /* config options */
        char input_file_1[APP_MAX_FILE_PATH];
        char output_file[APP_MAX_FILE_PATH];
        uint32_t width;
        uint32_t height;
    
        /* OpenVX references */
        vx_context context;
        vx_graph graph;
        vx_node  colorConvertNode;
        vx_node  channelExtractNode;
        vx_image input_img1;
        vx_image yuv_img;
        vx_image output_img;
    
        DisplayObj displayObj;
    } AppObj;
    
    AppObj gAppObj;
    
    static void app_parse_cmd_line_args(AppObj *obj, int argc, char *argv[]);
    static void app_init(AppObj *obj);
    static void app_deinit(AppObj *obj);
    static vx_status app_create_graph(AppObj *obj);
    static vx_status app_run_graph(AppObj *obj);
    static void app_delete_graph(AppObj *obj);
    
    
    static void VX_CALLBACK log_callback(vx_context context, vx_reference ref, vx_status status, const vx_char string[])
    {
        size_t len = strlen(string);
        if (len > 0) {
            printf("%s", string);
            if (string[len - 1] != '\n')
                printf("\n");
            fflush(stdout);
        }
    }
    
    int app_gac_openvx_demo_main(int argc, char* argv[])
    {
        AppObj *obj = &gAppObj;
    
        app_parse_cmd_line_args(obj, argc, argv);
        app_init(obj);
        app_create_graph(obj);
        app_run_graph(obj);
        app_delete_graph(obj);
        app_deinit(obj);
        
    
        return 0;
    }
    
    static void app_init(AppObj *obj)
    {
        obj->context = vxCreateContext();
        APP_ASSERT_VALID_REF(obj->context);
        tivxHwaLoadKernels(obj->context);
        app_init_display1( obj->context, &obj->displayObj , "display1Obj");
        app_init_display2( obj->context, &obj->displayObj , "display2Obj");
    
        vxRegisterLogCallback(obj->context, log_callback, vx_false_e);
    }
    
    static void app_deinit(AppObj *obj)
    {   
        app_deinit_display1(&obj->displayObj);
        app_deinit_display2(&obj->displayObj);
        tivxHwaUnLoadKernels(obj->context);
        vxReleaseContext(&obj->context);
    }
    
    /*
     * Graph,
     *
     * input_img_1 -> ChannelExtractNode -----> output_img
     */
    static vx_status app_create_graph(AppObj *obj)
    {
        vx_status status = VX_SUCCESS;
        vx_uint32 pipeline_depth;
    
        pipeline_depth = MAX_NUM_BUF;
    
    
        obj->graph = vxCreateGraph(obj->context);
        APP_ASSERT_VALID_REF(obj->graph);
    
        obj->input_img1 = vxCreateImage(obj->context, obj->width, obj->height, VX_DF_IMAGE_RGB);
        APP_ASSERT_VALID_REF(obj->input_img1);
        
        app_create_graph_display2(obj->graph,
                                  &obj->displayObj,
                                  obj->input_img1);
    
        vxSetReferenceName((vx_reference)obj->input_img1, "Input1ImageRGB");
    
    
        obj->yuv_img  = vxCreateVirtualImage(obj->graph, obj->width, obj->height, VX_DF_IMAGE_IYUV);
        APP_ASSERT_VALID_REF(obj->yuv_img);
        vxSetReferenceName((vx_reference)obj->yuv_img, "IntermediateImageYUV");
    
        obj->output_img = vxCreateImage(obj->context, obj->width, obj->height, VX_DF_IMAGE_U8);
        APP_ASSERT_VALID_REF(obj->output_img);
        vxSetReferenceName((vx_reference)obj->output_img, "OutputImageU8");
    
    
        obj->colorConvertNode = vxColorConvertNode(obj->graph, obj->input_img1, obj->yuv_img),
        APP_ASSERT_VALID_REF(obj->colorConvertNode);
        vxSetReferenceName((vx_reference)obj->colorConvertNode, "colorConvertNode");
    
        obj->channelExtractNode = vxChannelExtractNode(obj->graph, obj->yuv_img, VX_CHANNEL_Y, obj->output_img),
        APP_ASSERT_VALID_REF(obj->channelExtractNode);
        vxSetReferenceName((vx_reference)obj->channelExtractNode, "channelExtractNode");
    
        app_create_graph_display1(obj->graph,&obj->displayObj,obj->output_img);
    
        
        tivxSetGraphPipelineDepth(obj->graph, pipeline_depth);
    
        status = vxVerifyGraph(obj->graph);
        APP_ASSERT(status==VX_SUCCESS);
    
        status = tivxExportGraphToDot(obj->graph,".", "vx_app_gac_openvx_demo");
        /* APP_ASSERT(status==VX_SUCCESS); */ /* dont assert on this error since its not critical */
    
        return status;
    }
    
    static void app_delete_graph(AppObj *obj)
    {
        vxReleaseNode(&obj->channelExtractNode);
        vxReleaseNode(&obj->colorConvertNode);
        vxReleaseGraph(&obj->graph);
        vxReleaseImage(&obj->input_img1);
        vxReleaseImage(&obj->yuv_img);
        vxReleaseImage(&obj->output_img);
        app_delete_display1(&obj->displayObj);
        app_delete_display2(&obj->displayObj);
    }
    
    static vx_status app_run_graph(AppObj *obj)
    {
        vx_status status = VX_SUCCESS;
    
        printf(" Loading [%s] ...\n", obj->input_file_1);
        tivx_utils_load_vximage_from_bmpfile(obj->input_img1, obj->input_file_1, vx_false_e);
    
        printf(" Running graph ...\n");
        #if 1
        status = vxScheduleGraph(obj->graph);
        APP_ASSERT(status==VX_SUCCESS);
        status = vxWaitGraph(obj->graph);
        APP_ASSERT(status==VX_SUCCESS);
        //tivxTaskWaitMsecs(20000);
        
        #endif
    
        printf(" Saving [%s] ...\n", obj->output_file);
         
        tivx_utils_save_vximage_to_bmpfile(obj->output_file, obj->output_img);
         
    //    tivx_utils_save_vximage_to_bmpfile(obj->output_file, obj->yuv_img);
        printf(" Done !!!\n");
         
    
        return status;
    }
    
    static void app_show_usage(int argc, char* argv[])
    {
        printf("\n");
        printf(" GAC OpenVX demo - (c) GAC R&D 2020\n");
        printf(" ========================================================\n");
        printf("\n");
        printf(" Usage,\n");
        printf("  %s --cfg <config file>\n", argv[0]);
        printf("\n");
    }
    
    static void app_set_cfg_default(AppObj *obj)
    {
        snprintf(obj->input_file_1,APP_MAX_FILE_PATH, "./img_1.bmp");
        snprintf(obj->output_file,APP_MAX_FILE_PATH, "./out_img.bmp");
        obj->width = 640;
        obj->height = 480;
        obj->displayObj.display_option = 1;
    }
    
    static void app_parse_cfg_file(AppObj *obj, char *cfg_file_name)
    {
        FILE *fp = fopen(cfg_file_name, "r");
        char line_str[1024];
        char *token;
    
        if(fp==NULL)
        {
            printf("# ERROR: Unable to open config file [%s]\n", cfg_file_name);
            exit(0);
        }
    
        while(fgets(line_str, sizeof(line_str), fp)!=NULL)
        {
            char s[]=" \t";
    
            if (strchr(line_str, '#'))
            {
                continue;
            }
    
            /* get the first token */
            token = strtok(line_str, s);
            if(strcmp(token, "input_file_1")==0)
            {
                token = strtok(NULL, s);
                token[strlen(token)-1]=0;
                strcpy(obj->input_file_1, token);
            }
            else
            if(strcmp(token, "output_file")==0)
            {
                token = strtok(NULL, s);
                token[strlen(token)-1]=0;
                strcpy(obj->output_file, token);
            }
            else
            if(strcmp(token, "width")==0)
            {
                token = strtok(NULL, s);
                obj->width = atoi(token);
            }
            else
            if(strcmp(token, "height")==0)
            {
                token = strtok(NULL, s);
                obj->height = atoi(token);
            }
        }
    
        fclose(fp);
    }
    
    static void app_parse_cmd_line_args(AppObj *obj, int argc, char *argv[])
    {
        int i;
    
        app_set_cfg_default(obj);
    
        if(argc==1)
        {
            app_show_usage(argc, argv);
            exit(0);
        }
    
        for(i=0; i<argc; i++)
        {
            if(strcmp(argv[i], "--cfg")==0)
            {
                i++;
                if(i>=argc)
                {
                    app_show_usage(argc, argv);
                }
                app_parse_cfg_file(obj, argv[i]);
                break;
            }
            else
            if(strcmp(argv[i], "--help")==0)
            {
                app_show_usage(argc, argv);
                exit(0);
            }
        }
    }
    

  • Hi,

    U8, as such, is supported in the display Node, so it should work. I am not able to see the exact error, could you please share the complete output log? I want to see if there is any error returned from the display node.

    Regards,

    Brijesh

  • root@j7-evm:/opt/vision_apps/output# ./run_app_gac_demo.sh
    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 !!!
    APP: Init ... Done !!!
    123.404010 s: VX_ZONE_INIT:Enabled
    123.404031 s: VX_ZONE_ERROR:Enabled
    123.404036 s: VX_ZONE_WARNING:Enabled
    123.404538 s: VX_ZONE_INIT:[tivxInit:71] Initialization Done !!!
    123.404659 s: VX_ZONE_INIT:[tivxHostInit:48] Initialization Done for HOST !!!
    123.408480 s: VX_ZONE_ERROR:[ownContextSendCmd:770] Command ack message returned failure cmd_status: -10
    123.408493 s: VX_ZONE_ERROR:[ownContextSendCmd:806] tivxEventWait() failed.
    123.408499 s: VX_ZONE_ERROR:[ownNodeKernelInit:526] Target kernel, TIVX_CMD_NODE_CREATE failed
    123.408557 s: VX_ZONE_ERROR:[ownGraphNodeKernelInit:583] kernel init for node 2, kernel com.ti.hwa.display ... failed !!!
    123.408566 s: VX_ZONE_ERROR:[vxVerifyGraph:2010] Node kernel init failed
    123.408571 s: VX_ZONE_ERROR:[vxVerifyGraph:2064] Graph verify failed
    123.408735 s: VX_ZONE_ERROR:[tivxExportGraphToDot:1414] Invalid parameters or graph node not verified Loading [/opt/vision_apps/test_data/lena.bmp] ...
    Running graph ...
    123.434859 s: VX_ZONE_ERROR:[ownContextSendCmd:770] Command ack message returned failure cmd_status: -1
    123.434869 s: VX_ZONE_ERROR:[ownContextSendCmd:806] tivxEventWait() failed.
    123.434875 s: VX_ZONE_ERROR:[ownNodeKernelInit:526] Target kernel, TIVX_CMD_NODE_CREATE failed
    123.434932 s: VX_ZONE_ERROR:[ownGraphNodeKernelInit:583] kernel init for node 3, kernel com.ti.hwa.display ... failed !!!
    123.434941 s: VX_ZONE_ERROR:[vxVerifyGraph:2010] Node kernel init failed
    123.434946 s: VX_ZONE_ERROR:[vxVerifyGraph:2064] Graph verify failed
    123.439487 s: VX_ZONE_ERROR:[ownGraphScheduleGraphWrapper:807] graph is not in a state required to be scheduled
    123.439495 s: VX_ZONE_ERROR:[vxWaitGraph:877] graph not in expected state
    Saving [app_gac_demo.bmp] ...
    [MCU2_0] 123.434530 s: src/drv/disp/dss_dispApi.c @ Line 272:
    [MCU2_0] 123.434617 s: Driver instance already created!!
    [MCU2_0] 123.434653 s: src/fvid2_drvMgr.c @ Line 759:
    [MCU2_0] 123.434678 s: Driver create failed!!
    [MCU2_0] 123.434710 s: VX_ZONE_ERROR:[tivxDisplayCreate:454] DISPLAY: ERROR: Display Create Failed!
    Done !!!
    delete_Display1
    123.445662 s: VX_ZONE_ERROR:[ownReleaseReferenceInt:307] Invalid reference
    delete_Display2
    123.445674 s: VX_ZONE_ERROR:[ownReleaseReferenceInt:307] Invalid reference
    deinit_Display1
    deinit_Display2
    123.445918 s: VX_ZONE_ERROR:[vxReleaseContext:1026] Reference 111 not removed

  • Thanks Brijesh, i have uploaded the complete log file.

  • Hi Li,

    -10 error number is for invalid parameter. 

    In the display create function, i see this error error is returned only two cases,

    1, display param struct is corrupted due to some reason.

    2, display pipe id is not correct.

    In your code, you are calling API app_create_graph_display2 to initialize display parameters, can you check if this API is initializing pipe id correctly?

    Regards,

    Brijesh

  • Hi Brijesh,

    i set PipeId=0 for Display1(output image) and PipeId=2 for Display2(input image).

    Pipeline Depth is set to 3u . should I call the function vxSetGraphScheduleConfig in this case?

    Below is my code for Display module.

    By the way what is -1 Error ?

    /*
     *
     * Copyright (c) 2017 Texas Instruments Incorporated
     *
     * All rights reserved not granted herein.
     *
     * Limited License.
     *
     * Texas Instruments Incorporated grants a world-wide, royalty-free, non-exclusive
     * license under copyrights and patents it now or hereafter owns or controls to make,
     * have made, use, import, offer to sell and sell ("Utilize") this software subject to the
     * terms herein.  With respect to the foregoing patent license, such license is granted
     * solely to the extent that any such patent is necessary to Utilize the software alone.
     * The patent license shall not apply to any combinations which include this software,
     * other than combinations with devices manufactured by or for TI ("TI Devices").
     * No hardware patent is licensed hereunder.
     *
     * Redistributions must preserve existing copyright notices and reproduce this license
     * (including the above copyright notice and the disclaimer and (if applicable) source
     * code license limitations below) in the documentation and/or other materials provided
     * with the distribution
     *
     * Redistribution and use in binary form, without modification, are permitted provided
     * that the following conditions are met:
     *
     * *       No reverse engineering, decompilation, or disassembly of this software is
     * permitted with respect to any software provided in binary form.
     *
     * *       any redistribution and use are licensed by TI for use only with TI Devices.
     *
     * *       Nothing shall obligate TI to provide you with source code for the software
     * licensed and provided to you in object code.
     *
     * If software source code is provided to you, modification and redistribution of the
     * source code are permitted provided that the following conditions are met:
     *
     * *       any redistribution and use of the source code, including any resulting derivative
     * works, are licensed by TI for use only with TI Devices.
     *
     * *       any redistribution and use of any object code compiled from the source code
     * and any resulting derivative works, are licensed by TI for use only with TI Devices.
     *
     * Neither the name of Texas Instruments Incorporated nor the names of its suppliers
     *
     * may be used to endorse or promote products derived from this software without
     * specific prior written permission.
     *
     * DISCLAIMER.
     *
     * THIS SOFTWARE IS PROVIDED BY TI AND TI'S LICENSORS "AS IS" AND ANY EXPRESS
     * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
     * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
     * IN NO EVENT SHALL TI AND TI'S LICENSORS BE LIABLE FOR ANY DIRECT, INDIRECT,
     * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
     * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
     * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
     * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
     * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
     * OF THE POSSIBILITY OF SUCH DAMAGE.
     *
     */
    #include "app_display_module.h"
    
    vx_status app_init_display(vx_context context, DisplayObj *displayObj, char *objName)
    {
      vx_status status = VX_SUCCESS;
    
      if ((vx_true_e == tivxIsTargetEnabled(TIVX_TARGET_DISPLAY1)) && (displayObj->display_option == 1))
      {
          status = VX_SUCCESS;
      }
      else
      {
          status = VX_FAILURE;
      }
    
      if(VX_SUCCESS == status)
      {
          memset(&displayObj->disp_params, 0, sizeof(tivx_display_params_t));
    
          displayObj->disp_params.opMode = TIVX_KERNEL_DISPLAY_ZERO_BUFFER_COPY_MODE;//TIVX_KERNEL_DISPLAY_BUFFER_COPY_MODE;
          displayObj->disp_params.pipeId = 0;
          displayObj->disp_params.outWidth = DISPLAY_WIDTH;
          displayObj->disp_params.outHeight = DISPLAY_HEIGHT;
          displayObj->disp_params.posX = (1920-DISPLAY_WIDTH)/2;
          displayObj->disp_params.posY = (1080-DISPLAY_HEIGHT)/2;
    
          displayObj->disp_params_obj = vxCreateUserDataObject(context, "tivx_display_params_t", sizeof(tivx_display_params_t), &displayObj->disp_params);
          status = vxGetStatus((vx_reference)displayObj->disp_params_obj);
      }
    
      return status;
    }
    
    void app_deinit_display(DisplayObj *displayObj)
    {
      if ((vx_true_e == tivxIsTargetEnabled(TIVX_TARGET_DISPLAY1)) && (displayObj->display_option == 1))
      {
        vxReleaseUserDataObject(&displayObj->disp_params_obj);
      }
    }
    
    void app_delete_display(DisplayObj *displayObj)
    {
      if (displayObj->disp_node != NULL)
      {
        vxReleaseNode(&displayObj->disp_node);
      }
    }
    
    vx_status app_create_graph_display(vx_graph graph, DisplayObj *displayObj, vx_image disp_image)
    {
        vx_status status = VX_SUCCESS;
    
        if ((vx_true_e == tivxIsTargetEnabled(TIVX_TARGET_DISPLAY1)) && (displayObj->display_option == 1))
        {
          displayObj->disp_node = tivxDisplayNode(graph, displayObj->disp_params_obj, disp_image);
          vxSetNodeTarget(displayObj->disp_node, VX_TARGET_STRING, TIVX_TARGET_DISPLAY1);
          vxSetReferenceName((vx_reference)displayObj->disp_node, "display_node");
          status = vxGetStatus((vx_reference)displayObj->disp_node);
        }
        return status;
    }
    

  • Hi,

    I see you are using same display object for both the displays initialization, ie DisplayObj displayObj;. Can you create separate instances/objects for display1 and display2 and then initialize them accordingly in init API? Can you try with it?

    Regards,

    Brijesh

  • Hallo Brijesh,

    now i just use the displayObj for the output image.

    If i set PipeId=0 and Pipedepth=1, i can get an imput image on display , which is not my expected output image.

    Then i chande Pipedepth to 2, then i get the Error show as below:

    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 !!!
    APP: Init ... Done !!!
    45.125685 s: VX_ZONE_INIT:Enabled
    45.125707 s: VX_ZONE_ERROR:Enabled
    45.125712 s: VX_ZONE_WARNING:Enabled
    45.126364 s: VX_ZONE_INIT:[tivxInit:71] Initialization Done !!!
    45.126517 s: VX_ZONE_INIT:[tivxHostInit:48] Initialization Done for HOST !!!
    45.130815 s: VX_ZONE_ERROR:[ownContextSendCmd:770] Command ack message returned failure cmd_status: -10
    45.130835 s: VX_ZONE_ERROR:[ownContextSendCmd:806] tivxEventWait() failed.
    45.130841 s: VX_ZONE_ERROR:[ownNodeKernelInit:526] Target kernel, TIVX_CMD_NODE_CREATE failed
    45.130873 s: VX_ZONE_ERROR:[ownGraphNodeKernelInit:583] kernel init for node 2, kernel com.ti.hwa.display ... failed !!!
    45.130881 s: VX_ZONE_ERROR:[vxVerifyGraph:2010] Node kernel init failed
    45.130886 s: VX_ZONE_ERROR:[vxVerifyGraph:2064] Graph verify failed
    45.131050 s: VX_ZONE_ERROR:[tivxExportGraphToDot:1414] Invalid parameters or graph node not verified Loading [/opt/vision_apps/test_data/lena.bmp] ...
    Running graph ...
    45.155597 s: VX_ZONE_ERROR:[ownContextSendCmd:770] Command ack message returned failure cmd_status: -1
    45.155607 s: VX_ZONE_ERROR:[ownContextSendCmd:806] tivxEventWait() failed.
    45.155612 s: VX_ZONE_ERROR:[ownNodeKernelInit:526] Target kernel, TIVX_CMD_NODE_CREATE failed
    45.155645 s: VX_ZONE_ERROR:[ownGraphNodeKernelInit:583] kernel init for node 2, kernel com.ti.hwa.display ... failed !!!
    45.155652 s: VX_ZONE_ERROR:[vxVerifyGraph:2010] Node kernel init failed
    45.155657 s: VX_ZONE_ERROR:[vxVerifyGraph:2064] Graph verify failed
    45.155812 s: VX_ZONE_ERROR:[ownGraphScheduleGraphWrapper:807] graph is not in a state required to be scheduled
    45.155819 s: VX_ZONE_ERROR:[vxWaitGraph:877] graph not in expected state
    Saving [app_gac_demo.bmp] ...
    Done !!!
    50.205130 s: VX_ZONE_ERROR:[vxReleaseContext:1026] Reference 109 not removed
    50.205140 s: VX_ZONE_ERROR:[vxReleaseContext:1026] Reference 110 not removed
    50.205155 s: VX_ZONE_INIT:[tivxHostDeInit:56] De-Initialization Done for HOST !!!
    50.205170 s: VX_ZONE_ERROR:[tivxObjectDeInit:282] Is data ref q use failed
    50.209465 s: VX_ZONE_INIT:[tivxDeInit:111] De-Initialization Done !!!
    APP: Deinit ... !!!
    REMOTE_SERVICE: Deinit ... !!!
    REMOTE_SERVICE: Deinit ... Done !!!
    IPC: Deinit ... !!!
    IPC: DeInit ... Done !!!
    MEM: Deinit ... !!!
    MEM: Alloc's: 12 alloc's of 4302226 bytes
    MEM: Free's : 12 free's of 4302226 bytes
    MEM: Open's : 0 allocs of 0 bytes
    MEM: Deinit ... Done !!!
    APP: Deinit ... Done !!!

  • /*here is my main.c file*/
    #include "Displaymodule.h"
    
    
    typedef struct {
    
        /* config options */
        char input_file_1[APP_MAX_FILE_PATH];
        char output_file[APP_MAX_FILE_PATH];
        uint32_t width;
        uint32_t height;
    
        /* OpenVX references */
        vx_context context;
        vx_graph graph;
        vx_node  colorConvertNode;
        vx_node  channelExtractNode;
        vx_image input_img1;
        vx_image yuv_img;
        vx_image output_img;
    
        //DisplayObj displayObj1;
        DisplayObj displayObj;
        vx_int32 input_img_graph_parameter_index;
    } AppObj;
    
    AppObj gAppObj;
    
    static void app_parse_cmd_line_args(AppObj *obj, int argc, char *argv[]);
    static void app_init(AppObj *obj);
    static void app_deinit(AppObj *obj);
    static vx_status app_create_graph(AppObj *obj);
    //static vx_status app_display_img(AppObj *obj);
    static vx_status app_run_graph(AppObj *obj);
    static void app_delete_graph(AppObj *obj);
    void show_graph_attributes(vx_graph graph);
    
    
    
    static void VX_CALLBACK log_callback(vx_context context, vx_reference ref, vx_status status, const vx_char string[])
    {
        size_t len = strlen(string);
        if (len > 0) {
            printf("%s", string);
            if (string[len - 1] != '\n')
                printf("\n");
            fflush(stdout);
        }
    }
    
    void add_graph_parameter_by_node_index( vx_graph graph, 
                                            vx_node node,
                                            vx_uint32 node_parameter_index)
    {
        vx_parameter parameter = vxGetParameterByIndex(node, node_parameter_index);
    
        vxAddParameterToGraph(graph, parameter);
        vxReleaseParameter(&parameter);
    }
    
    int app_gac_openvx_demo_main(int argc, char* argv[])
    {
        AppObj *obj = &gAppObj;
    
        app_parse_cmd_line_args(obj, argc, argv);
        app_init(obj);
        app_create_graph(obj);
        app_run_graph(obj);
        app_delete_graph(obj);
        app_deinit(obj);
    
        return 0;
    }
    
    static void app_init(AppObj *obj)
    {
        obj->context = vxCreateContext();
        APP_ASSERT_VALID_REF(obj->context);
        tivxHwaLoadKernels(obj->context);
        app_init_display( obj->context, &obj->displayObj , "displayObj");
        vxRegisterLogCallback(obj->context, log_callback, vx_false_e);
    }
    
    static void app_deinit(AppObj *obj)
    {   
        //app_deinit_display1(&obj->displayObj);
        app_deinit_display(&obj->displayObj);
        tivxHwaUnLoadKernels(obj->context);
        vxReleaseContext(&obj->context);
    }
    
    /*
     * Graph,
     *
     * input_img_1 -> ChannelExtractNode -----> output_img
     */
    static vx_status app_create_graph(AppObj *obj)
    {
        vx_status status = VX_SUCCESS;
    
        obj->graph = vxCreateGraph(obj->context);
        APP_ASSERT_VALID_REF(obj->graph);
    
        obj->input_img1 = vxCreateImage(obj->context, obj->width, obj->height, VX_DF_IMAGE_RGB);
        APP_ASSERT_VALID_REF(obj->input_img1);
        vxSetReferenceName((vx_reference)obj->input_img1, "Input1ImageRGB");
    
        obj->yuv_img  = vxCreateVirtualImage(obj->graph, obj->width, obj->height, VX_DF_IMAGE_IYUV);
        APP_ASSERT_VALID_REF(obj->yuv_img);
        vxSetReferenceName((vx_reference)obj->yuv_img, "IntermediateImageYUV");
    
        obj->output_img = vxCreateImage(obj->context, obj->width, obj->height, VX_DF_IMAGE_U8);
        APP_ASSERT_VALID_REF(obj->output_img);
        vxSetReferenceName((vx_reference)obj->output_img, "OutputImageU8");
       
    
        obj->colorConvertNode = vxColorConvertNode(obj->graph, obj->input_img1, obj->yuv_img),
        APP_ASSERT_VALID_REF(obj->colorConvertNode);
        vxSetReferenceName((vx_reference)obj->colorConvertNode, "colorConvertNode");
    
        obj->channelExtractNode = vxChannelExtractNode(obj->graph, obj->yuv_img, VX_CHANNEL_Y, obj->output_img),
        APP_ASSERT_VALID_REF(obj->channelExtractNode);
        vxSetReferenceName((vx_reference)obj->channelExtractNode, "channelExtractNode");
    
        app_create_graph_display(obj->graph, &obj->displayObj,obj->output_img);
    
        add_graph_parameter_by_node_index(obj->graph, obj->displayObj.node, 1);
        
        tivxSetGraphPipelineDepth(obj->graph,2);
      
        status = vxVerifyGraph(obj->graph);
        APP_ASSERT(status==VX_SUCCESS);
        status = tivxExportGraphToDot(obj->graph,".", "vx_app_gac_openvx_demo");
     
        return status;
    }
    
    static void app_delete_graph(AppObj *obj)
    {
        vxReleaseNode(&obj->channelExtractNode);
        vxReleaseNode(&obj->colorConvertNode);
        vxReleaseImage(&obj->input_img1);
        vxReleaseImage(&obj->yuv_img);
        vxReleaseImage(&obj->output_img);
        app_delete_display(&obj->displayObj);
        vxReleaseGraph(&obj->graph);
    }
    
    static vx_status app_run_graph(AppObj *obj)
    {
        vx_status status = VX_SUCCESS;
    
        printf(" Loading [%s] ...\n", obj->input_file_1);
        tivx_utils_load_vximage_from_bmpfile(obj->input_img1, obj->input_file_1, vx_false_e);
    
        printf(" Running graph ...\n");
        #if 1
        status = vxScheduleGraph(obj->graph);
        APP_ASSERT(status==VX_SUCCESS);
        status = vxWaitGraph(obj->graph);
        APP_ASSERT(status==VX_SUCCESS);
        tivxTaskWaitMsecs(5000); 
        #endif
        printf(" Saving [%s] ...\n", obj->output_file);
        tivx_utils_save_vximage_to_bmpfile(obj->output_file, obj->output_img);
        printf(" Done !!!\n"); 
    
        return status;
    }
    
    
    static void app_show_usage(int argc, char* argv[])
    {
        printf("\n");
        printf(" GAC OpenVX demo - (c) GAC R&D 2020\n");
        printf(" ========================================================\n");
        printf("\n");
        printf(" Usage,\n");
        printf("  %s --cfg <config file>\n", argv[0]);
        printf("\n");
    }
    
    static void app_set_cfg_default(AppObj *obj)
    {
        snprintf(obj->input_file_1,APP_MAX_FILE_PATH, "./img_1.bmp");
        snprintf(obj->output_file,APP_MAX_FILE_PATH, "./out_img.bmp");
        obj->width = 640;
        obj->height = 480;
        obj->displayObj.display_option = 1;
    }
    
    static void app_parse_cfg_file(AppObj *obj, char *cfg_file_name)
    {
        FILE *fp = fopen(cfg_file_name, "r");
        char line_str[1024];
        char *token;
    
        if(fp==NULL)
        {
            printf("# ERROR: Unable to open config file [%s]\n", cfg_file_name);
            exit(0);
        }
    
        while(fgets(line_str, sizeof(line_str), fp)!=NULL)
        {
            char s[]=" \t";
    
            if (strchr(line_str, '#'))
            {
                continue;
            }
    
            /* get the first token */
            token = strtok(line_str, s);
            if(strcmp(token, "input_file_1")==0)
            {
                token = strtok(NULL, s);
                token[strlen(token)-1]=0;
                strcpy(obj->input_file_1, token);
            }
            else
            if(strcmp(token, "output_file")==0)
            {
                token = strtok(NULL, s);
                token[strlen(token)-1]=0;
                strcpy(obj->output_file, token);
            }
            else
            if(strcmp(token, "width")==0)
            {
                token = strtok(NULL, s);
                obj->width = atoi(token);
            }
            else
            if(strcmp(token, "height")==0)
            {
                token = strtok(NULL, s);
                obj->height = atoi(token);
            }
        }
    
        fclose(fp);
    }
    
    static void app_parse_cmd_line_args(AppObj *obj, int argc, char *argv[])
    {
        int i;
    
        app_set_cfg_default(obj);
    
        if(argc==1)
        {
            app_show_usage(argc, argv);
            exit(0);
        }
    
        for(i=0; i<argc; i++)
        {
            if(strcmp(argv[i], "--cfg")==0)
            {
                i++;
                if(i>=argc)
                {
                    app_show_usage(argc, argv);
                }
                app_parse_cfg_file(obj, argv[i]);
                break;
            }
            else
            if(strcmp(argv[i], "--help")==0)
            {
                app_show_usage(argc, argv);
                exit(0);
            }
        }
    }
    

  • /*here is my display.c file*/
    #include "Displaymodule.h"
    
    
    vx_status app_init_display(vx_context context, DisplayObj *displayObj, char *objName)
    {
      vx_status status = VX_SUCCESS;
    
        if (vx_true_e == tivxIsTargetEnabled(TIVX_TARGET_DISPLAY1) && (1 == displayObj->display_option))
        {
            memset(&displayObj->display_params, 0, sizeof(tivx_display_params_t));
            displayObj->display_config = vxCreateUserDataObject(context, 
                                                                "tivx_display_params_t",
                                                                sizeof(tivx_display_params_t), 
                                                                NULL);
            APP_ASSERT_VALID_REF(displayObj->display_config);
    
            vxSetReferenceName((vx_reference)displayObj->display_config, "DisplayConfiguration");
    
            displayObj->display_params.opMode=TIVX_KERNEL_DISPLAY_BUFFER_COPY_MODE;
            displayObj->display_params.pipeId = 0;
            displayObj->display_params.outWidth = DISPLAY_WIDTH;
            displayObj->display_params.outHeight = DISPLAY_HEIGHT;
            displayObj->display_params.posX = (1920-DISPLAY_WIDTH);
            displayObj->display_params.posY = (1080-DISPLAY_HEIGHT)/2 - 80;
    
            status = vxCopyUserDataObject(displayObj->display_config, 
                                            0, 
                                            sizeof(tivx_display_params_t), 
                                            &displayObj->display_params, 
                                            VX_WRITE_ONLY, 
                                            VX_MEMORY_TYPE_HOST);
    
            APP_ASSERT(status==VX_SUCCESS);
        }
    
      return status;
    }
    
    
    
    void app_deinit_display(DisplayObj *displayObj)
    {
        if (vx_true_e == tivxIsTargetEnabled(TIVX_TARGET_DISPLAY1) && (displayObj->display_option == 1))
        {
            vxReleaseUserDataObject(&displayObj->display_config);
        }
    }
    
    
    void app_delete_display(DisplayObj *displayObj)
    {
    
        if (vx_true_e == tivxIsTargetEnabled(TIVX_TARGET_DISPLAY1) && (displayObj->display_option == 1))
        {
            vxReleaseNode(&displayObj->node);
        }
    
    }
    
    vx_status app_create_graph_display(vx_graph graph, DisplayObj *displayObj, vx_image disp_image)
    {
        vx_status status = VX_SUCCESS;
    
        if (vx_true_e == tivxIsTargetEnabled(TIVX_TARGET_DISPLAY1) && (displayObj->display_option == 1))
        {
            displayObj->node = tivxDisplayNode(
                                                graph,
                                                displayObj->display_config,
                                                disp_image);
            status = vxGetStatus((vx_reference)displayObj->node);
            if (VX_SUCCESS != status)
            {
                printf("# ERROR: Display is not enabled on this platform, please disable it in config \n");
            }
            APP_ASSERT(VX_SUCCESS == status);
            status = vxSetNodeTarget(displayObj->node, VX_TARGET_STRING, TIVX_TARGET_DISPLAY1);
            APP_ASSERT(status==VX_SUCCESS);
            vxSetReferenceName((vx_reference)displayObj->node, "Display");
        }
    
        return status;
    }
    
    

  • Hi Li,

    I think what is missing is call to API tivxSetNodeParameterNumBufByIndex for each node. 

    You have created three nodes, color convert, channel extract and display node and enabled the pipeline with the depth of 2. But you have not increased the depth of output buffer for each node. 

    Can you add below code before VerifyGraph and see if it works?

    tivxSetNodeParameterNumBufByIndex(obj->colorConvertNode, 1, 2);

    tivxSetNodeParameterNumBufByIndex(obj->channelExtractNode, 1, 2);

    Here, the last parameter is queue depth. since you have pipeline depth as 2, i have also kept output buffer depth on each node as 2..

    Please refer to any simple example, which enables pipelining in the graph. If we miss any of the steps, the framework would return error..

    Regards,

    Brijesh

  • Hi Berijesh,

    I update the code as above, i still get the error when the kernel initials.

    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 !!!
    APP: Init ... Done !!!
    34.928509 s: VX_ZONE_INIT:Enabled
    34.928526 s: VX_ZONE_ERROR:Enabled
    34.928530 s: VX_ZONE_WARNING:Enabled
    34.929055 s: VX_ZONE_INIT:[tivxInit:71] Initialization Done !!!
    34.929165 s: VX_ZONE_INIT:[tivxHostInit:48] Initialization Done for HOST !!
    34.930948 s: VX_ZONE_ERROR:[tivxSetNodeParameterNumBufByIndex:2310] Invalis
    34.933865 s: VX_ZONE_ERROR:[ownContextSendCmd:770] Command ack message ret0
    34.933874 s: VX_ZONE_ERROR:[ownContextSendCmd:806] tivxEventWait() failed.
    34.933880 s: VX_ZONE_ERROR:[ownNodeKernelInit:526] Target kernel, TIVX_CMDd
    34.933912 s: VX_ZONE_ERROR:[ownGraphNodeKernelInit:583] kernel init for no!
    34.933920 s: VX_ZONE_ERROR:[vxVerifyGraph:2010] Node kernel init failed
    34.933925 s: VX_ZONE_ERROR:[vxVerifyGraph:2064] Graph verify failed
    34.934097 s: VX_ZONE_ERROR:[tivxExportGraphToDot:1414] Invalid parameters .
    Running graph ...

  • Hi Brijesh,

    I tried several times and set the parameter as below.


    tivxSetNodeParameterNumBufByIndex(obj->colorConvertNode, 1, 2);

    tivxSetNodeParameterNumBufByIndex(obj->channelExtractNode, 2, 2);

    In log now i have no errors any more but still i have no correct display output img.

    I update the code also in another reply. Could you PLZ check the code and give me some advices?

  • #include "Displaymodule.h"
    #include "Display_common.h"
    
    
    typedef struct {
    
        /* config options */
        char input_file_1[APP_MAX_FILE_PATH];
        char output_file[APP_MAX_FILE_PATH];
        uint32_t width;
        uint32_t height;
    
        /* OpenVX references */
        vx_context context;
        vx_graph graph;
        vx_node  colorConvertNode;
        vx_node  channelExtractNode;
        vx_image input_img1[MAX_NUM_BUF];
        vx_image yuv_img;
        vx_image output_img[MAX_NUM_BUF];
        DisplayObj displayObj;
    } AppObj;
    
    AppObj gAppObj;
    
    static void app_parse_cmd_line_args(AppObj *obj, int argc, char *argv[]);
    static void app_init(AppObj *obj);
    static void app_deinit(AppObj *obj);
    static vx_status app_create_graph(AppObj *obj);
    static vx_status app_run_graph(AppObj *obj);
    static void app_delete_graph(AppObj *obj);
    
    
    static void VX_CALLBACK log_callback(vx_context context, vx_reference ref, vx_status status, const vx_char string[])
    {
        size_t len = strlen(string);
        if (len > 0) {
            printf("%s", string);
            if (string[len - 1] != '\n')
                printf("\n");
            fflush(stdout);
        }
    }
    
    void add_graph_parameter_by_node_index( vx_graph graph, 
                                            vx_node node,
                                            vx_uint32 node_parameter_index)
    {
        vx_parameter parameter = vxGetParameterByIndex(node, node_parameter_index);
    
        vxAddParameterToGraph(graph, parameter);
        vxReleaseParameter(&parameter);
    }
    
    int app_gac_openvx_demo_main(int argc, char* argv[])
    {
        AppObj *obj = &gAppObj;
    
        app_parse_cmd_line_args(obj, argc, argv);
        app_init(obj);
        app_create_graph(obj);
        app_run_graph(obj);
        app_delete_graph(obj);
        app_deinit(obj);
    
        return 0;
    }
    
    static void app_init(AppObj *obj)
    {
       obj->context = vxCreateContext();
    
        tivxHwaLoadKernels(obj->context);
    
        app_init_display( obj->context, &obj->displayObj , "displayObj");
        vxRegisterLogCallback(obj->context, log_callback, vx_false_e);
    }
    
    static void app_deinit(AppObj *obj)
    {   
        app_deinit_display(&obj->displayObj);
        tivxHwaUnLoadKernels(obj->context);
        vxReleaseContext(&obj->context);
    }
    
    /*
     * Graph,
     *
     * input_img_1 -> ChannelExtractNode -----> output_img
     */
    static vx_status app_create_graph(AppObj *obj)
    {
        vx_status status = VX_SUCCESS;
        vx_graph_parameter_queue_params_t graph_parameters_queue_params_list[2];
        uint32_t num_buf, buf_id;
        num_buf=MAX_NUM_BUF;
    
    
        obj->graph = vxCreateGraph(obj->context);
        APP_ASSERT_VALID_REF(obj->graph);
        
        for(buf_id=0; buf_id<num_buf; buf_id++)
        {
            obj->input_img1[buf_id] = vxCreateImage(obj->context, obj->width, obj->height, VX_DF_IMAGE_RGB);
            obj->output_img[buf_id] = vxCreateImage(obj->context, obj->width, obj->height, VX_DF_IMAGE_U8);
        }
    
        obj->yuv_img  = vxCreateVirtualImage(obj->graph, obj->width, obj->height, VX_DF_IMAGE_IYUV);
    
        obj->colorConvertNode = vxColorConvertNode(obj->graph, obj->input_img1[0], obj->yuv_img),
        APP_ASSERT_VALID_REF(obj->colorConvertNode);
        vxSetReferenceName((vx_reference)obj->colorConvertNode, "colorConvertNode");
    
        obj->channelExtractNode = vxChannelExtractNode(obj->graph, obj->yuv_img, VX_CHANNEL_Y, obj->output_img[0]),
        APP_ASSERT_VALID_REF(obj->channelExtractNode);
        vxSetReferenceName((vx_reference)obj->channelExtractNode, "channelExtractNode");
        
        app_create_graph_display(obj->graph, &obj->displayObj,obj->output_img[0]);
    
        int graph_parameter_num = 0;
            /* Set graph schedule config such that graph parameter @ index 0 is
             * enqueuable */
        add_graph_parameter_by_node_index(obj->graph, obj->colorConvertNode, 0);
        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 = MAX_NUM_BUF;
        graph_parameters_queue_params_list[graph_parameter_num].refs_list = (vx_reference*)&obj->input_img1[0];
        graph_parameter_num++;
    
    
        add_graph_parameter_by_node_index(obj->graph, obj->channelExtractNode, 1);
        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 = MAX_NUM_BUF;
        graph_parameters_queue_params_list[graph_parameter_num].refs_list = (vx_reference*)&obj->output_img[0];
        graph_parameter_num++;
    
    
        vxSetGraphScheduleConfig(obj->graph,
                VX_GRAPH_SCHEDULE_MODE_QUEUE_AUTO,
                graph_parameter_num,    
                graph_parameters_queue_params_list);
    
        tivxSetGraphPipelineDepth(obj->graph,2);
    
        tivxSetNodeParameterNumBufByIndex(obj->colorConvertNode, 1, 2);
        
        tivxSetNodeParameterNumBufByIndex(obj->channelExtractNode, 2, 2);
       
        status = vxVerifyGraph(obj->graph);
    
        APP_ASSERT(status==VX_SUCCESS);
        status = tivxExportGraphToDot(obj->graph,".", "vx_app_gac_openvx_demo");
     
        return status;
    }
    
    static void app_delete_graph(AppObj *obj)
    {
        vx_int32 buf_id,num_buf;
    
        num_buf=MAX_NUM_BUF;
    
    
        vxReleaseNode(&obj->channelExtractNode);
        vxReleaseNode(&obj->colorConvertNode);
          for(buf_id=0; buf_id<num_buf; buf_id++)
        {
            vxReleaseImage(&obj->input_img1[buf_id]);
            vxReleaseImage(&obj->output_img[buf_id]);
        }
        vxReleaseImage(&obj->yuv_img);
        app_delete_display(&obj->displayObj);
        vxReleaseGraph(&obj->graph);
    }
    
    static vx_status app_run_graph(AppObj *obj)
    {
        vx_status status = VX_SUCCESS;
        uint32_t num_buf, buf_id, loop_id, loop_cnt;
    
        num_buf=MAX_NUM_BUF;
        loop_cnt = 10 - num_buf; /* runs the graph 10 times */
    
        printf(" Loading [%s] ...\n", obj->input_file_1);
        tivx_utils_load_vximage_from_bmpfile(obj->input_img1[0], obj->input_file_1, vx_false_e);
    
       
        #if 1
        printf(" Running graph ...\n");
        for(buf_id=0; buf_id<num_buf; buf_id++)
        {
           
            /* reset output */
            vxGraphParameterEnqueueReadyRef(obj->graph, 1, (vx_reference*)&obj->output_img[buf_id], 1);
           
            /* load input */
            vxGraphParameterEnqueueReadyRef(obj->graph, 0, (vx_reference*)&obj->input_img1[buf_id], 1);
        }
    
        buf_id = 0;
        for(loop_id=0; loop_id<(loop_cnt+num_buf); loop_id++)
        {
            vx_image cur_out_img, cur_in_img;
            uint32_t num_refs;
    
            vxGraphParameterDequeueDoneRef(obj->graph, 1, (vx_reference*)&cur_out_img, 1, &num_refs);
            vxGraphParameterDequeueDoneRef(obj->graph, 0, (vx_reference*)&cur_in_img, 1, &num_refs);
            buf_id = (buf_id+1)%num_buf;
          
            if(loop_id<loop_cnt)
            {
                vxGraphParameterEnqueueReadyRef(obj->graph, 1, (vx_reference*)&cur_out_img, 1);
                vxGraphParameterEnqueueReadyRef(obj->graph, 0, (vx_reference*)&cur_in_img, 1);
            }
        }
        status = vxWaitGraph(obj->graph);
        APP_ASSERT(status==VX_SUCCESS);
        tivxTaskWaitMsecs(5000);
        
        #endif
        printf(" Saving [%s] ...\n", obj->output_file);
        tivx_utils_save_vximage_to_bmpfile(obj->output_file, obj->output_img[0]);
        printf(" Done !!!\n"); 
    
    
        return status;
    }
    
    
    static void app_show_usage(int argc, char* argv[])
    {    
        printf("\n");
        printf(" GAC OpenVX demo - (c) GAC R&D 2020\n");
        printf(" ========================================================\n");
        printf("\n");
        printf(" Usage,\n");
        printf("  %s --cfg <config file>\n", argv[0]);
        printf("\n");
    }
    
    static void app_set_cfg_default(AppObj *obj)
    {
        snprintf(obj->input_file_1,APP_MAX_FILE_PATH, "./lena.bmp");
        snprintf(obj->output_file,APP_MAX_FILE_PATH, "./app_gac_demo.bmp");
        obj->width = 640;
        obj->height = 480;
        obj->displayObj.display_option = 1;
    }
    
    static void app_parse_cfg_file(AppObj *obj, char *cfg_file_name)
    {
        FILE *fp = fopen(cfg_file_name, "r");
        char line_str[1024];
        char *token;
    
        if(fp==NULL)
        {
            printf("# ERROR: Unable to open config file [%s]\n", cfg_file_name);
            exit(0);
        }
    
        while(fgets(line_str, sizeof(line_str), fp)!=NULL)
        {
            char s[]=" \t";
    
            if (strchr(line_str, '#'))
            {
                continue;
            }
    
            /* get the first token */
            token = strtok(line_str, s);
            if(strcmp(token, "input_file_1")==0)
            {
                token = strtok(NULL, s);
                token[strlen(token)-1]=0;
                strcpy(obj->input_file_1, token);
            }
            else
            if(strcmp(token, "output_file")==0)
            {
                token = strtok(NULL, s);
                token[strlen(token)-1]=0;
                strcpy(obj->output_file, token);
            }
            else
            if(strcmp(token, "width")==0)
            {
                token = strtok(NULL, s);
                obj->width = atoi(token);
            }
            else
            if(strcmp(token, "height")==0)
            {
                token = strtok(NULL, s);
                obj->height = atoi(token);
            }
        }
    
        fclose(fp);
    }
    
    static void app_parse_cmd_line_args(AppObj *obj, int argc, char *argv[])
    {
        int i;
    
        app_set_cfg_default(obj);
    
        if(argc==1)
        {
            app_show_usage(argc, argv);
            exit(0);
        }
    
        for(i=0; i<argc; i++)
        {
            if(strcmp(argv[i], "--cfg")==0)
            {
                i++;
                if(i>=argc)
                {
                    app_show_usage(argc, argv);
                }
                app_parse_cfg_file(obj, argv[i]);
                break;
            }
            else
            if(strcmp(argv[i], "--help")==0)
            {
                app_show_usage(argc, argv);
                exit(0);
            }
        }
    }
    
    

  • Hi Li,

    Few questions/Queries from the example,

    1, Any specific reason to register callback to Log (vxRegisterLogCallback)?

    2, Any specific reason for using output_img as graph parameter? Is it just to view the output image offline? 

    3, In the line "tivxSetNodeParameterNumBufByIndex(obj->channelExtractNode, 2, 2);", you are asking framework to create a queue of buffers for parameter 2 of channel extract. But i think you have created this as graph parameter, so it is not required. 

    Can you try comment out call to tivxSetNodeParameterNumBufByIndex for channelExtract node?

    Regards,

    Brijesh

  • Hello LI,

    I have posted reply on the other thread, .

     Lets continue discussion over there.

    I am closing this thread.

    Regards,

    Brijesh