XBMC packages for Raspberry Pi running Raspbian

I recently got a Raspberry Pi, which is an ARM based device which runs Linux. My goal is to use this as my HTPC running XBMC, so that I can move the fileserver out the lounge.

Edit: I've moved the latest information and updates about these packages to this page.

Building

I installed Raspbian on my RPi, which is basically a rebuild of Debian Wheezy specifically for the RPi (targeting the ARMv6 architecture with hard float). I found various instructions on how to build XBMC for Raspbian, but none of them were in the form of deb packages, and installing software without packages just makes me queezy. So I went off and built it myself.

Since the RPi is relatively low powered, I built the package on my laptop using qemu-user, which emulates binaries with a different architecture. I based the packaging on the XBMC package in Wheezy, and the source is from the xbmc-rbp branch on GitHub. I made the modifications to the source as per this forum post and added an initscript so that it can automatically start at bootup.

Installing

The easiest way to install the package is to add my archive to your system. To do this, store the following in /etc/apt/sources.list.d/mene.list:

deb http://archive.mene.za.net/raspbian wheezy contrib

and then import the archive signing key:

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-key 5243CDED

You can then install it as you would with any other package, for example, with apt-get:

sudo apt-get install xbmc

(If you don't want to configure my archive you can download the packages manually, but you'll have to deal with all the dependencies. Note that it requires a newer libcec package which is also in my archive.)

The user which you're going to run XBMC as needs to be a member of the following groups:

audio video input dialout plugdev

Running

To run XBMC, run xbmc-standalone from a VT (i.e. not under X). XBMC accesses the display directly and not via Xorg.

If you want XBMC to automatically start when the system boots, edit /etc/default/xbmc and change ENABLED to 1:

ENABLED=1

You also need to set the user which XBMC should run as (the xbmc user is not automatically created at the moment). Run sudo service xbmc start to test this.

Configuration

The following settings in advancedsettings.xml decreases the CPU usage while showing the UI. Disabling the RSS feeds also helps with this.

<advancedsettings>
    <gui>
        <algorithmdirtyregions>3</algorithmdirtyregions>
        <nofliptimeout>0</nofliptimeout>
    </gui>
</advancedsettings>

Rebuilding

If you want to rebuild this package with a different source (e.g. a later Git revision), you need to prepare the source by running ./bootstrap before creating the orig.tar.gz. You obviously need all the build dependencies (which should be listed in the packaging), as well as the VideoCoreIV libraries in /opt. You probably want to set DEB_BUILD_OPTIONS=nocheck parallel=4 to disable the tests (they failed to build for me), and speed up the build by using more than one core. You can find the packaging in my archive or my Bazaar repository.

Trackback URL for this post:

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

Pingback

[...] Read instructions HERE [...]

Michael, I have successfully

Michael,

I have successfully installed this on a Rpi B+ Jessie system running the latest V7 kernel. There is still an issue exiting out of Kodi and back to the shell. The first time it is run, it exits fine. Subsequently it does not exit cleanly and leaves Kodi running so we get a locked blank screen. To recover you need to ssh in and kill the top pf the Kodi tree process using top or htop. Once the kodi processes are killed it then returns to the shell on tty1.

Cheers Stephen

Hi Michael, Will you be

Hi Michael,

Will you be updating your Kodi verison to the release version 14.1 and compiling for debain Jessie and Rpi 2?

Cheers Spart

14.1 is available for Jessie

14.1 is available for Jessie and Wheezy. The packages and the latest SD card image should work on Rpi 2, but aren't optimised for it.

But will it be optimized for

But will it be optimized for the RPi2?!

I have succesfully installed this with some changes of path/name (xbmc=>kodi) but I think the Broadcom chipset isn't updated, but the hardware encoded video does work, and the multi processor too! (seeing CPU0 to CPU3!)

well, ican work with this already now (on the RPi2).

Thanks for the very good description/instruction given!

Pingback

[...] I have used Raspbian which is general purpose Debian based distro and added XBMC to it with this guide – http://michael.gorven.za.net/blog/2012/08/06/xbmc-packages-raspberry-pi-running-raspbian [...]

Hi, Thank you for writing

Hi,

Thank you for writing this up. I have access to arm build environment and would like to build some other pacakges for my Raspberry Pi.

I wanted to check with you on if and whether we need to supply any extra / additional build paramereters that could be specifically for the Pi ?

My arm build environment is Debian.

I got it to build but when I

I got it to build but when I installed the package, it failed stating "Illegal Instruction". Looking at the Debian wiki, it says that Debian armhf defaults to hard float. It does have armel, that does soft float. RPI on the other hand is in between.

So my question to you is on how do I build any usual debian source package on a Debian armhf box, that can work on RPI ?

I just followed the

I just followed the instructions for adding the xbmc package to my PI:

deb http://archive.mene.za.net/raspbian wheezy contrib

and then import the archive signing key:

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-key 5243CDED

You can then install it as you would with any other package, for example, with apt-get:

sudo apt-get install xbmc

I got the following error:

perl: warning: Setting locale failed. perl: warning: Please check that your locale settings: LANGUAGE = (unset), LC_ALL = (unset), LANG = "en_GB.UTF-8" are supported and installed on your system. perl: warning: Falling back to the standard locale ("C"). locale: Cannot set LC_CTYPE to default locale: No such file or directory locale: Cannot set LC_MESSAGES to default locale: No such file or directory locale: Cannot set LC_ALL to default locale: No such file or directory

Please advise, thanks.

Additional info: There

Additional info: There appears to be a seg fault...

inline: Install these packages without verification [y/N]? y perl: warning: Setting locale failed. perl: warning: Please check that your locale settings: LANGUAGE = (unset), LC_ALL = (unset), LANG = "en_GB.UTF-8" are supported and installed on your system. perl: warning: Falling back to the standard locale ("C"). locale: Cannot set LC_CTYPE to default locale: No such file or directory locale: Cannot set LC_MESSAGES to default locale: No such file or directory locale: Cannot set LC_ALL to default locale: No such file or directory Extracting templates from packages: 100% Preconfiguring packages ... (Reading database ... 69776 files and directories currently installed.) Preparing to replace libc6:armhf 2.13-38+rpi2 (using .../libc6_2.18-4_armhf.deb) ... Checking for services that may need to be restarted... Checking init scripts... Unpacking replacement libc6:armhf ... dpkg: warning: subprocess old post-removal script was killed by signal (Segmentation fault) dpkg: trying script from the new package instead ... dpkg: error processing /var/cache/apt/archives/libc6_2.18-4_armhf.deb (--unpack): subprocess new post-removal script was killed by signal (Segmentation fault) dpkg: error while cleaning up: subprocess installed pre-installation script was killed by signal (Segmentation fault) Errors were encountered while processing: /var/cache/apt/archives/libc6_2.18-4_armhf.deb E: Sub-process /usr/bin/dpkg returned an error code (1)

You might have to configure

You might have to configure your locales with sudo dpkg-reconfigure locales. Once you're at it, you might also like to configure your timezone: sudo dpkg-reconfigure tzdata. Follow the on-screen instructions.

Once you've done this, run sudo apt-get update, then run sudo apt-get install xbmc and follow the rest of the tutorial.

Hope it helps,

Euler

Hi, I run a raspberry pi

Hi,

I run a raspberry pi operated via SSH and connected via HDMI to a TV screen using the latest versions of raspbian and your XBMC. When I start xbmc-standalone I get the followig :

Login: pi Linux raspberrypi 3.10.25+ #622 PREEMPT Fri Jan 3 18:41:00 GMT 2014 armv6l

The programs included with the Debian GNU/Linux system are free software; the exact distribution terms for each program are described in the individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent permitted by applicable law. Last login: Wed Jan 15 13:15:28 2014 from 192.168.0.22 pi@raspberrypi ~ $ xbmc-standalone terminate called after throwing an instance of 'dbiplus::DbErrors' Aborted (core dumped) Crash report available at /home/pi/xbmc_crashlog-20140115_132202.log terminate called after throwing an instance of 'dbiplus::DbErrors' Aborted (core dumped) Crash report available at /home/pi/xbmc_crashlog-20140115_132223.log

pi@raspberrypi ~ $ grep -i "error" /home/pi/xbmc_crashlog-20140115_132223.log 13:22:18 T:3036353248 ERROR: Error: Requested setting (audiooutput.guisoundmode) was not found. It must be case-sensitive 13:22:22 T:3025560592 ERROR: CecLogMessage - failed to release the previous LA 13:22:22 T:3025560592 ERROR: CecLogMessage - could not open a connection (try 1) 13:22:22 T:3036353248 ERROR: SQL: SQL error or missing database pi@raspberrypi ~ $

do you have any ideas how I can fix this ?

Thanks

Werner

Under 'Installing', it was

Under 'Installing', it was necessary to do

sudo apt-get update sudo apt-get upgrade

before sudo apt-get install xbmc, otherwise there are unmet dependencies.

Pingback

