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

From Official Kodi Wiki
Jump to navigation Jump to search
>Olympia
>Olympia
No edit summary
Line 26: Line 26:
https://help.ubuntu.com/community/Installation/MinimalCD
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.
''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:''
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.
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.
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.''




Line 45: Line 45:


'''NEXT STEP'''
'''NEXT STEP'''
<div style="height: 30px; border: thin inset black; background: #E6E6FA">
<div style="height: 32px; border: thin inset black; background: #E6E6FA">
  # sudo apt-get update
  # sudo apt-get update
</div>
</div>
Line 64: Line 64:


'''NEXT STEP'''<BR>
'''NEXT STEP'''<BR>
<xml>
<div style="height: 32px; border: thin inset black; background: #E6E6FA">
  # wget http://217.20.138.65/AlsaUpgrade-1.0.x-rev-1.15-Ben.sh
  # wget http://217.20.138.65/AlsaUpgrade-1.0.x-rev-1.15-Ben.sh
</xml>  
</div>


'''NEXT STEP'''<BR>
'''NEXT STEP'''<BR>
<xml>
<div style="height: 32px; border: thin inset black; background: #E6E6FA">
  # chmod 777 AlsaUpgrade-1.0.x-rev-1.15-Ben.sh
  # chmod 777 AlsaUpgrade-1.0.x-rev-1.15-Ben.sh
</xml>
</div>




'''NEXT STEP'''<BR>
'''NEXT STEP'''<BR>
<xml>
<div style="height: 32px; border: thin inset black; background: #E6E6FA">
  # sudo ./AlsaUpgrade-1.0.x-rev-1.15-Ben.sh -di
  # sudo ./AlsaUpgrade-1.0.x-rev-1.15-Ben.sh -di
</xml>
</div>


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:
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'''<BR>
'''NEXT STEP'''<BR>
<xml>
<div style="height: 32px; border: thin inset black; background: #E6E6FA">
  # sudo usermod -a -G audio xbmc
  # sudo usermod -a -G audio xbmc
</xml>
</div>


or replace „xbmc” with username you installed with
or replace „xbmc” with username you installed with
Line 91: Line 91:


'''NEXT STEP'''<BR>
'''NEXT STEP'''<BR>
<xml>
<div style="height: 32px; border: thin inset black; background: #E6E6FA">
  # sudo reboot
  # sudo reboot
</xml>
</div>


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:
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'''<BR>
'''NEXT STEP'''<BR>
<xml>
<div style="height: 32px; border: thin inset black; background: #E6E6FA">
  # more /proc/asound/version
  # more /proc/asound/version
</xml>
</div>


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 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).
Line 107: Line 107:


'''NEXT STEP'''<BR>
'''NEXT STEP'''<BR>
<xml>
<div style="height: 32px; border: thin inset black; background: #E6E6FA">
  # sudo rm -r /usr/src/Alsa-1.0.19/
  # sudo rm -r /usr/src/Alsa-1.0.19/
</xml>
</div>


Now run alsamixer:
Now run alsamixer:


'''NEXT STEP'''<BR>
'''NEXT STEP'''<BR>
<xml>
<div style="height: 32px; border: thin inset black; background: #E6E6FA">
  # alsamixer
  # alsamixer
</xml>
</div>


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.
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.
Line 123: Line 123:


'''NEXT STEP'''<BR>
'''NEXT STEP'''<BR>
<xml>
<div style="height: 32px; border: thin inset black; background: #E6E6FA">
  # sudo nano /etc/modprobe.d/alsa-base
  # sudo nano /etc/modprobe.d/alsa-base
</xml>
</div>


and add this line to the end:
and add this line to the end:
<xml>
<div style="height: 32px; border: thin inset black; background: #E6E6FA">
options snd-hda-intel model=6stack-dig
options snd-hda-intel model=6stack-dig
</xml>
</div>


== To update NVIDIA driver ==
= Updating NVIDIA driver =


NEXT STEP
'''NEXT STEP'''<BR>
Code:
<div style="height: 32px; border: thin inset black; background: #E6E6FA">
# wget http://us.download.nvidia.com/XFree86/Linux-x86/180.22/NVIDIA-Linux-x86-180.22-pkg1.run
</div>


#wget http://us.download.nvidia.com/XFree86/Linux-x86/180.22/NVIDIA-Linux-x86-180.22-pkg1.run
'''NEXT STEP'''<BR>
 
<div style="height: 32px; border: thin inset black; background: #E6E6FA">
NEXT STEP
# sudo sh NVIDIA-Linux-x86-180.22-pkg1.run
Code:
</div>
 
#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.
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.
Line 148: Line 148:
Now you can delete NVIDIA installer
Now you can delete NVIDIA installer


NEXT STEP
'''NEXT STEP'''<BR>
Code:
<div style="height: 32px; border: thin inset black; background: #E6E6FA">
# rm NVIDIA-Linux-x86-180.22-pkg1.run
</div>


#rm NVIDIA-Linux-x86-180.22-pkg1.run
= Download, compile, and install XBMC from source =


== To install XBMC (latest SVN) ==
'''NEXT STEP'''<BR>
 
<div style="height: 32px; border: thin inset black; background: #E6E6FA">
NEXT STEP
# svn checkout https://xbmc.svn.sourceforge.net/svnroot/xbmc/branches/linuxport/XBMC
Code:
</div>
 
#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:
Wait for downloading XBMC source files, might takes long time, depend on your Internet connection. After it downloaded:


NEXT STEP
'''NEXT STEP'''<BR>
Code:
<div style="height: 32px; border: thin inset black; background: #E6E6FA">
 
# cd XBMC
#cd XBMC
</div>


OPTIONAL STEP
'''OPTIONAL STEP'''<BR>
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).
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".
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
'''OPTIONAL STEP2'''<BR>
Code:
<div style="height: 32px; border: thin inset black; background: #E6E6FA">
# wget http://trac.xbmc.org/raw-attachment/ticket/5680/xbmc_ffmpeg_mt.patch
</div>


#wget http://trac.xbmc.org/raw-attachment/ticket/5680/xbmc_ffmpeg_mt.patch
'''OPTIONAL STEP3'''<BR>
 
<div style="height: 32px; border: thin inset black; background: #E6E6FA">
OPTIONAL STEP3
# patch -p0 < xbmc_ffmpeg_mt.patch
Code:
</div>
 
#patch -p0 < xbmc_ffmpeg_mt.patch


Then configure/compile/install XBMC:
Then configure/compile/install XBMC:


NEXT STEP
'''NEXT STEP'''<BR>
Code:
<div style="height: 32px; border: thin inset black; background: #E6E6FA">
# ./configure --prefix=/usr --disable-pulse
</div>


#./configure --prefix=/usr --disable-pulse
'''NEXT STEP'''<BR>
 
<div style="height: 32px; border: thin inset black; background: #E6E6FA">
NEXT STEP
# make -j2
Code:
</div>
 
#make -j2


(NOTE: use only „make”, if you don’t have a dualcore CPU)
(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.
This is again, can take a a while, depend on your CPU speed.


NEXT STEP
'''NEXT STEP'''<BR>
Code:
<div style="height: 32px; border: thin inset black; background: #E6E6FA">
# sudo make install
</div>


#sudo make install
= Autoboot and autostart XBMC =


== To autoboot and autostart XBMC ==
'''NEXT STEP'''<BR>
 
<div style="height: 32px; border: thin inset black; background: #E6E6FA">
NEXT STEP
# cd ..
Code:
</div>
 
#cd ..


Or "cd $home"
Or "cd $home"


NEXT STEP
'''NEXT STEP'''<BR>
Code:
<div style="height: 32px; border: thin inset black; background: #E6E6FA">
# wget http://217.20.138.65/.xsession
</div>


#wget http://217.20.138.65/.xsession
'''NEXT STEP'''<BR>
 
<div style="height: 32px; border: thin inset black; background: #E6E6FA">
NEXT STEP
# sudo nano /etc/event.d/tty2
Code:
</div>
 
#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:
In here comment out the last line (with #) and add the following line. The end of the file should look like this:


Code:
<div style="height: 32px; border: thin inset black; background: #E6E6FA">
 
respawn
respawn
#exec /sbin/getty 38400 tty2
#exec /sbin/getty 38400 tty2
exec /sbin/mingetty --autologin xbmc tty2
exec /sbin/mingetty --autologin xbmc tty2
</div>


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


NEXT STEP
'''NEXT STEP'''<BR>
Code:
<div style="height: 32px; border: thin inset black; background: #E6E6FA">
 
# sudo nano .bash_profile
#sudo nano .bash_profile
</div>


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


Code:
<div style="height: 32px; border: thin inset black; background: #E6E6FA">
 
if [ -z "$DISPLAY" ] && [ $(tty) == /dev/tty2 ]; then
if [ -z "$DISPLAY" ] && [ $(tty) == /dev/tty2 ]; then


Line 245: Line 244:


fi
fi
</div>


== To install Lirc ==
= Install Lirc =


NEXT STEP
'''NEXT STEP'''<BR>
Code:
<div style="height: 32px; border: thin inset black; background: #E6E6FA">
 
# sudo apt-get install –y lirc
#sudo apt-get install –y lirc
</div>


And follow the wizard.
And follow the wizard.


== Power Management ==
= Power Management =


To be able to control power management (suspend, shutdown, reboot) from within XBMC, you have to change PolicyKit.conf
To be able to control power management (suspend, shutdown, reboot) from within XBMC, you have to change PolicyKit.conf


NEXT STEP
'''NEXT STEP'''<BR>
Code:
<div style="height: 32px; border: thin inset black; background: #E6E6FA">
 
# sudo wget -P/etc/PolicyKit http://217.20.138.65/PolicyKit.conf
#sudo wget -P/etc/PolicyKit http://217.20.138.65/PolicyKit.conf
</div>


If you wish to enable CPU scaling feature:
If you wish to enable CPU scaling feature:
Line 268: Line 268:
First of all, don’t forget to enable it in the BIOS.
First of all, don’t forget to enable it in the BIOS.


Code:
'''NEXT STEP'''<BR>
 
<div style="height: 32px; border: thin inset black; background: #E6E6FA">
#sudo apt-get powernowd
# sudo apt-get powernowd
</div>


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


This is not an easy part and can differ from display to display.
This is not an easy part and can differ from display to display.
Line 279: Line 280:
If you have a FullHD display, and want to play with my xorg.conf you can replace your xorg.conf with mine:
If you have a FullHD display, and want to play with my xorg.conf you can replace your xorg.conf with mine:


NEXT STEP
'''NEXT STEP'''<BR>
Code:
<div style="height: 32px; border: thin inset black; background: #E6E6FA">
# sudo cp /etc/X11.xorg.conf /etc/X11.xorg.conf.backup
</div>


#sudo cp /etc/X11.xorg.conf /etc/X11.xorg.conf.backup
'''NEXT STEP'''<BR>
 
<div style="height: 32px; border: thin inset black; background: #E6E6FA">
NEXT STEP
# sudo wget -P/etc/X11 http://217.20.138.65/xorg.conf
Code:
</div>
 
#sudo wget -P/etc/X11 http://217.20.138.65/xorg.conf


== Sound configuration in XBMC ==
= Sound configuration in XBMC =


After booted into XBMC switch to „digital” audio output, than choose the AC3 and DTS capabilities according to your receiver.
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 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)
For HDMI: change both audio output device and passthrough to hdmi (you will loose analog sound eg. navigation sound in case of hdmi)

Revision as of 19:57, 29 January 2009

Introduction

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/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: 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

# sudo apt-get update

NEXT STEP

# 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.

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/AlsaUpgrade-1.0.x-rev-1.15-Ben.sh

NEXT STEP

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


NEXT STEP

# sudo ./AlsaUpgrade-1.0.x-rev-1.15-Ben.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

or 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 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

# 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

Updating NVIDIA driver

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

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 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

# 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

(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

# sudo make install

Autoboot and autostart XBMC

NEXT STEP

# cd ..

Or "cd $home"

NEXT STEP

# wget http://217.20.138.65/.xsession

NEXT STEP

# 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:

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

# sudo nano .bash_profile

Copy the following text, then save the file:

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

startx -- -br

fi

Install Lirc

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

NEXT STEP

# 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.

NEXT STEP

# 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

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

NEXT STEP

# 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)