Search

Ubuntu 10.04 - XBMC Media Center with Revo 3610

dropcap-xbmc

Since a long time I was planning to replace my MediaPortal mediacenter under Windows with one under Linux.

But I could not find any Media Center under Linux as complete a MediaPortal. In term of functionnalities, here is what is expected :

  • silent & low consumption system
  • possibility to use my MCE Remote
  • suspend/resume from the remote only
  • ability to play HD movies (720 & 1080)
  • DVB-T functionnality, including HD channels
  • recording possibility for DVB-T
  • access to all my video, photo & music from a network share
  • access to media on USB key
  • access to photo on APN
  • be cheap ...

So, here are the installation steps to convert a very small & silent nettop into a full featured digital Media Center.

After some researches, I discovered that all that has become possible under Linux with the association of 4 main items :

  • Acer Revo 3610 nettop, which includes Ion chipset for HD decoding
  • Ubuntu as a welcoming OS (10.04 Lucid LTS)
  • XBMC as a Media Player
  • TVHeadEnd, to add TV possibilities, thru DVB-T

XBMC main menu

This guide has been updated for an installation on Lucid LTS.

1. Ubuntu Installation

1.1. Ubuntu itself

The first thing is to download and install Ubuntu LTS i386.

As the Revo 3610 doesn't have a CD-ROM drive, you need to do the installation from a Live USB key. UnetBootIn will be your friend.

Once installation process is over, the first thing is to update the distribution and install all the utilities packages for dvb adapters that will be used for TV reception.

To do so, with Synaptics :

  1. reload the sources
  2. update all the packages
  3. install openssh-server & linux-firmware-nonfree
  4. apply the changes

The open SSH server will allow you to have a remote access to your media center even when it will be fully remote controlled, with now mouse nor keyboard.

You will be able to connect to your box with a SSH client from any computer connected to your network.

1.2. Ubuntu Tweak

Ubuntu Tweak is a fantastic piece of software that simplifies lots of Ubuntu configuration job. It will specifically ease the package repository definition.

You can get the Ubuntu Tweak package from http://ubuntu-tweak.com/downloads. Just download it and install it thru GetDeb.

Once done, launch Ubuntu Tweak and from the Program/Repository menu & select the following repositories :

  • Medibuntu (to get latest codec)
  • Ubuntu Tweak
  • XBMC

Then in the appplication list :

  • install Ubuntu Restricted Extra
  • if needed remove evolution, empathy, gwibber & pitivi

1.3. Disable automatic updates

To avoid any unwanted automatic update, you configure Update Manager not to do so.

Start System / Administration / Update manager, go in Settings ... and uncheck Check for updates.

1.4. Activate proprietary nVidia drivers

XBMC will need 3D drivers to be activated.

Go to System / Administration / Hardware drivers, select nVidia accelerated graphics driver & select the button Activate.

at the end of the installation process,you need to reboot.

1.5. Anti-tearing setup

To avoid tearing during video playback, you need to tweak the nividia drivers setup and the compiz setting.

You first need to adjust nVidia drivers VSync for XVideo & OpenGL under System / Administration / nVidia X Server Setting.

Configure it as follow :

OpenGL configuration
XVideo configuration

For these parameters to take effect, you need to disable Compiz, as Compiz configuration is overloading nVidia default configuration.

So you just need to open System / Preferences / Appearence, and to select none in the Visual effect tab.

Disable compiz

You are now ready to install XBMC.

2. XBMC

XBMC is a very powerfull mediacenter that allows your to :

  • listen to your music
  • look at your photos
  • watch movies
  • watch live TV programs
  • watch videos from replay sites
  • play some games
  • ...

First thing to do is to go on the wiki page of the project. Everything is explained very clearly.

This guide will just focus on some basic but essential configurations of XBMC.

2.1. Installation

Once all the repositories are setup, the next thing is to install XBMC :

sudo aptitude install xbmc

Your system is ready for the next steps.

XBMC is now installed with the latest version.

2.2. Main configuration

As XBMC is running on your Revo 3610 box, you need to enable the ION harware acceleration for your HD 720 and 1080 movies. You will also need to configure it to suspend the Revo when Power Off is selected.

To do so :

  • menu System / Video / Player, enable the VDPAU rendering.
  • menu System / System / Power saving, select Shut down function : Suspend

2.3. Add-Ons installation

One very interesting feature of XBMC is its possibilities of being enriched by some add-ons. These add-ons can be installed manually or thru some repositories.

A very interesting repository is http://passion-xbmc.org/addons/ provided by the XBMC Passion team.

For french speaking people, it provides some very nice add-ons :

  •  Pluzz (replay for France 2, France 3, France 4, France 5 & France O)
  •  M6 Replay
  •  W9 Replay
  •  AlloCiné trailers
  • ...

To install these add-ons, the simplest way is to declare the XBMC Passion repository and then to directly install the add-ons from the repository.

First, download the XBMC Passion Repository Add-On.

Install the downloaded zip file thru the XBMC menu System / Add-ons / Install from zip file.

Once installed & enabled, you can install all the Add-ons provided by the repository thru the XBMC menu System / Add-ons / Get Add-on / Passion-XBMC.org Add-ons.

