fraz0815
Posts: 70
Joined: Fri Jul 20, 2012 1:29 pm

Building Kodi on Pi 2

Tue Feb 24, 2015 11:02 pm

Hello,
since my Pi 2 arrived I started playing around with it and since I couldn't find any up2date guides for compiling kodi natively, I wrote one.

This is actual not very stable, if you want to use your pi 2 mainly with kodi, use Openelec/Raspbmc/Osmc/xbian (all are highly optimized and have lots of features).
But for the fun of compiling and learning some stuff read further :-) To be honest I thought it would be lot easier....

I did not test much after compiling besides normal features, but exiting likes to crash, and probably tons of of other things.

I tried to comment as much as I could, it does compile and should give you some idea what is needed to compile kodi on raspbian (debian wheezy) and what options you have.

Feel free to test or make suggestions.

https://drive.google.com/file/d/0B8nSlx ... sp=sharing
or direct link to file
http://not-guild.de/temp/kodi.txt


Edit:
Ok, build seems pretty stable, exiting fails after a video was played, probably kodi bug, taking some logs and maybe kodi team can fix, workaround with a cronjob wich kills kodi.bin here: http://www.raspberrypi.org/forums/viewt ... 3&t=100811

:edit2
direct link added, also kodi exit bug is fixed in kodi 15 Isengard

:edit3
changed branch to Isengard and new libcec instructions
Last edited by fraz0815 on Sat Jul 18, 2015 1:02 pm, edited 4 times in total.

rpi25
Posts: 23
Joined: Sat Feb 21, 2015 2:31 am

Re: Building Kodi on Pi 2

Wed Feb 25, 2015 3:06 am

Cool! Thanks for the guide.

Another option to get Kodi running in Raspbian is to add this guy's archive, he hosts a debian package of Kodi compiled on Raspbian:

http://michael.gorven.za.net/

I've been surprisingly pleased with it, in some ways I think it almost runs more smoothly than Raspbmc did, with all my other background services running.

fruitoftheloom
Posts: 19810
Joined: Tue Mar 25, 2014 12:40 pm
Location: Delightful Dorset

Re: Building Kodi on Pi 2

Wed Feb 25, 2015 7:44 am

adieu

My other Computer is an Asus CS10 ChromeBit running Chrome Operating System.
HP Envy 4500 Wireless Printer supported by HPLIP software in Raspbian Buster.
Raspberry Pi Model 2B v1.1

fraz0815
Posts: 70
Joined: Fri Jul 20, 2012 1:29 pm

Re: Building Kodi on Pi 2

Wed Feb 25, 2015 8:37 am

I was aware of that, but that is not building ;-)

Theoretically we gain performance because we use all new cpu stuff on pi 2 like '-mcpu=cortex-a7 -mfpu=neon-vfpv4' during compile. This is missing in this deb because it was made for pi 1 (but it also runs on pi 2 without these optimizations).

Also I thought there would be some people who like to compile for themselves, learn a bit about using git, deciding which branch of kodi to use etc. Especially now that we have the cpu power now to compile in a reasonable amount of time on the pi itself.

:edit, but thankfully there are the needed fixes to exit kodi correctly in the linked post above :)

darren99
Posts: 1
Joined: Sat Feb 28, 2015 6:12 pm

Re: Building Kodi on Pi 2

Sat Feb 28, 2015 6:20 pm

Thanks for the build process.
All went well aside from one missing package. libgles2-mesa-dev
I build from a fresh image of the Feb 16 Raspbian.
I started make -j2 when I went to bed and it was done when I got up.

fraz0815
Posts: 70
Joined: Fri Jul 20, 2012 1:29 pm

Re: Building Kodi on Pi 2

Sun Mar 01, 2015 10:13 am

darren99 wrote:Thanks for the build process.
All went well aside from one missing package. libgles2-mesa-dev
I build from a fresh image of the Feb 16 Raspbian.
I started make -j2 when I went to bed and it was done when I got up.
Added missing lib, thanks

