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 1: Line 1:
== Introduction ==
== Introduction ==


<python>
<xml>
req = urllib2.Request(url)
req = urllib2.Request(url)
req.add_header('User-Agent', ' Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3')
req.add_header('User-Agent', ' Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3')
</python>
</xml>


After my XBMC Live guide, I decided to put together a guide for installing XBMC on Ubuntu Intrepid Minimal CD version as well.
After my XBMC Live guide, I decided to put together a guide for installing XBMC on Ubuntu Intrepid Minimal CD version as well.

Revision as of 12:50, 29 January 2009

Introduction

<xml> req = urllib2.Request(url) req.add_header('User-Agent', ' Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3') </xml>

After my XBMC Live guide, I decided to put together a guide for installing XBMC on Ubuntu Intrepid Minimal CD version as well.

Please note:

  • I only tested this with nvidia, so I have no experience with ATI
  • The guide is for using XBMC on a dedicated HTPC, so there is not any window manager installed
  • You need minimum 4GB size flash drive or hard disk to go

This guide walks you through how to install every needed components and XBMC itself, but try to leave to footprint as small as it can.

You will get:

  • A dedicated HTPC autoboot to XBMC
  • Latest XBMC SVN version
  • Upgraded ALSA driver
  • Upgraded NVIDIA driver
  • Lirc (I have MS MCE Remote which works out of the box, so everybody with other remotes and LCD displays are in his/ her own to solve the individual Lirc issues)
  • Suspend/ resume (works perfectly on ASUS P5N7A-VM)

So, let’s start:

Preparation

FIRST STEP Download, burn and install Ubuntu Intrepid mini.iso from here: https://help.ubuntu.com/community/In...tion/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: 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.

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’re 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 Code:

  1. sudo apt-get update

NEXT STEP Code:

  1. sudo apt-get install –y 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

Please note, that as this is a guide for dedicated HTPC and in this case we mostly need passthrough, I choose NOT to install the libs for Pulseaudio and compile XBMC later without Pulseaudio support. As far I understand, only ALSA is needed in this case.

To upgrade ALSA

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:

NEXT STEP Code:

  1. wget http://217.20.138.65/AlsaUpgrade-1.0.x-rev-1.15-Ben.sh

NEXT STEP Code:

  1. chmod 777 AlsaUpgrade-1.0.x-rev-1.15-Ben.sh

NEXT STEP Code:

  1. sudo ./AlsaUpgrade-1.0.x-rev-1.15-Ben.sh -di

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

NEXT STEP Code:

  1. sudo usermod -a -G audio xbmc

or replace „xbmc” with username you installed with

reboot the computer:

NEXT STEP Code:

  1. 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 Code:

  1. more /proc/asound/version

If you see driver version 1.0.19 here, you can continue, but if there is 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 Code:

  1. sudo rm -r /usr/src/Alsa-1.0.19/

Now run alsamixer: NEXT STEP Code:

  1. 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 Code:

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

and add this line to the end:

Code:

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

To update NVIDIA driver

NEXT STEP Code:

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

NEXT STEP Code:

  1. 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 Code:

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

To install XBMC (latest SVN)

NEXT STEP Code:

  1. 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 Code:

  1. cd XBMC

OPTIONAL STEP 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".

OPTIONAL STEP2 Code:

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

OPTIONAL STEP3 Code:

  1. patch -p0 < xbmc_ffmpeg_mt.patch

Then configure/compile/install XBMC:

NEXT STEP Code:

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

NEXT STEP Code:

  1. make -j2

(NOTE: use only „make”, if you don’t have a dualcore CPU) This is again, can take a a while, depend on your CPU speed.

NEXT STEP Code:

  1. sudo make install

To autoboot and autostart XBMC

NEXT STEP Code:

  1. cd ..

Or "cd $home"

NEXT STEP Code:

  1. wget http://217.20.138.65/.xsession

NEXT STEP Code:

  1. sudo nano /etc/event.d/tty2

In here comment out the last line (with #) and add the following line. The end of the file should look like this:

Code:

respawn

  1. exec /sbin/getty 38400 tty2

exec /sbin/mingetty --autologin xbmc tty2

Or replace "xbmc" with the username you installed Ubuntu Mini.

NEXT STEP Code:

  1. sudo nano .bash_profile

Copy the following text, then save the file:

Code:

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

startx -- -br

fi

To install Lirc

NEXT STEP Code:

  1. 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 change PolicyKit.conf

NEXT STEP Code:

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

If you wish to enable CPU scaling feature:

First of all, don’t forget to enable it in the BIOS.

Code:

  1. sudo apt-get powernowd

Configure xorg.conf for proper modes to benefit from auto refresh

This is not an easy part and can differ from display to display. For myself, I include 3 custom modelines to my xorg.conf for my FullHD plazma screen.

If you have a FullHD display, and want to play with my xorg.conf you can replace your xorg.conf with mine:

NEXT STEP Code:

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

NEXT STEP Code:

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

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)