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.

Enabling Ports on a newly created OMX Component fails

Hi Folks,
Using this exercise, I wanted to be able to add, build and run our own omx component(s), and so i started off by using the simple example of the "vsrc" omx component that was provided. I duplicated the "vsrc" Omx component and called it the "videosource" omx component. But after i had successfully compiled my videosource omx component for the a8host in my demo IL client and tried to run it using the video source to video sink test, the execution halted at a certain point. I was able to obtain a valid handle to the videosource component, set it to loaded state, and start up the component's thread. When i tried to Enable the output port(s) on the component, this is where i then ran into the issue. It seems like the videosource thread stops running, but the main thread did get successfully notified of the EventCmdComplete

At this point, i have tried several things, but am not sure if this is a memory allocation issue or something else under the hood. Any tips on how to debug the OpenMAX layers or even how to enable tracing in them would be much appreciated.

My changes to add an omx component are listed below.

videosource OMX Component - omx_05_00_00_09/packapes/company/omx/comp/videosource

  1. Modified the omx component's header and source files as needed. e.g. omx_videosource.h, src/omx_videosource.c, src/omx_videosurce_utils.c src/omx_videosource_utils.h, src/omx_videosource_priv.h
  2. Renamed occurences of "vsrc" to "videosource" and renamed other occurences appropriately and as needed.
  3. Modified the omx component's makefile as needed. e.g. MODULE_NAME = videosource, SRCS_COMMON = omx_videosource.c omx_videosource_utils.h
  4. Allocated enough stack size in src/omx_videosource_priv.h - #define OMX_VIDEOSOURCE_STACKSIZE  (1024 * 1000)


vs2 demo

  1. src/omx_src_snk_ilc.c - Included necessary header files, and in function "OMX_SSILC1_Test" replaced the second parameter to OMX_GetHandle using the "OMX_VIDEOSOURCE_COMP_NAME" component name, instead of OMX_VSRC_COMP_NAME
  2. src/app_cfg.h - Added the following:  #define DOMX_CORE_videosource_a8host   /* Signifies that videosource runs on host-A8 core */
  3. makefile - Appended the "videosource" component to the list of components specified in the COMP_LIST_a8host


omxcore

  • omxcore_cfg.c

#ifdef _BUILD_videosource_
 {
    OMX_VIDEOSOURCE_COMP_NAME,
    VIDEOSOURCE_COMP_INIT_FNPTR,
    0,
    {{0}}
 },
#endif

  • omxcore_cfg.h - defined ComponentInit funtion pointer for a8host, m3video, and m3vpss cores, e.g.

 /* VIDEOSOURCE */
 #ifndef VIDEOSOURCE_COMP_INIT_FNPTR    /* It is not defined by the app/integrator */
  #ifdef DOMX_CORE_videosource_m3vpss               /* resides on local core */
   #define VIDEOSOURCE_COMP_INIT_FNPTR    (OMX_XXX_VIDEOSOURCE_ComponentInit)
  #else                                 /* resides on the remote core */
   #define VIDEOSOURCE_COMP_INIT_FNPTR    (DomxProxy_OMX_XXX_VIDEOSOURCE_ComponentInit)
  #endif
 #endif

domx

  • domxProxyWrappers.c

OMX_ERRORTYPE DomxProxy_OMX_XXX_VIDEOSOURCE_ComponentInit (OMX_HANDLETYPE hComponent)
{
    return OmxProxy_commonInit(hComponent, OMX_VIDEOSOURCE_COMP_NAME);
}

  • domx_cfg.c

  #ifdef _BUILD_videosource_
  {
    OMX_VIDEOSOURCE_COMP_NAME,
    DOMX_CORE_COMPINFOTBL_COREID_videosource,
    DOMX_CORE_COMPINFOTBL_CTRLRCMSVRPRI_videosource,
    DOMX_CORE_COMPINFOTBL_CBRCMSVRPRI_videosource,
    DOMX_CORE_COMPINFOTBL_MAXNUMBUFFS_videosource,
  },
  #endif

 #ifdef DOMX_OMXPROXY_VIDEOSOURCE
  {
    OMX_VIDEOSOURCE_COMP_NAME,
    customConfigInfo_16,
  },
 #endif

  • domx_cfg.h - added Entry for videosource and under each of the three core's respective _LOCAL_CORE_xxxxxx_ sections
  • domx_compfn_defs.h - Extern's the following function prototypes

extern OMX_ERRORTYPE OMX_XXX_VIDEOSOURCE_ComponentInit(OMX_HANDLETYPE hComponent);
extern OMX_ERRORTYPE DomxProxy_OMX_XXX_VIDEOSOURCE_ComponentInit (OMX_HANDLETYPE hComponent);

omx_05_00_00_09/packapes/component.mk

  • Added $(videosource_INCLUDE) to omx_INCLUDE, and:
  • omx_COMP_LIST_a8host = cmux dmux rtptx rtprx videosource
  • Added the following

# VIDEOSOURCE - Video Source Component

videosource_RELPATH = xxx/omx/comp/videosource
videosource_PATH = $(omx_PATH)/$(videosource_RELPATH)
videosource_INCLUDE = $(videosource_PATH) $(videosource_PATH)/src
videosource_PKG_LIST = videosource
videosource_PLATFORM_DEPENDENCY = yes

  • Hi,

    Could you please try with SDK 5.0.0.11? Couple of issues have been resolved in this release. If you are looking at a single channel scenario, please try out VC3.

    Regards,

    Naveen

     

  • Hi Naveen,

    Thankyou for your response earlier. I moved the code to the new release of the SDK 5.0.0.11 and ran it, only to find the same results. i.e. After you enable the ports on the newly added component, the source component's thread does not appear to be printing the printf that i inserted to print out once every second in its while loop, and the main thread is blocked on the semaphore waiting for the state change event.

    Have there been any issues with others who had tried to add and run their own OpenMAX components, instead of modify the existing ones?

    Thanks,

    Dominic