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

From Official Kodi Wiki
Jump to navigation Jump to search
>L.capriotti
mNo edit summary
 
(354 intermediate revisions by 37 users not shown)
Line 1: Line 1:
= Introduction=
{{outdated}}
Most of XBMC users are aware that '''XBMC Live''' is being released regularly by TeamXBMC, allowing a set-top box experience both running from a CD, a flash disk or fixed disk drive. '''XBMC Live''' is a streamlined Ubuntu-based system, optimized for removable media, that once installed on a fixed disk drive is a pure Ubuntu-based system, although customized for set-top box experience.


Most of XBMC users are aware that XBMC Live is being released regularly by TeamXBMC, allowing a set-top box experience both running from a CD, a flash disk or fixed disk drive.  
An '''XBMC Live''' system will be exactly like the one that this procedure will generate, except that no build environment will be available by default. Instructions for installing a build environment are XBMCbuntu#Install XBMC unstable build environment|under "Optional Installs".


XBMC Live is a streamlined Ubuntu-based system, optimised for removable media, that once installed on a fixed disk drive is a pure ubuntu-based system, although customized for set-top box experience.  
This guide describes how to build an Ubuntu-based system with the minimal set of features that are part of '''XBMC Live''', from which an expert user could start to create his/her perfect setup. The result will be a customized media center allowing the user to add support for specific hardware or providing additional functionalities. Internet access is required during the installation.


* Note: such a system will be exactly like the one that this procedure will generate, except that no build environment will be available by default (you will need to apply the last two steps only if interested).
Although this guide is not written for Linux neophytes, it is easily followed by anyone who can complete a Linux install.


However, more and more XBMC users are urging to build their own customized systems for their media centers, adding support for specific hardware or providing additional functionalities.
This guide assumes you are using the ''Ubuntu 10.04 "Lucid Lynx" Minimal CD''.  A window manager is not required for running XBMC.


If your processor supports 64-bit, it is recommended you use that version of Ubuntu.  Otherwise, use the 32-bit version.
<div class="toclimit-3">
==Install minimal Ubuntu==


This guide describes how to build an Ubuntu-based system with the minimal set of features that are part of XBMC Live, from which an expert user could start to create his/her perfect setup. Internet access is required during the installation. All the following screens and instructions are related to Ubuntu Jaunty.
The Ubuntu community provides a handy "Minimal CD image", a tiny bootable CD (<15 MB) to be used to perform a custom installation with a text-based installer. Get the most recent Lucid Lynx ISO image from [https://help.ubuntu.com/community/Installation/MinimalCD here].
* The ISO can either be burned to CD (seems like a waste for 12.5 MB); alternatively, I used [http://unetbootin.sourceforge.net/ UNetbootin] to make a bootable USB drive from ISO.




After starting the computer with either the CD or the USB drive, select "Install" at boot prompt, then when prompted provide info about your location, language, keyboard layout, time zone. Disk partitioning will be basic, the full disk will be deleted and used.


'''This guide is not destined to Linux neophytes, since some knowledge of the Linux/Unix systems is needed to perform some steps. For a simpler approach pls follow the procedure describe [http://wiki.xbmc.org/?title=HOW-TO_install_XBMC_for_Linux_on_Ubuntu_with_a_minimal_installation_step-by-step here].'''
* Note: If you want more control on the install options you can opt for the "Expert install" at boot prompt, that provides you more flexible disk selection and partitioning options.


=Install miminal Ubuntu=


The Ubuntu community provides a handy "Minimal CD image", a tiny bootable CD (<10 MB) to be used to perform a custom installation with a text-based installer. Get the most recent Janty ISO image from [https://help.ubuntu.com/community/Installation/MinimalCD here].
When prompted, create an username for your account. Note that XBMC will run on its own account "xbmc" that will be created later in the install process.
 
 
During the installation select "OpenSSH server" as the only option if you want to have (secure) remote connections facilities.
 
[[Image:BasicUbuntu.png]]
 
The installer will then download all the required packages and finally the system will reboot. If you installed from USB, you may be greeted with a blank screen with a single blinking cursor on reboot. This is because the installer has mistakenly installed grub on the USB drive instead of your HDD. To fix this, select the USB drive as boot drive on reboot - this will correctly launch Ubuntu. Log in with the username/password you created, and run the following to install grub on your real HDD:
 
<source lang="bash">
sudo grub-install /dev/sda (replace 'a' with whatever HDD you want to boot from)
sudo update-grub
sudo reboot
</source>
 
On reboot you should be correctly booting from HDD.
 
From now on, if you installed OpenSSH, you can SSH from a computer to simplify the rest of the install.
 
==Initial system configuration==
 
'''Note:''' You find newer XBMC packages on this [http://www.loggn.de/ubuntu-xbmc-repository-11-eden-airplay-pvr-livetv/ Repository-Overview] for Ubuntu 12.04 and older.


On '''Ubuntu 9.10 or higher''', run the following commands:


Select [["Install"]] at boot prompt, then when prompted provide info about your location, language, keyboard layout, time zone. Disk partitioning will be basic, the full disk will be deleted and used.
Stable Repository:
<source lang="bash">
sudo apt-get install python-software-properties pkg-config
sudo add-apt-repository ppa:team-xbmc/ppa
sudo apt-get update
</source>


* Note: If you want more control on the install options you can opt for the [["Expert install"]] at boot prompt, that provides you more flexible disk selection and partitioning options.
Alternatively, you can follow the Unstable Repository:
<source lang="bash">
sudo apt-get install python-software-properties pkg-config
sudo apt-add-repository ppa:team-xbmc/unstable
sudo apt-get update
</source>


==Install XBMC==


When prompted, create an username for your account. Note that XBMC will run on its own account "xbmc" that will be created later in the install process.
The core XBMC application and its related dependencies can be installed by typing:
 
<source lang="bash">
sudo apt-get install xbmc xorg
</source>
This will take a considerable amount of time since lots of packages are due to be installed.
 
==Install "restricted drivers" if you have an NVIDIA or ATI/AMD GPU==
 
XBMC requires a 3D GPU (Graphics Processing Unit) that at least supports Shader Model 3.0 and OpenGL 2.0 (that features 24bpp or 32bpp for 3D hardware-acceleration support). As of writing, only Intel, ATI/AMD and NVIDIA have compatible products. However, while Intel drivers are included by default in the standard Ubuntu kernel, NVIDIA and ATI/AMD are not and require additional steps for installation.
 
===If using NVIDIA: install NVIDIA restricted drivers===
 
====Method 1: Default NVIDIA drivers Installation====
 
Ubuntu has official packages for NVIDIA drivers in their repository. You can see these by:
<source lang="bash">
apt-cache search nvidia | grep glx
</source>


Looking at the listed versions from the command above enter the following command substituting 185 if you desire a different version:


During the installation select "Base Ubuntu server" as the only option, or optionally "OpenSSH server" if you want to have (secure) remote connections facilities.
<source lang="bash">
sudo apt-get install nvidia-glx-185 nvidia-settings mesa-utils libvdpau-dev
</source>


[[Image:BasicUbuntu.jpg]]
====Method 2: Manual Installation====


First, download the open source NVIDIA nForce drivers from [http://www.nvidia.com/object/unix.html here].


The installer will then download all the required packages and finally the system will reboot.
Latest version available to download is 270.41.06 for both 32-bit and 64-bit platform. This version is okay for audio over HDMI.


=Initial system configuration=
binutils and gcc must be installed for nVidia package installer to run/compile. The installer will stop running if those packages are not found on the system.
<source lang="bash">
sudo apt-get install binutils gcc
</source>


Create the file /etc/apt/sources.list.d/xbmc.org.list with the following content:
The driver can be downloaded directly using 'wget' (you may have to install wget, if not installed yet).
<source lang="bash">
sudo apt-get install wget
</source>
Linux IA32 (32 bit version):
<source lang="bash">
wget http://us.download.nvidia.com/XFree86/Linux-x86/270.41.06/NVIDIA-Linux-x86-270.41.06.run
chmod 755 NVIDIA-Linux-x86-270.41.06.run
sudo ./NVIDIA-Linux-x86-270.41.06.run
</source>


<xml> deb http://ppa.launchpad.net/team-xbmc/ppa/ubuntu/ jaunty main
Linux AMD64/EM64T (64-bit version):
deb-src http://ppa.launchpad.net/team-xbmc/ppa/ubuntu/ jaunty main
<source lang="bash">
deb http://ppa.launchpad.net/xbmc-addons/ppa/ubuntu/ jaunty main
wget http://us.download.nvidia.com/XFree86/Linux-x86_64/270.41.06/NVIDIA-Linux-x86_64-270.41.06.run
</xml>
chmod 755 NVIDIA-Linux-x86_64-270.41.06.run
then import the TeamXBMC key:
sudo ./NVIDIA-Linux-x86_64-270.41.06.run
</source>


<xml>sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 0x6D975C4791E7EE5E
If everything goes right, you should see the driver being installed on the screen. For further reading on this, look [http://ubuntuforums.org/showthread.php?t=1467074 here]
</xml>


and then
====Generate an xorg.conf file====
=====Default xorg.conf=====
You need a proper xorg.conf file; you can generate a new one automatically by using:


<xml>sudo apt-get update
<source lang="bash">
</xml>
sudo nvidia-xconfig -s --no-logo --force-generate --output-xconfig=/etc/X11/xorg.conf
</source>


=Install custom boot splash (optional)=
=====Judder free playback (NVidia Only) Very Recommended=====
For a judder free playback at 23.97/59.94 Hz follow [http://forum.xbmc.org/showpost.php?p=506251&postcount=1 this guide].


If you want to replace the standard Ubuntu boot screen with a custom, XBMC related one TeamXBMC provides the following in its repository:
====Load the NVIDIA kernel module====
The NVIDIA module can now either be loaded:
<source lang="bash">
sudo modprobe nvidia
</source>


Or you can reboot and it will be automatically loaded:
<source lang="bash">
sudo reboot
</source>


* usplash-theme-xbmc-pulsating-logo XBMC Usplash theme for Ubuntu (Pulsating Logo edition)
===If using ATI/AMD; install ATI/AMD restricted drivers===
* usplash-theme-xbmc-spinner-black XBMC Usplash theme for Ubuntu (Black edition)
* usplash-theme-xbmc-spinner-blue XBMC Usplash theme for Ubuntu (Blue edition)


Follow one of the two methods described in the [http://wiki.cchtml.com/index.php/Ubuntu_Lucid_Installation_Guide "Unofficial ATI Linux Driver wiki"].
Manual install is very likely to give the best results.


All of them are courtesy of user Duduke, see [http://du-duke.blogspot.com/ his blog] for information and screenshots.
==Install XBMC-live and Test XBMC==


You do not need a window manager to run XBMC.  In fact, your system will be much more lightweight without one.  Instead, install the XBMC-live startup script.


To install the pulsating logo, as an example, type the following:
The xbmc-live package requires the "xbmc" account, but does not create one.  Create one before you install it:
<source lang="bash">
sudo adduser xbmc --gecos XBMC
</source>
Set the password to whatever you wish.


<xml>sudo apt-get install usplash-theme-xbmc-*
Add the xmbc user to the required groups:
sudo update-alternatives --config usplash-artwork.so
<source lang="bash">
sudo update-initramfs -u
sudo usermod --group adm,sudo,cdrom,floppy,audio,video,plugdev,netdev,powerdev,fuse,polkituser xbmc
</xml>
</source>


=Install XBMC=
Install XBMC-live for Automated startup:
(When install the unstable release use the [http://forum.xbmc.org/showpost.php?p=793399&postcount=12 link for automated startup])
<source lang="bash">
sudo apt-get install xbmc-live
</source>


The core XBMC application and its related dependencies can be installed by typing:


<xml>sudo apt-get install xbmc xinit x11-xserver-utils
</xml>
This will take a considerable amount of time since lots of packages are due to be installed.


=Install "restricted drivers" for NVIDIA or ATI/AMD video cards (optional)=
Now to test, logout of your administrative user and log back in as "xbmc".  Then run:


XBMC requires a 3D GPU (Graphics Processing Unit) that at least supports Shader Model 3.0 and OpenGL 2.0 (that features 24bpp or 32bpp for 3D hardware-acceleration support). As of writing, only Intel, ATI/AMD and NVIDIA have compatible products. However, while Intel drivers are included by default in the standard Ubuntu kernel, NVIDIA and ATI/AMD are not and require additional steps for installation.
<source lang="bash">
xinit xbmc-standalone
</source>


If everything has been setup correctly, you should be greeted by the XBMC interface.  If not, a likely culprit is your X setup.  Check the logfile '''/var/log/Xorg.0.log'''.  A quick way to find fatal errors is with the command:
<source lang="bash">
grep EE /var/log/Xorg.0.log
</source>
If you find problems, try reinstalling your drivers and editing your '''/etc/X11/xorg.conf''' file.


=== Safe Mode ===
If you want to boot to a console for repair without starting XBMC, hold down the shift key when booting and "grub" will give you a choice of "(recovery mode)".  Select this and the system will boot to a console.  Alternately, you can attach a keyboard and switch out of XBMC to a text console by pressing '''CTRL-ALT-F1''' through '''CTRL-ALT-F6''', you can switch back to XBMC with '''CTRL-ALT-F7'''.


==If using NVIDIA: install NVIDIA restricted drivers==
==Install ALSA==


===Method 1: use third-party reporitories===
<source lang="bash">
sudo apt-get install alsa-utils pulseaudio
</source>


The sound level may be set to zero, to change the volumes we need to enter the sound mixer.


Create the file /etc/apt/sources.list.d/avenard.org.list with the following content:
<source lang="bash">
sudo alsamixer
</source>


<xml>deb http://www.avenard.org/files/ubuntu-repos release/
Adjust the channels you are interested in.
</xml>
Press ESC to exit out of the mixer.


and then type
Save the volumes of Alsamixer.


<xml>sudo apt-get update
<source lang="bash">
sudo apt-get install nvidia-glx-180
sudo alsactl store 0
</xml>
</source>


===Method 2: use the binary driver installer for NVIDIA===
===Updating ALSA===
'''NOTE: Only if you experience difficulties with audio.'''


There are a few issues with the current ALSA package shipped with Ubuntu, therefore it might be a good idea to upgrade.


Install a proper kernel module build environment:
By using [http://ubuntuforums.org/showpost.php?p=10427675&postcount=1 this guide].


<xml>sudo apt-get install build-essential cdbs fakeroot dh-make debhelper debconf libstdc++5 dkms linux-headers-$(uname -r)
Credits for the script: Soundcheck/Temüjin on Ubuntu forums
</xml>


This should download and update your ALSA to the latest version (1.0.24.2 when writing this)
*'''NOTE:''' ALSA v1.0.22.1 is installed by default with Ubuntu 10.04 [Lucid Lynx] and there is no need to upgrade if you really have some serious issues. If you have GeForce/nForce iGPU, then you can follow HOW-TO set up audio over HDMI on nVidia GeForce/nForce controller|this guide to enable audio over HDMI.


Download the latest installer from [http://www.nvidia.com/object/unix.html NVIDIA website] using wget:
Reboot the computer and check that ALSA is updated, start alsamixer and look in the caption, the version should show there.


<xml>sudo apt-get install wget
By default the sound card will have several channels muted, others with low volumes. You have to find your setup by running
</xml>


example:
<source lang="bash">
<xml>wget http://us.download.nvidia.com/XFree86/Linux-x86/180.51/NVIDIA-Linux-x86-180.51-pkg1.run
alsamixer
</xml>
</source>


Make it executable:
and adjust the channels you are interested in.
Once done, save the sound volumes permanently with


<xml>sudo chmod +x NVIDIA-Linux-x86-180.51-pkg1.run</xml>
<source lang="bash">
sudo alsactl store 0
</source>
====Updating ALSA with PPA====
By following [http://www.webupd8.org/2010/01/upgrade-to-alsa-1022-and-more-in-ubuntu.html this guide] you can update alsa with a ppa.


and run it:
====HDMI audio on NVidia GeForce G2xx====


<xml>sudo ./NVIDIA-Linux-x86-180.51-pkg1.run</xml>
By following HOW-TO set up HDMI audio on nVidia GeForce G210, GT220, or GT240|this guide you can setup HDMI audio for NVidia GT2xx


The installer should take care of installing drivers, libraries and building the proprietary kernel module (via dkpg).
====Audio over HDMI for NVidia GeForce/nForce controller====
By following HOW-TO set up audio over HDMI on nVidia GeForce/nForce controller|this guide you can setup audio over HDMI audio for NVidia GeForce/nForce.


==Optional Installs==
=== Install XBMC unstable build environment ===
If you want to walk on the bleeding edge and follow daily development of XBMC you have to install unstable and all XBMC build dependencies:


<source lang="bash">
sudo stop xbmc-live
sudo rm /etc/apt/sources.list.d/team-xbmc*
sudo add-apt-repository ppa:team-xbmc/unstable
sudo apt-get update
sudo apt-get upgrade
sudo start xbmc-live
</source>


In both ways, you need a proper xorg.conf file; you can generate a new one automatically by using:
=== Enable the XBMC user to shutdown or put the computer to sleep ===
The following commands, gives the xbmc user rights to suspend, hibernate, reboot and shutdown:
<source lang="bash">
sudo apt-get install upower acpi-support
</source>


<xml>sudo nvidia-xconfig -s --no-logo --force-generate</xml>
Create a custom-actions.pkla file with the following contents:


==If using ATI/AMD; install ATI/AMD restricted drivers==
<source lang="bash">
sudo nano /var/lib/polkit-1/localauthority/50-local.d/custom-actions.pkla
</source>
Put this in the file.
<pre>
[Actions for xbmc user]
Identity=unix-user:xbmc
Action=org.freedesktop.upower.*;org.freedesktop.consolekit.system.*;org.freedesktop.udisks.*
ResultAny=yes
ResultInactive=no
ResultActive=yes
</pre>
For more info see this page [[Archive:Suspend and wake in Ubuntu]]


Follow one of the two methods described in the [http://wiki.cchtml.com/index.php/Ubuntu_Hardy_Installation_Guide "Unofficial ATI Linux Driver wiki"]. Manual install is very likely to give the best results, but YMMV.
===USB Automount===


=Test basic installation of XBMC=
To enable automount of usb mass storage (show up as source)
in xbmc and to unmount (using the context menu)


At this stage you should have a fully configured standard minimal Ubuntu setup. The system boots to console logon, and XBMC does not start automatically.
<source lang="bash">
You may want to test if all the above steps were successful by starting a graphical X session and run XBMC manually. For this you need a window manager, the most simple and compact being fluxbox or blackbox:
sudo apt-get install udisks usbmount
</source>


<xml>sudo apt-get install fluxbox xterm</xml>
Add NTFS support (maybe allready installed)
<source lang="bash">
sudo apt-get install ntfs-3g
</source>
<source lang="bash">
sudo nano /etc/usbmount/usbmount.conf
</source>
Change line
<source lang="bash">
FILESYSTEMS="vfat ext2 ext3 ext4 hfsplus"
</source>
to
<source lang="bash">
FILESYSTEMS="ntfs vfat ext2 ext3 ext4 hfsplus"
</source>


or
Set permissions for user xbmc to handle udisks polices:
Modify the file (see also previous chapter ! ):
<source lang="bash">
sudo nano /var/lib/polkit-1/localauthority/50-local.d/custom-actions.pkla
</source>
Put this in the file:
<pre>
[Actions for xbmc user]
Identity=unix-user:xbmc
Action=org.freedesktop.upower.*;org.freedesktop.consolekit.system.*;org.freedesktop.udisks.*
ResultAny=yes
ResultInactive=no
ResultActive=yes
</pre>


<xml>sudo apt-get install blackbox xterm</xml>
===Custom Boot Splash===
If you want to replace the standard Ubuntu boot screen with a custom, XBMC related one TeamXBMC provides the following in its repository.


and then
To install the logo, type the following:
<source lang="bash">
sudo apt-get install plymouth-label v86d
sudo wget http://excyle.nl/plymouth-theme-xbmc-logo.deb
sudo dpkg -i plymouth-theme-xbmc-logo.deb
</source>


<xml>startx</xml>


Start an xterm with the default fluxbox menu and type "xbmc" on the xterm. If XBMC opens yo are good to proceed, otherwhise something could have been gone wrong.
Determine what resolution you want Plymouth to open at. Some common ones are '''1920x1080-24''' (1080p), '''1280x720-24''' (720p), and '''1366x768-24'''.  Use this resolution in the files below.


=Install xbmc helpers=
Change the Grub-config
<source lang="bash">
sudo nano /etc/default/grub
</source>


Once a basic standard system is fully working you can start customizing the startup sequence in order to achieve the set-top box experience that is desired for a real media center.
Add next line to the GRUB_CMDLINE_LINUX_DEFAULT and GRUB_GFXMODE line.  If you have other arguments in your GRUB_CMDLINE_LINUX_DEFAULT, incorporate them as needed.
<pre>
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash video=uvesafb:mode_option=1920x1080-24,mtrr=3,scroll=ywrap"
GRUB_GFXMODE=1920x1080
</pre>


A package has been prepared for that in TeamXBMC repository, install it with
Change the Initramfs-Module
<source lang="bash">
sudo nano /etc/initramfs-tools/modules
</source>
Put this in the file as last line:
<pre>
uvesafb mode_option=1920x1080-24 mtrr=3 scroll=ywrap
</pre>


<xml>sudo apt-get install xbmc-live python-apt</xml>
<source lang="bash">
sudo nano /etc/initramfs-tools/conf.d/splash
</source>
Put this in the file:
<pre>
FRAMEBUFFER=y
</pre>


If you have an NVIDIA GPU, you may run into trouble with grub doing a proper handoff.  Run this sed command:
<source lang="bash">
sudo sed -i 's/ \\$vt_handoff//g' /etc/grub.d/10_linux
</source>


Finally, there is a manual modification to be applied to the file /boot/grub/menu.lst: you have to add
Update grub and the initramfs.
<source lang="bash">
sudo update-grub
sudo update-initramfs -u
</source>


<xml>xbmc=nodiskmount,noredir loglevel=0</xml>
Reboot
<source lang="bash">
sudo reboot
</source>


to the default kernel cmdline (entry 0).


Credits to eXcyle for creating the logo and to [.A.C.I.D.] for making a tutorial.


=== Support for a Remote ===
==== Install Lirc ====
If you prefer to navigate in XBMC with a remote, check if your remote is supported by "lirc" on their [http://www.lirc.org/ website], and if it is you can install and configure it with:


If you want to have a "SAFE MODE" option (boot to console prompt without XBMC starting automatically), copy all the lines of the default block (lines starting with title, uuid, kernel, initrd, quit) and create a new one, modifying the title and removing "quiet splash" from the kernel parameters. As an example the original entries for Jaunty are:
<source lang="bash">
sudo apt-get install lirc
</source>


<xml>
For the original XBOX DVD Dongle remote, [http://forum.xbmc.org/showpost.php?p=423466&postcount=8 configuration here]
title Ubuntu 9.04, kernel 2.6.28-11-generic
uuid b2730ec6-2352-49b0-a7c5-69f947380fac
kernel /boot/vmlinuz-2.6.28-11-generic root=UUID=b2730ec6-2352-49b0-a7c5-69f947380fac ro splash quiet xbmc=noredir,nodiskmount loglevel=0
initrd /boot/initrd.img-2.6.28-11-generic
quiet
#
title Ubuntu 9.04, kernel 2.6.28-11-generic (recovery mode)
uuid b2730ec6-2352-49b0-a7c5-69f947380fac
kernel /boot/vmlinuz-2.6.28-11-generic root=UUID=b2730ec6-2352-49b0-a7c5-69f947380fac ro  single
initrd /boot/initrd.img-2.6.28-11-generic
#
title Ubuntu 9.04, memtest86+
uuid b2730ec6-2352-49b0-a7c5-69f947380fac
kernel /boot/memtest86+.bin
quiet
</xml>
and you can create a SAFE MODE entry like this:


<xml>
==== Resume from Sleep with Remote ====
title Ubuntu 9.04, kernel 2.6.28-11-generic (SAFE MODE)
Refer to the [[Archive:Suspend_and_wake_in_Ubuntu#Remote_Suspend_.2F_Wake|"Remote Suspend & Wake"]] section of "Ubuntu Suspend / Wake".
  uuid b2730ec6-2352-49b0-a7c5-69f947380fac
kernel /boot/vmlinuz-2.6.28-11-generic root=UUID=b2730ec6-2352-49b0-a7c5-69f947380fac ro xbmc=noredir,nodiskmount loglevel=0
initrd /boot/initrd.img-2.6.28-11-generic
quiet
</xml>


=Additional settings and packages=
===Support for DVD===
==== Dvd-rom spin-down ====
Dvd spin-down is used, eliminating the noise of a rotating disk.
[http://forum.xbmc.org/showpost.php?p=523814&postcount=1 How-to for spindown]


By default the sound card will have several channels moted, others with low volumes. You have to find your setup by running
==== Unlock the DVD/CD drive for eject ====
The eject function in XBMC may not work unless you do the following.
<source lang="bash">
sudo bash -c "echo dev.cdrom.lock=0 >>/etc/sysctl.conf"
sudo sysctl dev.cdrom.lock=0
</source>


<xml>alsamixer</xml>
==== Disable HAL DVD automounting ====
If you see a pop-up about the DVD device being mounted and a complaint about unsafe removal when you eject the DVD, you should disable HAL's polling for DVD insertion.  Automounting through HAL is not required for DVD playback.


and adjust the channels you are interested in.
Create a file named "/etc/hal/fdi/policy/nodvdmount.fdi" with the following contents:
Once done, save the sound volumes permanently with
<source lang="xml">
<?xml version="1.0" encoding="UTF-8"?>


<xml>sudo alsactl store</xml>
<deviceinfo version="0.2">
  <device>
    <match key="storage.cdrom.dvd" bool="true">
      <remove key="info.addons" type="strlist">hald-addon-storage</remove>
    </match>
  </device>
</deviceinfo>
</source>
== Centralize Your XBMC Library, Metadata and Thumbnails ==
Synchronize Multiple XBMCs|Synchronize Multiple XBMC installations with MySQL


=Optional: Install support for a remote=
Sharing Metadata and Thumbnails see step 3 of
[http://lime-technology.com/forum/index.php?topic=11473.0 Hernandito: Sharing Metadata and Thumbnails]


If you prefer to navigate in XBMC with a remote check if your remote is supported by "lirc" on their [http://www.lirc.org/ website], and if it is you can install and configure it with
== Known Issues ==
=== Video Related ===


<xml>sudo apt-get install lirc</xml>
==== NVIDIA Powermizer Feature ====
I encountered a lot of playback issues who are related to the powermizer feature of my Nettop.
I solved them by adding powermizer settings to the xorg.conf after reading this page:
[http://tutanhamon.com.ua/technovodstvo/NVIDIA-UNIX-driver/#power-saving See Link]


=Optional: Install build environment=
==== Overscan ====
When connecting the PC to the TV using HDMI, the 4 sides of the screen may be cut off.  The recommended fix is to set [http://en.wikipedia.org/wiki/Pixel_mapping 1:1 pixel mapping] on your display.


If not already installed in previous steps, you may want to have a build environment in your system in order to allow the compilation of both custom applications and updated version of kernel modules and packages that are not available in Ubuntu repositories.
=== Sound Related ===


The basic packages needed are installed by the following command:
==== Multi-channel PCM over HDMI is broken ====


<xml>sudo apt-get install build-essential cdbs fakeroot dh-make debhelper debconf libstdc++5 dkms linux-headers-$(uname -r)</xml>
Due to a bug in the nvidia drivers version > 185, multi-channel audio (in non-passthrough mode) will be sent as regular stereo. These are the consequences:
* Multi-channel audio (typically AAC which XBMC needs to decode) will come through as a normal stereo signal
* Voices are muted - they are supposed to come over the center channel, which has been discarded as consequence of the stereo signal
Possible workarounds:
# Use nvidia driver version 185 with ALSA 1.0.21 or later, or
# Use any nvidia driver version, but enable down-sampling in the audio settings - you will lose surround, but at least everything can be heard.


=Optional: Install XBMC build environment and SVN tools=
<big>[[File:Attention talk.png|40px|link=http://www.nvnews.net/vbulletin/showthread.php?t=140999]] [http://www.nvnews.net/vbulletin/showthread.php?t=140999|'''Follow the discussion here''']</big>


If you want to walk on the bleeding edge and follow daily development of XBMC you have to install subversion and all XBMC build dependencies:
==== Sound Delay Issue ====
When using HDMI to connect the the audio of the PC to a TV, there appears to be a 2-3 second delay after the video playback is resumed before sound plays. The issues does not occur when the the analog audio out is used. More information on this issue is available at: [http://forum.xbmc.org/showthread.php?t=59176 this thread] and [http://forum.xbmc.org/showthread.php?t=59469 this thread].


<xml>sudo apt-get install subversion
== External Links ==
sudo apt-get build-dep xbmc
* [http://forum.xbmc.org/forumdisplay.php?f=52 XBMC Linux Forum] Here you can find different solutions to problems of XBMC on Linux.
</xml>
* [http://forum.xbmc.org/showthread.php?tid=141369 XBMC Automated Efficient minimal install Script] I believe this is the most up to date version of the setup script.
* [http://forum.xbmc.org/showthread.php?t=69753 Complete & Easy XBMC Install script for ION Based Systems] Pretty impressive installer script. (unmaintained version use above)
* [http://lifehacker.com/5391308/build-a-silent-standalone-xbmc-media-center-on-the-cheap Lifehacker article on "Build a Silent, Standalone XBMC Media Center On the Cheap"]
* [http://www.xbmc.org/forum/showthread.php?t=53812 HOW-TO make a minimal install of Ubuntu on Acer Revo ION in under 25 minutes] Some of this guide is based upon the forum
* [http://forum.xbmc.org/showthread.php?p=374815#post374815 XBMC Setup Script - Automatic installation of XBMC for Linux] The script was built for Ubuntu 9.04 (I believe). Some of the action performed are no longer needed. Page 18 has an updated version, but still performs actions that are not strictly required.

Latest revision as of 01:00, 20 August 2020

Time.png THIS PAGE IS OUTDATED:

This page or section has not been updated in a long time, no longer applies, refers to features that have been replaced/removed, and/or may not be reliable.

This page is only kept for historical reasons, or in case someone wants to try updating it.

Most of XBMC users are aware that XBMC Live is being released regularly by TeamXBMC, allowing a set-top box experience both running from a CD, a flash disk or fixed disk drive. XBMC Live is a streamlined Ubuntu-based system, optimized for removable media, that once installed on a fixed disk drive is a pure Ubuntu-based system, although customized for set-top box experience.

An XBMC Live system will be exactly like the one that this procedure will generate, except that no build environment will be available by default. Instructions for installing a build environment are XBMCbuntu#Install XBMC unstable build environment|under "Optional Installs".

This guide describes how to build an Ubuntu-based system with the minimal set of features that are part of XBMC Live, from which an expert user could start to create his/her perfect setup. The result will be a customized media center allowing the user to add support for specific hardware or providing additional functionalities. Internet access is required during the installation.

Although this guide is not written for Linux neophytes, it is easily followed by anyone who can complete a Linux install.

This guide assumes you are using the Ubuntu 10.04 "Lucid Lynx" Minimal CD. A window manager is not required for running XBMC.

If your processor supports 64-bit, it is recommended you use that version of Ubuntu. Otherwise, use the 32-bit version.

Install minimal Ubuntu

The Ubuntu community provides a handy "Minimal CD image", a tiny bootable CD (<15 MB) to be used to perform a custom installation with a text-based installer. Get the most recent Lucid Lynx ISO image from here.

  • The ISO can either be burned to CD (seems like a waste for 12.5 MB); alternatively, I used UNetbootin to make a bootable USB drive from ISO.


After starting the computer with either the CD or the USB drive, select "Install" at boot prompt, then when prompted provide info about your location, language, keyboard layout, time zone. Disk partitioning will be basic, the full disk will be deleted and used.

  • Note: If you want more control on the install options you can opt for the "Expert install" at boot prompt, that provides you more flexible disk selection and partitioning options.


When prompted, create an username for your account. Note that XBMC will run on its own account "xbmc" that will be created later in the install process.


During the installation select "OpenSSH server" as the only option if you want to have (secure) remote connections facilities.

BasicUbuntu.png

The installer will then download all the required packages and finally the system will reboot. If you installed from USB, you may be greeted with a blank screen with a single blinking cursor on reboot. This is because the installer has mistakenly installed grub on the USB drive instead of your HDD. To fix this, select the USB drive as boot drive on reboot - this will correctly launch Ubuntu. Log in with the username/password you created, and run the following to install grub on your real HDD:

sudo grub-install /dev/sda (replace 'a' with whatever HDD you want to boot from)
sudo update-grub
sudo reboot

On reboot you should be correctly booting from HDD.

From now on, if you installed OpenSSH, you can SSH from a computer to simplify the rest of the install.

Initial system configuration

Note: You find newer XBMC packages on this Repository-Overview for Ubuntu 12.04 and older.

On Ubuntu 9.10 or higher, run the following commands:

Stable Repository:

sudo apt-get install python-software-properties pkg-config
sudo add-apt-repository ppa:team-xbmc/ppa
sudo apt-get update

Alternatively, you can follow the Unstable Repository:

sudo apt-get install python-software-properties pkg-config
sudo apt-add-repository ppa:team-xbmc/unstable
sudo apt-get update

Install XBMC

The core XBMC application and its related dependencies can be installed by typing:

sudo apt-get install xbmc xorg

This will take a considerable amount of time since lots of packages are due to be installed.

Install "restricted drivers" if you have an NVIDIA or ATI/AMD GPU

XBMC requires a 3D GPU (Graphics Processing Unit) that at least supports Shader Model 3.0 and OpenGL 2.0 (that features 24bpp or 32bpp for 3D hardware-acceleration support). As of writing, only Intel, ATI/AMD and NVIDIA have compatible products. However, while Intel drivers are included by default in the standard Ubuntu kernel, NVIDIA and ATI/AMD are not and require additional steps for installation.

If using NVIDIA: install NVIDIA restricted drivers

Method 1: Default NVIDIA drivers Installation

Ubuntu has official packages for NVIDIA drivers in their repository. You can see these by:

apt-cache search nvidia | grep glx

Looking at the listed versions from the command above enter the following command substituting 185 if you desire a different version:

sudo apt-get install nvidia-glx-185 nvidia-settings mesa-utils libvdpau-dev

Method 2: Manual Installation

First, download the open source NVIDIA nForce drivers from here.

Latest version available to download is 270.41.06 for both 32-bit and 64-bit platform. This version is okay for audio over HDMI.

binutils and gcc must be installed for nVidia package installer to run/compile. The installer will stop running if those packages are not found on the system.

sudo apt-get install binutils gcc

The driver can be downloaded directly using 'wget' (you may have to install wget, if not installed yet).

sudo apt-get install wget

Linux IA32 (32 bit version):

wget http://us.download.nvidia.com/XFree86/Linux-x86/270.41.06/NVIDIA-Linux-x86-270.41.06.run
chmod 755 NVIDIA-Linux-x86-270.41.06.run
sudo ./NVIDIA-Linux-x86-270.41.06.run

Linux AMD64/EM64T (64-bit version):

wget http://us.download.nvidia.com/XFree86/Linux-x86_64/270.41.06/NVIDIA-Linux-x86_64-270.41.06.run
chmod 755 NVIDIA-Linux-x86_64-270.41.06.run
sudo ./NVIDIA-Linux-x86_64-270.41.06.run

If everything goes right, you should see the driver being installed on the screen. For further reading on this, look here

Generate an xorg.conf file

Default xorg.conf

You need a proper xorg.conf file; you can generate a new one automatically by using:

sudo nvidia-xconfig -s --no-logo --force-generate --output-xconfig=/etc/X11/xorg.conf
Judder free playback (NVidia Only) Very Recommended

For a judder free playback at 23.97/59.94 Hz follow this guide.

Load the NVIDIA kernel module

The NVIDIA module can now either be loaded:

sudo modprobe nvidia

Or you can reboot and it will be automatically loaded:

sudo reboot

If using ATI/AMD; install ATI/AMD restricted drivers

Follow one of the two methods described in the "Unofficial ATI Linux Driver wiki". Manual install is very likely to give the best results.

Install XBMC-live and Test XBMC

You do not need a window manager to run XBMC. In fact, your system will be much more lightweight without one. Instead, install the XBMC-live startup script.

The xbmc-live package requires the "xbmc" account, but does not create one. Create one before you install it:

sudo adduser xbmc --gecos XBMC

Set the password to whatever you wish.

Add the xmbc user to the required groups:

sudo usermod --group adm,sudo,cdrom,floppy,audio,video,plugdev,netdev,powerdev,fuse,polkituser xbmc

Install XBMC-live for Automated startup: (When install the unstable release use the link for automated startup)

sudo apt-get install xbmc-live


Now to test, logout of your administrative user and log back in as "xbmc". Then run:

xinit xbmc-standalone

If everything has been setup correctly, you should be greeted by the XBMC interface. If not, a likely culprit is your X setup. Check the logfile /var/log/Xorg.0.log. A quick way to find fatal errors is with the command:

grep EE /var/log/Xorg.0.log

If you find problems, try reinstalling your drivers and editing your /etc/X11/xorg.conf file.

Safe Mode

If you want to boot to a console for repair without starting XBMC, hold down the shift key when booting and "grub" will give you a choice of "(recovery mode)". Select this and the system will boot to a console. Alternately, you can attach a keyboard and switch out of XBMC to a text console by pressing CTRL-ALT-F1 through CTRL-ALT-F6, you can switch back to XBMC with CTRL-ALT-F7.

Install ALSA

sudo apt-get install alsa-utils pulseaudio

The sound level may be set to zero, to change the volumes we need to enter the sound mixer.

sudo alsamixer

Adjust the channels you are interested in. Press ESC to exit out of the mixer.

Save the volumes of Alsamixer.

sudo alsactl store 0

Updating ALSA

NOTE: Only if you experience difficulties with audio.

There are a few issues with the current ALSA package shipped with Ubuntu, therefore it might be a good idea to upgrade.

By using this guide.

Credits for the script: Soundcheck/Temüjin on Ubuntu forums

This should download and update your ALSA to the latest version (1.0.24.2 when writing this)

  • NOTE: ALSA v1.0.22.1 is installed by default with Ubuntu 10.04 [Lucid Lynx] and there is no need to upgrade if you really have some serious issues. If you have GeForce/nForce iGPU, then you can follow HOW-TO set up audio over HDMI on nVidia GeForce/nForce controller|this guide to enable audio over HDMI.

Reboot the computer and check that ALSA is updated, start alsamixer and look in the caption, the version should show there.

By default the sound card will have several channels muted, others with low volumes. You have to find your setup by running

alsamixer

and adjust the channels you are interested in. Once done, save the sound volumes permanently with

sudo alsactl store 0

Updating ALSA with PPA

By following this guide you can update alsa with a ppa.

HDMI audio on NVidia GeForce G2xx

By following HOW-TO set up HDMI audio on nVidia GeForce G210, GT220, or GT240|this guide you can setup HDMI audio for NVidia GT2xx

Audio over HDMI for NVidia GeForce/nForce controller

By following HOW-TO set up audio over HDMI on nVidia GeForce/nForce controller|this guide you can setup audio over HDMI audio for NVidia GeForce/nForce.

Optional Installs

Install XBMC unstable build environment

If you want to walk on the bleeding edge and follow daily development of XBMC you have to install unstable and all XBMC build dependencies:

sudo stop xbmc-live
sudo rm /etc/apt/sources.list.d/team-xbmc*
sudo add-apt-repository ppa:team-xbmc/unstable
sudo apt-get update
sudo apt-get upgrade
sudo start xbmc-live

Enable the XBMC user to shutdown or put the computer to sleep

The following commands, gives the xbmc user rights to suspend, hibernate, reboot and shutdown:

sudo apt-get install upower acpi-support

Create a custom-actions.pkla file with the following contents:

sudo nano /var/lib/polkit-1/localauthority/50-local.d/custom-actions.pkla

Put this in the file.

[Actions for xbmc user]
Identity=unix-user:xbmc
Action=org.freedesktop.upower.*;org.freedesktop.consolekit.system.*;org.freedesktop.udisks.*
ResultAny=yes
ResultInactive=no
ResultActive=yes

For more info see this page Archive:Suspend and wake in Ubuntu

USB Automount

To enable automount of usb mass storage (show up as source) in xbmc and to unmount (using the context menu)

sudo apt-get install udisks usbmount

Add NTFS support (maybe allready installed)

sudo apt-get install ntfs-3g
sudo nano /etc/usbmount/usbmount.conf

Change line

FILESYSTEMS="vfat ext2 ext3 ext4 hfsplus"

to

FILESYSTEMS="ntfs vfat ext2 ext3 ext4 hfsplus"

Set permissions for user xbmc to handle udisks polices: Modify the file (see also previous chapter ! ):

sudo nano /var/lib/polkit-1/localauthority/50-local.d/custom-actions.pkla

Put this in the file:

[Actions for xbmc user]
Identity=unix-user:xbmc
Action=org.freedesktop.upower.*;org.freedesktop.consolekit.system.*;org.freedesktop.udisks.*
ResultAny=yes
ResultInactive=no
ResultActive=yes

Custom Boot Splash

If you want to replace the standard Ubuntu boot screen with a custom, XBMC related one TeamXBMC provides the following in its repository.

To install the logo, type the following:

sudo apt-get install plymouth-label v86d
sudo wget http://excyle.nl/plymouth-theme-xbmc-logo.deb
sudo dpkg -i plymouth-theme-xbmc-logo.deb


Determine what resolution you want Plymouth to open at. Some common ones are 1920x1080-24 (1080p), 1280x720-24 (720p), and 1366x768-24. Use this resolution in the files below.

Change the Grub-config

sudo nano /etc/default/grub

Add next line to the GRUB_CMDLINE_LINUX_DEFAULT and GRUB_GFXMODE line. If you have other arguments in your GRUB_CMDLINE_LINUX_DEFAULT, incorporate them as needed.

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash video=uvesafb:mode_option=1920x1080-24,mtrr=3,scroll=ywrap"
GRUB_GFXMODE=1920x1080

Change the Initramfs-Module

sudo nano /etc/initramfs-tools/modules

Put this in the file as last line:

uvesafb mode_option=1920x1080-24 mtrr=3 scroll=ywrap
sudo nano /etc/initramfs-tools/conf.d/splash

Put this in the file:

FRAMEBUFFER=y

If you have an NVIDIA GPU, you may run into trouble with grub doing a proper handoff. Run this sed command:

sudo sed -i 's/ \\$vt_handoff//g' /etc/grub.d/10_linux

Update grub and the initramfs.

sudo update-grub
sudo update-initramfs -u

Reboot

sudo reboot


Credits to eXcyle for creating the logo and to [.A.C.I.D.] for making a tutorial.

Support for a Remote

Install Lirc

If you prefer to navigate in XBMC with a remote, check if your remote is supported by "lirc" on their website, and if it is you can install and configure it with:

sudo apt-get install lirc

For the original XBOX DVD Dongle remote, configuration here

Resume from Sleep with Remote

Refer to the "Remote Suspend & Wake" section of "Ubuntu Suspend / Wake".

Support for DVD

Dvd-rom spin-down

Dvd spin-down is used, eliminating the noise of a rotating disk. How-to for spindown

Unlock the DVD/CD drive for eject

The eject function in XBMC may not work unless you do the following.

sudo bash -c "echo dev.cdrom.lock=0 >>/etc/sysctl.conf"
sudo sysctl dev.cdrom.lock=0

Disable HAL DVD automounting

If you see a pop-up about the DVD device being mounted and a complaint about unsafe removal when you eject the DVD, you should disable HAL's polling for DVD insertion. Automounting through HAL is not required for DVD playback.

Create a file named "/etc/hal/fdi/policy/nodvdmount.fdi" with the following contents:

<?xml version="1.0" encoding="UTF-8"?>

<deviceinfo version="0.2">
  <device>
    <match key="storage.cdrom.dvd" bool="true">
      <remove key="info.addons" type="strlist">hald-addon-storage</remove>
    </match>
  </device>
</deviceinfo>

Centralize Your XBMC Library, Metadata and Thumbnails

Synchronize Multiple XBMCs|Synchronize Multiple XBMC installations with MySQL

Sharing Metadata and Thumbnails see step 3 of Hernandito: Sharing Metadata and Thumbnails

Known Issues

Video Related

NVIDIA Powermizer Feature

I encountered a lot of playback issues who are related to the powermizer feature of my Nettop. I solved them by adding powermizer settings to the xorg.conf after reading this page: See Link

Overscan

When connecting the PC to the TV using HDMI, the 4 sides of the screen may be cut off. The recommended fix is to set 1:1 pixel mapping on your display.

Sound Related

Multi-channel PCM over HDMI is broken

Due to a bug in the nvidia drivers version > 185, multi-channel audio (in non-passthrough mode) will be sent as regular stereo. These are the consequences:

  • Multi-channel audio (typically AAC which XBMC needs to decode) will come through as a normal stereo signal
  • Voices are muted - they are supposed to come over the center channel, which has been discarded as consequence of the stereo signal

Possible workarounds:

  1. Use nvidia driver version 185 with ALSA 1.0.21 or later, or
  2. Use any nvidia driver version, but enable down-sampling in the audio settings - you will lose surround, but at least everything can be heard.

Attention talk.png Follow the discussion here

Sound Delay Issue

When using HDMI to connect the the audio of the PC to a TV, there appears to be a 2-3 second delay after the video playback is resumed before sound plays. The issues does not occur when the the analog audio out is used. More information on this issue is available at: this thread and this thread.

External Links