Setting up a mediacenter with xbmc and mythtv on ubuntu natty (11.04)

4 minutters læsning

Setting up a mediacenter in Ubuntu is not neccessarily a Plug’n’Play experience. You need to dig hard in Google to make everything work. Here are my notes for setting up a mediacenter. I bought the following hardware at when we were still on Ubuntu 9.04. They were helpful giving advice. However, the keyboard, wireless module and the remote control was not working properly, and the tv-tuner was hard to setup. Luckily that is much easier in Ubuntu 11.04 Natty.


  • Shuttle XPC X106G
  • Shuttle, RC118 remote control
  • Anysee E30 Combo Plus tv-tuner card
  • Wireless module
  • Mini bluetooth keyboard


  • Ubuntu Natty 11.04
  • XBMC 10.10 (installed via maverick ppa as there is no official release for XBMC for Natty yet)
  • Mythtv 0.24
  • MySql, PHP, phpmyadmin

Install software on Ubuntu Natty 11.04

First I installed all the software on the box and that worked farily well.

  • Tv-tuner. The Anysee E30 Combo Plus tv-tuner card would not recognize which mode to start in, when it was plugged in on boot. It would start in DVB-T even though I needed it to start in DVB-C. After a lot of digging through a lot of internet posts, I found this post about Anysee E30 Combo startup mode.
  • Wireless. The wireless network worked right out of the box in Natty. On earlier versions I had a lot of trouble with it.
  • Remote. The remote seemed to work right out of the box. However, only a few buttons did. I installed lirc and that made all the buttons work.
  • Keyboard. I actually got this working following the command line guide for bluetooth setup for Ubuntu 11.04.

System settings in Ubuntu Natty 11.04

Under system settings for Ubuntu, I did some additional things to make my user experience better.

  • Login automatically. I enabled automatic login for my preferred user. You can make the setting under Login Screen.
  • Screensaver should not lock. I made sure that the screensaver does not lock. The setting is under Screensaver.
  • Disabled ubuntu sound. I do not want sounds on startup etc. You can disable all sounds under Sounds.
  • Automatically startup mythwelcome. Under Startup Applications I added mythwelcome as the command and I have disabled automatic start of the frontend.

Setting up mythtv (0.24)

Finding channels. I could nt get mythtv to automatically scan for channels, as the channel tuning for my provider was broken. Luckily an internet search showed me this guide on howto fix it when channel tuning is broken with dvb-c, so I just followed their guide.

Integrating XMLTV for the program guide. To make the most of mythtv, you need to integrate your channels with xmltv. However, the standard grabber for Danish tv does not work. I settled on using the DR 2009 grabber instead by following this guide. After I configured the grabber, I fetched the xmltv. However, with mythtv you also need a way to connect the data, so you need to edit the xmltvid for your channels. You can do that using phpmyadmin. The channel table is in the database mythconverg and you can find the xmltvid in the grabbed xmltv-file. After that I created the following bash script, which I put int o my cron tabs so the database is updated automatically once a day.

<pre type="shell">#!/bin/sh
# Checks whether the box can be shutdown

IS_XBMC_RUNNING=$(pgrep xbmc)
mythshutdown --check

if [ $MYTHSTATUS -ne 0 ]; then
  echo 'Myth is NOT idle'
  exit 1
  echo 'Myth is idle'

if [ -z "$IS_XBMC_RUNNING" ]; then
  echo 'XBMC is NOT running'
  exit 0
  echo 'XBMC is running'
  exit 1
<pre type="shell">#!/bin/sh
# Automatically grabs program information and fills it into mythtv db

tv_grab_dk_dr_2009 --output $XMLTV_FILE
mythfilldatabase --file 1 $XMLTV_FILE
mythbackend --resched

<![CDATA[// ><!]]> Getting the remote to work. Even though the remote worked in XBMC, it did not work in Mythtv. However, I looked at the console output for mythwelcome, and saw that a .lircrc file was missing. I just copied the example from this post to my homefolder, and the remote started working.

Setting up XBMC (10.10)

I have heard a lot of really good things about XBMC, but you could also just use mythtv as your primary media center (you might want to make sure you got some nicer themes though). Setting up XBMC was a breeze.

  • Add mythbox. I added the video add on mythbox which works very well as a frontend for mythtv. All that is missing in the current version is that Live TV is not supported, which is not an issue for me. You need the mythtv password for setting up the connection.
  • Add plugins. I added a lot of different plugins, e.g. TED Talks, Picasa, Flickr and so on, and they work great.
  • Configured remote control. I changed how the power button works in remote.xml. On my ubuntu system I found it using locate remote.xml and changed XBMC.Shutdown() to XBMC.Quit().

Problems persists

  • Keyboard glitches. Seems that my keyboard randomly uses English or Danish Layout. That is fairly annoying.
  • Shutdown not fool proof. I want to make sure that the system is not just shutdown. For that to work, I need to find out how the unity shutdown function and the XBMC shutdown function can map to mythshutdown instead. I also need to make sure that the shutdown function on the remote does not just send a HALT signal to the box.

That was basically it. How have you configured your media center using mythtv and xbmc?

Skriv en kommentar

Din e-mail bliver ikke offentliggjort. Obligatoriske felter er markeret *