Search

Ubuntu 12.04 - Revo 3610 as a XBMC Media Center with TV and Remote

 dropcap-xbmcNowadays, Linux can be a fantastic welcoming OS for a very complete Media Center. In term of functionnalities, here is what you can expect :

  • silent & low consumption system
  • possibility to use a 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 video, photo & music from a network share
  • access to any type of media on USB key or APN

After reading this list, you can say : Ok, very well, but why not to use a distribution like Openelec ?

Answer is simple : geekitude ... is an attitude ! Why let others handle things that you can handle directly by yourself.

So, here are the installation steps to convert a very small & silent nettop into a full featured digital Media Center using a standard Ubuntu Precise 12.04 platform.

This article is a complete rewrite of Ubuntu 10.04 - XBMC Media Center with Revo 3610.
You will get the same functionnalities, but on latest Precise 12.04 LTS Amd64.
It has been tuned for Acer Revo 3610 nettop, but with very few adjustments, you should be able to get it working on any nVidia ION based computer.

The perfect Media Center is possible under Linux with the association of 4 main items :

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

ubuntu-xbmc-eden

1. Ubuntu Installation & Configuration

1.1. Ubuntu itself

The first thing is to download and install Ubuntu Precise Pangolin 12.04 LTS Amd64.

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

During installation process, do not select autologin as we will later change the desktop to Unity 2D.
Autologin will be configured at the end of the procedure

Once installation process is over, the first thing is to update the distribution and install all the basic packages allowing remote access and DVB adapters management.

# sudo apt-get install openssh-server linux-firmware-nonfree aptitude

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 no 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. Switch to Unity 2D desktop

Unity 3D desktop is giving trouble when configuring XBMC auto-start at login.

So first thing to do is to configure your default desktop as Unity 2D.

Just logout, select Unity 2D and login.

1.3. Activate proprietary nVidia drivers

XBMC will need nVidia 3D drivers to be activated.

Go to Additionnal Drivers and select the [recommanded] choice.

ubuntu-xbmc-nvidia-driver

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

1.4. Anti-tearing Setup

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

You first need to adjust VSync for OpenGL under  nVidia Setting.

Configure it as follow :

OpenGL configuration

Then disable composite :

# sudo nvidia-xconfig --no-composite

After next reboot, tearing should be part of the past.

1.5. Multimedia Codec

Our Media Center will have to handle all sort of audio and video files. So we need to install a complete collection of whatever is available under Ubuntu.

Medibuntu provides a PPA with all latest packages.

We first need to declare the PPA :

# sudo wget --output-document=/etc/apt/sources.list.d/medibuntu.list http://www.medibuntu.org/sources.list.d/$(lsb_release -cs).list
# sudo apt-get --quiet update && sudo apt-get --yes --quiet --allow-unauthenticated install medibuntu-keyring
# sudo apt-get --quiet update && sudo apt-get --yes install app-install-data-medibuntu

Then, lets install the full codec collection :

# sudo aptitude install libavformat-extra-53 ubuntu-restricted-extras x264 mimms

1.6. Disable automatic updates & screen lock

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

Start Update manager, go in Settings … and select Automatically check for updates : Never

To disable unwanted screen lock, go to System Settings / Brightness & Lock and :

  • Select Lock : OFF
  • Uncheck Require my password …

ubuntu-xbmc-screen-lock

2. XBMC

First thing to do about XBMC is to go on the wiki page of the project.

Everything you need to know about this media center is explained very clearly.

2.1. Installation

With Ubuntu Precise, XBMX is finally in the main repository. So, you just need to install XBMC :

sudo aptitude install xbmc

Your system is ready for the next steps.

XBMC is now installed with the latest EDEN version.

2.2. Main configuration

As XBMC is running on your Revo 3610 box, you need to make sure that ION harware acceleration is enabled for your HD 720 and 1080 movies.

You will also need to configure it to Suspend the Revo when you're asking to quit the progam.

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 site about add-ons is http://passion-xbmc.org/addons/, provided by the XBMC Passion team.

For french people, it provides :

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

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

3. MCE Remote

3.1. Install needed software

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

sudo aptitude install lirc

During the installation process, select :

  • Receiver : Windows Media Center transceiver/remotes (all)
  • Transmitter : none

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

# irw
000000037ff07be9 00 Play mceusb
000000037ff07be9 01 Play 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.

That editing should be done as root.

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

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

4. TV reception

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.

4.1. DVB-T Adapter

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.

4.2. TVHeadEnd installation

TVHeadEnd author is providing a Debian cum Ubuntu repository.

So, we just need to de the repository and to install the package :

# echo "deb http://www.lonelycoder.com/debian hts main" | sudo tee -a /etc/apt/sources.list.d/tvheadend.list
# wget -q -O- http://www.lonelycoder.com/public.key | sudo apt-key add -
# 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.

Administration interface will then be available at http://127.0.0.1:9981/.

4.3. Channels configuration

From this interface, you will 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.

A typical TVHeadEnd configuration process is :

  1. Go to Configuration / TV adapters tab
  2. Select your DVB-T adapter
  3. Setup General / Add DVB network by location ...
  4. Check that multiplexex are properly detected
    ubuntu-xbmc-tvheadend-multiplexes
  5. In Services, uncheck the channels you don't want
  6. Click on General / Map DVB servoces to channels ...

Last thing to do is to allow streaming to any type of client. Before doing so, you won't be able to stream any channel to XBMC !

ubuntu-xbmc-tvheadend-access

Your TV channels are now ready for streaming.

4.4. Declare XBMC Video source

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

5. Suspend/Resume Configuration

5.1. Bios Configuration

First thing to do is to check in your BIOS that ACPI mode is set to S3.

Once done, just reboot.

5.2. MCE USB Remote

With new kernel, by default all USB ports should be enabled to handle wake-up :

# 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    *enabled   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

Even if USB ports are enabled, with the new 3.0 kernels, you need to enable the wake-up feature for your specific USB MCE remote device.

You can get your device caracteristics with a lsusb command :

# lsusb
...
Bus 002 Device 004: ID 0471:0815 Philips (or NXP) eHome Infrared Receiver

You need to declare a specific udev rule for your remote. This is done by creating the following file as root :

/etc/udev/rules.d/90-mcewakeup.rules

SUBSYSTEM=="usb", ATTRS{idVendor}=="0471", ATTRS{idProduct}=="0815" RUN+="/bin/sh -c 'echo enabled > /sys$env{DEVPATH}/../power/wakeup'"

5.3. TVHeadEnd daemon

While in the suspend process, you need to stop TvHeadEnd before unloading the DVB-T module. If you don't do so, the module will refuse to unload. As a result, the suspend process will hang.

You will then also need to do the opposite while being in the resume process, restarting TVHeadEnd daemon after the DVB-T module has been reloaded.

All these operations will be handled by the Power Management scripts. 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 /etc/pm/sleep.d/00_tv as root :

/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

5.4. DVB-T adapter

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 all these steps are done, you need to reboot your Revo 3610.

You should now 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.

When the Revo is suspended, the power light is slowly blinking.

You can resume your Revo 3610 straigth from your remote !

6. XBMC auto start

Once your configuration is fully operationnal, you can automatically startup XBMC at every login.

With this last step, XBMC will start at every boot without any user interaction.

After this step, you should not need any keyboard or mouse anymore.

Just launch Startup Applications and create a new item as follow :

 ubuntu-xbmc-startup

7. Disable Apport Error Reporting

Ubuntu 12.04 includes an error reporting system called Apport. It can send error information to Ubuntu center in case that something goes wrong on your system. It is enabled by default to help developers to get some valuable debug informations when a service or an application is crashing.

At this time, there are many reported issues caused with various reasons displaying an error message like "Sorry, Ubuntu 12.04 has experienced an internal error".

This error reporting is a very good thing but is asks a user acknowledgment every time it triggers. This is quite ennoying with a media center not supposed to provide any user input other than a remote control.

So, you can disable Apport by editing /etc/default/apport as root and setting enabled key to 0.

/etc/default/apport

...
enabled = 0

This will be operational at next boot.

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

Beware ! This setting really compromise your nettop security.
You should use it only if you are in a secure LAN environment.
This step is not at all compulsory, it's just to ease everyday's life. You can really live without it ...

If your HTPC does not need security, you can get Ubuntu stop nagging about its precious root-password.

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.

You are now ready to 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