Posts: 40
Joined: Thu Jul 19, 2012 7:23 am
Location: Czech Republic

omx_image stops working after latest rpi firmware update

Thu Dec 01, 2016 9:23 am

I was happy using example omx_image for loading jpeg images directly to texture with help of OMX_UseEGLImage.
But after rpi firmware update Commits on Oct4 2016 ... 6f9bd41e45 it stops working. It stops(stuck) loading image around line 575 in omx_image.c (OMX_UseEGLImage).
I don't know what changed in rpi firmware but I'm not able to modify this example to make it working with the latest rpi firmware update.

Posts: 11
Joined: Thu Nov 21, 2013 3:21 pm

Re: omx_image stops working after latest rpi firmware update

Sat Dec 17, 2016 5:45 am

Think they updated the implementation to be more compliant with the OpenMAX spec.

From the OpenMAX spec ... cation.pdf section

"The nData2 field of EventHandler specifies the unaltered nFlags field containing the end-of-stream (EOS) flag."

Previously they would just return 0x1 (OMX_BUFFERFLAG_EOS) for the nData2 field even if the nFlags had originally been set to 0x11 (OMX_BUFFERFLAG_EOS | OMX_BUFFERFLAG_ENDOFFRAME). New firmware made it correctly return 0x11.

Changed the code to now work exclusively with the new firmware.

Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 10530
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: omx_image stops working after latest rpi firmware update

Sat Dec 17, 2016 12:52 pm

Resize was failing to pass flags or timestamps through correctly (or at all), and that was fixed.
I had had a look at the commit text for the Oct 4th release, but it didn't include details of one of the firmware changes:
resize: Only set the flags on the last stripe and include OMX_BUFFERFLAG_ENDOFFRAME
That included two sections:

Code: Select all

+            // only set valid flags on the last frame
+            out->nFlags = output->flags | OMX_BUFFERFLAG_ENDOFFRAME;
-            out->nFlags |= OMX_BUFFERFLAG_EOS;
+            out->nFlags = output->flags | OMX_BUFFERFLAG_EOS;
So that would do it as you are passing in header->nFlags = OMX_BUFFERFLAG_EOS | OMX_BUFFERFLAG_ENDOFFRAME;.

It would have been nice if there had been a link to the issue raised on github to avoid duplicating effort.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

Return to “OpenMAX”