Two XBMC (.deb) compiled/prepared for users + instruction


298 posts   Page 1 of 12   1, 2, 3, 4, 5 ... 12
by tomaz » Wed Jul 25, 2012 10:38 pm
Hi,

almost week ago I tried to compile XBMC and I was surprised, first tray and I received:
-----------------------
XBMC built successfully
-----------------------

Here is prepared package (my first, just googling the way how to do it:) for XMBC for Raspberry pi users (normal users)!Almost no configuration needed :)

Motivated by RasPiThon group, I decided to make XMBC.deb, for "normal" users. If they can code game like this in 48h I can do XBMC.deb in 120h hehe, not far from true.

And I know my English sucks and you cannot wait to try XBMC, you can go directly to line: "4.)" :)

Best installing method would be of course "apt-get install xbmc", but till then...

I will start from beginning:

1.) Write latest image: 2012-07-15-wheezy-raspbian to your SD card.
2.) Start Raspberry pi and configure basic stuff (keyboard, re-size partition, start ssh,...) Raspi-conig which starts on boot helps a lot :)
3.) Update your Raspberry
Code: Select all
    sudo apt-get update
    sudo apt-get upgrade
   

4.) Install compiled xbmc-rdp-tomaz.armhf.deb (and all dependencies needed):

Code: Select all
    wget https://github.com/downloads/RB-tomaz/xbmc-rdp-tomaz/xbmc-rdp-tomaz.armhf.deb
    sudo dpkg -i xbmc-rdp-tomaz.armhf.deb; sudo apt-get -y -f install
   

Answer question about autostart of XBMC*
*I have to explain little more:

    - If you select <Yes> XMBC will start when you power your Raspberry Pi, with one exception:
    You will be asked to press any key, if you DON'T want XBMC to start! You will have 5 sec, otherwise it will continue and start XMBC. If you press any key, you will get prompt and you can still manually start xbmc, startx or do whatever you like.
    So you have total control :)
    This will also disable autostart of X, if you have enabled it with raspi-config in 2.)
    - If you select <No> your /etc/inittab will not be changed!
    You will have to login and start XBMC with command "xbmc".

Answer question about mounting /dev/sda1 and /dev/sdb1 USB/HDD disks when starting XBMC
*I have to explain little more:

    - If you select <Yes> XBMC will try to mount /dev/sda1 to /mnt/xbmc1 and /dev/sdb1 to /mnt/sdb2
    - If you select <No> XBMC will not try to mount
5.) Reboot
6.) Manually start xbmc (if not started automatically): I think this version is running OK without root access.
Code: Select all
xbmc

7.) You can safely delete xbmc-rdp-tomaz.armhf.deb, if you want.
8.) Please report, if it is working for you. Or more important, if it is not working :)

Probably I will not know how to help you, because I've juste follow this page to compile XBMC and found all stuff on google and on raspi-conig

I did learn how to create basic .deb and how to install (with all dependencies) and uninstall .deb. Not sure, if I have put dependencies correctly inside .deb, we will see when it will stop installing :) Today I have tested whole procedure with new SD card and it worked for me.

The last thing is of course, how you uninstall/remove XBMC. This part can be improved more... You can remove it with one line (XBMC, all dependencies, specific settings and "pi" user settings in folder ~/.xbmc):

To remove XBMC package:
Code: Select all
sudo dpkg -r xbmc-rdp-tomaz;sudo apt-get -y autoremove

It will ask you, if you want to start X on boot. This is because I don't know, what you had prior to installng this package. This could be TODO: to save settings of autostart X before installing package. Easy?

I just remember when uninstalling "disable_overscan=1" will stay unchanged. This you can be easily set with "sudo raspi-config".
Of course, could also be saved before installing package (preinst), another TODO for someone :)


===============================================
================ADVANCED USERS:================
===============================================


Some people don't like any changes made to the system, I totally understand them! That's the reason I'm actually preparing this package, because I don't like to have whole image custom made by one person with keyboard settings, local settings set and so on. But hay If I'm talking about one person, probably some good package out there on apt-get was prepared by just one person, who knows :)

Thanks to silas and his image I started to believe, it is possible to have XBMC on Pi! Don't kill me silas for making this .deb package ;)

So here is packet, with "untuched" XBMC binary, just packed in .deb:

https://github.com/downloads/RB-tomaz/xbmc-rdp/xbmc-rdp.armhf.deb
Code: Select all
    wget https://github.com/downloads/RB-tomaz/xbmc-rdp/xbmc-rdp.armhf.deb
    sudo dpkg -i xbmc-rdp.armhf.deb; sudo apt-get -y -f install
   

and uninstalling:
Code: Select all
     sudo dpkg -r xbmc-rdp;sudo apt-get -y autoremove
   

It will install it as when you run "make install", and it will install all dependencies needed. Every other settings are up to you. You have to start it like: "clear ; /usr/lib/xbmc/xbmc.bin". Don't forget about memory. (sudo cp /boot/arm128_start.elf /boot/start.elf)
For shutdown solution I suggest you make file: /var/lib/polkit-1/localauthority/50-local.d/20-xbmclive.pkla and inside:
Code: Select all
[Actions for xbmc user]
Identity=unix-user:pi
Action=org.freedesktop.upower.*;org.freedesktop.consolekit.system.*;org.freedesktop.udisks.*
ResultActive=yes
ResultAny=auth_admin
ResultInactive=yes

If you want to mount something (I remember I saw someone asking for NFS) before XMBC starts?
You can edit file /usr/bin/xbmc and mount whatever you like before line "clear ; /usr/lib/xbmc/xbmc.bin"


===============================================
=================END? Not yet?=================
===============================================

-------------------------------
For more cureous people, below:
-------------------------------
With postinst script in .deb I tried to fast fix some stuff people notice in this topic:
Instructions for building XBMC for Raspbian Thanks to Obsys, mpthompson, silas, Hexxeh (on IRC) and many many others, very long thread, I didn't fix all problems/ideas, but just few.

Uninstall will (for xbmc-rdp-tomaz.armhf.deb, which have set some specific settings):
1.) Remove XBMC and,
2.) copy /boot/arm224_start.elf to /boot/start.elf
3.) Delete autostart of XBMC, if exists
4.) delete autologin of user pi, if exists
5.) Ask if you want to boot directly to X desktop.
6.) Disable mounting of USB/HDD (/dev/sda1 and /dev/sdb1)
7.) Delete user settings in ~/.xbmc folder

------------------------------------
For even more cureous people, below:
------------------------------------
I was thinking, if I prepare .deb file with dependencies it will install them directly, I was mistaken, so that's why there is workaround/solution with "...; sudo apt-get -y -f install"

You can see basic information about installed package:
Code: Select all
sudo dpkg -l xbmc-rdp-tomaz

You can see all files in installed package like this:
Code: Select all
sudo dpkg -L xbmc-rdp-tomaz

If you don't like autostart of XMBC open file .bashrc and delete last 3 lines:
Code: Select all
case "`tty`" in # XBMC - start only for tty1
     *tty1) xbmc-ask;; # XBMC - start XBMC
esac # XBMC - end of case

If you don't like autologin open file /etc/inittab and uncomment line # XBMC_NORMALLOGIN and comment line # XBMC_AUTOLOGIN like this:
Code: Select all
1:2345:respawn:/sbin/getty --noclear 38400 tty1 # XBMC_NORMALLOGIN
#1:2345:respawn:/bin/login -f pi tty1 </dev/tty1 >/dev/tty1 2>\&1 # XBMC_AUTOLOGIN

If you don't like XMBC to mount your devices simple delite two files:
Code: Select all
   rm ~/.automountUSBforXBMC
   rm ~/.autoumountUSBforXBMC

If you would like XBMC to mount your devices simple create (same) two files:
Code: Select all
   touch ~/.automountUSBforXBMC
   touch ~/.autoumountUSBforXBMC

If you don't want XBMC to unmount your USB/HDD devices just delete file
Code: Select all
rm ~/.autoumountUSBforXBMC

If you want more or less seconds for timeout on "press any key to" cancel start of XBMC, you can simply edit
file xbmc-ask and change line "timeout" to whatever you prefer.
Code: Select all
sudo vi /usr/bin/xbmc-ask
timeout=5

========================================================================
All files: on github, learned how to use it, while watching RasPiThon maraton. I watched almost whole 48h of RasPiThon maraton, hehe, link.
Versions:
- Primary (recommended): https://github.com/RB-tomaz/xbmc-rdp-tomaz.git
- Basic (just control file, nothing else changed): https://github.com/RB-tomaz/xbmc-rdp.git
========================================================================

How to create .deb file yourself?

Very simple, you need to be in "arm224_start.elf". Now you should know what I'm talking about? Hit: sudo cp /boot/...

Google say the simplest way to build .deb from "make install" is CheckInstall, but Raspberry run out of memory. It uses all /tmp folder. I tried also "bzr" and same problem with /tmp. This bzr at leaset gave me error: "bzr -Derror dh-make -v test 1.0 ./test.tar.gz" but, couldn't figure it out. Then simply created ./DEBIAN/control file and that was it:) Simple, I say now; at the beginning it seemed impossible.

Building .deb from this (primary) git:
Code: Select all
sudo apt-get install git
cd
git clone https://github.com/RB-tomaz/xbmc-rdp-tomaz.git
rm -r xbmc-rdp-tomaz/.git #or mv ./xbmc-rdp-tomaz/.git ~
dpkg -b ./xbmc-rdp-tomaz/ xbmc-rdp-tomaz.armhf.deb

If you receive error:
dpkg-deb (subprocess): data member: internal gzip write error: 'No space left on device'
dpkg-deb: error: subprocess <compress> from tar -cf returned error exit status 2

I got this error when checking procedure written here, because I forgot to set memory to 224. Solution I found is this:
Code: Select all
cd
mkdir tmp
export TMPDIR=/home/pi/tmp

and try again. Probably this would also work with CheckInstall and bzr!? I think setting variable TMPDIR is very good solution, especially for some future bigger projects:)

For your own "make": This I didn't test exactly as written. I'm writing this from my head so this might not actually work...
Code: Select all
mkdir ~/xbmc-deb
cd ~/xbmc-rbp
sudo make install [B]DESTDIR=/home/pi/xbmc-deb[/B]
cd ~/xbmc-deb
mkdir DEBIAN
cd DEBIAN
vi control # you have to prepare control file
vi postinst # optional, if you want to do something after installing package
vi postrm #optional, if you want to do something after removing package
cd
dpkg -b ./xbmc-deb/ xbmc-rdp.armhf.deb

P.S.: If you start xbmc and go to Video-Files and screen start blinking you didn't reboot, you need arm128_start.elf !
P.S.2: If you have problems with xbmc you should check power supply, I tried with 500mA and it was not engouh. With 700mA everything seems OK :)
P.S.3: If you like vi in colors I suggest you do:
Code: Select all
   sudo apt-get install vim

and create file ~/.vimrc with lines:
:syntax on
:color torte # i like this profile more than default

P.S.4: I have added advancedsettings.xml for XMBC, thanks workshy:
<advancedsettings>
<gui>
<algorithmdirtyregions>3</algorithmdirtyregions>
<nofliptimeout>0</nofliptimeout>
</gui>
</advancedsettings>

P.S.5:If you have problems with composite video out when using XBMC (go to Settings->Video->Playback... don't remember now what I set ther but maybe will help you to know wher to look)
P.S.6: I think I just used more time writing this than making .deb :) Funny.

Someone could prepare better manual out of this ?

Last modification: I decided file name xbmc-rdp-tomaz.armhf.deb and xbmc-rdp.armhf.deb will be without version numbers, so it will be easier to update file on github, without modifying this post. I will give write access to person(s) who will prepare new .deb or modify control, postinst,... Especially correct my strange sentences...


And last question, anyone know how "apt-get install xbmc" would be possible?


I wish you all nice Raspberring. (RaspberryPiing hehe).


This message was send from Raspberry, ups not yet :)
Tomaz.
Posts: 38
Joined: Thu Jul 12, 2012 9:08 am
by masterluke » Thu Jul 26, 2012 6:23 am
Brilliant work - and thanks for all the detailed info. Cant wait to try this!
Posts: 199
Joined: Tue Apr 17, 2012 4:10 pm
by Gwyn400 » Thu Jul 26, 2012 11:20 am
No matter what resolution I choose in the system settings it always seems to cut off the edges, how do I fix this?
[edit] never mind I fixed it
Complete noob
Posts: 28
Joined: Fri Jul 20, 2012 1:49 pm
by mikfaina » Thu Jul 26, 2012 12:08 pm
Gwyn400 wrote:No matter what resolution I choose in the system settings it always seems to cut off the edges, how do I fix this?
[edit] never mind I fixed it

How?
Posts: 9
Joined: Fri Jul 20, 2012 12:56 pm
by fraz0815 » Thu Jul 26, 2012 12:50 pm
In xbmc itself you can use the video calibration option in the video settings, else check your /boot/config.txt (http://elinux.org/RPi_config.txt#Video_mode_options).
Posts: 52
Joined: Fri Jul 20, 2012 1:29 pm
by Gwyn400 » Thu Jul 26, 2012 2:36 pm
I used the video calibration options in XBMC, works great now.
Complete noob
Posts: 28
Joined: Fri Jul 20, 2012 1:49 pm
by Diaoul » Thu Jul 26, 2012 3:08 pm
You need to setup a debian repo and put it in /etc/apt/sources.list if you want to host your .deb and be able to "apt-get install xbmc-rbp-tomaz".
You'll also need to put a correct version number instead of none or no update will be possible.

I'll do my own .deb soon based on your hard work and on other members. The difference is that I'll make a tutorial to build it on a host machine, not directly on the RPi (or maybe on the RPi too, but in a chrooted env as I don't want to mess with the rest)
Posts: 24
Joined: Thu Jul 12, 2012 9:45 pm
by zakm » Thu Jul 26, 2012 3:42 pm
My complements and thanks for your dedicated effort, detailed instructions and explanation. The whole process was quick and effortless, my installation is working flawlessly, including the ralink Wifi dongle. With sincere appreciation. Zak
Posts: 1
Joined: Sat Mar 17, 2012 2:12 am
by tomaz » Thu Jul 26, 2012 7:28 pm
Hi,
Diaoul thanks for explaining. Package has version number, it is not in the file but it is packed inside .deb and it is 12.0-1.
So it has to be in the filename?

Just now I'm preparing 12.0-2 (added mount variables, so people can easily change to whatever they like)


For all: Little more explaining to do for v 12.0-2:

You can easly change auto-mount for XBMC by editing (I use vi) /usr/bin/xbmc script.
Code: Select all
sudo vi /usr/bin/xmbc

at the begining you will se:

usb1="/dev/sda1"
usb2="/dev/sdb1"


and you can change your mount point to your needs.


I'm just thinking out loud, maybe we should move all variables to one place let say ~/.xbmc.conf and people would be editing one file instead editing many different files...
Another TO-DO, maybe? :)

P.S.: v 12.0-1 has variables usb1 and usb2 but they are never used!


Tomaz.
Diaoul wrote:You'll also need to put a correct version number instead of none or no update will be possible.
Posts: 38
Joined: Thu Jul 12, 2012 9:08 am
by tomaz » Thu Jul 26, 2012 7:33 pm
V 12.0-2 uploaded. Exactly 100 downloads of v12.0-1 in one day :)
Where: Same location.

Tomaz.
Posts: 38
Joined: Thu Jul 12, 2012 9:08 am
by Diaoul » Fri Jul 27, 2012 10:34 am
I had a discussion with a guy on #debian on freenode about the correct version number to give to xbmc-rbp and it should be the same as the official package of the testing branch : http://packages.debian.org/wheezy/xbmc
So:12.0-alpha4~git20120715.2acdae-1

As someone said in the other thread, https://github.com/xbmc/xbmc-packaging/ ... rig-source is very usefull to retrieve latest source from git with the correct naming and stuff.
Posts: 24
Joined: Thu Jul 12, 2012 9:45 pm
by jared123 » Fri Jul 27, 2012 12:08 pm
Firstly, thanks for this - you've done a great job! As a linux user I'm especially appreciative of the detail in your first post :)

I've been tempted to compile xbmc myself for a few weeks now (but I'm lazy). I've also been patiently waiting for raspbmc rc4 to be released (the first one with hardfp).

Can anyone give any guesses about performance differences between a clean install of this deb on a raspbian image vs raspbmc? I know it's not really possible seeing as the current raspbmc is based on squeeze, but I'm assuming the dev has done a fair bit of xbmc performance tweaking which may/may not exist in this deb.
Posts: 9
Joined: Fri Jul 27, 2012 12:04 pm
by fordexplorer » Fri Jul 27, 2012 5:43 pm
Hello

I followed your instructions regarding installation of xbmc. I answered yes to autostart and to mounting of /dev/sda1 and /dev/sdb1

When I start xbmc, I get the following error:

Code: Select all
1016220007: * failed to add service - already in use?


Is this because I don't have a USB stick inserted?

Keep up the good work!

Ford :-)
Posts: 12
Joined: Mon Jul 23, 2012 9:23 pm
by fordexplorer » Fri Jul 27, 2012 5:46 pm
I should add the following information:

Code: Select all
pi@raspberrypi ~ $ uname -a
Linux raspberrypi 3.1.9+ #202 PREEMPT Wed Jul 25 22:11:06 BST 2012 armv6l GNU/Linux
pi@raspberrypi ~ $ /opt/vc/bin/vcgencmd version
Jul 26 2012 00:48:29
Copyright (c) 2012 Broadcom
version 327550 (release)


Cheers

Ford
Posts: 12
Joined: Mon Jul 23, 2012 9:23 pm
by dugbee » Fri Jul 27, 2012 11:00 pm
Ford,

I'm getting the same error as you. I have the same firmware version, just build yesterday. Before trying the .deb I built the source, but it too produced the "Failed to add service."

I enabled log level 3, but xbmc.log doesn't reveal much. I can post it if needed..
Posts: 3
Joined: Mon Jan 23, 2012 11:56 pm
by dugbee » Sat Jul 28, 2012 1:08 am
Ok, I reflashed the SD card to get to the previous version, (#168 Sat Jul 14) and reinstalled - this time xbmc launched without issue! :D
Posts: 3
Joined: Mon Jan 23, 2012 11:56 pm
by MothBox » Sat Jul 28, 2012 1:43 am
Please forgive me if this question is a little stupid, but what is the difference between loading Raspbian then installing XBMC as a .deb file and loading Raspbian with it already installed so that it boots on startup?

Are there any performance gains from either or is it exactly the same end result?
Posts: 19
Joined: Mon May 28, 2012 7:11 am
by fordexplorer » Sat Jul 28, 2012 8:46 am
Dugbee - thanks for the information!

Best regards

Ford
Posts: 12
Joined: Mon Jul 23, 2012 9:23 pm
by atharvai » Sat Jul 28, 2012 11:58 am
Thanks for this XBMC package. it is great and easy to install. :)

I have a question regarding use of keyboard. It appears that if there is a text field i cannot use my keyboard to type. eg. when searching network share or typing in IP address or searching in Youtube.

I am unable to type using Keyboard. has anyone experienced this? Is there any fix or settings I need to check/change to get this working?

Thanks in advance
Posts: 3
Joined: Tue Jul 24, 2012 8:02 pm
by MothBox » Sat Jul 28, 2012 3:09 pm
Fantastic! I've tried a few other versions on Debian, and OpenElec and this is definitely the most responsive. Really easy to install, thanks a lot!
Posts: 19
Joined: Mon May 28, 2012 7:11 am
by tomaz » Sat Jul 28, 2012 8:24 pm
Diaoul thanks for info :)

atharvai: I have tested keyboard and I have same problem as you :(

If I press numbers 0,1,2,...9 (before pressing enter; one step before) I get letters. Like mobile phone where you press numbers and get letters. Strange.

Maybe there is some setting in XBMC to fix this problem?

Tomaz.
Posts: 38
Joined: Thu Jul 12, 2012 9:08 am
by atharvai » Sat Jul 28, 2012 9:26 pm
tomaz wrote:Diaoul thanks for info :)

atharvai: I have tested keyboard and I have same problem as you :(

If I press numbers 0,1,2,...9 (before pressing enter; one step before) I get letters. Like mobile phone where you press numbers and get letters. Strange.

Maybe there is some setting in XBMC to fix this problem?

Tomaz.


Is this on the number pad?

I couldn't see any settings in XBMC it self. I'll look around.
Posts: 3
Joined: Tue Jul 24, 2012 8:02 pm
by charliesroot » Sat Jul 28, 2012 10:56 pm
@Tomaz

It's not on the numberpad. I'm running the pre-compile Silas image and changed the XBMC startup script by removing sudo, so XBMC is running as the user pi (instead of root). Same keyboard problem.

Running XBMC as root doesn't have "the keyboard problem". I've been working my way through Raspbmc (where XBMC is running as user not root) but haven't found anything yet that could solve things.

BTW GREAT work guys ...
Posts: 17
Joined: Wed Jul 25, 2012 3:45 pm
by fordexplorer » Sun Jul 29, 2012 8:40 am
OK - xbmc up and running after doing rpi-update as well as apt-get update and apt-get upgrade. Looks sweet!

Ford
Posts: 12
Joined: Mon Jul 23, 2012 9:23 pm
by mikerr » Sun Jul 29, 2012 11:09 am
To get iplayer on this, I had to install from zip:

Code: Select all
wget http://xbmc-iplayerv2.googlecode.com/files/iPlayer-v2.4.17.zip

then navigate to video addons / install from zip file in XBMC
Got a Pi Camera? View it in my android app - Raspicam Remote ! No software required on the pi
User avatar
Posts: 1322
Joined: Thu Jan 12, 2012 12:46 pm
Location: NorthWest, UK