Archive:HOW-TO:Install XBMC on Ubuntu/HOW-TO 1: Difference between revisions

From Official Kodi Wiki
Jump to navigation Jump to search
>Olympia
No edit summary
>Olympia
Line 165: Line 165:
'''NEXT STEP'''<BR>
'''NEXT STEP'''<BR>
<div style="height: 32px; border: thin inset black; background: #E6E6FA">
<div style="height: 32px; border: thin inset black; background: #E6E6FA">
  # sudo cp /etc/X11.xorg.conf /etc/X11.xorg.conf.backup
  # sudo cp /etc/X11.xorg.conf /etc/X11/xorg.conf.backup
</div>
</div>


Line 176: Line 176:


<BR>
<BR>
== Ati ==
== Ati ==



Revision as of 14:45, 2 February 2009


Introduction

The purpose of this guide is to give a hand to new XBMC users, who want to build a Linux based, deticated HTPC, but don't have any knowledge and experience in the Linux world. They have the chance to try XBMC Live, but if they also want to have more control and more customization possibilities, than the Linux version is more suitable.

So, as this is a real step-by-step guide, I hope everybody can follow and walk through the whole installation procedure.

The guide is based on Ubuntu 8.10 (Intrepid) as a platform, start with a minimal install and only install the needed components at the top of that.

On the face of it, maybe seems very lengthy process, but you will feel shorter while you follow it.

!!! Please note: !!!

  • The guide is for using XBMC on a dedicated HTPC, so there is no window manager and/ or any additional application installed
  • as you'll use this PC only as a media center, I assume you use passthrough (SPDIF or HDMI) audio, therefore I choose NOT to install the libs for Pulseaudio and compile XBMC later without Pulseaudio support.
  • You need minimum 4GB size flash drive or hard disk to go

You will get:

  • A dedicated HTPC autoboot to XBMC
  • Latest XBMC SVN version
  • Updated ALSA driver
  • Updated VIDEO driver
  • Lirc (MS MCE Remote works out of the box, so if you've any other remotes and/ or LCD displays, you're on your own to solve the individual Lirc issues)
  • Suspend/ resume (works perfectly on ASUS P5N7A-VM)

Preparation

FIRST STEP

Download, burn and install Ubuntu Intrepid mini.iso from here: https://help.ubuntu.com/community/Installation/MinimalCD

Apparently there seems to be an issue with Intrepid installer. If you are using flash drive, it's not installing GRUB for some reason.

You have to options:

  1. Either install Hardy(Ubuntu 8.04) mini.iso first, which is install GRUB, then right after that, install Intrepid mini.iso over the same flash drive. It will reformat the drive, but GRUB will stay alive on the drive.
  2. Second option is that right after Intrepid mini installation, boot up Intrepid mini.iso from the CD again, choose rescue mode, and there you will find an "install GRUB" option.
  • During the installation, please set „xbmc” as username and password at the account creation.
  • At the end, when you have to choose from the optional components, check only „OpenSSH” to be able to access your HTPC remotely via SSH.

After you’ve done, boot it up, then use an SSH application (e.g. putty) to log in remotely from your desktop, using the above created username and password. This way, you will be able to copy/ paste all the steps below. Alternatively you can use your console, but then you will have a hard time type in everything.

So once you logged in:


First of all, update the repos, and install all prerequisites:

NEXT STEP

# sudo apt-get update

NEXT STEP

# sudo apt-get install -y localepurge subversion make g++ gcc gawk pmount libtool nasm automake cmake gperf unzip bison libsdl1.2-dev libsdl-image1.2-dev libsdl-gfx1.2-dev libsdl-mixer1.2-dev libsdl-sound1.2-dev libsdl-stretch-dev libfribidi-dev liblzo-dev libfreetype6-dev libsqlite3-dev libogg-dev libasound-dev python-sqlite libglew-dev libcurl4-gnutls-dev x11proto-xinerama-dev libxinerama-dev libxrandr-dev libxrender-dev libmad0-dev libtre-dev libogg-dev libvorbis-dev libmysqlclient-dev libpcre3-dev libdbus-1-dev libhal-dev libhal-storage-dev libjasper-dev libfontconfig-dev libbz2-dev libboost-dev libfaac-dev libenca-dev libxt-dev libxmu-dev libpng-dev libjpeg-dev wget build-essential linux-headers-`uname -r` xorg pm-utils mingetty


During the installation of the packages, there will be a popup window to choose your locale languages to let "localepurge" know which locales not to remove in further installations. I would suggest to keep all en_us (3 all together) and your own country locales (again should be 3) as well. Localepurge will save you some space with removing unneccessary languages.

Upgrading ALSA (sound driver) to the latest version

I have modified the ALSA upgrade script (available at Ubuntuforums), and now it is working with only “-di” option in our case here (Also on ASUS P5N7A-VM).

To download and use the script:

NEXT STEP

# wget http://217.20.138.65/xbmc/AlsaUpgrade-1.0.x-rev-1.16.sh

NEXT STEP

# chmod a+x AlsaUpgrade-1.0.x-rev-1.16.sh


NEXT STEP

# sudo ./AlsaUpgrade-1.0.x-rev-1.16.sh -di

This mini version of Intrepid has a bug (or maybe a feature): the user created at installation is not added to the „audio” group. We need the correct this:

NEXT STEP

# sudo usermod -a -G audio xbmc 

(Please note: replace „xbmc” with username you installed with)

reboot the computer:

NEXT STEP

# sudo reboot

For some reason, the driver snapshot for ALSA 1.0.19 is not always downloading properly; in this case you have to run the script again. To check whether the driver upgraded or not:

NEXT STEP

# more /proc/asound/version

If you see driver version 1.0.19 here, you can continue, but it's shows 1.0.17 as driver version, then you have to repeat the last 3 step (upgrade, reboot, check).

If it’s OK, then you can delete the just downloaded ALSA source to free up some disk space:

NEXT STEP

# sudo rm -r /usr/src/Alsa-1.0.19/

Now run alsamixer:

NEXT STEP

# alsamixer

Navigate right with cursor keys until IEC958 and unmute all three of them (IEC958) with „M” key. You should see in case of all three IEC958 a „00” in green background. Press „ESC” to quit from alsamixer.

Now, you have to edit the following file, using nano for example:

NEXT STEP

# sudo nano /etc/modprobe.d/alsa-base

and add this line to the end:

options snd-hda-intel model=6stack-dig


Update Video driver

Nvidia

(For Ati owners: jump to #Ati)

NEXT STEP

# wget http://us.download.nvidia.com/XFree86/Linux-x86/180.22/NVIDIA-Linux-x86-180.22-pkg1.run

NEXT STEP

# sudo sh NVIDIA-Linux-x86-180.22-pkg1.run

In the nvidia installer: accept the License agreement, choose „YES” for „No precompiled kernel interface...”, choose „OK” for „No matching precompiled kernel interface...”, than choose „YES” to update X configuration file, than finally „OK” again at the end.

Now you can delete Nvidia installer:

NEXT STEP

# rm NVIDIA-Linux-x86-180.22-pkg1.run

Configure xorg.conf for Nvidia to benefit from XBMC's auto refresh

If you want your Xorg autodetect the native resolutions from EDID and want to use 24p you have to replace your xorg.conf with this (not guaranteed to work, but should with newer Nvidia cards):

NEXT STEP

# sudo cp /etc/X11.xorg.conf /etc/X11/xorg.conf.backup

NEXT STEP

# sudo wget -P/etc/X11 http://217.20.138.65/xbmc/xorg.conf

(To continue click on: #Download, compile, and install XBMC from source (skip section Ati))


Ati

NEXT STEP

# sudo apt-get install -y cdbs fakeroot dh-make debhelper debconf libstdc++5 dkms

NEXT STEP

# wget http://www2.ati.com/drivers/linux/ati-driver-installer-8-12-x86.x86_64.run

NEXT STEP

# sudo sh ati-driver-installer-8-12-x86.x86_64.run --buildpkg Ubuntu/intrepid

NEXT STEP

# sudo dpkg -i xorg-driver-fglrx_8.561-0ubuntu1_i386.deb fglrx-kernel-source_8.561-0ubuntu1_i386.deb fglrx-amdcccle_8.561-0ubuntu1_i386.deb

NEXT STEP

# rm ati-driver-installer-8-12-x86.x86_64.run  *.deb

Configure xorg.conf for Ati

Will be discussed later, stay tuned


Download, compile, and install XBMC from source

NEXT STEP

# svn checkout https://xbmc.svn.sourceforge.net/svnroot/xbmc/branches/linuxport/XBMC

Wait for downloading XBMC source files, might takes long time, depend on your Internet connection. After it downloaded:

NEXT STEP

# cd XBMC


OPTIONAL
Unofficial performance patch
If you experience problems with Intrepid ffmpeg performance (most probably you will) which is under discussion here:
http://forum.xbmc.org/showthread.php?t=43075, you may want to try aron's patch (thank you aron, for this).

Please be aware, that this is not supported and not recommended by team-XBMC.

If you don't want to install this patch, just skip all the optional steps and jump to the closest "NEXT STEP" (configure).


OPTIONAL STEP2

# wget http://trac.xbmc.org/raw-attachment/ticket/5680/xbmc_ffmpeg_mt.patch

OPTIONAL STEP3

# patch -p0 < xbmc_ffmpeg_mt.patch


Then configure/compile/install XBMC:

NEXT STEP

# ./configure --prefix=/usr --disable-pulse

NEXT STEP

# make -j2 (Please note: use only „make”, if you don’t have a dualcore CPU)

This is again, can take quite some time, depending on your CPU speed.

NEXT STEP

# sudo make install


Autoboot and autostart XBMC

NEXT STEP

# cd $home

NEXT STEP

# wget http://217.20.138.65/xbmc/.xsession

NEXT STEP

# sudo nano /etc/event.d/tty2

Comment out the last line (with #) and add the following line, so the end of the file should look like this:

respawn

#exec /sbin/getty 38400 tty2
exec /sbin/mingetty --autologin xbmc tty2

(Please note: replace „xbmc” with username you installed with)


NEXT STEP

# sudo nano .bash_profile

Copy the following text into it, then save the file:

if [ -z "$DISPLAY" ] && [ $(tty) == /dev/tty2 ]; then

startx -- -br

fi


Install Lirc

I've found MS MCE Remotes, listed here: http://www.mythtv.org/wiki/MCE_Remote, are plug & plays, working out of the box. I also found, that there're remotes out there, which instalation are a real pain. The choise is yours. If you have one of the above mentioned MS MCE remotes, the installation is that simple:

NEXT STEP

# sudo apt-get install -y lirc

And follow the wizard.


Power Management

To be able to control power management (suspend, shutdown, reboot) from within XBMC, you have to modify PolicyKit.conf to grant privilegies to your user for power management. There is a preprepared PolicyKit.conf for this, you can get it by:

NEXT STEP

# sudo wget -P/etc/PolicyKit http://217.20.138.65/xbmc/PolicyKit.conf

Please note: if you installed your system with username other than "xbmc" at the begining, you have to modify that in the file.


If you wish to enable CPU scaling, install the required packages as the following, but don’t forget to enable it in the BIOS as well.

NEXT STEP

# sudo apt-get powernowd


Install Splash

You may want to have a look at du-duke's fantastique splash screens. You can check these here: http://du-duke.blogspot.com/ You can download your choice below.

NEXT STEP

# sudo apt-get -y install usplash libusplash-dev

NEXT STEP - CHOICE 1 - Downloading spinner-blue

# sudo wget -P/usr/lib/usplash http://217.20.138.65/xbmc/spinner-blue/usplash-theme-ubuntu.so

NEXT STEP - CHOICE 2 - Downloading pulsating-logo

# sudo wget -P/usr/lib/usplash http://217.20.138.65/xbmc/pulsating-logo/usplash-theme-ubuntu.so

NEXT STEP

# sudo nano /etc/usplash.conf

and set your desired splash resolution, so inserting the following to here. (Please note: this is a FullHD example):

xres=1920
yres=1080

NEXT STEP

# sudo update-initramfs -u


Enable thermal monitoring

To install the necessary package:

# sudo apt-get install -y lm-sensors

Once lm-sensors installed, you have to run sensor detection to identify your sensors:

# sudo sensors-detect

There will be a lot of questions here, but you can answer by "enter" key to all of them, except the last question". So answer "enter" to all questions, until you see the the question "Do you want to add these lines automatically?" At here, you have to type "yes", then enter.

Reboot the computer:

# sudo reboot

After rebooted, check if the sensors are working:

# sensors -u

You should see the output of the sensors here.

To let XBMC detect your CPU temps provided by lm-sensors, you have to edit your advancedsettings.xml and insert the following:

<advancedsettings>
<cputempcommand>echo "$(sensors -u | grep "temp2_input"| awk '{print $2 }' |awk '{printf("%d\n",$1 + 0.5);}') C"</cputempcommand>
</advancedsettings>


Nvidia GPU temp

To let XBMC detect your GPU temps provided by nvidia-settings, you have to edit your advancedsettings.xml and insert the following:

<advancedsettings>
<gputempcommand>echo "$(nvidia-settings -tq gpuCoreTemp) C"</gputempcommand>
</advancedsettings>



Enable eject button of your ODD

# sudo nano /etc/sysctl.conf

and uncomment (by deleting # from the begining of the line) the last line, so it will look like this:

dev.cdrom.lock=0


Reduce boot time

reduce GRUB waiting (~2 sec)

# sudo nano /boot/grub/menu.lst

Find the timeout (currently set to 3) and change this to 0


reduce the number of loaded vts (virtual terminal service)

By default, there're F1 through F7, we don't need that much for a HTPC, so we can remove most of them.

# sudo nano /etc/event.d/tty3

and comment out all the lines, using #. Repeat the above command for tty4-tty6, so at the end you've deactivated 3 vts's.


Enable concurrent booting (if you own a dual-core CPU)

# sudo nano /etc/init.d/rc

Find the line "CONCURRENCY=none" and change it to "CONCURRENCY=shell"


Disable unneccessary services
Install the necessary application

# sudo apt-get -y install sysv-rc-conf


And run it:

# sudo sysv-rc-conf

Navigate with your cursor keys, you can disable services by clearing X in each runlevel by "space" key.
You can disable the following services:

  • apparmor
  • dns-clean
  • fancontrol (except you're using it)
  • pppd-dns
  • rsync


BIOS OEM Splash screen

Recent motherboards usually featured with the possibility to change to BIOS OEM logo. Below you can find a modified XBMC logo. The format and size of the picture has been modified to fit into the BIOS (ASUS P5N7A-VM), there is no guarantee to work with any other motherboard, but I guess it should work with all boards with newer AMI bioses.

BE AWARE! I take no responsibility if you brick your motherboard while playing with BIOS.

In case of ASUS, you can do it with MyLogo2, which is a bundled tool for your MB.

The aspect ratio of the picture is like this for purpose. When you BIOS is displaying it, it will stretch to fit to the screen. So this is made for 16:9 (not for 4:3, and nor for 16:10)

http://217.20.138.65/xbmc/pwrd_by_xbmc_bios_splash.bmp


Wake On Lan

# sudo apt-get install -y ethtool


# sudo nano /etc/init.d/wol.sh

Copy the following text into it, then save the file:

ethtool -s eth0 wol g


Make this newly created script executable:

# sudo chmod a+x /etc/init.d/wol.sh


Make it start during boot:

# sudo update-rc.d -f wol.sh defaults


Sound configuration in XBMC

After booted into XBMC switch to „digital” audio output, than choose the AC3 and DTS capabilities according to your receiver. For SPDIF: leave audio output device: default and passthrough on IEC958 For HDMI: change both audio output device and passthrough to hdmi (you will loose analog sound eg. navigation sound in case of hdmi)


MythTV

You may want to have a look at here:

http://wiki.xbmc.org/?title=MythTV