----- Date:

Compiling Kodi on a Raspberry Pi

Because $REASONS, i wanted to try compiling Kodi on a Raspberry Pi running the Raspibian distribution. I took notes on it and did succeed; but do not yet have the hardware acceleration I need. I'll chase it further some other time and post again.

This is just a dump of my notes, some of it might be useful.


https://github.com/LibreELEC/LibreELEC.tv/archive/master.zip

snatch that up and see what they're doing to the kodi source, first.

https://libreelec.wiki/compile

very nice instructions.

https://github.com/xbmc/xbmc/blob/master/docs/README.RaspberryPi.md

This guide has been tested with Ubuntu 16.04 (Xenial) x86_64 and 18.04 (Bionic). It is meant to cross-compile Kodi for the Raspberry Pi

Ok then. i guess i spins an ubuntu vm. I have an ubuntu 17.04 image, im gonna try that cuz downloading a new one will take a long time.

welp; got it to boot, got it seeing the fubar thb share, it wont speak to myra smb either. And copy and paste into the vm inst working which sucks massive.

ok, apt-get doesnt want to work because everythings too old, fuck this noise. it can build native.

11a, pulling down kodi source to rpi.

2p, git isnt going to do that.

from the 'build native' but ubuntu instructions:

https://github.com/xbmc/xbmc/blob/master/docs/README.Ubuntu.md

sudo apt install debhelper autoconf automake autopoint gettext autotools-dev cmake curl default-jre doxygen gawk gcc gdc gperf libasound2-dev libass-dev libavahi-client-dev libavahi-common-dev libbluetooth-dev libbluray-dev libbz2-dev libcdio-dev libp8-platform-dev libcrossguid-dev libcurl4-openssl-dev libcwiid-dev libdbus-1-dev libegl1-mesa-dev libenca-dev libflac-dev flatbuffers-dev libfontconfig-dev libfreetype6-dev libfribidi-dev libfstrcmp-dev libgcrypt-dev libgif-dev libgles2-mesa-dev libgl1-mesa-dev libglu1-mesa-dev libgnutls28-dev libgpg-error-dev libiso9660-dev libjpeg-dev liblcms2-dev libltdl-dev liblzo2-dev libmicrohttpd-dev libmysqlclient-dev libnfs-dev libogg-dev libpcre3-dev libplist-dev libpng-dev libpulse-dev libshairplay-dev libsmbclient-dev libsqlite3-dev libssl-dev libtag1-dev libtiff5-dev libtinyxml-dev libtool libudev-dev libva-dev libvdpau-dev libvorbis-dev libxmu-dev libxrandr-dev libxslt1-dev libxt-dev lsb-release python-dev python-pil rapidjson-dev swig unzip uuid-dev yasm zip zlib1g-dev
Package libmysqlclient-dev is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
However the following packages replace it:
  libmariadb-dev-compat libmariadb-dev

E: Unable to locate package flatbuffers-dev
E: Package 'libmysqlclient-dev' has no installation candidate
E: Unable to locate package libshairplay-dev

edit:

sudo apt install debhelper autoconf automake autopoint gettext autotools-dev cmake curl default-jre doxygen gawk gcc gdc gperf libasound2-dev libass-dev libavahi-client-dev libavahi-common-dev libbluetooth-dev libbluray-dev libbz2-dev libcdio-dev libp8-platform-dev libcrossguid-dev libcurl4-openssl-dev libcwiid-dev libdbus-1-dev libegl1-mesa-dev libenca-dev libflac-dev  libfontconfig-dev libfreetype6-dev libfribidi-dev libfstrcmp-dev libgcrypt-dev libgif-dev libgles2-mesa-dev libgl1-mesa-dev libglu1-mesa-dev libgnutls28-dev libgpg-error-dev libiso9660-dev libjpeg-dev liblcms2-dev libltdl-dev liblzo2-dev libmicrohttpd-dev libnfs-dev libogg-dev libpcre3-dev libplist-dev libpng-dev libpulse-dev  libsmbclient-dev libsqlite3-dev libssl-dev libtag1-dev libtiff5-dev libtinyxml-dev libtool libudev-dev libva-dev libvdpau-dev libvorbis-dev libxmu-dev libxrandr-dev libxslt1-dev libxt-dev lsb-release python-dev python-pil rapidjson-dev swig unzip uuid-dev yasm zip zlib1g-dev libmariadb-dev-compat libmariadb-dev

flatbuffers-dev and libshairplay-dev ... flatbuffers is mentioned in

https://github.com/xbmc/xbmc/blob/master/docs/README.Linux.md#31-build-missing-dependencies

ok, then, that all got installed, eventually

also sudo apt install libcec-dev libfmt-dev liblirc-dev

those instructions kick over to the general linux build instructions.

build their flatbuffers:

sudo make -C tools/depends/target/flatbuffers PREFIX=/usr/local

hmmm

Could NOT find Shairplay (missing: SHAIRPLAY_LIBRARY SHAIRPLAY_INCLUDE_DIR HAVE_SHAIRPLAY_CALLBACK_CLS)

nfi what it does, lets see what happens.

cmake --build . -- VERBOSE=1 -j$(getconf _NPROCESSORS_ONLN)

3.30p, thats chuggign merrily away, it'll be time to deliver the other tv pi soon. may invovle build shelves.

4.20p, it overhet and locked up? no, just in a heavy swap.

6p; killed the compile, and it sprung right back to life. hah. restart without the -j parameter

7.30p, thats chewing.

10.30p: /usr/bin/ld.gold: error: cannot find -lunistring appears to be the killer error.

sudo apt-get install libunistring-dev libunistring2

and surely since its all compiled now itll rerun the make and link and all better now?

oh my it appears to have. the kodi-x11 binary runs and displays a screen on this ssh session. that is nifty.

this adventure may be deserving of writeup. i suspect this version will have the same problem as the distro version, being x11 and not using the HW acceleration thats apparently vital and libreELEC has got. but now ive got a handle on and chance of including that in my version if i can figure out what it is.

in libreelec's linux.arm.conf is:

CONFIG_BCM_VIDEOCORE=y
CONFIG_BCM2835_VCHIQ=y
CONFIG_SND_BCM2835=m

CONFIG_BCM2835_VCHIQ_MMAL=y
CONFIG_BCM_VC_SM_CMA=y
CONFIG_VIDEO_CODEC_BCM2835=m

and i think that the 'MMAL' is the magic i need.

11.30p, set it down tonight.