[...] idea of it. So I set out to build it myself with some more stuff thrown in. Minimal LXDE install XBMC (Frodo 12.2) RetroPie (boots into EmulationStation) Quake III Arena (just add pak files) You boot [...]

Howdy I am so thrilled I

Howdy I am so thrilled I found your web site, I really found you by mistake, while I was browsing on Google for something else, Anyhow I am here now and would just like to say thanks for a incredible post and a all round entertaining blog (I also love the theme/design), I don’t have time to read through it all at the moment but I have book-marked it and also added in your RSS feeds, so when I have time I will be back to read much more, Please do keep up the excellent b.

How to turn on rss on the

How to turn on rss on the main screen?

I'm having the following

I'm having the following 'bugs' with my Raspbian/XBMC setup.

1) I got this fixed but I don't know how. The first time I tried using a mp3 file; it would not work. It is only after I did some other stuff such as installing other programs such as mpg123 that it worked through XBMC.

1.1) I do not know what I did to fix it because my testing was done through the terminal window. Audio through HDMI seems to only work through XBMC and not the terminal. Audio from the analog port works fine through the terminal and I did not test to make sure it works through XBMC (although I'm sure it does).

2) The program had a habit of freezing at random but was fixed by lowering the overclocking value. It was changed from Turbo to Medium.

3) The XBMC program is treating the keyboard as a giant remote control rather than a keyboard. This is not a problem until I get to a 'search' box. I have to use the arrow keys and hit enter for each letter rather than just type in what I want. The spacebar works though as it normally does.

4) The XBMC program crashes most of the time, but not all of the time, when I try to exit the program. It also sometimes crashes when I select the shutdown option instead.

Hi, Thank you for your XBMC

Hi,

Thank you for your XBMC package.

You wrote that the user which is going to run XBMC needs to be a member of the following groups:

audio video input dialout plugdev

but it seems (after installing the package) that i don't have any "input" group :

# cat /etc/group | grep input

returns nothing.

does it seems to be a problem ?

Thanks

mgorven, something went

mgorven, something went really wrong with the latest version...

the screen resolution (in standalone mode) is broken. XBMC renders itself out of the screen resolution. Also, none of the airplay stuff works.

It is simply unusable.

How canI go back to the previous version?

Thanks

The resolution problem is

The resolution problem is caused by this issue. To fix it edit userdata/guisettings.xml and remove the contents of the <resolutions> element. I can't test the airplay functionality unfortunately :-/

If you want to revert to the previous version grab the 20120804 debs from the archive pool and manually install them with dpkg -i.

Thanks mgorven! Re airplay I

Thanks mgorven!

Re airplay I think the issue is libshairport. In the build when trying to play over airtunes the following error comes up: 22:30:20 T:1101959168 DEBUG: AIRTUNES: Failed to create ipv6 socket. Trying ipv4 22:30:20 T:1101959168 DEBUG: AIRTUNES: Error setting up server socket on port 36666, try specifying a different port

Googling solution brought up this: http://forum.xbmc.org/showthread.php?tid=138106&pid=1207877

So basically, libshairport has to be updated with this patch: https://github.com/Memphiz/xbmc/commit/f5770cd1811a4ee0096010eca6bb0a9a6...

this should solve the problem

I've published a new build of

I've published a new build of libshairport to my archive which contains that patch. I tried to test it using PulseAudio as a sender, but couldn't get it working (display shows "Streaming..." but no sound).

Thanks, streaming music now

Thanks, streaming music now works!! Re pulseaudio, I did not have much success with this neither, however streaming from Apple products works fine!

There is one more issue that I'm facing now - CPU usage. I modified advancedsettings.xml, but xbmc still runs on >90% all the time. This is something new as I did not face the problem before. Any suggestions?

<advancedsettings>
    <network>
        <cachemembuffersize>5282880</cachemembuffersize>
    </network>
   <fanartheight>560</fanartheight>
   <thumbsize>256</thumbsize>
   <gui>
       <algorithmdirtyregions>3</algorithmdirtyregions>
       <nofliptimeout>0</nofliptimeout>
   </gui>
   <lookandfeel>
       <enablerssfeeds>false</enablerssfeeds>
   </lookandfeel>
   <bginfoloadermaxthreads>2</bginfoloadermaxthreads>
 
   <enableairtunesdebuglog>0</enableairtunesdebuglog>
</advancedsettings>

XBMC has always used a lot of

XBMC has always used a lot of CPU time for me. The package actually includes a default advancedsettings.xml customised for the Raspberry Pi which contains the best configuration I know of.

Is anyone else finding this

Is anyone else finding this stopped working with a recent upgrade (last week or two)?

I get the background of XBMC displayed but no menu bar across it. Was working fine...

Have anyone tried to use

Have anyone tried to use airplay with this build? For some reason I get to play pictures but no music at all, I found some where saying about libshairplay missing, but my does have it

Any thoughts?

I don't have any Apple

I don't have any Apple devices so I can't test AirPlay unfortunately. My latest build uses a newer libshairport (which is also in my archive) -- can you check that your system is fully updated?

Hi, it's compatible with

Hi, it's compatible with raspbian-19-09-12?

I've this message while I install xbmc:

sudo apt-get install xbmc
Lettura elenco dei pacchetti... Fatto
Generazione albero delle dipendenze       
Lettura informazioni sullo stato... Fatto
Alcuni pacchetti non possono essere installati. Questo può voler dire
che è stata richiesta una situazione impossibile oppure, se si sta
usando una distribuzione in sviluppo, che alcuni pacchetti richiesti
non sono ancora stati creati o sono stati rimossi da Incoming.
Le seguenti informazioni possono aiutare a risolvere la situazione:
 
I seguenti pacchetti hanno dipendenze non soddisfatte:
 xbmc : Dipende: xbmc-bin (>= 2:11.0~git20120510.82388d5-1) ma non è installabile
        Dipende: xbmc-bin (< 2:11.0~git20120510.82388d5-1.1~) ma non è installabile
        Raccomanda: python-qt3 ma non sta per essere installato
E: Impossibile correggere i problemi, ci sono pacchetti danneggiati bloccati.

thank you for your great work, Silvio

You need to run sudo apt-get

You need to run sudo apt-get update This will pull in the package lists.

Thank you, simple error :)

Thank you,

simple error :)

Are you referring to the

Are you referring to the 2012-09-18-wheezy-raspbian image? Or do you just mean Raspbian as of 2012/09/19? I haven't tested with the recent image, but am using it on a fully updated Raspbian installation.

Hi ! There are 2 things

Hi !

There are 2 things which you could expand on your blog (for better understanding).

  1. at the installing procedure, say that the existing /etc/apt/sources.list remain unchanged, because package "xbmc" will have double entry then and it seems to overlap, its ok to just keep the /etc/apt/sources.list intact

  2. say that advancedsettings.xml go into ~/.xbmc/userdata directory

Kind regards, Jan

just me or does the youtube

just me or does the youtube plugin not work?

Any plans to refresh the

Any plans to refresh the build? i.e. bake another snapshot?

I've just updated it to the

I've just updated it to the latest version in Git (which is 2012/08/04).

You need to rebuild your XBMC

You need to rebuild your XBMC packages to account for a newer libcec1 ... that is the error these users (and I) are having.

Cheers.

I packaged libCEC 1.8.0 and

I packaged libCEC 1.8.0 and built XBMC against that (since the version of libCEC in Raspbian is incompatible), so unless Raspbian now has an even later libCEC I don't think that that is the problem. I think the problem lies with the older kernel and VC libraries -- try following my instructions in this comment to update these, it seems to have worked for Goliat.

Bizarre. I reboot and

Bizarre. I reboot and suddenly it works. O_o

Move on, nothing to see here. :)

Sorry for the trouble.

I did that and very very

I did that and very very little was upgrade (only scratch).

I'm showing libcec1 1.8.0-1 ...

# dpkg -s libcec1
Package: libcec1
Status: install ok installed
Priority: optional
Section: libs
Installed-Size: 474
Maintainer: Andres Mejia <amejia@debian.org>
Architecture: armhf
Multi-Arch: same
Source: libcec
Version: 1.8.0-1
Depends: libc6 (>= 2.13-28), libgcc1 (>= 1:4.4.0), liblockdev1, libstdc++6 (>= 4.3.0), libudev0 (>= 0.140)
Pre-Depends: multiarch-support
Description: USB CEC Adaptor communication Library (shared library)
 This library provides support for the Pulse-Eight USB-CEC adapter.

Same error as already listed in comments here.

This does not work for me on

This does not work for me on a fresh Raspbian install (official build). When i try to launch XBMC i get:

pi@raspberrypi ~ $ xbmc-standalone 
/usr/lib/xbmc/xbmc.bin: symbol lookup error: /usr/lib/arm-linux-gnueabihf/libcec.so.1: undefined symbol: vc_cec_set_passive
/usr/lib/xbmc/xbmc.bin: symbol lookup error: /usr/lib/arm-linux-gnueabihf/libcec.so.1: undefined symbol: vc_cec_set_passive
/usr/lib/xbmc/xbmc.bin: symbol lookup error: /usr/lib/arm-linux-gnueabihf/libcec.so.1: undefined symbol: vc_cec_set_passive
XBMC has exited uncleanly 3 times in the last 21 seconds.
Something is probably wrong
pi@raspberrypi ~ $ 

Do you have the following on

Do you have the following on your system?

$ cat /etc/ld.so.conf.d/00-vmcs.conf 
/opt/vc/lib

And does /opt/vc/lib/libbcm_host.so exist?

Did you use the 2012-07-15-wheezy-raspbian image? Please make sure that your system is fully up to date. If it still doesn't work, try running rpi-update.

$ cat

$ cat /etc/ld.so.conf.d/00-vmcs.conf 
/opt/vc/lib

But

/opt/vc/lib/libbcm_host.so

does not exist. And yes I am using 2012-07-15-wheezy-raspbian and my system is fully up2date. By the way, is it safe to use rpi-update? I thought the kernel and firmware are updated already?

I've just booted the clean

I've just booted the clean 2012-07-15-wheezy-raspbian image and libbcm_host.so does exist, so I'm not sure what's going on with your system :-/ rpi-update isn't ideal because it does things without packages, but I've found it to be necessary. You can also try enabling the untested component of the raspberrypi.org archive and updating to the packages there. To do this make /etc/apt/sources.list.d/raspi.list look like this:

deb http://archive.raspberrypi.org/debian/ wheezy main untested

and run apt-get update and apt-get dist-upgrade.

Ive used the same image and

Ive used the same image and directly started on your guide after going through the config script. I seem to have the two files you mentioned but I also had the same problem until i enabled untested components and did dist-upgrade.

I saw that during the upgrade start.elf was commented to be the same as some other .elf that i think has the same memory split size, what memory split do you recommend yourself? 128Mb or does it work with 64Mb also?

I don't know if I was impatient but XBMC seems to crash when using exit, though it only happened the first time and now it works, reboot also works.

Thank you for this guide. I tried one other before this one and it worked but I had black screens occasionally while playing a movie. I have not tested playing a movie but this looks really promising :D

Sincerely Goliat

I've actually only tested the

I've actually only tested the 128/128 memory split, since that's what the Internet said should be used. 128M is enough RAM for XBMC to run in though, so it's not a problem.

Ok. Ive tried this guide two

Ok. Ive tried this guide two times now, one with official raspbian and with unofficial. The install works fine and it runs fine in menu, i have also tried the different configurations to run the UI smoother. The problem is playing movies though, i keep getting black screens and lose sound frequently. Do you have any idea what it might be?

What codecs do the videos

What codecs do the videos you're testing with use? The RPi can only decode H.264 in hardware, so if you're using any other video codec it has to use the CPU which probably isn't fast enough. It also apparently can't decode DTS audio fast enough (at least without overclocking), so if you're not using passthrough audio this may be the problem. What is the CPU usage like when trying to play videos?

It's a 720p movie h264

It's a 720p movie h264 encoded, I'm not sure what the cpu use is but when checking the cpu use in the menu it's at about 80-90%. But I have found out that the movies i have tested with have an fps of 23.97. It seems like many have issues getting those to run smoothly. I have tried my movie in omxplayer and it seems to run it without problems.

My raspberry is connected to my pc screen with hdmi and i get audio through my headphones output on the screen. I'm not sure if DTS in the movie affects also but then since omx does not have a gui i guess it could decode DTS then?

But it seems after checking this i think it's related to xbmc not being able to identify screens and then get the correct output. I not sure about this but it seems very likely.

that fixed it for me ;)

that fixed it for me ;)

Hi, I've just installed xbmc

Hi,
I've just installed xbmc from your repository on my raspbian, however it is not able to start:


pi@raspberrypi ~ $ xbmc-standalone
/usr/lib/xbmc/xbmc.bin: symbol lookup error: /usr/lib/arm-linux-gnueabihf/libcec.so.1: undefined symbol: vc_cec_set_passive
/usr/lib/xbmc/xbmc.bin: symbol lookup error: /usr/lib/arm-linux-gnueabihf/libcec.so.1: undefined symbol: vc_cec_set_passive
/usr/lib/xbmc/xbmc.bin: symbol lookup error: /usr/lib/arm-linux-gnueabihf/libcec.so.1: undefined symbol: vc_cec_set_passive
XBMC has exited uncleanly 3 times in the last 25 seconds.
Something is probably wrong

Do you know what could be wrong? :)