imx8mqevk linux OpenMax H.264 decoder component transition state issue

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

imx8mqevk linux OpenMax H.264 decoder component transition state issue

1,437 Views
doug4350
Contributor II

Hi NXP Community,

I'm trying to create a video decoder using the Hantro library and am starting with this:

imx-vpu-hantro-1.10.0/openmax_il/source/decoder/test/video_decoder.c

I'm getting problems transitioning the component state from Loaded -> Idle -> Executing.

In the setup_component(...) function, near line 1289,

// should have transitioned to idle state now

OMX_STATETYPE state = OMX_StateLoaded;

while (state != OMX_StateIdle && state != OMX_StateInvalid) {

    err = comp->GetState(comp, &state);

    if (err != OMX_ErrorNone)

        goto FAIL;

}

if (state == OMX_StateInvalid)

    goto FAIL;

err = comp->SendCommand(comp, OMX_CommandStateSet, OMX_StateExecuting, NULL);

if (err != OMX_ErrorNone)

    goto FAIL;

 

The execution gets stuck in an endless loop in the section while (state != OMX_StateIdle ...).

I've modified the loop to sleep 750uSec between iterations and fall out after 100 iterations, and I get an (expected) error message:

OMX  ! decoder_send_command Transition is already pending (dec->statetrans != dec->state) decoder.c:818

I've also tried combinations of enabling/disabling the component input and output ports with no success.

Are there specific conditions inside the component that need to be set before it can transition to Idle? 

Any other suggestions?

Edit: Does anyone have a sample of the test_script.txt file that the test program is using?

Thanks for any feedback you can offer.

- Doug

"Nothing is impossible if ImPossible"

edit: bump

0 Kudos
2 Replies

1,078 Views
doug4350
Contributor II

Hi Igor and thanks for the suggestions.

I was getting a bunch of headaches trying to get the unit test - mxc_vpu_test to work as it doesn't seem to support the MX8 and led me to conclude a lot of it was MX6 specific.  I do have the imx8mqevk board.

So, I picked apart the imx-vpu-hantro-1.10.0/openmax_il/source/decoder/test/video_decoder.c source file to figure out how it works, and got symptoms which look similar to what I was getting.  Here's the command line and output:

imx8mqevk:/run/media/mmcblk0p2/home/nxp/sybor/3rdParty/imx-vpu-hantro-1.10.0/openmax_il/source/decoder/test$ ./video_decoder -h264 -i ../../../../../../test.h264 -ih 480 -iw 480

OMX component test video decoder

Mar 20 2019, 05:52:06

[DBGT][debug_video_decoder_trace] disabled

[DBGT] g1dec compiled without trace support (ENABLE_DBGT_TRACE switch not enabled)

Input buffer width x height (480x480)

Allocating input buffer size 256000

bufPrivateInput 0xffffa6a0c010 / 281473477296144

Allocating input buffer size 256000

bufPrivateInput 0xffffa69cd010 / 281473477038096

Allocating input buffer size 256000

bufPrivateInput 0xffffa698e010 / 281473476780048

Allocating input buffer size 256000

bufPrivateInput 0xffffa694f010 / 281473476522000

Allocating input buffer size 256000

bufPrivateInput 0xffffa6910010 / 281473476263952

Allocating input buffer size 256000

bufPrivateInput 0xffffa68d1010 / 281473476005904

Allocating input buffer size 256000

bufPrivateInput 0xffffa6892010 / 281473475747856

Allocating input buffer size 256000

bufPrivateInput 0xffffa6853010 / 281473475489808

Allocating input buffer size 256000

bufPrivateInput 0xffffa6814010 / 281473475231760

Allocating input buffer size 256000

bufPrivateInput 0xffffa67d5010 / 281473474973712

Allocating output buffer size 1382400

bufPrivateOutput 0xffffa6683010 / 281473473589264

Allocating output buffer size 1382400

bufPrivateOutput 0xffffa6531010 / 281473472204816

Allocating output buffer size 1382400

OSAL    ! OSAL_EventWaitMultiple select(max+1, &read, NULL, NULL, &tv) failed openmax_il/source/OSAL.c:1057

OSAL    ! OSAL_EventWaitMultiple select(max+1, &read, NULL, NULL, &tv) failed openmax_il/source/OSAL.c:1057

bufPrivateOutput 0xffffa63df010 / 281473470820368

Allocating output buffer size 1382400

OSAL    ! OSAL_EventWaitMultiple select(max+1, &read, NULL, NULL, &tv) failed openmax_il/source/OSAL.c:1057

bufPrivateOutput 0xffffa628d010 / 281473469435920

Allocating output buffer size 1382400

bufPrivateOutput 0xffffa613b010 / 281473468051472

Allocating output buffer size 1382400

bufPrivateOutput 0xffffa5fe9010 / 281473466667024

Allocating output buffer size 1382400

bufPrivateOutput 0xffffa5e97010 / 281473465282576

Allocating output buffer size 1382400

bufPrivateOutput 0xffffa5d45010 / 281473463898128

Allocating output buffer size 1382400

bufPrivateOutput 0xffffa5bf3010 / 281473462513680

Allocating output buffer size 1382400

bufPrivateOutput 0xffffa5aa1010 / 281473461129232

OSAL    ! OSAL_EventWaitMultiple select(max+1, &read, NULL, NULL, &tv) failed openmax_il/source/OSAL.c:1057

OMX H264 ! HantroHwDecOmx_decoder_create_h264 H264DecInit error codec_h264.c:903

OMX  ! transition_to_idle_from_loaded ASYNC: error: OMX_ErrorHardware decoder.c:5146

OMX  ! async_decoder_set_state ASYNC: set state error:OMX_ErrorHardware decoder.c:5828

VIDEO_DECODER ! setup_component error: OMX_ErrorNone

video_decoder.c:1318

OMX  ! decoder_get_parameter Invalid state decoder.c:2126

VIDEO_DECODER ! comp_event Error: OMX_ErrorHardware video_decoder.c:745

OMX  ! decoder_push_buffer Invalid state decoder.c:3358

OMX  ! decoder_get_parameter Invalid state decoder.c:2126

Result summary:

Tests run: 1

Tests pass: 0

Tests fail: 1

Tests else: 0

*** FAIL ***

I'm not sure what I'm missing or where to look other than going down a rabbit trail into decoder.c.

Ideas?

Thanks,

- Doug

"Nothing is impossible if ImPossible"

0 Kudos

1,077 Views
igorpadykov
NXP Employee
NXP Employee

Hi Doug

some vpu unit tests can be found in sect.6.6.2.3 Unit test attached Linux Manual

imx-test - i.MX Driver Test Application Software 

Also may be useful

i.mx8M EVK board encoder and decoder 

Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos