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

Notices


Reply
  Search this Thread
Old 09-15-2017, 09:32 AM   #1
abga
Member
 
Registered: Jul 2017
Location: EU
Distribution: Slackware & Gentoo ARM (eval)
Posts: 290

Rep: Reputation: 137Reputation: 137
KODI Krypton - 17.x MediaPlayer - Optimized for Raspberry Pi1/Pi2/Pi3 on Slackware ARM 14.2 SF & Slackware ARM - current HF


Inspiration & Copyright & Credits:
https://forum.kodi.tv/
https://slackbuilds.org/repository/1...ltimedia/kodi/
(actually I used an older version of the script - 2015)

Preamble:
- the instructions are covering the build of the latest Kodi Krypton 17.4 Media Player. They are compatible with all the Kodi 17.x versions.
There are a lot of unnecessary things I have disabled with directives for the configure script - if you need them, feel free to enable them and resolve the dependencies before the compilation.
- Kodi, if carefully optimized, is pretty lightweight and runs well on all Raspberry Pi models. The GPU takes most of the load.
- the build is quite complex and filled with auto-make/conf scripts that were mainly developed under Debian/Ubuntu. Compiling it under Slackware needs some preparation and some automation with the help of a script
- Kodi uses 3 internal media players, the default VideoPlayer (HW Accel MMAL), AudioPlayer and OMXPlayer (HW Accel) - for both Audio/Video - if enabled during the Kodi build/compilation. While the first two are also performing pretty good but with higher CPU usage, performance wise I'd strongly suggest to use only the OMXPlayer on Raspberry Pi.
- OMXPlayer will be built internally and will be used by Kodi, unfortunately there is no standalone binary that you can use (at least I couldn't find one)
- it is covering the Kodi compilation&optimization for Raspberry Pi 1/0 (armv6), Raspberry Pi2B (armv7) and Raspberry Pi3B (armv8)
- there is a naming convention needed for helping with the short formatting:
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)
- I don't own any Pi1 & Pi3 and tested this only on Pi0 and Pi2B, however there shouldn't be any issues with the first ones.
- there are some dependencies that I was unable to compile and some source code patches I lost my notes on (failed HDD). I've uploaded these online and the links are ONLY available for 30 days. Feel free to mirror them.
- performance related, I can confirm that the result will be as fast (if not actually faster) compared to the common Kodi bundle releases (Slackware itself is clean & fast).
- Kodi needs some resources, around 200 MB video RAM and 100MB system RAM, therefore put the following settings in your /boot/config.txt
gpu_mem=256
framebuffer_depth=16
#If you're using Analog Audio Out
audio_pwm_mode=2
- for the compilation on pi2 / pi3 (with 4 make jobs) you should temporary set your gpu_mem=32 in /boot/config.txt to avoid getting over the available RAM and writing in the swap partition!
- it is safe to compile Kodi on a SDCard, I did it some 15 times, the only intensive operation is the unpacking of the Kodi source code. However, I advise to set your swappiness to 1 (this should be set by default on SDCard driven boards - put it in /etc/rc.S after enabling swap)
run:
echo 1 > /proc/sys/vm/swappiness
- compilation (work) duration on a Pi2B is around 3 hours (FFmpeg included)!

Getting started:
- preparing the work directories - I choose /kit/kodi-slack-build for consistency and cleanup simplicity
Code:
mkdir -p /kit/kodi-slack-build
mkdir -p /kit/kodi-slack-build/deps
mkdir -p /kit/kodi-slack-build/patches
mkdir -p /kit/kodi-slack-build/tmp
Dependencies: ________________________________

- FFmpeg 3.1.9-Krypton-17.4 follow the guide from:
https://www.linuxquestions.org/quest...on-4175612537/
and use the new version of FFmpeg - IMPERATIVE!
Code:
wget https://github.com/xbmc/FFmpeg/archive/3.1.9-Krypton-17.4.tar.gz
tar -xzpf 3.1.9-Krypton-17.4.tar.gz
cd FFmpeg-3.1.9-Krypton-17.4/

- Java
- Kodi build & Kodi itself relies on Java and you need to have it installed in /opt/java
- for pi2 & pi3 on SlackARM - current HardFloat, take it from Oracle:
http://www.oracle.com/technetwork/ja...s-2187472.html
- click on: JDK 8 download page
- First Table : Java SE Development Kit 8u144 (version will get updated)
- Accept License Agreement
- Download:
Linux ARM 32 Hard Float ABI 77.89 MB jdk-8u144-linux-arm32-vfp-hflt.tar.gz
- or, while still available - take it directly from a funtoo mirror:
Code:
cd /opt
wget http://ftp.osuosl.org/pub/funtoo/distfiles/oracle-java/jdk-8u144-linux-arm32-vfp-hflt.tar.gz
tar -xzpf jdk-8u144-linux-arm32-vfp-hflt.tar.gz
mv jdk1.8.0_144/ java/
- for pi1 on SlackARM 14.2 SoftFloat you can try (doesn't work ATM)
http://www.oracle.com/technetwork/ja...s-2187468.html
-Download:
Linux ARM v6/v7 Soft Float ABI 67.82 MB jdk-7u60-linux-arm-vfp-sflt.tar.gz
> EDIT
- I managed to get the original Oracle jdk arm SoftFloat archive uploaded and available for 30 days:
jdk-7u60-linux-arm-vfp-sflt.tar.gz
MD5: 87754d4b44fd485edb43b6abe9c5f095
http://www100.zippyshare.com/v/lT1AhV7l/file.html
https://www.sendspace.com/file/3xf4ej
- this should be made available in the Slackware arm 14.2 SoftFloat official repository, even if unsupported.
- download, put it in /opt and prepare it:
Code:
cd /opt
tar -xzpf jdk-7u60-linux-arm-vfp-sflt.tar.gz
mv jdk1.7.0_60/ java/
- or try an older - untested - package, it might work
Code:
wget ftp://ftp.arm.slackware.com/slackwarearm/slackwarearm-14.0/patches/packages/openjdk-7u13_b20-armhfp-1_slack14.0.txz
- unpack it manually (MidnightCommander):
/usr/lib/java to /opt/java
- try it by running:
/opt/java/bin/java -version


- libbluray - I disabled bluray in the configure, but Kodi won't build without this (cannot create Slack package - libtool issues)
Code:
cd /kit/kodi-slack-build/deps/
git clone http://git.videolan.org/git/libbluray.git
cd libbluray/
git checkout efcde25b3bd58eee9cb96f151b79a585a52a09ff
./bootstrap
./configure --enable-shared --disable-bdjava --disable-bdjava-jar --disable-udf
- edit Makefile and look after the line:
CFLAGS = -g -O2 -Wall....
- add at the end:
pi2:
-march=armv7-a -mtune=cortex-a7 -mfpu=neon-vfpv4 -mfloat-abi=hard
pi1:
-march=armv6zk -mtune=arm1176jzf-s -mfpu=vfp -mfloat-abi=soft
pi3:
-march=armv8-a+crc -mtune=cortex-a53 -mfpu=neon-fp-armv8 -mfloat-abi=hard
- on pi1 run make -j 1 V=1
- on pi2/pi3 run make -j 4 V=1
Code:
make install
ldconfig
- libgpg-error-1.27 - never understood why this is necessary, without it Kodi build fails (cannot create Slack package - libtool issues)
Code:
cd /kit/kodi-slack-build/deps/
wget https://www.gnupg.org/ftp/gcrypt/libgpg-error/libgpg-error-1.27.tar.bz2
tar -xjpf libgpg-error-1.27.tar.bz2
cd libgpg-error-1.27
./configure --disable-largefile
- on pi1 run make -j 1 V=1
- on pi2/pi3 run make -j 4 V=1
Code:
make install
ldconfig
- lirc - 0.9.2 - you can try newer versions - it's worth compiling Kodi with it, even if you don't plan to use it right away (cannot create Slack package - libtool issues)
Code:
cd /kit/kodi-slack-build/deps/
wget 'https://sourceforge.net/projects/lirc/files/LIRC/0.9.2/lirc-0.9.2.tar.gz'
tar -xzpf lirc-0.9.2.tar.gz
cd lirc-0.9.2/
./configure
- lirc is not really CPU intensive - just optional - edit Makefiles (from all subdirs) and add to the CFLAGS:
CFLAGS = -O2 -g -Wall
pi2:
-march=armv7-a -mtune=cortex-a7 -mfpu=neon-vfpv4 -mfloat-abi=hard
pi1:
-march=armv6zk -mtune=arm1176jzf-s -mfpu=vfp -mfloat-abi=soft
pi3:
-march=armv8-a+crc -mtune=cortex-a53 -mfpu=neon-fp-armv8 -mfloat-abi=hard
- on pi1 run make -j 1 V=1
- on pi2/pi3 run make -j 4 V=1
Code:
make install
ldconfig
- create dummy /var/run/lirc/lircd
Code:
mkdir -p /var/run/lirc/
touch /var/run/lirc/lircd
- yajl - needed by Kodi (cannot create Slack package - libtool issues)
Code:
cd /kit/kodi-slack-build/deps/
git clone git://github.com/lloyd/yajl
cd yajl/
./configure
make -j 1 V=1
make install
ldconfig
(DON'T use make -j 4! - it'll break the compilation)

- tinyXML - I couldn't compile it and got the necessary files packed manually in Slackware packages. Original files came from Debian Jessie:
https://packages.debian.org/jessie/libtinyxml-dev
https://packages.debian.org/jessie/libtinyxml2.6.2
- you could try and compile it on your own - create the so lib and document the process
http://www.grinninglizard.com/tinyxml/
https://sourceforge.net/projects/tinyxml/
- Here are the Slackware ARM packages (install with installpkg):
pi1 - tinyXML-2-6-2-Slack-ARMv6-SoftFloat.tgz
MD5: 30ba85f93703b8d6f22b42c273f3e9a8
https://ufile.io/v6tc9
pi2/pi3 - tinyXML-2-2-6-Slack-ARMv7-HardFloat.tgz
MD5: c27a0e70663b00a5a07640ad89b95504
https://ufile.io/884ak

Dependencies END ________________________________

Compiling Kodi:
- get the Kodi source and patches:
Code:
cd /kit/kodi-slack-build/
wget https://github.com/xbmc/xbmc/archive/17.4-Krypton.tar.gz
cd /kit/kodi-slack-build/patches
wget https://slackbuilds.org/slackbuilds/14.2/multimedia/kodi/patches/kodi-texturepacker.patch
wget https://slackbuilds.org/slackbuilds/14.2/multimedia/kodi/patches/xbmc-Krypton-samba-4.0.patch
- if you'd like to run Kodi under a normal user (I'd advise to) and would like to exit Kodi after a timer and put your monitor/TV in sleepmode, then you need to patch the Kodi source code. You'll need to manually unpack 17.4-Krypton.tar.gz, substitute the /xbmc/powermanagement directory with the one online and pack it back into 17.4-Krypton.tar.gz
powermanagement-17-x-MOD.tgz
MD5: cc3965bb21370eb62881e3c7514f8787
https://ufile.io/mb1yh
For some reference:
https://forum.kodi.tv/showthread.php?tid=305872

- create the slack-desc needed by the kodi.SlackBuild (I never understood the proper format nor do I care to understand it ) file in /kit/kodi-slack-build/ with the content you'd like - for example on pi2:
appname: appname Kodi 17.4 FINAL - Powermanagement Fix - Raspberry Pi2 specific compilation
appname:
appname: Slackware 14.2 - current - arm 32 HF - HW Accel

- create the kodi.SlackBuild file in /kit/kodi-slack-build/
- the script below is tuned for pi2 and there are notes to tune it for other Pi platforms (pi1 / pi3)

Code:
#!/bin/sh

# Slackware build script for kodi

# Copyright 2009-2015 Larry Hajali <larryhaja[at]gmail[dot]com>
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
# permitted provided that the following conditions are met:
#
# 1. Redistributions of this script must retain the above copyright
#    notice, this list of conditions and the following disclaimer.
#_____________________________________________________________________
#
# Stripped down and personalized for Raspberry Pi1/2/3 arm by abga
# Still needs some work! Feel free to butcher it further.



#Creating work directory
mkdir -p /kit/kodi-slack-build/tmp/

PRGNAM=kodi
SRCNAM=xbmc
CODNAM=Krypton
VERSION=${VERSION:-17.4}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}

if [ -z "$ARCH" ]; then
  case "$( uname -m )" in
    i?86) ARCH=i486 ;;
    arm*) ARCH=arm ;;
       *) ARCH=$( uname -m ) ;;
  esac
fi

CWD=$(pwd)
TMP=${TMP:-/kit/kodi-slack-build/tmp/SBo}
PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/kit/kodi-slack-build}

if [ "$ARCH" = "i486" ]; then
  SLKCFLAGS="-O2 -march=native -mtune=i686"
  LIBDIRSUFFIX=""
elif [ "$ARCH" = "i686" ]; then
  SLKCFLAGS="-O2 -march=i686 -mtune=i686"
  LIBDIRSUFFIX=""
elif [ "$ARCH" = "x86_64" ]; then
  SLKCFLAGS="-O2 -fPIC"
  LIBDIRSUFFIX="64"
else
# pi1 use the following flags: -O2 -march=armv6zk -mtune=arm1176jzf-s -mfloat-abi=soft
# pi3 use the following flags: -O2 -march=armv8-a+crc -mtune=cortex-a53 -mfpu=neon-fp-armv8 -mfloat-abi=hard
  SLKCFLAGS="-O2 -march=armv7-a -mtune=cortex-a7 -mfpu=neon-vfpv4 -mfloat-abi=hard"
  LIBDIRSUFFIX=""
fi

set -e

rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP
rm -rf $SRCNAM-$VERSION-$CODNAM
tar xvf $CWD/$SRCNAM-$VERSION-$CODNAM.tar.gz 2>/dev/null || tar xvf $CWD/$VERSION-$CODNAM.tar.gz
cd $SRCNAM-$VERSION-$CODNAM

chown -R root:root .
find -L . \
 \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
  -o -perm 511 \) -exec chmod 755 {} \; -o \
 \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
  -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;

export PATH="$PATH:$PWD/tools/depends/native/JsonSchemaBuilder/bin"

#Add JAVA to PATH
export PATH="$PATH:/opt/java/bin"

#pi1 - uncomment! - Slackware ARM 14.2 SoftFloat needs this patch
# Need to fix an autoreconf error with older version of pkg-config - http://forum.kodi.tv/showthread.php?tid=195791
#cp /bin/grep /usr/bin/
#cat /usr/share/aclocal/pkg.m4 > m4/pkg.m4
#echo 'm4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$])' \
#  >> m4/pkg.m4
#sed -i "/autoreconf/s|.*|& -I $PWD/m4|" bootstrap.mk

# Patch for Samba 4.0. 
patch -p1 < $CWD/patches/xbmc-Krypton-samba-4.0.patch

#Fix static linking for Texturepacker. Thanks to Gentoo.
# Issue: http://forum.kodi.tv/showthread.php?tid=220407
patch -p0 < $CWD/patches/kodi-texturepacker.patch

./bootstrap

# Prepare crossguid - otherwise kodi build fails
make -C tools/depends/target/crossguid PREFIX=/usr/local

# CONFIGURE SCRIPT tuning:
# For pi1 change: --with-platform=raspberry-pi2 to --with-platform=raspberry-pi
# For pi3 leave unchanged -  target: --with-platform=raspberry-pi2
# If lirc is not needed, remove: --with-lirc-device=/var/run/lirc/lircd \
CFLAGS="$SLKCFLAGS $AFPFS_NGFLAGS" \
CXXFLAGS="$SLKCFLAGS $AFPFS_NGFLAGS" \
export C_INCLUDE_PATH=/opt/vc/include:/opt/vc/include/interface/vcos/pthreads
export CPLUS_INCLUDE_PATH=/opt/vc/include:/opt/vc/include/interface/vcos/pthreads
LDFLAGS="-L/opt/vc/lib/" \
./configure \
  --prefix=/usr \
  --libdir=/usr/lib${LIBDIRSUFFIX} \
  --docdir=/usr/doc/$PRGNAM-$VERSION \
  --enable-optimizations \
  --with-ffmpeg=shared \
  --disable-sdl \
  --enable-external-libraries \
  --disable-goom \
  --disable-hal \
  --disable-xrandr \
  --disable-airplay \
  --with-platform=raspberry-pi2 \
  --enable-player=omxplayer \
  --disable-debug \
  --with-lirc-device=/var/run/lirc/lircd \
  --disable-x11 \
  --disable-gl \
  --enable-gles \
  --disable-libcec \
  --disable-nfs \
  --disable-optical-drive \
  --disable-dvdcss \
  --disable-libbluray \
  --disable-joystick \
  --disable-vtbdecoder \
  --disable-vaapi \
  --disable-vdpau \
  --disable-avahi \
  --enable-alsa \
  --enable-pulse \
  --disable-asap-codec \
  --disable-mysql \
  --disable-webserver \
  --disable-upnp \
  --disable-mdnsembedded \
  --enable-texturepacker \
  --build=$ARCH-slackware-linux

# pi1 only use 1 make job = make -j 1 V=1
make -j 4 V=1

# Wii controller usage. Default is no.
if ! [ "${WII:-no}" = "no" ]; then
  make -j 4 eventclients DESTDIR=$PKG WII_EXTRA_OPTS="-DCWIID_OLD"
  find $PKG/usr/lib${LIBDIRSUFFIX}/python* -iname "*\.py" -exec chmod 0644 '{}' \;
  # Create byte-compiled python files.
  python -m compileall $PKG/usr/lib${LIBDIRSUFFIX}/python*/site-packages/$PRGNAM
fi

make install DESTDIR=$PKG
python -m compileall $PKG/usr/share/$PRGNAM/addons/service.xbmc.versioncheck

install -m 0755 tools/depends/native/TexturePacker/bin/TexturePacker $PKG/usr/lib${LIBDIRSUFFIX}/$PRGNAM

find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
  | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true

# Install manpages.
mkdir -p $PKG/usr/man/man1
for i in $PRGNAM.bin.1 $PRGNAM.1 $PRGNAM-standalone.1; do
  install -m 0644 docs/manpages/$i $PKG/usr/man/man1/$i
done

if ! [ "${WII:-no}" = "no" ]; then
  for i in $PRGNAM-j2meremote.1 $PRGNAM-ps3remote.1 $PRGNAM-wiiremote.1 $PRGNAM-send.1; do
    install -m 0644 docs/manpages/$i $PKG/usr/man/man1/$i
  done
fi
gzip -9 $PKG/usr/man/man?/*.?

cp -a tools/EventClients/README.txt $PKG/usr/doc/$PRGNAM-$VERSION
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild

mkdir -p $PKG/install
cat /kit/kodi-slack-build/slack-desc > $PKG/install/slack-desc

cd $PKG
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}

# pi1 - uncomment! - Slackware ARM 14.2 SoftFloat clean-up
#rm -f /usr/bin/grep
- make the script executable and start the compilation:
Code:
chmod +x /kit/kodi-slack-build/kodi.SlackBuild
cd /kit/kodi-slack-build/
nohup ./kodi.SlackBuild 2>&1 | tee kodi-build.log &
- on a pi2 wait for around 2-2,5 hours and if everything works well, you'll get the last line in the kodi-buil.log:
Slackware package /kit/kodi-slack-build/kodi-17.4-arm-1_SBo.tgz created.
- that is your Kodi 17.4 Slackware package - backup it somewhere!
- install the package
- add kodi group and user:
groupadd kodi
adduser kodi
Group: kodi
Directory: /home/kodi
Shell: /bin/bash
- add kodi to some necessary groups:
usermod -a -G cdrom,audio,video,plugdev,input,pulse,messagebus kodi
- don't yet start Kodi!

Kodi Addons:
- there are some Kodi specific addons and addons dependencies that need to be first compiled and installed (no Slackware packages due to libtool issues)
Code:
mkdir -p /kit/kodi-slack-build/addons/
- platform - needed by Kodi to be able to load other addons
Code:
cd /kit/kodi-slack-build/addons/
git clone https://github.com/Pulse-Eight/platform.git
cd /kit/kodi-slack-build/addons/platform/
cmake -DCMAKE_INSTALL_PREFIX=/usr
make && make install
ldconfig
- kodi-platform - needed by Kodi to be able to load other addons
Code:
cd /kit/kodi-slack-build/addons/
git clone https://github.com/xbmc/kodi-platform.git
cd /kit/kodi-slack-build/addons/kodi-platform/
cmake -DCMAKE_INSTALL_PREFIX=/usr
make && make install
ldconfig
- visualisation spectrum - not really needed but Kodi is looking after it and eating up 40% CPU! - nice addon for Audio Playback. The git code won't build under Slackware ARM and I lost my notes on what I did to make it work
- unofficial way:
- download Addon MOD:
Addon-visualization-spectrum-MOD.tgz
MD5: 9a1069416b747d9135b65bd4bb5a6374
https://ufile.io/f2s9t
extract in:
/kit/visualization.spectrum
Code:
cd /kit/visualization.spectrum
cmake -DCMAKE_INSTALL_PREFIX=/usr
make && make install
ldconfig
- official way - doesn't build! - try diff to see what I've done - there were some cmake files mods I remember
Code:
cd /kit/kodi-slack-build/addons/
git clone https://github.com/notspiff/visualization.spectrum.git
cd /kit/kodi-slack-build/addons/visualization.spectrum
cmake -DCMAKE_INSTALL_PREFIX=/usr
make && make install
ldconfig
- tvheadend PVR addon - should you need it - the newest commit won't build - the older one 1caa390dc2ba92a7c614819a6fd427d534b09e62 is working well (using it without issues for almost 2 years)
Code:
cd /kit/kodi-slack-build/addons/
git clone https://github.com/kodi-pvr/pvr.hts.git
cd /kit/kodi-slack-build/addons/pvr.hts/
git checkout 1caa390dc2ba92a7c614819a6fd427d534b09e62
cmake -DCMAKE_INSTALL_PREFIX=/usr
make && make install
ldconfig
____________ DONE!________________________________

- now, if you use X and Kodi on the same system, you'll need to switch between the EGL/GLES libs (MESA) that are coming with Slackware ARM and the ones in /opt/vc/
- Kodi 17.x is linking by default to /usr/lib - it is an issue discussed on the Kodi Forums. Kodi will crash if you start it and don't change the symlinks in /usr/lib
- to resolve this I created two small scripts that you should use when using Kodi / or X.
Nevertheless, when you update your system with slackpkg and you see mesa-x.x.x-arm in your list, then stop Kodi, run the script that puts back the symlinks for X and only then start the update!
Put them back at /opt/vc after the update is finished and you'd like to use Kodi.

cat /kit/glx
Code:
#! /bin/sh
cd /usr/lib
rm libEGL.so
ln -s libEGL.so.1.0.0 libEGL.so
rm libGLESv2.so
ln -s libGLESv2.so.2.0.0 libGLESv2.so
cat /kit/glkodi
Code:
#! /bin/sh
cd /usr/lib
rm libEGL.so
ln -s /opt/vc/lib/libEGL.so libEGL.so
rm libGLESv2.so
ln -s /opt/vc/lib/libGLESv2.so libGLESv2.so
- run your glkodi script and switch to user kodi
- launch Kodi for the first time:
Code:
export PATH="$PATH:/opt/java/bin"
/usr/bin/kodi
------Configuration - Optimization--------
-enter the settings menu:

- in the Player Setting section:
- change the setting details (lower left corner) from Basic to Expert
Videos:
Allow Hardware Acceleration = OMXPlayer
- disable MMAL !!!
- adjust display refresh rate = off
Music:
- volume adjustments =off
Movies:
Sync playback to display = off

- in the System Settings - only if you are using the Analog Out of your Pi
- change the setting details (lower left corner) from Basic to Expert
- go to Audio
Audio output device: Pi Analogue
Keep audio device alive = off
Number of channels = 2
Output configuration = fixed
Maintain original volume on downmix = on
Stereo upmix = off
Sample quality = GPU accelerated
Limit sampling rate (kHz) = 44.1

- there is another crucial configuration for smooth playback and low system usage. Turn the de-interlace to BOB! and save it as default for all videos.
You can only access the de-interlace menu (well hidden) from within the contextual menu while playing some media (video). Press Enter on keyboard / OK on remote and the progress bar + some other icons will pop-up. Navigate to the gear symbol in the bottom right corner - settings - choose video settings and then choose Deinterlace Method: MMAL Bob - go down to Set as default for all media, press OK, then Close
- exit Kodi and make a backup of your /home/kodi folder - that's before you mess the configuration up, trust me

Last notes:
- BE ADVISED! Kodi will try to "call home" and update & doing some other interesting things. If you're paranoid, which is a quality nowadays, then just block the kodi user from accessing the internet in your firewall:
/usr/sbin/iptables -I OUTPUT -o eth0 -m owner --uid-owner kodi -j DROP
- on a Pi2B Kodi can play FullHD at 50-60fps with a mean CPU usage of 20%. If you're not achieving this, then you might have done something wrong in the configuration. I personally run Kodi all the time (playing satellite radio/tv in the background) and don't even feel it running (eating system resources), I only close it when I'm compiling something big.
- on a Pi0 Kodi can play FullHD streams at 50-60fps with a mean CPU usage of 100% with some framedrops (which can be caused by not being HardFloat and outputting the sound on Analog Out instead of HDMI - a little overhead), FullHD at 25FPS is running smooth even with tvheadend running on the same box (feeding the FullHD stream to Kodi). I guess that the pi0 will be able to play FullHD content @ 50-60FPS if taken directly from the storage (not a stream).
- Kodi work & configuration directory will be created in:
/home/kodi/.kodi
- in /home/kodi/.kodi/userdata you'll be able to fine tune the configuration with the help of advancedsettings.xml (create it if it doesn't exist)
- my advancedsettings.xml has the following content - telling curl to go to sleep after one try - I don't allow Kodi on the Internet and I had some issues with the timing of DVB streaming with tvheadend (pvr section):
Code:
<?xml version="1.0" encoding="UTF-8"?>
<advancedsettings>
  <pvr>
    <lingertime>1440</lingertime>
  </pvr>
  <network>
    <curlclienttimeout>1</curlclienttimeout>
    <curllowspeedtime>1</curllowspeedtime>
    <curlretries>1</curlretries>
  </network>
</advancedsettings>
- there are a lot of options you can tune and there is a page describing all of them on the Kodi Wiki
http://kodi.wiki/view/advancedsettings.xml
- also in /home/kodi/.kodi/userdata/ you'll need to have your Lircmap.xml defined if you want to use lirc with Kodi
- in /home/kodi/.kodi/temp the kodi.log will be available - good for troubleshooting
- here are some performance measurements that you might use as reference:
https://forum.kodi.tv/showthread.php...857#pid2580857

Have Fun!

Don't forget to Provide Feedback & Ask Intelligent Questions

Last edited by abga; 09-16-2017 at 04:29 PM. Reason: messed up formatting - a few typos - added original Oracle jdk SoftFloat repository - added Kodi advanced config - yajl stuff
 
Old 11-04-2017, 05:13 PM   #2
abga
Member
 
Registered: Jul 2017
Location: EU
Distribution: Slackware & Gentoo ARM (eval)
Posts: 290

Original Poster
Rep: Reputation: 137Reputation: 137
There's a new Kodi version available 17.5 (together with its paired FFMPEG 3.1.11-Krypton-17.5.tar.gz)and while I'm not really maintaining this, actually there's no maintenance necessary, at least I can just update from time to time since I'm also compiling new versions of Kodi for my own needs.
If you want to upgrade you need to uninstall your previous version of Kodi with removepkg /varlog/packages/NAME-OF-YOUR-KODI-build
Then manually clean some remaining subdirs:
Code:
rm -rf /usr/share/kodi/
rm -rf /usr/lib/kodi/
rm -rf /usr/include/kodi/
Get the new FFMPEG and Kodi packages (substitute the links in the guide above):
Code:
#FFMPEG 3.1.11 for Kody Krypton 17.5
wget https://github.com/xbmc/FFmpeg/archive/3.1.11-Krypton-17.5.tar.gz
#Kodi Krypton 17.5
wget https://github.com/xbmc/xbmc/archive/17.5-Krypton.tar.gz
Uninstall your older FFmpeg, build & install the new FFmpeg, then uninstall the older Kodi, build and install the new Kodi (you don't need to build the other dependencies apart from FFMPEG again). Afterwards you'll just need to rebuild the Kodi Addons.

Last edited by abga; 11-04-2017 at 05:22 PM. Reason: rephrasing
 
Old 11-16-2017, 02:23 PM   #3
abga
Member
 
Registered: Jul 2017
Location: EU
Distribution: Slackware & Gentoo ARM (eval)
Posts: 290

Original Poster
Rep: Reputation: 137Reputation: 137
If you are somehow bored and looking to compile Kodi again , maybe out of masochism, I'm not, I'm still using the Kodi 17.1 for "production" but always building - checking - deleting the new versions, Kodi 17.6 just got released and it appears to be the last 17.x bugfix release before Kodi Leia 18.x
https://kodi.tv/article/kodi-v176-final-very-last
Code:
wget https://github.com/xbmc/xbmc/archive/17.6-Krypton.tar.gz
It uses the same FFmpeg version like 17.5, no need to update it.


A general rule to get the latest (paired) FFmpeg Version - download the latest Kodi release source code archive and check the file FFMPEG-VERSION from the tools/depends/target/ffmpeg/ subdirectory.
For example on Kodi 17.6:
/xbmc-17.6-Krypton/tools/depends/target/ffmpeg/FFMPEG-VERSION
Code:
LIBNAME=ffmpeg
BASE_URL=https://github.com/xbmc/FFmpeg/archive
VERSION=3.1.11-Krypton-17.5
ARCHIVE=$(LIBNAME)-$(VERSION).tar.gz
GNUTLS_VER=3.4.14
Use the version number you learned to build the link and get FFmpeg:
Code:
wget https://github.com/xbmc/FFmpeg/archive/3.1.11-Krypton-17.5.tar.gz
 
Old 11-29-2017, 08:12 AM   #4
tb404
LQ Newbie
 
Registered: May 2016
Distribution: Slackware-14.2
Posts: 21

Rep: Reputation: Disabled
To make life easier, is it possible to create a slackbuild with all the information listed above?
 
Old 11-29-2017, 11:22 AM   #5
abga
Member
 
Registered: Jul 2017
Location: EU
Distribution: Slackware & Gentoo ARM (eval)
Posts: 290

Original Poster
Rep: Reputation: 137Reputation: 137
Quote:
Originally Posted by tb404 View Post
To make life easier, is it possible to create a slackbuild with all the information listed above?
Thanks for the feedback. Actually you have a SlackBuild in the middle of the first post, you just need to follow the instructions (some lines) and copy paste it. I'm sorry, I'm not registered with Slackware and have no access to the SlackBuilds repositories.

Regarding making life easier, you should realize that you need some dependencies resolution, which is documented in the first part of the original post and it's not subject to a SlackBuild. Then, at the end of the original post you get the Kodi Addons and the optimized configuration for Kodi, all this in order to not just have it compiled but to also be able to use it. You don't have any of these (dependecies resolution and Kodi addons + configuration) in the Kodi SlackBuild for Slackware x86.

Feel free to ask for help if you get stuck somewhere following the guide from the original post.
 
Old 11-29-2017, 10:19 PM   #6
tb404
LQ Newbie
 
Registered: May 2016
Distribution: Slackware-14.2
Posts: 21

Rep: Reputation: Disabled
oh i missed that, nice post :-)
 
Old 12-03-2017, 03:03 PM   #7
abga
Member
 
Registered: Jul 2017
Location: EU
Distribution: Slackware & Gentoo ARM (eval)
Posts: 290

Original Poster
Rep: Reputation: 137Reputation: 137
Given the high count of views on this thread (and only one single feedback) I considered to re-upload some of the files that are needed, again only for 30 days:
- the file Kodi-deps-mods-addons.tgz which contains:

Addon-visualization-spectrum-MOD.tgz
powermanagement-17-x-MOD.tgz
tinyXML-2-6-2-Slack-ARMv7-HardFloat.tgz
tinyXML-2-6-2-Slack-ARMv6-SoftFloat.tgz

To be found at:
http://www116.zippyshare.com/v/UZeoRu65/file.html

Check the SHA256sum before using it!
Code:
sha256sum Kodi-deps-mods-addons.tgz

52476b2bbc705da8f570826c2d864da01403752ea7de3b79cead3343050778ba
I'd be thankful if anyone interested in Kodi, followed the guide in this thread, has the ability to host and is willing accommodate and provide a permanent link for the 500KB Kodi-deps-mods-addons.tgz file.


I can also re-upload the Oracle JDK ARM SoftFloat again, although this one should maybe reside in the Slackware ARM 14.2 official repository:
jdk-7u60-linux-arm-vfp-sflt.tar.gz

Last edited by abga; 12-03-2017 at 03:25 PM. Reason: wrong paste
 
Old 12-28-2017, 03:10 PM   #8
abga
Member
 
Registered: Jul 2017
Location: EU
Distribution: Slackware & Gentoo ARM (eval)
Posts: 290

Original Poster
Rep: Reputation: 137Reputation: 137
Be aware that the folks at Raspberry, in their attempt to improve the Analogue-Out sound in the latest firmware, have apparently broke it:
https://www.raspberrypi.org/forums/v...?f=29&t=195178
I haven't noticed myself any "subjective" sound quality improvements but the load on the GPU is deffo higher.

I was trying the latest kernel&firmware from Raspbian - 4.9.59 and noticed cracks and pops while playing 1080p 50fps DVB streams on a Pi0 board with audio_pwm_mode=2. LibreELEC - latest versions 8.x - are also affected. On the firmware&kernel 4.4.50 everything still works fine.
Just to mention, I've recreated the audio circuit from the Raspberry Pi2B board (simple electronics) and connected it to the Pi0 GPIO (re-routed the Audio PWM pins). Kodi runs well on this Pi0 (even flawlessly playing MPEG4 1080p 50-60fps content - GUI gets a little laggy though, but still usable).

Last edited by abga; 12-28-2017 at 03:14 PM. Reason: typo
 
Old 01-10-2018, 05:44 AM   #9
abga
Member
 
Registered: Jul 2017
Location: EU
Distribution: Slackware & Gentoo ARM (eval)
Posts: 290

Original Poster
Rep: Reputation: 137Reputation: 137
I was considering to add a last touch/additions to this (rather boring) monologue of mine and present some updates to the HowTo from the first post. With these you'll be able to do everything on your own and won't depend on any external uploaded files.

1. Addons - I forgot to mention that there are some Addons that you need to build and install on your own. I presented some of those key addons in the original HowTo. The rest of the Addons, mainly video addons & such, you can download directly from withing the Kodi Addons menu from the Kodi repository.
There was a visualization Addon that I lost my notes on and got now some time to make it work again - it's the visualization.spectrum Addon.

- if you installed it from the archive I uploaded and you want to have it cleaned, run the following (exit Kodi first):
Code:
rm -rf /usr/lib/kodi/addons/visualization.spectrum/
rm -rf /usr/share/kodi/addons/visualization.spectrum/
rm -rf /home/kodi/.kodi/userdata/addon_data/visualization.spectrum/
- to compile&install it on your own, follow these steps:
Code:
cd /kit/kodi-slack-build/addons/
git clone https://github.com/notspiff/visualization.spectrum.git
cd /kit/kodi-slack-build/addons/visualization.spectrum
git checkout 73c87862c95a7578fd44bdca6d7b12631c2f8115
- edit the file FindOpenGLES2.cmake and comment the following
Code:
#find_package(PkgConfig)
#if(PKG_CONFIG_FOUND)
#  pkg_check_modules(OpenGLES2 glesv2)
#endif(PKG_CONFIG_FOUND)
- and add these lines just after the section above:
Code:
set(OPENGLES2_FOUND 1)
set(OPENGLES2_INCLUDE_DIR "/opt/vc/include")
set(OPENGLES2_LIBRARIES "-L/opt/vc/lib -lGLESv2 -lEGL")
- then run:
Code:
cmake -DCMAKE_INSTALL_PREFIX=/usr
make && make install
ldconfig
2. Should you need to play some IPTV streams, you'll need the Simple IPTV Addon (which is in a beta stage/unstable, but it works):
Code:
cd /kit/kodi-slack-build/addons/
wget https://github.com/kodi-pvr/pvr.iptvsimple/archive/Krypton.zip
unzip Krypton.zip
cd pvr.iptvsimple-Krypton
cmake -DCMAKE_INSTALL_PREFIX=/usr
make && make install
ldconfig
3. The TinyXML dependency. There is a SlackBuild for it that works under Slackware ARM (just tested it under -current compiling Kodi 17.6), available at:
https://slackbuilds.org/repository/1...aries/tinyxml/
- by the time I was playing with Kodi 16 /17-beta series, I had some issues with some dependencies I've manually compiled that were not creating a pc file in /usr/lib/pkgconfig/. The Kodi internal configure scripts were looking after these pc files and if not available, then the build would stop. While the SlackBuild for the tinyXML parser is not creating the pc file (available in the packages I manually created by nicking the files from Debian), the Kodi building scripts seem happy with only finding the .so file for it. Problem solved!

One last note. If you're into building a Kodi MediaCenter and only wanting to play Full HD content locally/online (even at 50-60fps), then a 5USD/EUR PiZero will suffice - no need to burn more money on a fancy - good for boiling eggs - Pi3, keep the Pi3 for some more interesting stuff. I wasn't curious about a Pi0W, just because the Broadcom WiFi chip was plagued for a very long time by the BroadPawn exploit and I've read that the WiFi performance is really poor (stable at 4-5 meters). Instead, I opted for cheap USB Ethernet / Wifi adapters @ 6-7EUR/piece. If you use a Pi0, then leave Kodi lightweight, do not use the visualization.spectrum addon as it will unnecessarily load the CPU/GPU! On a Pi2/Pi3 you shouldn't see too much extra load because of it.

I'm unsubscribing from this thread, as I'm considering it complete now. Still, if you need some help - I'll be around.

Last edited by abga; 01-10-2018 at 06:02 AM. Reason: typos - obvioulsy
 
1 members found this post helpful.
Old 01-12-2018, 08:59 AM   #10
abga
Member
 
Registered: Jul 2017
Location: EU
Distribution: Slackware & Gentoo ARM (eval)
Posts: 290

Original Poster
Rep: Reputation: 137Reputation: 137
Just came by to let you know, that unless you're very happy with Kodi 17.6, you should better stick with Kodi 17.4 as there are some Audio Analogue issues I've recently experienced in Kodi 17.6. Kodi 17.4 looks stable and doing fine, running for 2 days already.
https://forum.kodi.tv/showthread.php?tid=326879

The Audio has been modified in Kodi 17.5, making it more robust, but the kernel isn't apparently that robust to properly handle this new Audio robustness...
https://kodi.tv/article/kodi-v175-fi...er-bunch-fixes

The Kodi 17.4 sources (reminder):
https://github.com/xbmc/xbmc/archive...Krypton.tar.gz
https://github.com/xbmc/FFmpeg/archi...on-17.4.tar.gz
 
Old 02-13-2018, 04:47 PM   #11
stormtracknole
Senior Member
 
Registered: Aug 2005
Distribution: Slackware, RHEL
Posts: 1,007

Rep: Reputation: 130Reputation: 130
Okay, I was able to go through entire process and got everything to build just fine. I made sure use the scripts to change the mesa libraries back and forth. When I start kodi, I get:
Code:
 *failed to add service - already in use?
Then it segfaults. I made sure to have the libs from /opt/vc linked. Any ideas?
 
Old 02-13-2018, 05:00 PM   #12
stormtracknole
Senior Member
 
Registered: Aug 2005
Distribution: Slackware, RHEL
Posts: 1,007

Rep: Reputation: 130Reputation: 130
This is on a pi3 by the way.
 
Old 02-13-2018, 05:56 PM   #13
abga
Member
 
Registered: Jul 2017
Location: EU
Distribution: Slackware & Gentoo ARM (eval)
Posts: 290

Original Poster
Rep: Reputation: 137Reputation: 137
Quote:
Originally Posted by stormtracknole View Post
Okay, I was able to go through entire process and got everything to build just fine. I made sure use the scripts to change the mesa libraries back and forth. When I start kodi, I get:
Code:
 *failed to add service - already in use?
Then it segfaults. I made sure to have the libs from /opt/vc linked. Any ideas?
Have you enabled the vc4 driver in /boot/config.txt ? Check if you have a line like:
dtoverlay=vc4-kms-v3d
If so, comment it out and restart your Pi3, try to run Kodi again.

https://www.raspberrypi.org/forums/v...ic.php?t=12581
https://raspberrypi.stackexchange.co...ogrammatically
(first post)
https://retropie.org.uk/forum/topic/...-start-anymore
 
1 members found this post helpful.
Old 02-13-2018, 06:11 PM   #14
stormtracknole
Senior Member
 
Registered: Aug 2005
Distribution: Slackware, RHEL
Posts: 1,007

Rep: Reputation: 130Reputation: 130
Quote:
Originally Posted by abga View Post
Have you enabled the vc4 driver in /boot/config.txt ? Check if you have a line like:
dtoverlay=vc4-kms-v3d
If so, comment it out and restart your Pi3, try to run Kodi again.

https://www.raspberrypi.org/forums/v...ic.php?t=12581
https://raspberrypi.stackexchange.co...ogrammatically
(first post)
https://retropie.org.uk/forum/topic/...-start-anymore
YES! That's it!!! It's working. Going to take it for a spin and will report back if I hit any snags. I appreciate you taking the time to write that tutorial.
 
Old 02-13-2018, 06:19 PM   #15
stormtracknole
Senior Member
 
Registered: Aug 2005
Distribution: Slackware, RHEL
Posts: 1,007

Rep: Reputation: 130Reputation: 130
So kodi does indeed start, but I cannot interact with it through the keyboard at all. I have the pi connected to a touchscreen, but it won't respond to that either.
 
  


Reply


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
[SOLVED] Slackware ARM Raspberry Pi - armv6 and armv7 - optimized FFMPEG with HW Acceleration abga Slackware - ARM 21 02-12-2018 08:28 PM
Raspberry PI 3 + Slackware 14.2 Arm + Kodi tb404 Linux - Software 16 02-05-2017 12:26 AM
Elementary OS on Raspberry Pi3 (arm processors) ?? Marv_Mark elementary OS 3 12-14-2016 07:04 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware > Slackware - ARM

All times are GMT -5. The time now is 09:57 AM.

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