Archive:HOW-TO:Install XBMC on Ubuntu/with AMD GPU

Installation and configuration of XBMC on Ubuntu based OS with AMD HD Graphic (tested with Zotac AD02 and AD10)

THIS HOWTO MAY BE OUTDATED, PLEASE CHECK MY BLOG POST: http://youresuchageek.blogspot.fr/2012/06/xbmc-install-and-config-howto-for-linux.html


 * Updated July 2012 ***
 * Catalyst 12.6
 * Last xbmc-xvba-eden version
 * System tuning to improve performances

To not hesitate to take a look at my blog version, i'll try to keep both versions up to date ^^ http://youresuchageek.blogspot.fr/2012/06/xbmc-install-and-config-howto-for-linux.html

The Goal:
Installing and configuring all the necessary to get a fully functional, stable and great XBMC media center on AMD Plateform using proprietary ATI driver and Hardware acceleration.

Software:
This configuration guide has been tested under Ubuntu based OS running 11.10 TLS and 12.04 TLS (desktop versions of Xubuntu and Lubuntu), as well as 12.04 TLS Ubuntu (minimal)

Hardware:
This configuration guide has been tested on Zotac AMD Based HTPC: ZOTAC AD02 and ZOTAC AD10

These two HTPCs are quite the same; One major difference is the included and optional USB IR receiver for Zotac AD10, associated with its nice MCE remote control.

Also, only the Zotac AD02 has an SPDIF output to serve Digital sound, digital sound for Zotac AD10 will be achieved using HDMI output

Both of them are embedded with an AMD E350 CPU with ATI Radeon HD able to deal with 1080p video and 5.1 Digital audio :-)

Zotac AD02 Model : AMD E-350 APU Platform (dual-core) (1.6 GHz) AMD Radeon™ HD 6310



Zotac AD10 Model : AMD E-350 APU Platform (dual-core) (1.6 GHz) AMD Radeon™ HD 6310



= Step 1: Install, optimize and tune your base Linux system =

Choose and install your system:
First choose your Ubuntu version to install. This guide will only be fully applicable with an Ubuntu based version.

I will not cover the OS installation itself as there is a lot of tutorials on this subject and installation is enought easy right now.

I do not recommend using Ubuntu classic version as it provides by default a very resource consuming interface (Unity) and has a lot of problems and bugs running ATI proprietary driver!

As far as I know and as far as I tested, the only Ubuntu bases distributions with absolutely no issue with the ATI proprietary driver are:


 * Xubuntu : Ubuntu based version with XFCE desktop
 * Lubuntu : Ubuntu based version with LFCE desktop
 * Ubuntu (minimal): You will NOT have a desktop with this.

If you want to have a desktop running behind XBMC, I would recommend Lubuntu as it has a really low resource consuming desktop interface. Xubuntu is also a great choice, XFCE (Xubuntu's desktop) is also a low resource consuming desktop. (a little less than Lubuntu)

NB:

You may also want to choose a minimal Ubuntu installation and then only run an Xserver that will directly start XBMC interface. This guide will still be approximately applicable in this case.

I did not choose this option for different reasons:


 * No desktop interface to deal with system, files and so on (even if often prefer the command line, 2 possibilities are always betters than one!)
 * No graphical tool to manage Networks connections, etc…
 * No access to AMD ATI graphical configuration manager, so no way to simply change resolution, brightness, contrast and so on--you can change with the aticonfig command but it is not all that intuitive.

Installation recommendations:

3 partitions :


 * A first partition for the root system ( / )
 * A second partition for home (/home)
 * A small Swap partition (1 or 2 GB will largely be enough, a such system is not expected to really swap in normal conditions)

Other:


 * Install Third party softwares (mp3 and so on)
 * In the installation Software, use “xbmc” as a the login
 * Activate autologin for the user "xbmc"

Install SSH and Set your network configuration (optional set a static IP if you prefer):

sudo apt-get install ssh

Edit the /etc/config/interfaces file Comment out the line iface eth0 inet dhcp (or whatever your network adapter hardware device is)

My example looks as such:

iface eth0 inet static address 192.168.1.52 netmask 255.255.255.0 network	192.168.1.0 broadcast 192.168.1.255 gateway 192.168.1.1 dns-search YOURDOMAINNAME.COM dns-nameservers 192.168.1.2 192.168.1.3

After your based installation has achieved, ensure you are fully up to date:

sudo apt-get update sudo apt-get upgrade -y sudo apt-get dist-upgrade –y sudo reboot

Optimize your system:
1. Disable access time for more filesystem performances

For each ext4 filesystem, edit your /etc/fstab and add "noatime" in mount options, example:

UUID=affe0f48-6b88-43a5-b131-20a58cd776b8 /              ext4    errors=remount-ro,noatime  0       1
 * 1) / was on /dev/sda1 during installation

2. If you have an SSD (i recommend it for best performances) :

Go in EUFI (new BIOS) and ensure to set your Sata mode to "EHCI" Edit your fstab to add "discard" in mount options for each partition on your SSD, this will enable TRIM, example:

UUID=affe0f48-6b88-43a5-b131-20a58cd776b8 /              ext4    errors=remount-ro,noatime,discard  0       1
 * 1) / was on /dev/sda1 during installation

For more information, see: https://sites.google.com/site/lightrush/random-1/howtoconfigureext4toenabletrimforssdsonubuntu

3. If you have a large amount of RAM (beginning on 2GB), tune swapiness

For more information, see: https://wiki.archlinux.org/index.php/Maximizing_Performance

Add theses values to /etc/sysctl.conf:

vm.swappiness=10 vm.vfs_cache_pressure=50

4. Turn /tmp into tmpfs to use RAM instead of HDD or SSD

Using this you will turn your "/tmp" directory (used by many programs as their temp directory) into a tmpfs, which means this will reside into you virtual memory instead of the HDD or SSD partition

Edit /etc/fstab and add:

tmpfs  /tmp    tmpfs   defaults,noatime,mode=1777      0       0
 * 1) tmpfs

Reboot

You may see on different posts people also turning /var/tmp, /var/run and others into a tmpfs. This not useful anymore as it has been turned aleready into a tmpfs in recent distributions. (they are all linked into /run which is into a tmpfs)

Use "mount" to see all mounted tmpfs, you should now see /tmp and /run mounted that way

Tune your system:
Modify your grub configuration to ensure your system will always boot even after dirty reboot:

After a hard reset, grub may modify its menu timeout to "-1" meaning you have to manually confirm your choice to boot, this case be useful to understand a problem has occurred and system has abnormally rebooted, but in our case this may very boring and useless as we want the system to always boot with no questions.

So, modify the timeout set by the function "recordfail" to change "-1" timeout to any positive value.

Edit "/etc/grub.d/00_header" and search for this function: if [ "\${recordfail}" = 1 ]; then set timeout=-1 else set timeout=${2} fi

And change "-1" to a positive value or the same default value as above in second line: if [ "\${recordfail}" = 1 ]; then set timeout=${2} else set timeout=${2} fi

Update grub: sudo update-grub

Replace the system splash screen with an XBMC related:

You may prefer to replace your OS default splash screen by the XBMC splash screen:



Do: sudo apt-get update 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

Create "/etc/initramfs-tools/conf.d/splash" and add: FRAMEBUFFER=y

Update grub and initramfs: sudo update-grub sudo update-initramfs -u

Reboot and voila, you've got the XBMC boot screen logo ^^

= Step 2: Install some requirements =

sudo apt-get install ssh python-software-properties udisks upower xorg alsa-utils mesa-utils git-core librtmp0 lirc libmad0 lm-sensors lib32gcc1 libc6-i386 dkms dh-make dh-modaliases execstack libqtgui4 build-essential libc6-i386

NOTE: Copy and paste may only get the first line, make sure you have all of the packages above installed before proceeding.

