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

From Official Kodi Wiki
Jump to navigation Jump to search
>Pashdown
(remove more 1st person)
>3guk
Line 69: Line 69:
* usplash-theme-xbmc-spinner-black XBMC Usplash theme for Ubuntu (Black edition)
* usplash-theme-xbmc-spinner-black XBMC Usplash theme for Ubuntu (Black edition)
* usplash-theme-xbmc-spinner-blue XBMC Usplash theme for Ubuntu (Blue edition)
* usplash-theme-xbmc-spinner-blue XBMC Usplash theme for Ubuntu (Blue edition)
* usplash-theme-xbmc-spinner-black-silver XBMC Usplash theme for Ubuntu (XBMC Live Edition)





Revision as of 00:40, 28 December 2009

Template:GoToParent

Introduction

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

  • 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).

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


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

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 Karmic ISO image from here. Various forum posts seem to recommend the 32-bit version.

  • The ISO can either be burned to CD (seems like a waste for 10 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 "Basic Ubuntu server" as the only option, or optionally "OpenSSH server" if you want to have (secure) remote connections facilities.

BasicUbuntu.jpg


The installer will then download all the required packages and finally the system will reboot.

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

Initial system configuration

If Ubuntu 9.10 or higher is installed run the following commands: <xml>sudo apt-get install python-software-properties sudo add-apt-repository ppa:team-xbmc </xml>

If using Ubuntu 9.04 or lower, create the file /etc/apt/sources.list.d/xbmc.org.list with the following content:

deb http://ppa.launchpad.net/team-xbmc/karmic-ppa/ubuntu/ karmic main
deb-src http://ppa.launchpad.net/team-xbmc/karmic-ppa/ubuntu/ karmic main

then import the TeamXBMC key:

<xml>sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 91E7EE5E 318C7509 </xml>

Finally, no matter what version of Ubuntu you are running, do:

<xml>sudo apt-get update </xml>

Install custom boot splash (optional)

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

  • usplash-theme-xbmc-pulsating-logo XBMC Usplash theme for Ubuntu (Pulsating Logo edition)
  • usplash-theme-xbmc-spinner-black XBMC Usplash theme for Ubuntu (Black edition)
  • usplash-theme-xbmc-spinner-blue XBMC Usplash theme for Ubuntu (Blue edition)
  • usplash-theme-xbmc-spinner-black-silver XBMC Usplash theme for Ubuntu (XBMC Live Edition)


All of them are courtesy of user Duduke, see his blog for information and screenshots.

First you need to edit /etc/usplash.conf to look like this (or the resolution you want)

# Usplash configuration file for 720p
xres=1366
yres=720
# Usplash configuration file for 1080p
xres=1920
yres=1080

To install the pulsating logo, as an example, type the following:

<xml>sudo apt-get install usplash-theme-xbmc-* sudo update-alternatives --config usplash-artwork.so sudo update-initramfs -u </xml>

Install XBMC

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)

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.

Envy Next Generation (NVIDIA or ATI drivers)

After following method 2 for NVIDIA (listed below), whenever I ran 'startx', the NVIDIA driver would report "no screens found." Instead, I used envyng (which supports installing both NVIDIA and ATI drivers). It will offer multiple version of each driver to chose from.

Install envyng: <xml>sudo aptitude install envyng envyng-core</xml>

If you are installing the drivers for NVIDIA and you want the newest drivers, then add the proper repository (see below).

After installing envyng and if desired adding the NVIDIA repository, run: <xml>sudo envyng -t</xml>

Restart the computer when prompted.

There is also a GUI version which has some autodetect feature (install envyng-gtk and run envyng -g). You need a window manager to do this. You can run one by changing the driver in the XOrg file from 'nvidia' to 'vesa'.

After following these instructions, I was able to run 'startx' (after installing one of the window mangers listed below).

If using NVIDIA: install NVIDIA restricted drivers

Method 1: use Ubuntu's repository

Using this method will make upgrading your NVIDIA kernel modules much cleaner and safer.

Ubuntu has official packages for NVIDIA drivers in their repository. You can see these by: <xml>apt-cache search nvidia | grep ^nvidia</xml> Currently, version 185.18 is the highest available version to Ubuntu 9.10. This is perfect if you are using audio over HDMI, as later versions introduce a change which prevents the ALSA driver from handling this properly.

Looking at the listed versions from the command above enter the following command substituting 185 if you desire a different version: <xml>sudo apt-get install nvidia-glx-185 nvidia-settings mesa-utils</xml>

Method 2: use NVIDIA-VDPAU repository

For NVIDIA versions > 185 use this method.

For Karmic or newer: <xml>sudo add-apt-repository ppa:nvidia-vdpau/ppa</xml>

for older releases, add to /etc/apt/sources.list: <xml>deb http://ppa.launchpad.net/nvidia-vdpau/ppa/ubuntu karmic main</xml> Change 'karmic' to your release...

Generate an xorg.conf file

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

<xml>sudo nvidia-xconfig -s --no-logo --force-generate --output-xconfig=/etc/X11/xorg.conf</xml>

Alternately, here is a preconfigured xorg.conf for NVidia with some required settings.

Load the NVIDIA kernel module

The NVIDIA module can now either be loaded: <xml>sudo modprobe nvidia</xml>

Or you can reboot and it will be automatically loaded: <xml>sudo reboot</xml>

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, but YMMV.

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: <xml>sudo adduser xbmc --gecos XBMC</xml> Set the password to whatever you wish.

Add the xmbc user to the required groups: <xml>sudo usermod --group audio,video,netdev,fuse,cdrom,plugdev xbmc</xml>

Install XBMC-live: <xml>sudo apt-get install xbmc-live</xml>

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

<xml>xinit xbmc-standalone</xml>

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: <xml>grep EE /var/log/Xorg.0.log</xml> If you find problems, try reinstalling your drivers and editing your /etc/X11/xorg.conf file.

Automated startup

GRUB

Finally, there is a manual modification to be applied to the file /boot/grub/menu.lst: you have to add:

xbmc=autostart,noredir loglevel=0

to the first "kernel" line after the comment, "## ## End Default Options ##". Do not add "loglevel=0" if you are still debugging your setup.

GRUB 2

If you can't find /boot/grub/menu.lst, then chances are you are running GRUB2 (Ubuntu 9.10 and higher).

Edit the following line in /etc/default/grub to appear as:

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash xbmc=autostart,noredir loglevel=0"

Then update grub: <xml>sudo update-grub</xml>

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.

Updating ALSA

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

<xml>sudo apt-get install wget wget http://xbmc.org/wp-content/uploads/alsaup.sh chmod +x alsaup.sh sudo ./alsaup.sh -di</xml>

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

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

Credits for the script: soundcheck on Ubuntu forums

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

<xml>alsamixer</xml>

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

<xml>sudo alsactl store</xml>

Optional Installs

Support for a Remote

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

<xml>sudo apt-get install lirc</xml>

For the original XBOX DVD Dongle remote, configuration here

Resume from Sleep with Remote

After installing in order to be able to allow the remote to trigger resume from suspend, you must run

<xml>sudo sh -c 'echo "USB0" > /proc/acpi/wakeup'</xml>

USB0 might need to be changed to USBX, depending on your system. This setting gets cleared on reboot, so I added a file to my /etc/init/ directory (I am using Upstart) to make the change on system start:

/etc/init/set_wakup.conf: <xml>start on startup

script

       echo "USB0" > /proc/acpi/wakeup

end script</xml>

or refer to Enable_Wake-On-Device to enable resuming using your remote control instead of pushing the power button.

Setup privileges for XBMC user to allow suspend

This may not be necessary on your install. Test it before executing these commands.

<xml>sudo polkit-auth --user xbmc --grant org.freedesktop.hal.power-management.suspend sudo polkit-auth --user xbmc --grant org.freedesktop.hal.power-management.hibernate sudo polkit-auth --user xbmc --grant org.freedesktop.hal.power-management.reboot sudo polkit-auth --user xbmc --grant org.freedesktop.hal.power-management.shutdown sudo polkit-auth --user xbmc --grant org.freedesktop.hal.power-management.reboot-multiple-sessions sudo polkit-auth --user xbmc --grant org.freedesktop.hal.power-management.shutdown-multiple-sessions </xml>

Install build environment

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.

The basic packages needed are installed by the following command:

<xml>sudo apt-get install build-essential cdbs fakeroot dh-make debhelper debconf libstdc++5 dkms linux-headers-$(uname -r)</xml>

Install XBMC build environment and SVN tools

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:

<xml>sudo apt-get install subversion sudo apt-get build-dep xbmc </xml>

Known Issues

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. On the Panasonic TC-P54V10, go to the "Picture" menu to access "Advanced picture" and then set "HD Size" to "Size 2". Most modern displays have this as an option for the input.

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 and this thread.

External Links