It seems exit bug is fixed, https://github.com/popcornmix/xbmc/comm ... 17ea77343a
Building right now :)
Also added part 'how to update'.

:edit
I should wake up before posting. afaik ibgles2-mesa-dev should not be used, or did this change? We use raspberry's gles in /opt/vc/ instead.
I also don't have it installed, maybe something was wrong with configure and the paths. I will re-check whole process with a fresh image in the next days, there may be something wrong in the guide, I did a lot of sym-linking due testing, so I cant say for sure.

dertester
Posts: 6
Joined: Sun Nov 03, 2013 3:14 am

Re: Building Kodi on Pi 2

Tue Mar 10, 2015 2:23 pm

Thx for these instructions.

Im not sure how to get the pvr addons installed. Can someone point my on where to get and put them or how to build?




I was a bit confused with ./configure, as i just copy & pasted the whole block of cflags without seeing that the ./configure command is behind it..

pickfire
Posts: 43
Joined: Fri Dec 19, 2014 3:27 pm

Re: Building Kodi on Pi 2

Thu Mar 12, 2015 10:05 am

Can you provide a link to download the raw text file?
I hope you can make it a shell script with comment.

## change to 'gpu_mem=256'
sudo nano /boot/config.txt

Isn't 128 enough? And it can be changed to:

grep -q '^gpu_mem=' /boot/config.txt && sudo sed -i '/^gpu_mem=/c gpu_mem=128' /boot/config.txt || sudo echo 'gpu_mem=128' >> /boot/config.txt

fraz0815
Posts: 70
Joined: Fri Jul 20, 2012 1:29 pm

Re: Building Kodi on Pi 2

Thu Mar 12, 2015 4:21 pm

I'll have a look at PVR-addons and making a script. I am not sure about how much ram is really needed.
I can copy that txt file to a direct http mirror, just finishing some things.

The configure and xflag stuff should get bit shorter soon, also according to http://forum.kodi.tv/showthread.php?tid=217892&page=3 we may get kodi pre-compiled in raspbian repo, so we can 'apt-get install' it, which would be very nice.