NB : For lirc, when wizard asks you to choose your hardware in our case we will configure it later so you can choose none... If you already know how to configure lirc and your hardware you may want to choose the right one.

= Step 3: Install ATI proprietary driver (required for XVBA Hardware acceleration) =


 * Get the driver from AMD Site (same file for both 32/64 Bits):

http://support.amd.com/us/gpudownload/linux/Pages/radeon_linux.aspx

12.4 works but has the audio issue where you will loose audio on some TVs if you turn them off and then back on. I advise you to install 12.6 as it comes with some interesting improvements, you have 2 solutions to install 12.6:
 * NOTE: As of 6-JUL-2012 12.6 is the latest version but aticonfig is broken and you will have to apply a workaround to make it work correctly.

Solution 1: Install 12.4 and then upgrade to 12.6

Follow the instructions in this post to use 12.4 then upgrade to 12.6 and using the 12.4 aticonfig:

http://forum.xbmc.org/showthread.php?tid=116996&pid=1138272#pid1138272

-12.4 can be found under the previous versions section on the link above.

Solution 2: Install directly 12.6, extract and overwrite broken /etc/ati/control using 12.4 file


 * Follow steps behind, download, compile and install 12.6 Catalyst
 * Download, extract and replace /etc/ati/control by following commands:

cd ~/; mkdir catalyst12.4; cd catalyst12.4/ wget http://www2.ati.com/drivers/linux/amd-driver-installer-12.4-x86.x86_64.run chmod +x amd-driver-installer-12.4-x86.x86_64.run sh amd-driver-installer-12.4-x86.x86_64.run --extract driver sudo mv /etc/ati/control ~/control.bak sudo cp driver/common/etc/ati/control /etc/ati


 * Follow configuration steps behind (aticonfig...) and reboot

Direct links to 64Bits Catalyst driver for 12.4 and 12.6:

CATALYST 12.4

CATALYST 12.6

sudo sh ./amd-driver-installer-*-x86.x86_64.run --buildpkg
 * Build Packages:

NB: I you are missing some requirements to build packages, a graphical apt-get install will automaticaly appear and install requirements, just valid and proceed and package building will continue

Packages will be built in current directory and exit.

sudo dpkg -i fgl*.deb
 * Install packages:

*** PAY ATTENTION: STOP X11 before applying ATI config ***

Go in terminal using SSH from a remote local networked computer or switching to local console (ctrl+alt+F1)

sudo service lightdm stop
 * Stop X11:

sudo aticonfig --initial -f sudo aticonfig --sync-vsync=on sudo aticonfig --set-pcs-u32=MCIL,HWUVD_H264Level51Support,1
 * Create xorg configuration file, activate vsync and 5.1Level Video:

sudo aticonfig --set-pcs-val=MCIL,DigitalHDTVDefaultUnderscan,0
 * Optionnal and not destructive: Disable underscan (if you have black borders on your TV):

sudo reboot
 * Reboot

= Step 4: Proceed with XBMC installation using pre-compiled packages built for ATI =

This procedure will add a ppa containing pre-compiled XBMC stable Eden version with XVBA support and install XBMC:


 * Add the ppa(edit wsnipex: updated to Frodo stable):

sudo add-apt-repository ppa:wsnipex/xbmc-xvba-frodo

or for a newer but possible less stable version (this is the recommended one as it it has the h.264 (high) fix in it.)

sudo add-apt-repository ppa:wsnipex/xbmc-xvba

or if you are really into risk ;) Everything included in xbmc-xvba + more

sudo add-apt-repository ppa:wsnipex/xbmc-xvba-testing

Press enter to valid adding this ppa


 * Update and install:

sudo apt-get update sudo apt-get install xbmc xbmc-bin

= Step 5: XBMC nice level =


 * Allow xbmc user to change its nice level:

edit /etc/security/limits.conf add the following line at the end of the file

xbmc           	 -       	nice           		 -1

Step 5a (optional): Set XBMC to start automatically (works on lightdm on Ubuntu, not tested on Lubuntu or Xubuntu)

 * NOTE: This will install a window manager, which might overwrite yours if you installed with Lubuntu or Xbuntu, so do not install lightdm

sudo apt-get install lightdm lightdm-gtk-greeter sudo adduser xbmc video sudo adduser xbmc audio

Auto start XBMC

edit /etc/lightdm/lightdm.conf

[SeatDefaults] autologin-user=xbmc autologin-user-timeout=0 user-session=XBMC greeter-session=lightdm-gtk-greeter

edit /usr/share/xsessions/XBMC.desktop

[Desktop Entry] Name=XBMC Comment=This session will start XBMC Media Center Exec=xbmc-standalone TryExec=xbmc-standalone Type=Application

= Step 6: First start of XBMC and base configuration =

Open XBMC and proceed with first settings:


 * Open XBMC


 * In Appearance / skin, I recommend “NEON” (again my personal choice!)


 * In Appearance, adapt your language if required




 * In System->Settings->System->Video Settings:

Vertical Sync: Always on



XVBA: On Adjust Refreshrate to match video: On Sync Playback to Display: On Sync Method: Video Clock (Drop/Dupe)
 * In System ->Video->Playback:




 * Exit XBMC

= Step 7: Optimizing XBMC CPU use and configure GPU sensor =

Enable Dirty Region Rendering (drastically reduces CPU load on XBMC idle) and DDS Fanart NOTE: do not do this as root or with sudo. this file must belong to your normal xbmc user

create: ~/.xbmc/userdata/advancedsettings.xml

0    1     false 0  sensors|sed -ne "s/temp1: \+[-+]\([0-9]\+\).*/\1 C/p" /usr/bin/aticonfig --od-gettemperature | grep Temperature | cut -f 2 -d "-" | cut -f 1 -d "." | sed -e "s, ,," | sed 's/$/ C/'

= Step 8: Configuring Digital Audio =

You will certainly want to get Digital sound with your own Home Cinema, to get this working you have two possibilities depending on your hardware :
 * Digital sound through SPDIF
 * Digital sound through HDMI

I will provide these two examples, you have to adapt this depending on your Hardware !


 * Digital Audio with SPDIF on Zotac AD02

As xbmc user, create a new file in your home: ~/.asoundrc

pcm.dmixer { type dmix ipc_key 1024 slave { pcm "hw:1,1" period_time 0 period_size 1024 buffer_size 8192 #periods 128 #rate 44100 rate 48000 }     bindings { 0 0        1 1      } }

Restart XBMC, in Settings>System>Audio Output:


 * Audio Output: Optical/Coax
 * Speaker Configuration: 5.1
 * Audio Output Device: Custom
 * Custom Audio Device: plug:dmixer
 * Passthrought Output Device: Custom
 * Custom Passthrought Device: plug:dmixer




 * Digital Audio with HDMI on Zotac AD10

As xbmc user, create a new file in your home: ~/.asoundrc

pcm.dmixer { type dmix ipc_key 1024 ipc_key_add_uid false ipc_perm 0660 slave { pcm "hw:0,3"              #HDMI, defaults to 48000 kHz channels 2 period_size 1024 buffer_size 4096 } } pcm.!default { type plug slave.pcm "dmixer" }

Restart XBMC, in Settings>System>Audio Output:


 * Audio Output: HDMI
 * Speaker Configuration: 5.1
 * Audio Output Device: Custom
 * Custom Audio Device: plug:dmixer
 * Passthrought Output Device: hdmi (alsa)

= Step 9: Configuring power management to allow shutdown and others power management functions from XBMC =

Without configuring it, you won't be able to shutdown or suspend your system directly from XBMC Source: http://wiki.xbmc.org/index.php?title=HOW-TO:Suspend_and_wake_in_Ubuntu


 * Install requirements:

sudo apt-get install policykit-1 upower acpi-support

Create a new file "/var/lib/polkit-1/localauthority/50-local.d/custom-actions.pkla":

For Ubuntu 11.10:

[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 Ubuntu 12.04:

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

Workaround for suspend / wake up issue:

You need to apply this workaround to avoid issue on system waking up from suspend. (ensure you enabled auto login for your XBMC user)

Add a new file "/etc/pm/sleep.d/99_fglrx":
 * 1) !/bin/sh

case $1 in    suspend|suspend_hybrid|hibernate)        /usr/sbin/service lightdm stop        /sbin/rmmod -f fglrx        ;;

resume|thaw)       /sbin/modprobe fglrx        /usr/sbin/service lightdm start        ;; esac

Make the file executable: $ sudo chmod +x /etc/pm/sleep.d/99_fglrx


 * Restart XBMC and try power management functions such as shutdown

You may have to do more configuration if you need wake up from USB connected devices, in my case with the Zotac AD10 and using remote control, i did not had to and powering up was working from remote control even with the optional IR USB receiver.

= Step 10: Configure your Video Media Library and Home access screens using Smart Playlist =

I will present the way i do which is absolutely personal and you may want to work completely differently ^^

Probably you will have: 
 * One and probably various external storage
 * Films, but also anime for kids, music videos, comics shows and so on...

Using the XBMC's library function associated with Smart Playlist, you will be able (assoiated with a scrapper) to automatically get film's pictures and information, so you absolutely need to organize all that. You can have as for an example your film's library splitted in various external storage !

I Recommend:


 * Use the same directory organisation for each external storage, example:

You have a first external drive: /media/EXTERNAL1/Multimedia/Films /media/EXTERNAL1/Multimedia/Animes

And a second with the same organization: /media/EXTERNAL2/Multimedia/Films /media/EXTERNAL2/Multimedia/Animes


 * For each Film or Video, create a dedicated Directory with the official name of the Film, example:

/media/EXTERNAL1/Multimedia/Films/Ironman 1 /media/EXTERNAL1/Multimedia/Films/Ironman 2 ...

NB: Check for each film the official name on: http://www.themoviedb.org/


 * In XBMC, Go To "Video", Scroll Down and open "Files"
 * Add a Video Source for each Directory you want XBMC to scan and add to the Media Library

Follow theses instructions:


 * Scroll Down and select the "themoviedb" as the scrapper
 * Select automatic scan
 * Select Each video in a dedicated directory
 * Valid and Valid scan now







I recommend deactivate defaults Home screens as they will mix all of your Media Library.

In Settings>Skin, Deactivate view Movies, HD Movies and anything you don't need (such as Live TV if you don't have PVR)




 * Create your own Smart Playlist, in the following example as i use different paths for each type of media, it will be really easy to separate them

Go back to "Video>Files" :

Scroll up to "...":

Select "Playlists":

Add your Smart Playlist:



Choose your criteria (such as the path's name) and to forget to select "Order by" whatever you want (by Title could be a good idea)





Go back to Settings>Skin and add your own Home screen for each category you want, example:



Also, you may want to choose your own picture (all Custom playlist screen will have the same by default), example:



Overview:







So great no :-)

I also recommend to install an addon called "Missing Movie Scanner". It will provide a way to check for each video media library directory you set if files haven't been recognized by the scapper and are missing from your library.

When identified, you just have to correct folder names, retry scanning and double check missing files with this addon.

To use this addon, go to video>addons (scrol down in video to get addons) Launch the addon, choose your video source and the scan will be executed.

= Step 11: Add a Web browser direct access from XBMC =

This is absolutely optional but in my opinion getting a Web browser access directly inside the Media Center interface is an evidence.

Using an addon "Advanced Launcher" we will create a dedicated screen that will launch our Web browser inside XBMC:

First install the addon "Advanced Launcher" (go to addon page, more, and Programs Addons) In terminal, create a small bash script at the root of your media hard drive, as for an example: create a directory for your launchers (adapt "MY VOLUME"): mkdir /launchers

Create a simple shell script, in my example i want to launch chromium-browser (open version of chrome):

Note: If not yet installed, install chromium using "sudo apt-get install chromium-browser"

create a new file "/launchers/chromium.sh" (adapt "MY VOLUME"): /usr/bin/chromium-browser -start-maximized http://www.google.fr
 * 1) !/bin/sh

Add execution right (adapt "MY VOLUME"): chmod +x /launchers/chromium.sh

Create the launcher for our script:

Note: You can manually create the launcher using Advanced Launcher, just ensure not to let any command argument (provided by default). I feel more simple to use the configuration file i provide but this is optional...

create addon dir if does not exists yet: mkdir -p ~/.xbmc/userdata/addon_data/plugin.program.advanced.launcher

create or replace if already exists the file "launcher.xml" with the following content: edit: "~/.xbmc/userdata/addon_data/plugin.program.advanced.launcher/launchers.xml" and adapt "MY VOLUME":

 b3352b31d3fc35a5a7810b39d598bb89 chromium /launchers/chromium.sh                                                                     true


 * Add your launcher to favorites (Go in addon / Advanced Launcher and right click add to favorites upon chromuim)
 * Go to skin configuration: settings>skins
 * Add a custom page and call it as you want, example: INTERNET
 * Set a nice wallpaper

And test! Final result:





When you will launch chromium browser, it will be opened in full page outside of XBMC. When closing it, the system goes back automatically to XBMC

= Step 12: Configuring Network services: UPnP, Airplay, XBMC web control interface =

UPnP: Share your Media Library with any other device

In a few words, UPnP will allow to share and access to your Media Library from any other UPnP aware device.

You may have a connected TV or Home Cinema and DLNA aware, you will be able to play any media from your library using your network!

First, enable UPnP in System>Network>Services:





And... Really that's all !!! ^^

Just ensure your TV, Home Cinema, other device running XBMC, even your Ipad (and perhaps soon your fridge) is well connected to your Network and launch your DLNA explorer.

Any DLNA Server (when activating UPnP, XBMC is acting as a DLNA server) will be automatically detected and accessible, just browse and enjoy.

It took me around 2 minutes to access XBMC library and play video on my LG Home Cinema with absolutely no difficulties.

Airplay: Play your Music, Video or Pictures directly from your Iphone, Ipad or any Airplay aware device !

Any Apple addict may already know Airplay, Apple's remote protocol that allow you to wireless play your music and so on from your Apple device.

For that you had to buy an Apple Airport...this time is over thanks to XBMC Airplay implementation in Eden version! (real great work from XBMC developers!)

Install requirements: sudo apt-get install avahi-daemon libshairport1

Enable Airplay (deactivated by default) :



And...that's it ^^ Take your Iphone while connected to your Wifi Network, open Music, Video or Picture and look for the Airplay icon, you'll find within a minute your XBMC!



And play whatever you want, Again enjoy ^^

'''IMPORTANT INFORMATION!!! '''

Some updates seem have to broken airplay on my system, in case of trouble check your XBMX log (~/.xbmc/temp/xbmc.log), if you see this message:

ERROR: Unable to load libshairport.so.0, reason: libshairport.so.0: cannot open shared object file: No such file or directory

Correct with: cd /usr/lib/x86_64-linux-gnu/ && sudo ln -s libshairport.so.1.0.0 libshairport.so.0

Then deactivate airplay and re-activate, retest and it should work ^^

Control XBMC with a Web Interface:

You may also find amazing or useful to control XBMC through a Web page, activate the service and set credentials:





= Step 13: Configuring Remote Control =

In the case of the Zotac AD10, an MCE remote control is provided, associated with an embeded IR receiver and also an optional USB IR receiver.

Using the optional IR receiver, the remote control was working good without doing anything :)

However, some buttons weren't working as i wanted, and more boring the most usefull button was not working... (Home button, the green with windows logo)

Thanks to him, i found this: http://ben.periton.co.uk/2012/06/configuring-the-zotac-zbox-remote-control/


 * First remove lirc (we will install a specific version):

sudo apt-get remove lirc


 * Install requirements:

sudo apt-get install automake dialog libtool


 * Download the version from FernetMenta:

wget https://github.com/FernetMenta/lirc/tarball/master -O lirc.tar.gz


 * Extract, configure and install:

When you will run setup.sh, choose select driver "zotac" under usb, then save & configure

tar -xvf lirc.tar.gz cd  ./autogen.sh ./setup.sh make sudo make install


 * Create links /usr/sbin:

cd /usr/sbin sudo ln -s ../local/sbin/lircd lircd sudo ln -s ../local/sbin/lircmd lircmd


 * Stop X11 from registering device as keyboard

'''IMPORTANT INFORMATION!!! ''' Xorg update could overwrite this file, if you later experience some kind of strange key repeating, sometime infinite and always boring, it may have been overwritten! In this case, just redo this step and you're done ^^ Edit "/usr/share/X11/xorg.conf.d/10-evdev.conf" and place the following code at the begining of the file:

Section "InputClass" Identifier "PHILIPS MCE USB IR Receiver- Spinel plus" MatchProduct "PHILIPS MCE USB IR Receiver- Spinel plus" MatchIsKeyboard "true" Option "Ignore" "true" EndSection


 * Add a alias in udev to /dev/remote by creating a new file at /etc/udev/rules.d/10-local.rules with the following:

SUBSYSTEM=="usb", ATTRS{idVendor}=="0471", ATTRS{idProduct}=="20cc", SYMLINK+="remote", ACTION=="add", RUN+="/sbin/initctl --quiet emit --no-wait ir-ready"


 * Replace the current version of /etc/lirc/hardware.conf with:

REMOTE="Zotac MCE Remote" REMOTE_MODULES="" REMOTE_DRIVER="zotac" REMOTE_DEVICE="/dev/remote" REMOTE_SOCKET="" REMOTE_LIRCD_CONF="zotac/lircd.conf.zotac" REMOTE_LIRCD_ARGS="" TRANSMITTER="None" TRANSMITTER_MODULES="" TRANSMITTER_DRIVER="" TRANSMITTER_DEVICE="" TRANSMITTER_SOCKET="" TRANSMITTER_LIRCD_CONF="" TRANSMITTER_LIRCD_ARGS="" START_LIRCD="true" LOAD_MODULES="true" LIRCMD_CONF="" FORCE_NONINTERACTIVE_RECONFIGURATION="false" START_LIRCMD=""
 * 1) hardware.conf for Zotac


 * Replace the current version of /etc/lirc/lircd.conf with:


 * 1) Please make this file available to others
 * 2) by sending it to
 * 3) this config file was automatically generated
 * 4) using lirc-0.9.1-git(zotac) on Mon Apr  2 14:10:29 2012
 * 5) contributed by
 * 6) brand:                       zotac.conf
 * 7) model no. of remote control:
 * 8) devices being controlled by this remote:
 * 1) brand:                       zotac.conf
 * 2) model no. of remote control:
 * 3) devices being controlled by this remote:

begin remote

name zotac.conf bits          32 eps           30 aeps         100

one            0     0 zero           0     0 gap         100123 min_repeat     9
 * 1)  suppress_repeat 9
 * 2)  uncomment to suppress unwanted repeats
 * 3)  toggle_bit_mask 0x7004F

begin codes KEY_SLEEP               0x00010082 KEY_WAKEUP              0x00010083 KEY_RECORD              0x000C00B2 KEY_PAUSE               0x000C00B1 KEY_STOP                0x000C00B7 KEY_REWIND              0x000C00B4 KEY_PLAY                0x000C00B0 KEY_FORWARD             0x000C00B3 KEY_LEFTSHIFT           0x000C00B6 KEY_RIGHTSHIFT          0x000C00B5 KEY_BACK                0x000C0224 KEY_INFO                0x000C0209 KEY_MENU                0xFFBC000D KEY_UP                  0x00070052 KEY_LEFT                0x00070050 KEY_RIGHT               0x0007004F KEY_DOWN                0x00070051 KEY_OK                  0x00070028 KEY_VOLUMEUP            0x000C00E9 KEY_VOLUMEDOWN          0x000C00EA KEY_MUTE                0x000C00E2 KEY_CHANNELUP           0x000C009C KEY_CHANNELDOWN         0x000C009D KEY_1                   0x0007001E KEY_2                   0x0007001F KEY_3                   0x00070020 KEY_4                   0x00070021 KEY_5                   0x00070022 KEY_6                   0x00070023 KEY_7                   0x00070024 KEY_8                   0x00070025 KEY_9                   0x00070026 KEY_0                   0x00070027 KEY_NUMERIC_STAR        0x10070025 KEY_NUMERIC_POUND       0x10070020 KEY_CLEAR               0x00070029 KEY_TEXT                0xFFBC005A KEY_TITLE               0x000C008D KEY_ENTER               0x00070028 KEY_RED                 0xFFBC005B KEY_GREEN               0xFFBC005C KEY_YELLOW              0xFFBC005D KEY_BLUE                0xFFBC005E end codes

end remote


 * As xbmc user, replace if already exists or create: ~/.xbmc/userdata/Lircmap.xml

 KEY_SLEEP KEY_WAKEUP KEY_RECORD KEY_PAUSE KEY_STOP KEY_REWIND KEY_PLAY KEY_FORWARD KEY_LEFTSHIFT KEY_RIGHTSHIFT KEY_BACK KEY_INFO KEY_MENU KEY_UP KEY_LEFT KEY_RIGHT KEY_DOWN KEY_OK KEY_VOLUMEUP KEY_VOLUMEDOWN KEY_MUTE KEY_CHANNELUP KEY_CHANNELDOWN KEY_0 KEY_1 KEY_2 KEY_3 KEY_4 KEY_5 KEY_6 KEY_7 KEY_8 KEY_9 KEY_RED KEY_GREEN KEY_YELLOW KEY_BLUE KEY_NUMERIC_STAR KEY_NUMERIC_POUND KEY_TEXT KEY_TITLE KEY_CLEAR

In my case, i was not fully satisfied with this configuration, the Home button was not doing what i was expecting (going back to XBMC Home, and i wanted a button to be able to change language by the remote control

You may try this configuration:

 KEY_SLEEP KEY_WAKEUP KEY_RECORD KEY_PAUSE KEY_STOP KEY_REWIND KEY_PLAY KEY_FORWARD KEY_LEFTSHIFT KEY_RIGHTSHIFT KEY_BACK KEY_INFO KEY_MENU KEY_UP KEY_LEFT KEY_RIGHT KEY_DOWN KEY_OK KEY_VOLUMEUP KEY_VOLUMEDOWN KEY_MUTE KEY_CHANNELUP</up> KEY_CHANNELDOWN KEY_0 KEY_1 KEY_2 KEY_3 KEY_4 KEY_5 KEY_6 KEY_7 KEY_8 KEY_9 KEY_RED KEY_GREEN KEY_YELLOW KEY_BLUE KEY_NUMERIC_STAR KEY_NUMERIC_POUND KEY_TEXT <Language>KEY_TITLE</Language> KEY_CLEAR


 * Reboot and test, everything should work !

= Step 14: Optional - Use Live TV if you have a TV Tuner =

If you have an external TV Tuner, you may want to use it with XBMC and be able to watch Real TV on your Box.

This is very fun and will complete your XBMC Media Center Experience :-)

Please check my post here to see how to configure it: http://youresuchageek.blogspot.fr/2012/07/xbmc-pvr-how-to-enhance-your-xbmc-media.html Some screenshots ^^