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.

ICS : gst-openmax is blocked at OMX_EventPortSettingsChanged event

hello:

Currently I am working on ICS, and gstreamer is porting to ICS, ffdec + gstsurfaceflingersink could works well.

I met a gst-openmax blocking issue while process HW DEC, after set the apporiate parameters as stagefright,

after receive message OMX_EventPortSettingsChanged event , firstly i would link to disable output port, but blocking while sendCommand to OMX, 

I checked the ducati side, in function _OMX_BASE_EventNotifyToClient, output port defination is exactly.

and the block point is   "TIMM_OSAL_EventRetrieve"

does anybody have some idea?

thanks in advance.

Br,

Ning

  • Ning;

    When OMX_EventPortSettingsChanged event is received Client IL needs to disabled the component and call OMX_FrreBuffer for all the buffer of that port index that are allocated, component is waiting for this to happen to complete the state transition.

    After this it is possible to call OMX_GetParameter/OMX_SetParameter and\or OMX_GetConfig/OMX_SetConfig to read and configure correct values and calculate correct buffer sizes between other calculations.

    Similar thing happens when the component is enabled it requires to send the command to enable and the component is going to wait for buffers to be allocated before passing to next state.

    When OMX_EventPortSettingsChanged event is generated in its parameters it contains the port index for what is generated this event and data2 contains the type of event or for what configuration index was in the cases when it is indicated.

    Port disable command is similar to moving the component to OMX_StateLoaded allocated resources are deallocated in before moving to next state, same for port enable it is similar to to moving to OMX_StateIdle.

  • Thanks for reply.

    As mentioned, it is true that after OMX change state to executing,

    so firstly , buffers already allocated during change state to IDLE .

    later, encoded buffer received in gst-openmax, and sent to OMX by empty this buffer.  And output buffer released to OMX that's for get the decoded bufferdata.

    But during this OMX_EventPortSettingsChanged event occurs (for portindex=output port) that's triggered by first frame data.

    when I tried to disable output port, sendcommand always blocked, that input and output port defination are correct.

    besides this, when OMX_EventPortSettingsChanged event received, other action (eg.OMX_GetParameter ) from OMX also blocked...





         

  • Ning Wei;

    I faced similar issue for OMX_SendCommand to become unresponsive when something was incorrect in previous configuration and one thread became unresponsive,port reconfiguration is required to get correctly padded and multiple of 16 resolutions, it calculates others values that are read from first buffer SPS+PPS, this is made at Ducati level, those calculated values are important to correct functioning.

    If may I know, are you implementing GST-OpenMax for AFS? or it is an actual GST implementation?

    Port reconfiguration is required and it could not be part of your actual GST code, is it implemented? this to know what version are you using.

    I going to suppose next points about your current development environment, if some point is incorrect can you correct it or confirm it in either case?

    1. You are building your code inside Android source code system. Important point to know what is you actual environment and used variables.

    2. You are building for either Blaze, Blaze Tablet or Panda Board. If you are using Panda Board some configurations could not be the same as in Blaze.

    3. In your Android configuration board you are using next configurations,

    ./4AI.1.4/mydroid/device/ti/blaze/BoardConfig.mk

    OMAP_ENHANCEMENT := true
    ENHANCED_DOMX := true
    ifdef OMAP_ENHANCEMENT
      COMMON_GLOBAL_CFLAGS += -DOMAP_ENHANCEMENT -DTARGET_OMAP4
    ifdef OMAP_ENHANCEMENT_S3D
      COMMON_GLOBAL_CFLAGS += -DOMAP_ENHANCEMENT_S3D
    endif
    endif

    4. Are you using 4AI1.x? just to know for references.

    5. In your Android.mk file or current project Makefile you have next include directory,

    LOCAL_C_INCLUDES += $(TOP)/hardware/ti/omap4xxx/domx/omx_core/inc

    or

    LOCAL_C_INCLUDES += $(TOP)/hardware/ti/domx/omx_core/inc

    What value are you defining in your code? it must be second one to select correct OMX Indexes and other features.

    6. Can you check if between your makefile options it matches with what are used in sample test? just to check it, reason, it is hanging at some point some flag could be incorrect and returning an error before this point and it is not checked. one code to compare is

    http://review.omapzoom.org/#/c/22418/

    I may need some log to see how code is executing, I don't have a reference on how and what your code is doing, if you can share some more information could be great.

    If my questions are not correct or not applicable please comment it.

  • Hello Dear Manuel:

    Please see my comments, thank you very much .

    Manuel Contreras said:

    Ning Wei;

    I faced similar issue for OMX_SendCommand to become unresponsive when something was incorrect in previous configuration and one thread became unresponsive,port reconfiguration is required to get correctly padded and multiple of 16 resolutions, it calculates others values that are read from first buffer SPS+PPS, this is made at Ducati level, those calculated values are important to correct functioning.

    If may I know, are you implementing GST-OpenMax for AFS? or it is an actual GST implementation?

    >> My development env is OMAP4430 blaze + android ICS, gst-openmax source code is following , that gst-openmax works well in our android 2.3, but blocking in android 4.0 as  described,  when first encoded buffer is sent to OMX, event OMX_EventPortSettingsChanged receivd, it blocked, send command failed...

    https://github.com/mrchapp/gst-openmax/tree/gst-24.14-rc

    Port reconfiguration is required and it could not be part of your actual GST code, is it implemented? this to know what version are you using.

    >> In OMX callback function, eventHandler(gstomx_core.c), 

           case OMX_EventPortSettingsChanged:

                    OMX_SendCommand(mNode, OMX_CommandPortDisable, portIndex, NULL); ==> This function call never returned.... if calling OMX_GetPortDefinations, blocking too

         

    I going to suppose next points about your current development environment, if some point is incorrect can you correct it or confirm it in either case?

    1. You are building your code inside Android source code system. Important point to know what is you actual environment and used variables. 

    2. You are building for either Blaze, Blaze Tablet or Panda Board. If you are using Panda Board some configurations could not be the same as in Blaze.

      >>  My development env is OMAP4430 blaze + android ICS, 

    3. In your Android configuration board you are using next configurations,

    ./4AI.1.4/mydroid/device/ti/blaze/BoardConfig.mk

    OMAP_ENHANCEMENT := true
    ENHANCED_DOMX := true
    ifdef OMAP_ENHANCEMENT
      COMMON_GLOBAL_CFLAGS += -DOMAP_ENHANCEMENT -DTARGET_OMAP4
    ifdef OMAP_ENHANCEMENT_S3D
      COMMON_GLOBAL_CFLAGS += -DOMAP_ENHANCEMENT_S3D
    endif
    endif

    >> Yes, checked, this configuration is correct.

    4. Are you using 4AI1.x? just to know for references.

    5. In your Android.mk file or current project Makefile you have next include directory,

    LOCAL_C_INCLUDES += $(TOP)/hardware/ti/omap4xxx/domx/omx_core/inc   ==> Use this, Stagefright also reference this, but she could plays well.

    or

    LOCAL_C_INCLUDES += $(TOP)/hardware/ti/domx/omx_core/inc   ===> I also tested this include, same thing occures.

    What value are you defining in your code? it must be second one to select correct OMX Indexes and other features.

    6. Can you check if between your makefile options it matches with what are used in sample test? just to check it, reason, it is hanging at some point some flag could be incorrect and returning an error before this point and it is not checked. one code to compare is

    http://review.omapzoom.org/#/c/22418/

    >> Thanks, I download the file and made modifications according to my test file,  running video_decode_bin in my blaze ,  same thing, it blocked when OMX_EventPortSettingsChanged. I upload the modified test_video_decoder.c and corresponding log here.

    http://www.ziddu.com/download/19599145/test_video_decoder.zip.html 

    I may need some log to see how code is executing, I don't have a reference on how and what your code is doing, if you can share some more information could be great.

    >> in gst-openmax:

           1) OMX_IndexParamVideoPortFormat, Get/Set both Input port and output port; 

            2) OMX_IndexParamPortDefinition, 

                for Input port, correct nFrameWidth, nFrameHeight, eCompressionFormat, eColorFormat, and nBufferSize=64K

                for output port, correct nFrameWidth, nFrameHeight,xFramerate

             3) native_window_set_crop/ native_window_set_buffer_layout

              4) enableGraphic buffer

              5) Allocate buffer:

                 Input port, OMX_AllocateBuffer

                 Output port,  Set up the native window(scaling mode, geometry, usage...),  

                                    nativewindow->dequeueBuffer, then OMX_UseBuffer

              6) EmptyBuffer/FillBuffer

              7) OMX_EventPortSettingsChanged, received and send port disable command blocked...

                  In all the past steps, there is no error... 

                  ducati trace and gstreamer traces are uploaded here.

                 http://www.ziddu.com/download/19599291/ducati_gstreamer.zip.html

                  Dynamic port reconfiguration triggered since small o/p buffer size provided in first frame decode

    If my questions are not correct or not applicable please comment it.

    >> I use test_decoder_bin that have 1D output buffer, but it still blocked on OMX_EventPortSettingsChanged event, same blocking point. But stagefright could plays well in same blaze configure.

         Do you think I missed configuration?  

  • Hello Dear Manuel:

    The reason is found, OMX_EventPortSettingsChanged should be processed asynchronous, but gst-openmax do it sync. so blocked.

    Thank you.

  • No problem, great to know issue is identified now.

    Thanks for sharing the answer.