XBMC add-ons menu

3. MCE Remote setup for XBMC & Suspend/Resume

3.1. Install needed software

To use a MCE Remote control, you need to install Lirc and to configure the proper modules :

aptitude install lirc

In the remote control configuration menu, select Windows Media Center transceiver/remotes (all) and none as IR transmitter.

If everything is running fine, you should se your remote key pressed when running irw :

# irw
000000037ff07be9 00 Play mceusb
000000037ff07be9 01 Play mceusb
000000037ff07bdc 00 Back mceusb
000000037ff07bdc 01 Back mceusb
000000037ff07be6 00 Stop mceusb
000000037ff07be6 01 Stop mceusb

3.2. Change some remote actions

If you want to change XBMC action for the MCE remote Return key to display the previous menu as an OSD when watching a fullscreen video, you need to modify two entries in the remote.xml configuration file.

/usr/share/xbmc/system/keymaps/remote.xml

...
‹FullscreenVideo›
‹remote›
‹back›Fullscreen‹/back›
‹select›Fullscreen‹/select›
...

3.3. Wake-up on USB

First thing to do is to check in your BIOS that S3 acpi is enabled. Once done, just reboot.

In a terminal, list the devices available :

# cat /proc/acpi/wakeup
Device    S-state      Status   Sysfs node
SMB0      S4     disabled  pci:0000:00:03.2
USB0      S3     disabled  pci:0000:00:04.0
USB2      S3     disabled  pci:0000:00:04.1
NMAC      S5     disabled  pci:0000:00:0a.0
PBB0      S4     disabled  pci:0000:00:09.0
HDAC      S4     disabled  pci:0000:00:08.0
XVR0      S4     disabled  pci:0000:00:0c.0
XVR1      S4     disabled  
P0P5      S4     disabled  
P0P6      S4     disabled  pci:0000:00:15.0
P0P7      S4     disabled  pci:0000:00:16.0
P0P8      S4     disabled  pci:0000:00:17.0
P0P9      S4     disabled  pci:0000:00:18.0

To activate S3 USB wakeup on all the ports, type :

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

Even if you see USB2 in the list, you do not need to activate it. If so, you PC will resume immediatly after suspend ... which is not what is expected !

Check in the list that the device is enabled, enter :

# cat /proc/acpi/wakeup
Device    S-state      Status   Sysfs node
SMB0      S4     disabled  pci:0000:00:03.2
USB0      S3     enabled   pci:0000:00:04.0
USB2      S3     disabled   pci:0000:00:04.1
NMAC      S5     disabled  pci:0000:00:0a.0
PBB0      S4     disabled  pci:0000:00:09.0
HDAC      S4     disabled  pci:0000:00:08.0
XVR0      S4     disabled  pci:0000:00:0c.0
XVR1      S4     disabled 
P0P5      S4     disabled 
P0P6      S4     disabled  pci:0000:00:15.0
P0P7      S4     disabled  pci:0000:00:16.0
P0P8      S4     disabled  pci:0000:00:17.0
P0P9      S4     disabled  pci:0000:00:18.0

To get it started at each boot, just add these lines at the end of :

/etc/rc.local

...
# Enable S3 wakeup on all the USB ports
echo "USB0" >> /proc/acpi/wakeup

exit 0

Once this is done, you should be able to suspend and resume your Revo with the power button of the MCE remote (when the Revo is suspended, the power light is slowly blinking).

4. Remove password on Resume

By default Ubuntu ask your password when resuming after suspend.

The easiest way to remove it is to use Ubuntu Tweak, menu System / Security and to check Deactivate Screen Lock.

5. TV reception : TVHeadEnd & DVB-T

To be able to receive TV channels thru XBMC, one very simple solution is to get them thru TVHeadEnd server.

TVHeadEnd is a fantastic DVB streaming server. It uses a proprietary streaming protocol, but as a chance, XBMC is totally compatible with it.

5.1. DVB-T setup

In Ubuntu, a lot of DVB-T firmware are available thru the linux-firmware-nonfree package. You first need to install that package :

# sudo aptitude install linux-firmware-nonfree

Before watching any TV channel, you first need to automatically load at boot time the proper module handling your DVB receiver (USB dongle in my case).

To do so you need to add your module name in the /etc/modules file. Any module listed in that file will be loaded at boot time.

/etc/modules

...
# DVB-T module
dvb_usb_af9015

Here my DVB-T adapter is an AverMedia Volar Black HD. It will be recognized properly after next boot.

5.2. TVHeadEnd installation

So, first thing to do is to add the deb http://www.lonelycoder.com/debian hts main repository to synaptic.

Then you need to import the public key of this repository that you can get from http://www.lonelycoder.com/public.key.

From Synaptics or from command line you need to update your package list and to install the hts-tvheadend package :

# sudo aptitude update
# sudo aptitude install hts-tvheadend

During the installation process, you will need to select the administrator login & password you will use to access the web based administration interface of TVHeadEnd.

It will be available at http://127.0.0.1:9981/.

5.3. Channels configuration

You then need to configure your channels according to the TVHeadEnd manual.

As you have installed the linux firmware nonfree package, your DVB adapter should be recognized automatically by TVHeadEnd. If not, you may need specific module or firmware for your adapter to be properly handled by your Ubuntu system. This is not the topic of this guide.

5.4. Declare the source in XBMC

Once done, the last thing to do is to declare your streaming server in the XBMC video sources with the htsp:// protocol.

As TVHeadEnd server is on the same machine, your source URL will be htsp://127.0.0.1:9982/

You should now be able to receive your DVB channels under the Live channels directory in your new video source  :-)

6. Suspend/Resume for DVB-T & TVHeadEnd

Few things can create trouble while in the suspend or resume process.

The first one is that the suspend process doesn't work well with many DVB-T adapter. As a result, you will notice Ubuntu not able to suspend with a blinking cursor on the top left corner of the screen.

To solve the trouble, you just need to stop TvHeadEnd and to unload the DVB-T module while in the suspend process, and to do the opposite while being in the resume process.

All the files in /etc/pm/sleep.d are called following the alphabetical order while suspending and the reverse alphabetical order while resuming. A script starting with 00_ will be called first during suspend and last during resume.

So, to allow suspend and resume process to run smoothly, you need to create a /etc/pm/sleep.d/00_tv file that is called every time the computer suspends or resumes. The file should contain the following scriptand to add the following lines :

/etc/pm/sleep.d/00_tv

#!/bin/sh
# Stop/start the TV server before/after the DVB module.

case "$1" in

  # in suspend action, stop tvheadend daemon
  hibernate|suspend)
   # stop TvHeadEnd to be able to unload the DVB-T module
   logger Suspend : Stopping TVheadEnd
   /etc/init.d/tvheadend stop
   ;;

  # in resume action, start tvheadend daemon
  thaw|resume)
   # start TvHeadEnd after the DVB-T module is loaded
   logger Resume : Restarting TVHeadEnd
   /etc/init.d/tvheadend start
  ;;

   *) exit $NA
   ;;

esac

The new file should be rwxr-xr-x as it will be executed by the system :

# sudo chmod 0755 /etc/pm/sleep.d/00_tv

Next, you need to configure the suspend/resume process so that it unloads/loads the DVB-T module during the process. In the next configuration, my DVB-T module name is dvb_usb_af9015. You need to adapt it to your adapter.

To do so, you just need to create as root the /etc/pm/config.d/dvbt file :

/etc/pm/config.d/dvbt

SUSPEND_MODULES="dvb_usb_af9015"

Once it is done, you should be able to suspend and resume your Revo3610 without any problem, including the TV adapter.

The suspend action can be done from the gnome menu or thru the MCE Remote Power button in XBMC.

7. Remote movies collection (NFS & Automount)

If you are planning to view some HD movies shared from a linux server, the best is to use a NFS share for that.

In fact, NFS protocol is much more efficient than SMB, allowing to stream efficiently a HD movie, even thru a good wifi 54 Mbits connexion.

The best way to mount a NFS share on your media center is to go thru AutoFS.

AutoFS is a daemon that will automatically mount a NFS share when needed. Its best feature is to allow a stable mount even after suspend/resume or after a network connectivity problem.

First thing to do is to install the AutoFS package and to create the automount root

# sudo aptitude install autofs
# sudo mkdir /mnt/xbmc

Once installed, you need to setup the mounting root for AutoFS.

We will choose the /mnt/xbmc directory just created. This is done thru the edition of /etc/auto.master configuration file :

/etc/auto.master

/mnt/xbmc       /etc/auto.type      --ghost,--timeout=30

All the mounting point associated with auto-mounting shares will then be declared in the /etc/auto.type configuration file :

/etc/auto.type

Video    -fstype=nfs,ro,intr      IPofYourServer:/nfs/exported/path

Last operation is to restart autofs service to take the previous configuration into account.

# sudo /etc/init.d/autofs restart

Once done, you will access your Video network share automatically, as soon as you browse the /mnt/xbmc/Video directory from whithin XBMC.

8. Making your user sudo-master-password-free

If your HTPC does not need security, you can get Ubuntu stop nagging about its precious root-password.This removes the security totally.
This step is not compulsory, it's just to ease everyday's life.
Beware !

To do so, you should type the following command :

# sudo visudo

At the end of file (in the nano-window) enter this:

username  ALL=NOPASSWD: ALL
%usernameALL=NOPASSWD: ALL

Change username to what your username is. The installer creates a user and group with your selected username.

Press Ctrl-X to save the changes and reboot to activate the setting.

Your mediacenter default user can now do any sudo command without password.

9. Conclusion

Your media center should now be fully operationnal and fully remote controlled.

I've been using mine for the last 18 month with no trouble at all.

Sometime you just forget what a TV is all about  :-)

Enjoy !

Signature Technoblog

This article is published "as is", without any warranty that it will work for your specific need.
If you think this article needs some complement, or simply if you think it saved you lots of time & trouble,
just let me know at This email address is being protected from spambots. You need JavaScript enabled to view it.. Cheers !

icon linux icon debian icon apache icon mysql icon php icon piwik icon googleplus