New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
hello_mmal_encode fails to compile on upgraded Stretch Lite #1027
Comments
Please try
The userland repo is the master copy of that code. I've just tried it and it builds fine. There is a PR (https://github.com/raspberrypi/userland/pull/459/files) to set --no-as-needed on various libraries. |
Hmm, it looks like the content of that commit got merged internally but not into userland. |
Yes, the userland Repo builds OK, but the firmware Repo does not. Thanks for starting to sort this out, I'll wait for the changes to work their way through the system. In the meantime I'll tell those users who have not already broken their systems with an upgrade not to upgrade. |
kernel: bcm2835: interpolate audio delay See: #1026 kernel: dtoverlays: Add support for ADV7280-M and ADV7281-M chips See: raspberrypi/linux#2656 kernel: First batch of fixes for V4L2 camera driver See: raspberrypi/linux#2609 kernel: Revert mm: alloc_contig: re-allow CMA to compact FS pages See: raspberrypi/linux#2647 firmware: rawcam: Fix double buffer return issue firmware: rawcam: Code cleanup firmware: host_apps: Fixup partially merged commit from userland See: #1027 firmware: mmal: Add KEEP_PORT_FORMATS flag to mmal connection See: raspberrypi/userland#483 firmware: RaspiStill: Apply gpsd info as EXIF tags See: raspberrypi/userland#286
kernel: bcm2835: interpolate audio delay See: raspberrypi/firmware#1026 kernel: dtoverlays: Add support for ADV7280-M and ADV7281-M chips See: raspberrypi/linux#2656 kernel: First batch of fixes for V4L2 camera driver See: raspberrypi/linux#2609 kernel: Revert mm: alloc_contig: re-allow CMA to compact FS pages See: raspberrypi/linux#2647 firmware: rawcam: Fix double buffer return issue firmware: rawcam: Code cleanup firmware: host_apps: Fixup partially merged commit from userland See: raspberrypi/firmware#1027 firmware: mmal: Add KEEP_PORT_FORMATS flag to mmal connection See: raspberrypi/userland#483 firmware: RaspiStill: Apply gpsd info as EXIF tags See: raspberrypi/userland#286
@davecrump is this now fixed for you with latest update? |
Note that that is update via rpi-update, and not via apt (yet). |
Thanks for your efforts guys, but I'm not out of the woods yet. I have built a new card using the 2018-06-27-raspbian-stretch-lite.img, then run sudo rpi-update, then run my installer, which among other things does |
Sorry, you'll never get an IL error and a MMAL error being the same. Or are you meaning that if you ran your app on the same version firmware as had the MMAL compile failure then you got that error? They are two totally independent things. There have been changes to video encode to support additional input formats and using a hardware block instead of software for internal conversions. Most of those went in with ec9d84e, although there was a followup in 911147a due to #182 (the software requirements on stride were looser than the hardware version). /** Ports being connected are not compatible */ |
My mistake; I hadn't thought it through. The MMAL error seems to have been cured; the separate IL error has occurred since a change that came after ec9d84e. I'll try to provide more detail later. Thanks! |
Before the error occurs, the camera port is port is set up with this Has something changed in ec9d84e that might have broken this? Dave |
It seems that this firmware upgrade break ALL openmax based softwares that use Camera (NO backward compatible)
@6by9 : Can you update IL documentation or explain in details what are changes in order so fix the issue (until you can provide a backward compatible firmware) |
I don't have any IL test apps to hand other than hello_encode which is working fine. That seriously hampers any form of debugging. MMAL all seems to be working properly. I can't amend documentation or fix something if I can't reproduce! The one linked project is huge, so there is no way I'm going to try and build it. Minor observations:
is wrong.
That's the base buffer address takes that alignment, not the stride. The code snippet above appears not to set nSliceHeight either, although https://github.com/davecrump/portsdown/blob/master/src/avc2ts/avc2ts.cpp#L1090 does, but without any alignment (likely to fail on 1080P as 1080 is not a multiple of 16). |
Thx for observations, will check that. If the project is too big, you can also try with a minimal project like : https://github.com/gagle/raspberrypi-openmax-h264 |
Thank you - https://github.com/gagle/raspberrypi-openmax-h264 does show the issue, and it is in not setting nSliceHeight sensibly when combined with IL tunnelling. Camera defaults to producing 16 line stripes. Video_encode can't cope with that as the codec requires full frames. When tunnelled it attempts to set the video encode input port format to only have 16 line stripes, and that fails. My quick patch
The old firmware didn't sanity check the port definition if proprietary tunnelling had been agreed, whilst the new one does (unnecessarily). I'll try to sort out a patch to remove that requirement. Yes the IL spec does say that nSliceHeight is read only, but that is a barking made state of affairs. The components have no context over what they are connected to, nor whether they are in a low memory or max performance use case, hence why it is implemented as read/write. |
@6by9 Confirm that your patch works. I will modify avc2ts and confirm all is OK. @davecrump could then close issue. |
A polite request to please keep to one problem per raised issue - this was raised as an unrelated MMAL issue and should have remained one. |
A valid request. Sorry - I did not realise that there were 2 issues here until we were well into it. That was due to my unfamiliarity with the video encoding side of the RPi. Thanks both for progressing the resolution. |
2 last questions before I close the issue: Reference the hello_mmal_encode compile error that is fixed by kernel 4.14.66. How long till this gets into the apt update (as opposed to rpi-update)? Reference the change to the IL video encode. Where is the documentation referred to by @6by9 ? Some final tests today and then I will close this issue. Thanks, Dave |
That depends on when one of us nudges @XECDesign to pick up the changes and repackage them.
Which documentation reference? |
Thanks @6by9 very useful. Now that @F5OEO has updated avc2ts https://github.com/F5OEO/avc2ts/commit/b4ff9d2ce1cc80e85f0927f60e567b5a253e519a (which works well!) I can close this issue and wait for @XECDesign to repackage kernel 4.14.66 so that I can move my user community on to it (when they feel like upgrading...). |
I have been using hello_mmal_encode for over a year now on Jessie Lite and Stretch Lite. However, in the last month or so it has started throwing an error at compile time on Stretch Lite. If I build a new card using the 2018-06-27-raspbian-stretch-lite.img (on a RPi 3B) and then
cd /opt/vc/src/hello_pi/ ./rebuild.sh
I get no errors. However, if I upgrade and then compile:
cd ~ sudo apt-get update sudo apt-get -y dist-upgrade cd /opt/vc/src/hello_pi/ ./rebuild.sh
I get this error:
make -C hello_mmal_encode make[1]: Entering directory '/opt/vc/src/hello_pi/hello_mmal_encode' cc -DSTANDALONE -D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS -DTARGET_POSIX -D_LINUX -fPIC -DPIC -D_REENTRANT -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -U_FORTIFY_SOURCE -Wall -g -DHAVE_LIBOPENMAX=2 -DOMX -DOMX_SKIP64BIT -ftree-vectorize -pipe -DUSE_EXTERNAL_OMX -DHAVE_LIBBCM_HOST -DUSE_EXTERNAL_LIBBCM_HOST -DUSE_VCHIQ_ARM -Wno-psabi -I/opt/vc/include/ -I/opt/vc/include/interface/vcos/pthreads -I/opt/vc/include/interface/vmcs_host/linux -I./ -I/opt/vc/src/hello_pi/libs/ilclient -I/opt/vc/src/hello_pi/libs/vgfont -g -c mmal_encode.c -o mmal_encode.o -Wno-deprecated-declarations cc -o hello_mmal_encode.bin -Wl,--whole-archive mmal_encode.o -lmmal -lmmal_core -lmmal_components -lmmal_util -lmmal_vc_client --no-as-needed -L/opt/vc/lib/ -lbrcmGLESv2 -lbrcmEGL -lopenmaxil -lbcm_host -lvcos -lvchiq_arm -lpthread -lrt -lm -L/opt/vc/src/hello_pi/libs/ilclient -L/opt/vc/src/hello_pi/libs/vgfont -Wl,--no-whole-archive -rdynamic cc: error: unrecognized command line option ‘--no-as-needed’; did you mean ‘--no-assert’? ../Makefile.include:19: recipe for target 'hello_mmal_encode.bin' failed make[1]: *** [hello_mmal_encode.bin] Error 1 rm mmal_encode.o make[1]: Leaving directory '/opt/vc/src/hello_pi/hello_mmal_encode' Makefile:10: recipe for target 'apps' failed make: *** [apps] Error 2
Adding -Wl, in front of --no-as-needed in the Makefile clears the compile error, but hello_mmal_encode seems to be non-functional afterwards. it looks like commit 418b77e is causing the problem.
How can i get hello_mmal_encode to compile and function on a clean upgraded Stretch Lite build?
Thanks, Dave
The text was updated successfully, but these errors were encountered: