greenbag
Posts: 121
Joined: Wed Aug 05, 2015 12:52 am

Re: Building Kodi on Pi 2

Thu Apr 21, 2016 6:38 pm

Kratos wrote:
greenbag wrote: I just compile the way the instructions in the package tell me to.. or I find a guide. I've used checkinstall in the past to make packages, but when I tried with this.. it tells me it can't find some tar ball or something, then goes through a list of countries.. then continues in a loop. Until I physically close the terminal. blah. :P
Same here. Did you find a way around this? I am building on Ubuntu MATE 15.10 if it helps.

Kratos
Ubuntu? You're trying to get me in trouble. :P

popcornmix gave me the fix....

Code: Select all

sudo mkdir -p /usr/local/share/doc /usr/local/share/icons/hicolor/16x16 /usr/local/share/icons/hicolor/22x22 /usr/local/share/icons/hicolor/24x24 /usr/local/share/icons/hicolor/32x32 /usr/local/share/icons/hicolor/48x48 /usr/local/share/icons/hicolor/64x64 /usr/local/share/icons/hicolor/128x128 /usr/local/share/icons/hicolor/256x256
btw... I tried compiling Kodi 17 Krypton on Ubuntu.. no go. I had to resort to installing Raspbian to build Krypton. :P But it was easy as hell... 'apt-get build-dep kodi' virtually grabbed everything needed.. except 3 or 4 packages. This was the easiest build yet. :)


Start with fresh install of Raspbian Jessie...

Code: Select all

sudo apt-get update
sudo apt-get install synaptic
sudo synaptic

- Settings/Repositories - select all and close

sudo apt-get update
sudo apt-get upgrade
sudo apt-get dist-upgrade
sudo rpi-update

reboot

sudo apt-get install make git-core build-essential checkinstall

git clone -b Jarvis git://github.com/xbmc/xbmc.git kodi

sudo apt-get build-dep kodi
sudo apt-get install uuid-dev ANT openjdk-7-jdk doxygen

wget https://download.videolan.org/pub/videolan/libbluray/0.8.1/libbluray-0.8.1.tar.bz2
tar xvjf libbluray-0.8.1.tar.bz2

cd libbluray*

./bootstrap
./configure
make -j4
sudo make install

cd

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

cd kodi/project
git clone -b Jarvis https://github.com/kodi-pvr/pvr.hts.git

cmake -DADDONS_TO_BUILD=pvr.hts -DADDON_SRC_PREFIX=../.. -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=../../xbmc/addons -DPACKAGE_ZIP=1 ../../xbmc/project/cmake/addons

make -j4

cd ..

./bootstrap

CFLAGS="-I/opt/vc/include/ -I/opt/vc/include/interface/vcos/pthreads -I/opt/vc/include/interface/vmcs_host/linux -mfloat-abi=hard -mcpu=cortex-a7 -mfpu=neon-vfpv4" CXXFLAGS="-I/opt/vc/include/ -I/opt/vc/include/interface/vcos/pthreads -I/opt/vc/include/interface/vmcs_host/linux -mfloat-abi=hard -mcpu=cortex-a7 -mfpu=neon-vfpv4" LDFLAGS="-L/opt/vc/lib" FFMPEG_OPTS="--cpu=cortex-a7" ./configure --disable-gl --enable-gles --with-platform=raspberry-pi --disable-x11 --disable-vaapi --disable-vdpau --disable-avahi --enable-libcec --disable-pulse --disable-vtbdecoder --enable-alsa --enable-player=omxplayer --enable-libusb --enable-libbluray --enable-lirc --enable-joystick --with-ffmpeg=auto

make -j3

sudo mkdir -p /usr/local/share/doc /usr/local/share/icons/hicolor/16x16 /usr/local/share/icons/hicolor/22x22 /usr/local/share/icons/hicolor/24x24 /usr/local/share/icons/hicolor/32x32 /usr/local/share/icons/hicolor/48x48 /usr/local/share/icons/hicolor/64x64 /usr/local/share/icons/hicolor/128x128 /usr/local/share/icons/hicolor/256x256

sudo checkinstall


edit:

btw... it takes about 20 to 30 minutes just for the *deb package to build. It looks like it's crashed, saying an error, but just hang on... it will build. As long as the $ prompt isn't there, then it's still building.

Also.. I started by setting gpu mem @ 64mb. Popcornmix says you can set it even lower at 16mb. Just make sure to set it back after the build for best video playback in Kodi.

greenbag
Posts: 121
Joined: Wed Aug 05, 2015 12:52 am

Re: Building Kodi on Pi 2

Thu Apr 21, 2016 8:39 pm

frambozentaart wrote:Thanks, excellent post!, isengard compiled and ran without a glitch. I noticed this (stable) version creates a lot of debug output (in ~/.kodi/temp) that cannot be disabled and could wreck your sd card in the end, so you might want to add "--enable-debug=no" to the configure parameters.
According to popcornmix, you only use --disable-debug when compiling a public release. You want to use it... enabling it creates a ~300mb kodi.bin, compared to the ~20mb kodi.bin you get if disabling debug. Disabling it strips kodi of all the optimizations it calculates, specifically for your build, on your hardware. It also creates a slower kodi. So no... don't --disable-debug.

As for the debug logs... maybe you have debugging enabled in kodi itself?


edit:

ok... I think I see the logs you're talking about. Every time kodi closes, there's a kodi_crashlog-*.log.. but it does have errors in it.. at least on my setup. I was reading kodi automatically logs anyways. I added a quick command to delete kodi_crashlog-* to the beginning of my /usr/local/bin/startkodi...

Code: Select all

#!/bin/bash
rm /home/pi/kodi_crashlog-*.log
kodi
then edited the kodi.desktop...

Code: Select all

Exec=startkodi
Now it saves the log when closed, then deletes it when starting up again. Gives the ability to read the logs when needed, but doesn't keep saving them all.

Rascas
Posts: 531
Joined: Tue Mar 11, 2014 6:18 pm
Location: Porto, Portugal
Contact: Website

Re: Building Kodi on Pi 2

Fri Apr 22, 2016 2:02 pm

@greenbag
You got it wrong. You only want debug enabled when you are the developer of the application and want to debug the program. So, for normal usage, you always want --disable-debug because it produces a much smaller and optimized binary. In Kodi if you compile it with debug enabled it is slower, because the binary is much bigger and disables some optimizations. But this kind of debug is only for developers, even whith it disabled you can always enable debug in the options to check if there is a problem.

greenbag
Posts: 121
Joined: Wed Aug 05, 2015 12:52 am

Re: Building Kodi on Pi 2

Fri Apr 22, 2016 7:48 pm

Rascas wrote:@greenbag
You got it wrong. You only want debug enabled when you are the developer of the application and want to debug the program. So, for normal usage, you always want --disable-debug because it produces a much smaller and optimized binary. In Kodi if you compile it with debug enabled it is slower, because the binary is much bigger and disables some optimizations. But this kind of debug is only for developers, even whith it disabled you can always enable debug in the options to check if there is a problem.
So... you're smarter than popcornmix now?? lmfao!
You obviously want --disable-debug for a release build. Debugging disables a lot of optimisations, so produces a slower kodi.
http://forum.kodi.tv/showthread.php?tid ... pid2312410


I'll take popcornmix's word over yours anyday. He writes the code... you just compile it. :P

Rascas
Posts: 531
Joined: Tue Mar 11, 2014 6:18 pm
Location: Porto, Portugal
Contact: Website

Re: Building Kodi on Pi 2

Fri Apr 22, 2016 7:53 pm

"You obviously want --disable-debug for a release build. Debugging disables a lot of optimisations, so produces a slower kodi." Popcornmix

Which part that don't you understand ?

greenbag
Posts: 121
Joined: Wed Aug 05, 2015 12:52 am

Re: Building Kodi on Pi 2

Fri Apr 22, 2016 7:57 pm

Rascas wrote:"You obviously want --disable-debug for a release build. Debugging disables a lot of optimisations, so produces a slower kodi." Popcornmix

Which part that don't you understand ?

Holy crap.. I need new glasses.

User avatar
Kratos
Posts: 394
Joined: Sun Apr 12, 2015 12:41 pm

Re: Building Kodi on Pi 2

Wed May 18, 2016 2:52 pm

greenbag wrote:
Rascas wrote:"You obviously want --disable-debug for a release build. Debugging disables a lot of optimisations, so produces a slower kodi." Popcornmix

Which part that don't you understand ?

Holy crap.. I need new glasses.
WOW! Best irony case I have seen on the net yet. *Still laughing*

Kratos
I have posted mostly with a Pi 2 running either Ubuntu MATE, or Raspbian.

greenbag
Posts: 121
Joined: Wed Aug 05, 2015 12:52 am

Re: Building Kodi on Pi 2

Wed May 18, 2016 8:35 pm

Kratos wrote:
greenbag wrote:
Rascas wrote:"You obviously want --disable-debug for a release build. Debugging disables a lot of optimisations, so produces a slower kodi." Popcornmix

Which part that don't you understand ?

Holy crap.. I need new glasses.
WOW! Best irony case I have seen on the net yet. *Still laughing*

Kratos
Shit happens. I was smart enough to show you how to build Kodi 17 on Ubuntu though.. couldn't figure that one out by yourself. ;)

User avatar
Kratos
Posts: 394
Joined: Sun Apr 12, 2015 12:41 pm

Re: Building Kodi on Pi 2

Thu May 19, 2016 2:34 pm

Yeah, thanks a lot for all your help. I had to change a few things, like a custom Makefile.include to get around the gcc 5 ABI errors. Check out all the details here: viewtopic.php?f=35&t=124572&p=978013#p978013

Kratos
I have posted mostly with a Pi 2 running either Ubuntu MATE, or Raspbian.

greenbag
Posts: 121
Joined: Wed Aug 05, 2015 12:52 am

Re: Building Kodi on Pi 2

Thu May 19, 2016 8:10 pm

Kratos wrote:Yeah, thanks a lot for all your help. I had to change a few things, like a custom Makefile.include to get around the gcc 5 ABI errors. Check out all the details here: viewtopic.php?f=35&t=124572&p=978013#p978013

Kratos

What errors? The how-to I gave you worked perfectly as is.. I literally c&p'd the steps myself when testing it. If you had errors of any sort.. you messed up somewhere. Just like the errors at the end while doing checkinstall.. I said you'll be stuck at India for 20 minutes or so, but have patience.. it'll work. What do you do? You come back and say it crashed at India... lol.

User avatar
Kratos
Posts: 394
Joined: Sun Apr 12, 2015 12:41 pm

Re: Building Kodi on Pi 2

Thu May 19, 2016 11:42 pm

It did. The error was the Jarvis was not a valid version name.

Kratos
I have posted mostly with a Pi 2 running either Ubuntu MATE, or Raspbian.

greenbag
Posts: 121
Joined: Wed Aug 05, 2015 12:52 am

Re: Building Kodi on Pi 2

Fri May 20, 2016 1:05 am

Kratos wrote:It did. The error was the Jarvis was not a valid version name.

Kratos
lol... it said "16.9.701" is not a valid version.. so you rename it 17.0.000.

edit: If it was Jarvis, then it would have complained about "16.1.000", so you change it to 16.1.001, or whatever you prefer.


edit #2: I can't find a log where I captured the checkinstall data list, but...

Code: Select all

Please write a description for the package.
End your sescription with an empty line or EOF.
>> kodi 16.1.001

0 - Maintainer:	[ ubuntu@mate ]
1 - Summary:	[ kodi 16.1 ]
2 - Name:	[ kodi-16.1 ]
3 - Version:	[ 16.1 ]
I'm going by memory, I can't remember if a hyphen in the name or not. Whatever you're presented with after stating the description in the first step. Just make sure the vesrion number's in there, and not the name.. ie: Jarvis.

aherbjornsen
Posts: 5
Joined: Tue Aug 09, 2016 9:35 am

Re: Building Kodi on Pi 2

Wed Aug 10, 2016 12:42 pm

I have successfully been able to compile and run kodi (Jarvis) on Pi 2 and Pi 3, using the instructions provided by greenbag.

Everything seems to work fine so far, except Lirc which is not working at all. Doing an 'strace -f kodi | grep -i lirc', I cannot see that kodi is trying to open /dev/lircd:

Code: Select all

24005 stat64("/home/pi/.kodi/userdata/Lircmap.xml", {st_mode=S_IFREG|0644, st_size=15486, ...}) = 0
24005 openat(AT_FDCWD, "/sys/class/lirc", O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY|O_CLOEXEC) = 20
24005 readlink("/sys/class/lirc/lirc0", "../../devices/platform/soc/3f980"..., 1024) = 77
24005 stat64("/sys/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.2/1-1.2:1.0/rc/rc0/lirc0/uevent", {st_mode=S_IFREG|0644, st_size=4096, ...}) = 0
24005 readlink("/sys/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.2/1-1.2:1.0/rc/rc0/lirc0", 0x7e9a5ab0, 1024) = -1 EINVAL (Invalid argument)
24005 stat64("/sys/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.2/1-1.2:1.0/rc/rc0/lirc0/uevent", {st_mode=S_IFREG|0644, st_size=4096, ...}) = 0
24005 openat(AT_FDCWD, "/sys/class/lirc", O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY|O_CLOEXEC) = 20
24005 readlink("/sys/class/lirc/lirc0", "../../devices/platform/soc/3f980"..., 1024) = 77
24005 stat64("/sys/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.2/1-1.2:1.0/rc/rc0/lirc0/uevent", {st_mode=S_IFREG|0644, st_size=4096, ...}) = 0
24005 readlink("/sys/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.2/1-1.2:1.0/rc/rc0/lirc0",  <unfinished ...>
24005 stat64("/sys/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.2/1-1.2:1.0/rc/rc0/lirc0/uevent",  <unfinished ...>
24022 openat(AT_FDCWD, "/sys/class/lirc", O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY|O_CLOEXEC <unfinished ...>
Removing the self-built Kodi installing it from the repository with 'apt-get install kodi', Lirc works fine and if I do an "strace -f kodi | grep -i lirc" I see:

Code: Select all

24817 stat64("/home/pi/.kodi/userdata/Lircmap.xml", {st_mode=S_IFREG|0644, st_size=15497, ...}) = 0
24829 connect(18, {sa_family=AF_LOCAL, sun_path="/dev/lircd"}, 110 <unfinished ...>
24829 inotify_add_watch(19, "/dev/lircd", IN_DELETE_SELF <unfinished ...>
24817 stat64("/usr/share/kodi/system/Lircmap.xml", {st_mode=S_IFREG|0644, st_size=15497, ...}) = 0
24817 open("/usr/share/kodi/system/Lircmap.xml", O_RDONLY|O_LARGEFILE) = 20
24817 stat64("/home/pi/.kodi/userdata/Lircmap.xml", {st_mode=S_IFREG|0644, st_size=15497, ...}) = 0
24817 stat64("/home/pi/.kodi/userdata/Lircmap.xml", {st_mode=S_IFREG|0644, st_size=15497, ...}) = 0
24817 open("/home/pi/.kodi/userdata/Lircmap.xml", O_RDONLY|O_LARGEFILE) = 20
24817 openat(AT_FDCWD, "/sys/class/lirc", O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY|O_CLOEXEC) = 22
24817 readlink("/sys/class/lirc/lirc0", "../../devices/platform/soc/3f980"..., 1024) = 77

Any suggestions?

berne
Posts: 31
Joined: Sat Sep 24, 2016 10:53 pm

Re: Building Kodi on Pi 2

Sat Sep 24, 2016 10:56 pm

i am trying to install kodi 17 on my pi 2 using jessie

but run in to one error i dont know what to do... iam prety new to this


pi@raspberrypi:~/xbmc $ make install
Copying kodi binary to /home/pi/local/lib/kodi/
install: cannot stat ‘kodi-xrandr’: No such file or directory
Makefile:514: recipe for target 'install-binaries' failed
make: *** [install-binaries] Error 1

any ides?

arusia
Posts: 1
Joined: Sat Oct 08, 2016 12:57 am

Re: Building Kodi on Pi 2

Sat Oct 08, 2016 1:00 am

greenbag wrote:
Kratos wrote:
greenbag wrote: I just compile the way the instructions in the package tell me to.. or I find a guide. I've used checkinstall in the past to make packages, but when I tried with this.. it tells me it can't find some tar ball or something, then goes through a list of countries.. then continues in a loop. Until I physically close the terminal. blah. :P
Same here. Did you find a way around this? I am building on Ubuntu MATE 15.10 if it helps.

Kratos
Ubuntu? You're trying to get me in trouble. :P

popcornmix gave me the fix....

Code: Select all

sudo mkdir -p /usr/local/share/doc /usr/local/share/icons/hicolor/16x16 /usr/local/share/icons/hicolor/22x22 /usr/local/share/icons/hicolor/24x24 /usr/local/share/icons/hicolor/32x32 /usr/local/share/icons/hicolor/48x48 /usr/local/share/icons/hicolor/64x64 /usr/local/share/icons/hicolor/128x128 /usr/local/share/icons/hicolor/256x256
btw... I tried compiling Kodi 17 Krypton on Ubuntu.. no go. I had to resort to installing Raspbian to build Krypton. :P But it was easy as hell... 'apt-get build-dep kodi' virtually grabbed everything needed.. except 3 or 4 packages. This was the easiest build yet. :)


Start with fresh install of Raspbian Jessie...

Code: Select all

sudo apt-get update
sudo apt-get install synaptic
sudo synaptic

- Settings/Repositories - select all and close

sudo apt-get update
sudo apt-get upgrade
sudo apt-get dist-upgrade
sudo rpi-update

reboot

sudo apt-get install make git-core build-essential checkinstall

git clone -b Jarvis git://github.com/xbmc/xbmc.git kodi

sudo apt-get build-dep kodi
sudo apt-get install uuid-dev ANT openjdk-7-jdk doxygen

wget https://download.videolan.org/pub/videolan/libbluray/0.8.1/libbluray-0.8.1.tar.bz2
tar xvjf libbluray-0.8.1.tar.bz2

cd libbluray*

./bootstrap
./configure
make -j4
sudo make install

cd

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

cd kodi/project
git clone -b Jarvis https://github.com/kodi-pvr/pvr.hts.git

cmake -DADDONS_TO_BUILD=pvr.hts -DADDON_SRC_PREFIX=../.. -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=../../xbmc/addons -DPACKAGE_ZIP=1 ../../xbmc/project/cmake/addons

make -j4

cd ..

./bootstrap

CFLAGS="-I/opt/vc/include/ -I/opt/vc/include/interface/vcos/pthreads -I/opt/vc/include/interface/vmcs_host/linux -mfloat-abi=hard -mcpu=cortex-a7 -mfpu=neon-vfpv4" CXXFLAGS="-I/opt/vc/include/ -I/opt/vc/include/interface/vcos/pthreads -I/opt/vc/include/interface/vmcs_host/linux -mfloat-abi=hard -mcpu=cortex-a7 -mfpu=neon-vfpv4" LDFLAGS="-L/opt/vc/lib" FFMPEG_OPTS="--cpu=cortex-a7" ./configure --disable-gl --enable-gles --with-platform=raspberry-pi --disable-x11 --disable-vaapi --disable-vdpau --disable-avahi --enable-libcec --disable-pulse --disable-vtbdecoder --enable-alsa --enable-player=omxplayer --enable-libusb --enable-libbluray --enable-lirc --enable-joystick --with-ffmpeg=auto

make -j3

sudo mkdir -p /usr/local/share/doc /usr/local/share/icons/hicolor/16x16 /usr/local/share/icons/hicolor/22x22 /usr/local/share/icons/hicolor/24x24 /usr/local/share/icons/hicolor/32x32 /usr/local/share/icons/hicolor/48x48 /usr/local/share/icons/hicolor/64x64 /usr/local/share/icons/hicolor/128x128 /usr/local/share/icons/hicolor/256x256

sudo checkinstall


edit:

btw... it takes about 20 to 30 minutes just for the *deb package to build. It looks like it's crashed, saying an error, but just hang on... it will build. As long as the $ prompt isn't there, then it's still building.

Also.. I started by setting gpu mem @ 64mb. Popcornmix says you can set it even lower at 16mb. Just make sure to set it back after the build for best video playback in Kodi.
Excellent write up. With this I successfully built Jarvis, but what would I need to change to build Krypton on Raspbian, as Jarvis' touch screen controls are still a bit wonky?

uros678
Posts: 1
Joined: Thu Nov 10, 2016 12:10 pm

Re: Building Kodi on Pi 2

Thu Nov 10, 2016 12:21 pm

Hello guys,

I have compiled the beta release of kodi 17 on Pi 2 using

https://github.com/xbmc/xbmc/blob/maste ... aspberrypi

I just changed

Code: Select all

PATH="$PATH:/opt/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin" \
       ./configure --host=arm-linux-gnueabihf \
       --prefix=/opt/xbmc-bcm/xbmc-dbg \
       --with-toolchain=/usr/local/bcm-gcc/arm-bcm2708hardfp-linux-gnueabi/sysroot \
       --with-firmware=/opt/bcm-rootfs \
       --with-platform=raspberry-pi2 \
       --build=i686-linux
to

Code: Select all

PATH="$PATH:/opt/gcc-linaro-arm-linux-gnueabihf-raspbian/bin" \
       ./configure --host=arm-linux-gnueabihf \
       --prefix=/opt/xbmc-bcm/xbmc-dbg \
       --with-toolchain=/usr/local/bcm-gcc/arm-bcm2708hardfp-linux-gnueabi/sysroot \
       --with-firmware=/opt/bcm-rootfs \
       --with-platform=raspberry-pi2 \
       --build=arm-linux-gnueabihf 
And then before running make install I just created all the icon directories

Code: Select all

mkdir /opt/xbmc-bcm/xbmc-dbg/arm-linux-gnueabihf/share/icons/hicolor/16x16
mkdir /opt/xbmc-bcm/xbmc-dbg/arm-linux-gnueabihf/share/icons/hicolor/22x22
mkdir /opt/xbmc-bcm/xbmc-dbg/arm-linux-gnueabihf/share/icons/hicolor/24x24
mkdir /opt/xbmc-bcm/xbmc-dbg/arm-linux-gnueabihf/share/icons/hicolor/32x32
mkdir /opt/xbmc-bcm/xbmc-dbg/arm-linux-gnueabihf/share/icons/hicolor/48x48
mkdir /opt/xbmc-bcm/xbmc-dbg/arm-linux-gnueabihf/share/icons/hicolor/64x64
mkdir /opt/xbmc-bcm/xbmc-dbg/arm-linux-gnueabihf/share/icons/hicolor/128x128
mkdir /opt/xbmc-bcm/xbmc-dbg/arm-linux-gnueabihf/share/icons/hicolor/256x256
Kind regards,

Uros

Return to “Raspbian”