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.

H264 omx decoder not stable with odd number of nals processed at input.

Hi,

I'm trying to build a player using the omx components and Gstreamer. From the stability standpoint I found that keeping the handle for the component allows me to survive endurance testing for days, just by reconfiguring the ports acording to the desired resolution and options. After a lot of testing I found that when decoding h264 interlaced video if a odd number of nal units are processed by the decoder I get a Omx_ErrorUndefined.
I modified the omx application decode-display in order to reproduce the issue, here is the code, the application and the test file:

/cfs-file/__key/communityserver-discussions-components-files/791/2110.data.zip

The data flow goes like this:

                                                    - > omx_display
file->omx_h264dec->omx_dei->|
                                                      -> discarded


Testing the aplication, the following works (I kept the deiscaler to check the output, but is not actually deinterlacing the output is configured at 1080p ):

/decode_display_a8host_debug.xv5T -o /tmp/file.h264   -i /test-000.h264    -m 1080p -c h264 -f 30 -b 10000000 -n 60 -d 0 -r 1


That is actually able to survive for days. The following fails:

/decode_display_a8host_debug.xv5T -o /tmp/file.h264   -i /test-000.h264    -m 1080p -c h264 -f 30 -b 10000000 -n 61 -d 0 -r 1

After the first iterationg I get  a Omx_ErrorUndefined, the interlaced file test-000.h264 is included in the zip file.  Here is the log from my aplication when it fails:

Decoder processing frame: 8
Processing buffer number 8
Sending buffers to the decoder
In Parser number of bytes i :0 bytes: 184
In Parser number of bytes i :65 bytes: 184
In Parser returning Success i: 120
Sending framesize to component: 19808
Decoder processing frame: 9
Processing buffer number 9
got event*** unrecoverable error: OMX_ErrorUndefined (0x80001001)
Press a key to proceed
Sending buffers to the decoder
In Parser number of bytes i :0 bytes: 184
In Parser number of bytes i :65 bytes: 184
In Parser returning Success i: 90
Sending framesize to component: 26218
Decoder processing frame: 10
Processing buffer number 10
Sending buffer downstream
Sending buffers to the decoder

This causes that a buffer is never returned via empty_callback (lost forever?) and makes the application unable to restart again without destroying the handle of the decoder. I'm testing on the Dm8168 EVM with ezsdk 5_05_02_00.  Any suggestions will be greatly appreciated.

  • Hi Jose,
    I tried to reproduce the issue with your decode_display executable but I am seeing some issue with this.
    The stream you have shared has odd number of frames(fields), Last frame has only top field and bottom field is missing
    but default decode_display example which is provided with EZSDK works fine for this stream without any issue. Can you try this?

    When this issue occurs, execute

    /usr/share/ti/ti-uia/loggerSMDump.out 0x9E400000 0x00100000 video and check you are seeing this message.
    "VDEC->Warning!!! Codec is not freeing all buffers in XDM_FLUSH"

    This is to check if decoder has locked up any buffer or not.

    Ram
  • Hi Ramprasad,
    Thanks for your reply. The problem with the omx application that is provided in the EZSDK is that each time you run it will create and destroy each omx component from scratch, my actual scenario is more like a player where I just need to reconfigure the decoder to decode the stream I want without freeing handles (and actually, not destoying instances of omx components has proven to be more stable ). I modified the application so that when you run it with the option "-r 1" it will play the same file and reconfigure the omx component keeping the handle and it works fine till it's an odd number of nal units is sent with the stream I shared.
    I'm actually not able to see that warning from the decoder, but I do see the following error:

    N:Video P:1 #:00967 T:000000236d69c8a1 M:xdc.runtime.Main S: OMX Error in OMX_TI_VIDDEC_CB_ProcessDone :: line 3031


    I think that's the one that produces the Omx_ErrorUndefined. Since destroying the omx instance of the decoder (calling free_handle, and get_handle) in the same process allows me to play the file several times in a row, I think that the issue must be somehow OMX related. In case furter testing is required, I have access to the ezsdk overlay, any ideas?

    Thanks again,
    JJ

    Ps: Create/destroy instances is not an option because it crashes at some point endurance tests.