I would also not recommend to use branch newclock4 from popcornmix anymore the way we compile kodi.
Even though there are some pi2 specific patches. I think this branch should be build with dependencies (https://github.com/xbmc/xbmc/tree/master/tools/depends), else we miss a lot of patches.
I am testing around but had no luck so far to make a deb on pi2 itself nor cross-compiling.

edit.
Direct link added http://not-guild.de/temp/kodi.txt , also copy&pasted gpu_mem script, thanks.
Last edited by fraz0815 on Thu Mar 12, 2015 7:20 pm, edited 1 time in total.

dertester
Posts: 6
Joined: Sun Nov 03, 2013 3:14 am

Re: Building Kodi on Pi 2

Thu Mar 12, 2015 6:48 pm

Thx. I tried the new cmake pvr method but with no luck. (im more or less just copying commands)

The make - j4 for kodi went without Problems. Ram usage was around 50% at max when I checked.

johnsonld123
Posts: 14
Joined: Thu Feb 23, 2012 5:03 am

Re: Building Kodi on Pi 2

Thu Mar 12, 2015 10:31 pm

Anyone have a start up script to boot into kodi? Actually, I'm trying to set it to boot to kodi and exit to desktop but having little luck.
RPi-Debian-SiriProxy-2013-02-16

User avatar
DougieLawson
Posts: 35381
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: Building Kodi on Pi 2

Fri Mar 13, 2015 8:02 am

johnsonld123 wrote:Anyone have a start up script to boot into kodi? Actually, I'm trying to set it to boot to kodi and exit to desktop but having little luck.
Why not take the easy path. http://openelec.tv/get-openelec ?
Note: Having anything remotely humorous in your signature is completely banned on this forum.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

johnsonld123
Posts: 14
Joined: Thu Feb 23, 2012 5:03 am

Re: Building Kodi on Pi 2

Fri Mar 13, 2015 3:13 pm

I would still like to use the desktop. I later plan on trying to integrate a script to exit to desktop and also launch minecraft for the kids.
RPi-Debian-SiriProxy-2013-02-16

jan-h
Posts: 4
Joined: Thu Mar 19, 2015 9:51 pm

Re: Building Kodi on Pi 2

Thu Mar 19, 2015 10:05 pm

I have been following the instructions from the .txt file linked to above, compiled several times and even tried the popcornmix branch, but just cannot get it to work.

Everything builds just fine, it actually says "Kodi built successfully" but when I run it, all I see is Confluence's background with the mouse pointer in the upper left corner of the screen. Moving has no effect to what I see on screen and keyboard input is ignored as well. However, the Pi (2 Model B by the way) is not locked up, logging in via SSH and killing Kodi works, brings back the console on screen and restores keyboard input (mouse as well when I start lightdm from that console). The Kodi log ends with "LIRC Connect: connect failed: No such file or directory". the only errors in the log are "GetString: error reading /sys/class/graphics/fb0/device/modalias" and "Error reading joystick map element, Invalid id: 0". Not sure about the first one, but the second one should not cause the issue.

Any idea why Kodi just freezes? I would like to try out Isengard for two reasons. First, the exit bug is fixed and second, I am experimenting with a little lightweight program I wrote, which runs as a daemon and listens for HDMI CEC commands. At the moment the red button starts Kodi and the green button starts EmulationStation. The latter works without any problems, but running Kodi (14, Michael Gorven's repo) from that small application breaks HDMI CEC control. I was hoping that this might not happen with Isengard.

fraz0815
Posts: 70
Joined: Fri Jul 20, 2012 1:29 pm

Re: Building Kodi on Pi 2

Fri Mar 20, 2015 11:26 pm


jan-h
Posts: 4
Joined: Thu Mar 19, 2015 9:51 pm

Re: Building Kodi on Pi 2

Sat Mar 21, 2015 6:17 pm

Looks promising, I'll give it a try. Thanks.

jan-h
Posts: 4
Joined: Thu Mar 19, 2015 9:51 pm

Re: Building Kodi on Pi 2

Sun Mar 22, 2015 3:21 pm

Well, it didn't work out as planned but I finally got everything to work using the official Raspbian and Michael Gorven's Helix build.

Tom_A
Posts: 272
Joined: Fri Dec 06, 2013 8:34 am

Re: Building Kodi on Pi 2

Fri Mar 27, 2015 4:13 pm

jan-h wrote:I am experimenting with a little lightweight program I wrote, which runs as a daemon and listens for HDMI CEC commands. At the moment the red button starts Kodi and the green button starts EmulationStation. The latter works without any problems, but running Kodi (14, Michael Gorven's repo) from that small application breaks HDMI CEC control. I was hoping that this might not happen with Isengard.
Before XBMC had been renamed Kodi, I discovered I could remote control my sister's TV over a VPN connection by sending CEC commands through SSH. I was using RaspBMC and it broke CEC control from XBMC/Kodi as well. I think this is something that is in all builds of Kodi and it's been there longer than the name Kodi. I just don't think they expected anyone to also use ssh to control using CEC.

jan-h
Posts: 4
Joined: Thu Mar 19, 2015 9:51 pm

Re: Building Kodi on Pi 2

Sun Mar 29, 2015 1:34 pm

Actually I got around that. As a base I'm using https://github.com/DrGeoff/cec_simplest/, the background thread reacts to the color keys on the remote to start Kodi, EmulationStation, lightdm and to stop lightdm. What I found was that as long as I start Kodi from the background thread, the keystrokes never make it through to Kodi. However, when I just set a var named "startKodi" and evaluate that from the main thread to actually start Kodi, everything works just fine. The only thing left was that after Kodi exited, my application no longer received any keystrokes from the remote. Since the application already runs in the background via an init.d script, you can work around this issue by simply restarting the service/daemon after Kodi exits. Now I can easily switch between Kodi and EmulationStation without direct or remote console access.

gkreidl
Posts: 5953
Joined: Thu Jan 26, 2012 1:07 pm
Location: Germany

Re: Building Kodi on Pi 2

Fri Apr 03, 2015 12:12 pm

fraz0815 wrote:I
I am testing around but had no luck so far to make a deb on pi2 itself nor cross-compiling.
You could try using checkinstall to create a deb image
sudo checkinstall make install
Minimal Kiosk Browser (kweb)
Slim, fast webkit browser with support for audio+video+playlists+youtube+pdf+download
Optional fullscreen kiosk mode and command interface for embedded applications
Includes omxplayerGUI, an X front end for omxplayer

Tom_A
Posts: 272
Joined: Fri Dec 06, 2013 8:34 am

Re: Building Kodi on Pi 2

Sat Apr 04, 2015 5:50 am

johnsonld123 wrote:Anyone have a start up script to boot into kodi? Actually, I'm trying to set it to boot to kodi and exit to desktop but having little luck.
I just have raspi-config set to automatically log me in. If I log out, there is an option to log back in but into Kodi instead of the desktop. If you log into Kodi and then reboot, you auto log back in to Kodi. I think this is a nice option as It would prevent someone without your password from just logging in automatically as your user other than into Kodi. If you need the desktop, just log out and back in to the desktop enviroment. No scripting needed.

zog
Posts: 200
Joined: Sun Nov 20, 2011 5:43 pm
Contact: Website

Re: Building Kodi on Pi 2

Mon Apr 13, 2015 7:19 am

Hi,
I am trying to build Kodi under jessie on the RPi2. I can't get beyond the configure step.

I cleaned and remastered from git this morning.

When I run ./configure I get this output

configure: "FFmpeg installation forced by user - installing our version"
ERROR: gnutls not found using pkg-config

If you think configure made a mistake, make sure you are using the latest
version from Git. If the latest version fails, report the problem to the
ffmpeg-user@ffmpeg.org mailing list or IRC #ffmpeg on irc.freenode.net.
Include the log file "config.log" produced by configure as this will help
solve the problem.
Makefile:2: config.mak: No such file or directory
Makefile:59: /common.mak: No such file or directory
Makefile:100: /libavutil/Makefile: No such file or directory
Makefile:100: /library.mak: No such file or directory
Makefile:102: /doc/Makefile: No such file or directory
Makefile:185: /tests/Makefile: No such file or directory
make: *** No rule to make target '/tests/Makefile'. Stop.
ERROR: Building ffmpeg failed
checking for FFMPEG... no
configure: error: "ffmpeg not found"


I have compiled FFmpeg as a separate project and I have done a make install on it, but alas it has no effect on the xbmc build process.

I am stumped and I have already wasted a day trying to get Kodi to install on the rpi2.

I need the source code as I want to write a rasberry pi specific plugin for Kodi and OpenElec. I couldn't build openelec from source either. I have tried to install gnutls several times as well.

fraz0815
Posts: 70
Joined: Fri Jul 20, 2012 1:29 pm

Re: Building Kodi on Pi 2

Mon Apr 13, 2015 9:48 am

libgnutls-dev or libcurl4-gnutls-dev installed?

zog
Posts: 200
Joined: Sun Nov 20, 2011 5:43 pm
Contact: Website

Re: Building Kodi on Pi 2

Mon Apr 13, 2015 11:43 am

There first package isn't available in jessie the 2nd is installed.

root@raspberrypi:/home/pi# apt-get install libgnutls-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package libgnutls-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

E: Package 'libgnutls-dev' has no installation candidate

I think it should be there it's just not in the Raspbian repository for some reason?


root@raspberrypi:/home/pi# apt-get install libcurl4-gnutls-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
libcurl4-gnutls-dev is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 301 not upgraded.


Thanks for the reply Jack

zog
Posts: 200
Joined: Sun Nov 20, 2011 5:43 pm
Contact: Website

Re: Building Kodi on Pi 2

Mon Apr 13, 2015 12:01 pm

I installed this package

libgnutls28-dev instead

now FFmpeg appears to be building from ./configure
I will keep you posted

Return to “Raspbian”