Share your knowledge at the LQ Wiki.
Go Back > Forums > Linux Forums > Linux - Distributions > Slackware > Slackware - ARM
User Name
Slackware - ARM This forum is for the discussion of Slackware ARM.


  Search this Thread
Old 02-04-2019, 02:07 AM   #1
Registered: Jul 2017
Location: EU
Distribution: Slackware
Posts: 904

Rep: Reputation: 468Reputation: 468Reputation: 468Reputation: 468Reputation: 468
KODI Leia - 18.x MediaPlayer - Optimized for Raspberry Pi1/Zero/Pi2B/Pi3B(+) on Slackware ARM 14.2 SF & Slackware ARM - current HF

Kodi 18.0 - codename Leia has been released, it contains a lot of optimizations and it's apparently able to play DRM content (NetFlix, Amazon Prime, etc. included).

The build method has changed, somewhat simplified/automated, it's all wrapped in cmake now, not really properly documented for Raspberry builds and a little difficult to fine-tune/optimize.
But I did receive some proper help and I'm thankful for that.
- first, The Kodi Team
- then:
(I'm not so familiar with cmake and had to ask for help for the Raspberry target compilation details)

Before you follow the instructions presented here, look after & read the follow-up posts from this thread, as they may contain some corrections or adaptations.
Due to the way LQ works, I won't be able to update this original post after a while.

If you already have Kodi 17.x installed and would like to upgrade it, you'll be able to - upgrade is supported. Backup your /home/kodi/.kodi/ directory (just in case), uninstall the previous Kodi version, make sure you manually delete the 3-4 directories removepkg will not delete and install this version.
Do not launch it in case you built some add-ons for Kodi 17.x, you'll need to rebuild them - follow the ADD-ONS sections from this How-To for the details.

As with Kodi 17, I'll cover both Slackware ARM releases and the Raspberry P1 1/0, Pi2B, Pi3B boards:
Using "pi1" will imply Slack ARM 14.2 - SoftFloat on armv6 (RaspberryPi 1/0)
Using "pi2" will imply Slack ARM current - HardFloat on armv7 (RaspberryPi 2B)
Using "pi3" will imply Slack ARM current - HardFloat on armv8 (Raspberry Pi3B(+))
To avoid any confusions, I'm going to use absolute paths in my instructions and again using /kit/kodi-slack-build/ as the top tree for the compilation work.
There will be some steps you might find absurd, but you'll find the reasons behind them in the Kodi Forum thread I posted above.
During the Kodi compilation, you'll need to be online, because the Kodi build scripts will need to download a few source packages.

Edit: - some more "idiot-proof-ness"
Prepare the working directory and enter the deps subdirectory for resolving the dependencies first.
If you're not building as the user root (I do it all the time), then don't forget to chown (needs root privileges) the working directory for your user.
Substitute your-username with your actual user in the command in bold from the following section:

# as root
mkdir -p /kit/kodi-slack-build/
# then, only if you're not building as root
chown -R your-username:users /kit/kodi-slack-build/
# exit root / switch to your user if you're not planning to stay & build as root
mkdir -p /kit/kodi-slack-build/deps/
cd /kit/kodi-slack-build/deps/

The dependencies, plenty of, are the same as with Kodi 17, and there are some more.

1. FFmpeg:
- there are 3 ways I documented to build the required FFmpeg 4.x for Kodi:
a. The way the Kodi Team is doing with their "endorsed" FFmpeg 4.0.3-Leia-RC5.tar.gz (OMX Player is broken):
b. The way FFmpeg 4.0.3-Leia-RC5.tar.gz is officially designed to support the MMAL & OMX HW Acceleration (OMX Player is broken):
c. The way FFmpeg 4.1 is officially designed to support the MMAL & OMX HW Acceleration (OMX Player is broken):
- in any of these 3 cases don't forget to resolve the FFmpeg dependencies described here:
- build it & install it, run ldconfig
- there is a possibility to let Kodi build FFmpeg internally&statically (highly recommended), but ATM the FFmpeg configure script is broken and I'm not sure if the compiler CPU optimization flags are passed to the FFmpeg build and if the Raspberry specific FFmpeg HW accelerations are enabled (MMAL, OMX) by cmake.
- to build FFmpeg internally/statically, make sure you have no FFmpeg available on the system, Kodi won't find one to link with, and do some investigation and patching in the files: CMakeLists.txt,, Makefile, before you start the Kodi compilation. There you could also patch the configure script.
- just in case you're interested, these files will be available in your /kit/kodi-slack-build/xbmc-18.0-Leia/tools/depends/target/ffmpeg/ folder.

2. for java / libbluray (this should be already available in Slackware ARM) / libgpg-error / lirc / yajl follow the dependencies section from Kodi 17:
- there might be newer versions available for all of the above - I didn't bother to upgrade
- alternatively, look for slackbuilds at

3. tinyXML
- use the Slackbuild fix (add -fPIC) that stormtracknole presented here:

4. fstrcmp - no slackbuild available
tar -xzpf fstrcmp-0.7.D001.tar.gz
cd fstrcmp-0.7.D001/
make && make install
cd /kit/kodi-slack-build/deps/
# or, create a package
5. rapidjson
for pi2 & pi3 - Slackware ARM -current, use ponce's slackbuild:
and patch it according to this post:

6. libxkbcommon

7. only for pi1 you'll need libinput and there's a little extra effort to put in building its deps.
- build & install these in the following order:
then follow:
- the above will install the python3 module setuptools needed by meson
and finally:

8. CEC support - if you want to control Kodi through your CEC enabled TV set (works through HDMI)

9. libmicrohttpd - only needed if you plan to control Kodi remotely and unsecurely (doesn't use HTTPS) through a web browser or the official Kodi android remote application (Kore)
- just for reference:

10. don't forget to run:


- get the source code and unpack it:
cd /kit/kodi-slack-build/
tar -xzpf 18.0-Leia.tar.gz
- preparing the compilation environment:
- only for pi1, the Kodi build scripts will look after /usr/bin/grep
cp /usr/sbin/grep /usr/bin/grep
- absurd step - playing hide and seek - uninstall mesa as the build scripts from Kodi will link to it. You'll install it back after the Kodi compilation (if you don't forget about it).
ls -al /var/log/packages/mesa*
# get the name and then remove it - substitute mesa-name with the actual package name
removepkg /var/log/packages/mesa-name
- to get it back, just run:
slackpkg install mesa
- edit the project build script for optimizing the compiler flags:
- for pi1 modify the CPU flags section like this:
  elseif(CPU STREQUAL arm1176jzf-s)
    set(ARCH arm)
    set(NEON False)
    set(NEON_FLAGS "-march=armv6zk -mtune=arm1176jzf-s -mfpu=vfp -mfloat-abi=soft")
- for pi2 and pi3 modify the two CPU flags sections (ATM only modifying the second section would suffice, but better be sure and mod both) like this:
  elseif(CPU MATCHES "cortex-a7")
    set(ARCH arm)
    set(NEON True)
    set(NEON_FLAGS "-fPIC -march=armv7-a -mtune=cortex-a7 -mfpu=neon-vfpv4 -mvectorize-with-neon-quad -mfloat-abi=hard")
  elseif(CPU MATCHES "cortex-a53")
    set(ARCH arm)
    set(NEON True)
    set(NEON_FLAGS "-fPIC -march=armv8-a+crc -mtune=cortex-a53 -mfpu=neon-fp-armv8 -mvectorize-with-neon-quad -mfloat-abi=hard")
# temp until further cleanup is done
# add Raspberry Pi 2 and 3 specific flags
  if(CPU MATCHES "cortex-a7")
    set(NEON_FLAGS "-fPIC -march=armv7-a -mtune=cortex-a7 -mfpu=neon-vfpv4 -mvectorize-with-neon-quad -mfloat-abi=hard")
  elseif(CPU MATCHES "cortex-a53")
    set(NEON_FLAGS "-fPIC -march=armv8-a+crc -mtune=cortex-a53 -mfpu=neon-fp-armv8 -mvectorize-with-neon-quad -mfloat-abi=hard")
- set up the environment and prepare the cmake project.
- create the working directory - cmake project directory:
mkdir /kit/kodi-slack-build/kodi-build/ && cd /kit/kodi-slack-build/kodi-build/
- for pi1 run:
export PATH="$PATH:/opt/java/bin"
CFLAGS="-march=armv6zk -mtune=arm1176jzf-s -mfpu=vfp -mfloat-abi=soft"
CXXFLAGS="-march=armv6zk -mtune=arm1176jzf-s -mfpu=vfp -mfloat-abi=soft"
cmake ../xbmc-18.0-Leia -DCMAKE_INSTALL_PREFIX=/usr/local -DCMAKE_PREFIX_PATH=/opt/vc -DENABLE_INTERNAL_CROSSGUID=ON -DENABLE_INTERNAL_FLATBUFFERS=ON -DENABLE_INTERNAL_FMT=ON -DCORE_SYSTEM_NAME=linux -DCORE_PLATFORM_NAME=rbpi -DWITH_CPU=arm1176jzf-s -DCMAKE_C_FLAGS="-march=armv6zk -mtune=arm1176jzf-s -mfpu=vfp -mfloat-abi=soft" -DCMAKE_CXX_FLAGS="-march=armv6zk -mtune=arm1176jzf-s -mfpu=vfp -mfloat-abi=soft"
- for pi2 run:
export PATH="$PATH:/opt/java/bin"
CFLAGS="-march=armv7-a -mtune=cortex-a7 -mfpu=neon-vfpv4 -mvectorize-with-neon-quad -mfloat-abi=hard"
CXXFLAGS="-march=armv7-a -mtune=cortex-a7 -mfpu=neon-vfpv4 -mvectorize-with-neon-quad -mfloat-abi=hard"
cmake ../xbmc-18.0-Leia -DCMAKE_INSTALL_PREFIX=/usr/local -DCMAKE_PREFIX_PATH=/opt/vc -DENABLE_INTERNAL_CROSSGUID=ON -DENABLE_INTERNAL_FLATBUFFERS=ON -DENABLE_INTERNAL_FMT=ON -DCORE_SYSTEM_NAME=linux -DCORE_PLATFORM_NAME=rbpi -DWITH_CPU=cortex-a7 -DCMAKE_C_FLAGS="-march=armv7-a -mtune=cortex-a7 -mfpu=neon-vfpv4 -mvectorize-with-neon-quad -mfloat-abi=hard" -DCMAKE_CXX_FLAGS="-march=armv7-a -mtune=cortex-a7 -mfpu=neon-vfpv4 -mvectorize-with-neon-quad -mfloat-abi=hard"
- for pi3 run:
export PATH="$PATH:/opt/java/bin"
CFLAGS="-march=armv8-a+crc -mtune=cortex-a53 -mfpu=neon-fp-armv8 -mvectorize-with-neon-quad -mfloat-abi=hard"
CXXFLAGS="-march=armv8-a+crc -mtune=cortex-a53 -mfpu=neon-fp-armv8 -mvectorize-with-neon-quad -mfloat-abi=hard"
cmake ../xbmc-18.0-Leia -DCMAKE_INSTALL_PREFIX=/usr/local -DCMAKE_PREFIX_PATH=/opt/vc -DENABLE_INTERNAL_CROSSGUID=ON -DENABLE_INTERNAL_FLATBUFFERS=ON -DENABLE_INTERNAL_FMT=ON -DCORE_SYSTEM_NAME=linux -DCORE_PLATFORM_NAME=rbpi -DWITH_CPU=cortex-a53 -DCMAKE_C_FLAGS="-march=armv8-a+crc -mtune=cortex-a53 -mfpu=neon-fp-armv8 -mvectorize-with-neon-quad -mfloat-abi=hard" -DCMAKE_CXX_FLAGS="-march=armv8-a+crc -mtune=cortex-a53 -mfpu=neon-fp-armv8 -mvectorize-with-neon-quad -mfloat-abi=hard"
- in all cases follow the output of cmake and look after unresolved dependencies - you might want to add something.
- to restart the process, just clean the content of /kit/kodi-slack-build/kodi-build/ and start over again with the last cmake command, don't forget to cd to that dir:
cd /kit/kodi-slack-build/kodi-build/
- if everything went well, you can start the compilation, but first some considerations about the space&time(continuum).
I used a Pi 2B loaded with Slackware ARM 14.2 SF and 4 make jobs to build for Kodi Pi Zero and I had 960MB RAM available (set the GPU RAM on 32MB for the compilation period). Even so, it was using my swap on a few occasions, writing around 60MB in it. The compilation took well over 4 hours!
On the native Pi 2B compilation under Slackware ARM -current (new toolchain), I could only use 3 make jobs, because with 4 jobs the compilation crashed - at around 30% during the build, it went over both the available RAM and the 200MB swap space. This compilation took around 5-6 hours!
- on pi1, make sure you're still in the /kit/kodi-slack-build/kodi-build/ directory, run:
nohup cmake --build . -- VERBOSE=1 -j 1 2>&1 | tee kodi-build.log &
- on pi2 and pi3, make sure you're still in the /kit/kodi-slack-build/kodi-build/ directory, run:
nohup cmake --build . -- VERBOSE=1 -j 3 2>&1 | tee kodi-build.log &
- go out and play, or take a nap and tail the kodi-build.log from time to time, the cmake will inform you about the stage of the build [percentage%]
- if your build is successful, you'll end up with something like this:
gmake[2]: Leaving directory '/kit/kodi-slack-build/kodi-build'
[100%] Built target kodi
gmake[1]: Leaving directory '/kit/kodi-slack-build/kodi-build'
/usr/bin/cmake -E cmake_progress_start /kit/kodi-slack-build/kodi-build/CMakeFiles 0


- the compilation results will be available in /kit/kodi-slack-build/kodi-build/ and you only need to run make install in that directory, or, create a package:
- for those of you lazier than me, I didn't write a slackbuild for this compilation, here is what I did - copy-paste:
cd /kit/kodi-slack-build/kodi-build/
rm -rf /tmp/build
mkdir /tmp/build
make install DESTDIR=/tmp/build
strip -s /tmp/build/usr/local/lib/* /tmp/build/usr/local/bin/*
cd /tmp/build
mkdir install/
cd install/
mcedit slack-desc
- put the following in slack-desc
# The "handy ruler" below makes it easier to edit a package description.
# Line up the first '|' above the ':' following the base package name, and
# the '|' on the right side marks the last column you can put a character in.
# You must make exactly 11 lines for the formatting to be correct.  It's also
# customary to leave one space after the ':' except on otherwise blank lines.

kodi: kodi 18 - Leia
kodi: Raspberry Pi specific compilation
- then back in the console:
cd /tmp/build/
makepkg -l y -c n ../kodi-18-0-Leia-Raspberry-1-2-3-SF-HF.tgz
mv /tmp/kodi-18-0-Leia-Raspberry-1-2-3-SF-HF.tgz /kit/kodi-slack-build/
cd /kit/kodi-slack-build/
rm -rf /tmp/build/
rm -rf /kit/kodi-slack-build/kodi-build/
- for a new installation, just install the package:
installpkg /kit/kodi-slack-build/kodi-18-0-Leia-Raspberry-1-2-3-SF-HF.tgz

- If this is your first installation, DO NOT yet launch Kodi!

--- ADD-ONS ---
- some important add-ons that you need to build. Prepare the working dir:
mkdir -p /kit/kodi-slack-build/addons-18/ && cd /kit/kodi-slack-build/addons-18/
- the platform add-on, required to be able to build&install other add-ons:
cd /kit/kodi-slack-build/addons-18/
git clone
cd /kit/kodi-slack-build/addons-18/platform/
cmake -DCMAKE_INSTALL_PREFIX=/usr/local
make && make install
- the kodi-platform add-on, required to be able to build&install other add-ons:
cd /kit/kodi-slack-build/addons-18/
git clone
cd /kit/kodi-slack-build/addons-18/kodi-platform/
cmake -DCMAKE_INSTALL_PREFIX=/usr/local
make && make install
- the pvr.hts add-on, in case you want to connect to a TVheadend backend and watch TV:
cd /kit/kodi-slack-build/addons-18/
git clone
cd /kit/kodi-slack-build/addons-18/pvr.hts/
cmake -DCMAKE_INSTALL_PREFIX=/usr/local
make && make install
- the inputstream.adaptive add-on, might be required for some other add-ons (listening/watching online streams):
cd /kit/kodi-slack-build/addons-18/
git clone
cd /kit/kodi-slack-build/addons-18/inputstream.adaptive/
cmake -DCMAKE_INSTALL_PREFIX=/usr/local
make && make install
- the rest of the add-ons you can install from within the Kodi GUI > Add-Ons - from their official repository

--- ADD-ONS END ---

--- CLEAN UP ---

- install back mesa!
- clean ccache
/usr/bin/ccache -C
- only for pi1, remove the grep alter ego
rm -f /usr/bin/grep
--- CLEAN UP END ---

- in my previous Kodi 17 How-To I wasn't using proper formatting (was new on LQ, and on forums in general) and the kodi user setup section looks pretty bad, here you have it again:
- create the kodi user & group and add the user to the required groups:
groupadd kodi
adduser kodi
- for the user kodi use the following settings:
Group: kodi
Directory: /home/kodi
Shell: /bin/bash
- add kodi to the required groups (you might want to add some more, related to storage/power/etc.):
usermod -a -G cdrom,audio,video,plugdev,input,pulse,messagebus kodi
- the /kit/glx and /kit/glkodi scripts from this post (towards the end of the post) might be required:
- launch kodi:
- the configuration hasn't changed too much and you can use the hints I provided in the Kodi 17 How-To post, again the very end of the post - section ------Configuration - Optimization--------

Sharing my personal experience, Kodi 18 doesn't run well on Raspberry Pi Zero (audio&video stuttering) with OMX and analogue out, there are reports in the Kodi Forum about Pi 2B too, and the FFmpeg is in a RC state.
That doesn't mean it won't work well over digital audio - HDMI, the GPU will be less busy with the analogue audio generation.
I'll stick with the solid Kodi 17.4 for the moment. Just wanted to write down all these instructions because I'll forget the details soon, getting older...
Go on and play with it, maybe on a more powerful Pi3B it's running fine with OMX and analogue out, although the GPU is the same on all boards.

Enjoy! And do "annoy" me with errors/inconsistencies you spot in this post & with Slackware/Raspberry related questions.
For the Kodi related ones please address the Kodi Forum.

Last edited by abga; 02-17-2019 at 02:41 PM. Reason: 2 little typos + Edit + ffmpeg details
Old 02-04-2019, 02:21 AM   #2
Registered: Jul 2017
Location: EU
Distribution: Slackware
Posts: 904

Original Poster
Rep: Reputation: 468Reputation: 468Reputation: 468Reputation: 468Reputation: 468
Yes, there is still work in progress and I'm using this second post to write about it, also to have a reply to the original post and to bring it down from the top of the list.

1. Will need to patch (literally butcher) the new Kodi 18.x power/shutdown source code in order to be able to access the very useful Custom Shutdown Timer (sleep timer) from the Exit menu, without allowing the kodi user to shut down the system.

2. I'm failing to build the iptv.simple add-on, required for playing IPTV and I need to dig into its cmake files to understand where to put its newly externalized dependency rapidXML.
This add-on should be normally built like this:
cd /kit/kodi-slack-build/addons-18/
git clone
cd /kit/kodi-slack-build/addons-18/pvr.iptvsimple/
cmake -DCMAKE_INSTALL_PREFIX=/usr/local
make && make install
- but it has a dependency that got "externalized" recently:
- that needs to get extracted somewhere where it can find it, that's before running cmake
- tried this so far and failed - /pvr.iptvsimple/lib/rapidxml/ was the place it was available in the older version of the add-on (for Kodi 17):
cd /kit/kodi-slack-build/addons-18/pvr.iptvsimple/
mkdir -p /kit/kodi-slack-build/addons-18/pvr.iptvsimple/lib/rapidxml/
mv /kit/kodi-slack-build/addons-18/pvr.iptvsimple/rapidxml-1.13/*.hpp /kit/kodi-slack-build/addons-18/pvr.iptvsimple/lib/rapidxml/
- there are some scripts in:
- and some inspiration here:
- all these for when I have a little more time

3. I'll wait for Kodi 18.1.
... tried 18.1 RC1 (cloned the master) yesterday and is still not usable on Pi Zero for watching TV/Movies with OMX and analogue out.
Old 02-04-2019, 05:19 PM   #3
Registered: Jul 2017
Location: EU
Distribution: Slackware
Posts: 904

Original Poster
Rep: Reputation: 468Reputation: 468Reputation: 468Reputation: 468Reputation: 468
I got a reply in the Kodi forum from user asavah, suggesting I should better build the newclock5 Kodi tree prepared by popcornmix:
It's in this tree that all the Raspberry optimizations are first developed and then merged into the main Kodi tree. Apparently, this merge didn't happen with Kodi Leia 18.0 and it's my mistake for not checking it.

I used popcornmix's stuff when I first built Kodi 17 Krypton for Raspberry Pi under Slackware ARM, the beta series, before it was released as stable. The builds were performing well, a little unstable - crashed a lot, but then, all the developments from that popcornmix Raspberry specific tree have been merged into the first official Kody 17 Krypton release and I started to use that instead. This didn't happen with Kodi 18 Leia yet, that's odd, but I'm sure it will in the following official Kodi 18 releases.

I took a look at how FFmpeg is built in popcornmix's newclock5 tree and noticed some interesting patches:
Will try to build that FFmpeg together with the patches (not sure I need hevc) and substitute the "official" one I documented in:

FFmpeg is actually the workhorse that drives the Kodi Media Player and I hope that only this new FFmpeg compilation will resolve the performance issues I reported.
Will post back once I get some time to compile/play/test the new patched FFmpeg.
Old 02-05-2019, 08:03 PM   #4
Registered: Jul 2017
Location: EU
Distribution: Slackware
Posts: 904

Original Poster
Rep: Reputation: 468Reputation: 468Reputation: 468Reputation: 468Reputation: 468
This is the official way in which the Kodi Team is building FFmpeg for the Raspberry target in the Kodi build scripts. This will also enable HW accelerated (GPU aided) HEVC decoding - haven't tested it.

In all my attempts to get the FFmpeg 4.x compiled and optimized for the Raspberry boards, I've used the newer, FFmpeg 4.x official, syntax to enable the MMAL&OMX HW accelerations:
--enable-encoder=h264_omx \
--enable-omx \
--enable-omx-rpi \
--enable-decoder=h264_mmal \
--enable-decoder=mpeg2_mmal \
It looks like the Kodi Team is doing it differently, patching the FFmpeg 4.0.3-Leia-RC5.tar.gz code and using the older (FFmpeg 3.x) --enable-rpi switch, switch that is not available anymore in the official FFmpeg 4.x

Inspiration: popcornmix & LibreELEC - FFmpeg builds:

I suggest to use the LibreELEC patches, these look actual and contain some "patches for the patches", example:

- get the code and unpack it:
tar -xzpf 4.0.3-Leia-RC5.tar.gz
cd FFmpeg-4.0.3-Leia-RC5/
- get the patches from LibreELEC & apply them:
mkdir patches/ && cd patches/
cd ..
patch -p1 < patches/ffmpeg-99.1001-Call-get_format-to-fix-an-issue-with-MMAL-ren.patch
patch -p1 < patches/ffmpeg-99.1002-mpeg4video-Signal-unsupported-GMC-with-more-than-one.patch
patch -p1 < patches/ffmpeg-99.1003-pfcd_hevc_optimisations.patch
patch -p1 < patches/ffmpeg-99.1004-added_upstream_mvc_patches.patch
- Note: The bigger ffmpeg-99.1003-pfcd_hevc_optimisations.patch patch will also modify the configure script and will add the older (ffmpeg 3.x) configuration switch: --enable-rpi

- Configure FFmpeg for the platform you're building on:
- For Pi1 / Pi0:
./configure --extra-ldflags="-L /opt/vc/lib/" \
--extra-cflags="-I/opt/vc/include/ -I/opt/vc/include/interface/vcos/pthreads -I/opt/vc/include/interface/vmcs_host/linux -march=armv6zk -mtune=arm1176jzf-s -mfpu=vfp -mfloat-abi=soft" \
--extra-cxxflags="-march=armv6zk -mtune=arm1176jzf-s -mfpu=vfp -mfloat-abi=soft" \
--extra-libs="-lbcm_host -lvcos -lvchiq_arm -lmmal -lmmal_core -lmmal_util -lvcsm" \
--disable-neon \
--enable-rpi \
--disable-debug \
--enable-stripping \
--disable-v4l2_m2m \
--disable-vaapi \
--disable-vdpau \
--disable-static \
--enable-shared \
--enable-gpl \
--disable-version3 \
--enable-nonfree \
--enable-logging \
--disable-doc \
--enable-pic \
--enable-optimizations \
--disable-extra-warnings \
--disable-programs \
--enable-avdevice \
--enable-avcodec \
--enable-avformat \
--enable-swscale \
--enable-postproc \
--enable-avfilter \
--disable-devices \
--enable-pthreads \
--enable-network \
--disable-gnutls --enable-openssl \
--disable-gray \
--enable-swscale-alpha \
--disable-small \
--enable-dct \
--enable-fft \
--enable-mdct \
--enable-rdft \
--disable-crystalhd \
--enable-runtime-cpudetect \
--disable-hardcoded-tables \
--disable-encoders \
--enable-encoder=ac3 \
--enable-encoder=aac \
--enable-encoder=wmav2 \
--enable-encoder=mjpeg \
--enable-encoder=png \
--enable-hwaccels \
--disable-muxers \
--enable-muxer=spdif \
--enable-muxer=adts \
--enable-muxer=asf \
--enable-muxer=ipod \
--enable-muxer=mpegts \
--enable-demuxers \
--enable-parsers \
--enable-bsfs \
--enable-protocol=http \
--disable-indevs \
--disable-outdevs \
--enable-filters \
--disable-avisynth \
--enable-bzlib \
--disable-lzma \
--disable-alsa \
--disable-frei0r \
--disable-libopencore-amrnb \
--disable-libopencore-amrwb \
--disable-libopencv \
--disable-libdc1394 \
--disable-libfreetype \
--disable-libgsm \
--disable-libmp3lame \
--disable-libopenjpeg \
--disable-librtmp \
--disable-libtheora \
--disable-libvo-amrwbenc \
--disable-libvorbis \
--disable-libvpx \
--disable-libx264 \
--disable-libxavs \
--disable-libxvid \
--enable-zlib \
--enable-asm \
--disable-altivec \
For Pi 2B:
./configure --extra-ldflags="-L /opt/vc/lib/" \
--extra-cflags="-I/opt/vc/include/ -I/opt/vc/include/interface/vcos/pthreads -I/opt/vc/include/interface/vmcs_host/linux -march=armv7-a -mtune=cortex-a7 -mfpu=neon-vfpv4 -mvectorize-with-neon-quad -mfloat-abi=hard" \
--extra-cxxflags="-march=armv7-a -mtune=cortex-a7 -mfpu=neon-vfpv4 -mvectorize-with-neon-quad -mfloat-abi=hard" \
--extra-libs="-lbcm_host -lvcos -lvchiq_arm -lmmal -lmmal_core -lmmal_util -lvcsm" \
--enable-neon \
#continue with the rest of the configure switches - like for Pi1 / Pi0
For Pi 3B(+):
./configure --extra-ldflags="-L /opt/vc/lib/" \
--extra-cflags="-I/opt/vc/include/ -I/opt/vc/include/interface/vcos/pthreads -I/opt/vc/include/interface/vmcs_host/linux -march=armv8-a+crc -mtune=cortex-a53 -mfpu=neon-fp-armv8 -mvectorize-with-neon-quad -mfloat-abi=hard" \
--extra-cxxflags="-march=armv8-a+crc -mtune=cortex-a53 -mfpu=neon-fp-armv8 -mvectorize-with-neon-quad -mfloat-abi=hard" \
--extra-libs="-lbcm_host -lvcos -lvchiq_arm -lmmal -lmmal_core -lmmal_util -lvcsm" \
--enable-neon \
#continue with the rest of the configure switches - like for Pi1 / Pi0
- build it:
#on Pi1 / Zero run:
make -j 1 V=1
# on Pi 2B/ Pi 3B (both quad-core) to avoid exhausting the 1GB RAM, run only 3 make jobs
make -j 3 V=1
- remove any other existent ffmpeg versions/packages and install this one:
make install
- or, create a package (recommended) and install that one:

Last edited by abga; 02-17-2019 at 02:30 PM. Reason: Rewrote the whole post
Old 02-11-2019, 07:44 PM   #5
Registered: Jul 2017
Location: EU
Distribution: Slackware
Posts: 904

Original Poster
Rep: Reputation: 468Reputation: 468Reputation: 468Reputation: 468Reputation: 468
As an alternative to FFmpeg 4.0.3-Leia-RC5.tar.gz use the official FFmpeg latest source 4.1 (not a RC release, but stable):
and patch the configure script according to this new patch:
cat configure.patch
--- configure   2018-11-06 01:22:33
+++ configure-ok        2019-02-07 18:21:53
@@ -6222,10 +6222,12 @@
                                check_lib opengl ES2/gl.h glGetError "-isysroot=${sysroot} -Wl,-framework,OpenGLES" ||
                                die "ERROR: opengl not found."
-enabled omx               && require_headers OMX_Core.h
-enabled omx_rpi           && { check_headers OMX_Core.h ||
-                               { ! enabled cross_compile && add_cflags -isystem/opt/vc/include/IL && check_headers OMX_Core.h ; } ||
-                               die "ERROR: OpenMAX IL headers not found"; } && enable omx
+enabled omx_rpi && enable omx
+enabled omx               && { check_header OMX_Core.h ||
+                                { ! enabled cross_compile && enabled omx_rpi && {
+                                    add_cflags -isystem/opt/vc/include/IL ; }
+                                check_header OMX_Core.h ; } ||
+                               die "ERROR: OpenMAX IL headers not found"; }
 enabled openssl           && { check_pkg_config openssl openssl openssl/ssl.h OPENSSL_init_ssl ||
                                check_pkg_config openssl openssl openssl/ssl.h SSL_library_init ||
                                check_lib openssl openssl/ssl.h SSL_library_init -lssl -lcrypto ||
The rest of the steps to build ffmpeg are the same as in:

Afterwards, in Kodi 18 use the MMAL acceleration and disable the faulty OMX. In Menu Setting > Player settings > Videos > Allow hardware acceleration MMAL (enabled) and Allow hardware acceleration OMX (disabled)
This will enable the default Kodi VideoPlayer and disable the OMXPlayer engine. This MMAL acceleration is not that efficient like OMX (which runs mostly in the GPU) and it will put some load on the CPU(s).
MMAL on a Pi Zero it's almost usable, the media playback starts pretty slow but works well and the OSD is very laggy, almost unusable. On a more powerful Rpi 2B it's running decent and I guess that on a Rpi 3B(+) it'll perform OK.

For watching Netfilx and/or Amazon Prime, you need to install the inputstream add-on (documented in the first post) and then the actual Netflix/Amazon add-ons:

Amazon Prime - external, not official but "tolerated":

Netflix - internal Add-On - can be installed through the Kodi Add-Ons Menu > Video Add-Ons:

Note that these add-ons will require the internal Kodi Videoplayer with the MMAL acceleration and won't work with OMX.
- it also looks like the maximum video resolution on Rpi Pi3 is 720p. I cannot confirm this as I'm not using Netflix/Amazon

Besides, a side note, the "perverted" scope:
"The Raspberry Pi is a series of small single-board computers developed in the United Kingdom by the Raspberry Pi Foundation to promote teaching of basic computer science in schools and in developing countries."
In the newly opened store, first stand - right side (where right-handed people(the majority) will focus first), the "first" thing to do with a Pi board is ... run Kodi on it:
(right side of the picture, first stand - Build an all-in-one multimedia centre - running Kodi)
Run Kodi with a 2 years old broken firmware, I must add ...

Will update this thread in case Kodi will get a new release out and maybe fix the OMX engine.

Last edited by abga; 02-17-2019 at 02:58 PM. Reason: correction - alternative
Old 02-12-2019, 04:36 AM   #6
LQ Newbie
Registered: Jul 2012
Location: Cumbria UK
Distribution: Slackware
Posts: 9

Rep: Reputation: Disabled
From the kodi 18 Leia changelog

Removed the unused and unmaintained OpenMAX video decoder from Kodi's VideoPlayer[160]
So I guess that trying to get OMX working is a non starter.
Edit: I see OMX is the rpi interface to their hardware decoders. Any resemblance to openmax is coincidental.

On the plus side 18.1 rc1 is out!

Kind regards


Last edited by Dunc.; 02-12-2019 at 04:54 AM. Reason: I thought omx was an inplementation of openmax
Old 02-12-2019, 06:07 PM   #7
Registered: Jul 2017
Location: EU
Distribution: Slackware
Posts: 904

Original Poster
Rep: Reputation: 468Reputation: 468Reputation: 468Reputation: 468Reputation: 468
Kodi 18.1 RC1 was started immediately after Kodi 18.0 got released and I mentioned I tried it in my post #2 (last point - 3):
As of today, there are over 108 commits already and I couldn't see the one you mentioned (must have been one from the past - maybe Kodi 17):
Removed the unused and unmaintained OpenMAX video decoder from Kodi's VideoPlayer[160]
There's a little confusion over the two video players Kodi is using. Some details:

1. The default VideoPlayer - developed and maintained by the Kodi Team. This VideoPlayer is available for all targets (x86 incl.) and is the main video player. Under Raspberry Pi it will use the MMAL acceleration. It's not very efficient, will put some high load on the CPU and it's not able to use the OMX (OpenMAX) libraries and acceleration. That's why the "OpenMAX video decoder from Kodi's VideoPlayer" was removed.
This default VideoPlayer(MMAL) will work well on all Raspberry Pi boards, including Pi1/Zero for pretty much all the video playbacks. The problems appear on Pi1/Zero boards for DVB-H264-FullHD streams (over TVHeadend), where it will put too much load on the single CPU and the GUI will start to behave really laggy/unresponsive, Kodi 17 would also crash after a few seconds (crashing doesn't occur in Kodi 18.x anymore).

2. OMX Player - an adapted/simplified version of the OMX Player, that is only available for the Raspberry Pi targets (specific Kodi compilations - like this one here - first post). This is very efficient, using the GPU directly for video playback primitives and not putting too much pressure on the CPU itself. Due to this efficiency, this OMX Player is the recommended video player to be used on Raspberry Pis, especially on weaker single-core ones like the Pi1/Zero. However, it has some limitations, as previously mentioned, the DRM (&encrypted) add-ons like NetFlix/Amazon/etc. cannot make use of it and the only audio outputs it supports, as it works directly with the GPU also for the audio decoding, are the internal analogue and HDMI. For external sound adapters, if these are configured to be used in the Kodi GUI - Settings, Kodi will fallback on its default VideoPlayer(MMAL).
See some reference from the maintainer of the Raspberry Pi / OMX Player specific code for Kodi - popcornmix:
The actual issue in Kodi 18.x with the OMX Player looks to be some buffering and it should be trivial to fix, but it'll take time, since popcornmix looks to be the only one maintaining this specific Raspberry Pi stuff for Kodi and he's pretty busy, maintaining also the official Raspberry Pi kernel & firmware.
For the actual OMX Player buffering issue in Kodi 18.x - check the Extra section from this post (I also uploaded a debug log):

Note that both VideoPlayer(MMAL) and OMX Player were suffering from audio-analogue&video stuttering with the Kodi 18.0 "endorsed" FFmpeg 4.0.3-Leia-RC5 for all the video playbacks I tried (even simple 720p movies) and that is why I recommended FFmpeg latest source 4.1 to be used (post #5).
OMX Player is still broken (buffering issues - apparently a Kodi internal issue and not related to FFmpeg) but at least VideoPlayer(MMAL) is working fine with this mainstream FFmpeg 4.1.

@Dunc. - check this post for some links pointing to both MMAL & OMX libs (which are both included in the Raspberry Pi userland (in /opt/vc)) and used by both FFmpeg and Kodi:

And, on your statement:
Edit: I see OMX is the rpi interface to their hardware decoders. Any resemblance to openmax is coincidental.
Nope, it's not coincidental, OMX is actually OpenMAX IL, develoed by khronos.

Last edited by abga; 02-12-2019 at 07:29 PM. Reason: H264 + P.S.
Old 02-17-2019, 02:54 PM   #8
Registered: Jul 2017
Location: EU
Distribution: Slackware
Posts: 904

Original Poster
Rep: Reputation: 468Reputation: 468Reputation: 468Reputation: 468Reputation: 468
Kodi 18.1 has been released:

I got it compiled for Pi Zero and played with it. OMX (OMX Player) is still unusable - both audio&video stutters. Went on and inspected how the Kodi Team is compiling FFmpeg for their LibreELEC distro and updated post #4 from this thread with the findings:
Even with this FFmpeg compilation, OMX Player still doesn't want to work properly. I get the same symptoms even with LibreELEC and I don't know who to blame now, FFmpeg or the OMX Player code in Kodi:

ATM either stick with Kodi 17.x and OMX or use Kodi 18.x with the MMAL acceleration.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Trying to build KODI 18 Leia Barcoboy Slackware 8 11-19-2018 08:53 PM
[SOLVED] KODI Krypton - 17.x MediaPlayer - Optimized for Raspberry Pi1/Pi2/Pi3 on Slackware ARM 14.2 SF & Slackware ARM - current HF abga Slackware - ARM 40 08-28-2018 09:50 PM
LXer: Kodi v18 Leia Alpha, BleachBit Version 2.0, Use an RPi 3 to Build Your Own Cheap Car Head Unit and More LXer Syndicated Linux News 0 03-06-2018 02:30 AM
LXer: Kodi 18 Media Center to Be Dubbed "Leia," In Honor of the Late Carrie Fisher LXer Syndicated Linux News 0 01-10-2017 06:35 AM > Forums > Linux Forums > Linux - Distributions > Slackware > Slackware - ARM

All times are GMT -5. The time now is 02:32 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration