We have had a HTPC as our main source of TV content since about 2006.  We started with MediaPortal but I couldn’t get that stable so we switched to Vista Media Center which does actually work quite well but I’ve always wanted to try to put Linux on our HTPC.  Below are my notes.

Current status - 14 Sept 2011 {#current-status—14-sept-2011 dir=”ltr”}

Cable worked but seems faulty. To get the system to boot with Dell 24” monitor, remove the GRAPHICS line in 2nd grub menu. Myth 0.24.1, XBMC-PVR and tvheadend are all installed. MythTV, for whatever reason, feels buggy, slow performance. XBMC-PVR plus tvheadend looks like it might work really well; but unfortunately time-shifting isn’t working yet. There’s a feature request here; and also check the XBMC-PVR devs on timeshifting (not sure if it will be implemented in XBMC or backend).  Let’s keep checking and come back to this solution when timeshifting is working. XMBR-PVR plus MythBackend might also be an option, but I can’t get that to work yet, and would have much slower channel changes than tvheadend.

Next steps {#next-steps dir=”ltr”}

  1. Wait for timeshift to be implemented in XBMC-PVR / tvheadend
  2. Fix Radio Times XML grabber in tvheadend (see below)
  3. ACPI switch off
  4. Try XBMC-PVR + Tvheadend (simple how-to)
  5. Fix overscan using modelines
  6. Try XBMC (see below).  But the priority for 2011 should probably be to get MythTV working well.  XBMC 11 (due end of 2011) should support MythTV a bit better (?)
  7. Check the logs when the system freezes


RadioTimes XMLTV grabber in tvheadend

Gave this error:


Make sure that the grabber is properly configured before saving configuration.


To configure manually execute the following command in a shell on the server:

$ /usr/bin/tv_grab_uk_rt –configure


Note: It is important to configure the grabber using the same userid as tvheadend since most grabbers save their configuration in the users home directory.


Grabber version: XMLTV module version 0.5.59 This is tv_grab_uk_rt version 1.331, 2010/11/19 11:31:00


Installing tvheadend {#installing-tvheadend dir=”ltr”}

  • stopped mythbackend using “sudo stop mythtv-backend”
  • installed tvheadend as per wiki instructions
  • user: username “tv”; password “gad…”

System Configuration {#system-configuration dir=”ltr”}

  • Networking: use “nm-connection-editor”. Give the system a static IP address. Set this IP address in the Myth backend setup


Myth backend Config {#myth-backend-config dir=”ltr”}

  • Video Sources
    • New Video source
    • Call it “RadioTimes”
    • Select Listings Grabber UK/IR RadioTimes (xmltv)
    • Check “Perform EIT scan”
    • Click “configure”
  • Input Connections
    • Bind both DVB cards to RadioTimes
    • Scan channels for just one card


Myth Frontend Config {#myth-frontend-config dir=”ltr”}

  • TV Settings
    • Playback
      • Action on playback exit: Save position and exit


HD freeview
I think I need a card capable of DVB-T2 to receive HD. Crystal palace does broadcast HD on DVB-T2.


Researching alternatives {#researching-alternatives dir=”ltr”}

Boxee {#boxee dir=”ltr”}

  • XBMC plus “social media” proprietry add-ons.
  • Apparently the iPlayer module doesn’t work ATM
  • No native PVR functionality.  Can be made to work with MythTV, although not sure which version?
  • Not sure I see the point.  XBMC has some social media functionality (see below)


XBMC {#xbmc dir=”ltr”}

XBMC does not have native PVR functionality.  Dharma 10.1 supports MythTV 0.23 NOT 0.24 (althought there appears to be a patch ). The XBMC “unified PVR” thing is due for proper release until XBMC 12 (due end of 2012). Maybe, just maybe, getting 10.1 to work with MythTV 0.24 will be as simple as swapping out the libcmyth file for the one in trunk.  Although some people do report that MythTV 0.24 + XBMC “unified PVR” functionality in trunk works.


Teaching XBMC to play DVB\

XBMC Wiki: HOW-TO watch TV in XBMC (aka XBMC-PV)


Using Myth backend {#using-myth-backend dir=”ltr”}

2 options: MythBoxscript (no live TV under 0.24 ATM) and XBMC’s Unified PVR frontend (under active development but is the future of PVR in XBMC):

  • XBMC Wiki: MythTV how-to
  • XBMC PVR Development forum
  • On 29th May, 2 Myth TV patches (1, 2) were pushed to the main git repo of XBMC.  I should try this before trying the repos from the PVR devs.
  • Best web backend of the 3, apparently
  • slowest channel change of the 3
  • most features and the most mature (although also very complex to setup).  Best scheduling features


tvheadend {#tvheadend dir=”ltr”}



The Video Disk Recorder {#the-video-disk-recorder dir=”ltr”}


  • Stable, apparently
  • No built-in commercial skipping
  • Lots of the documentation is in German, apparently


May 2011 attempt {#may-2011-attempt dir=”ltr”}

Thoughts on how to install from fresh: {#thoughts-on-how-to-install-from-fresh dir=”ltr”}

  1. Install MythBuntu 11.04 (using a VGA monitor)
  2. Install Kernel 2.6.37 (download from Kernel.org and then followthese instructions, make sure lirc_mceusb AKA ir_mceusb and lirc_dev are enabled as modules)
  3. Install latest Radeon X11 open source driver and to the xrandr stuff mentioned below
  4. Install the Cinergy Card as discussed below
  5. Configure MythTV
    1. I can’t get RadioTimes to work so I’ve gone with Over The Air, although OTA only seems to provide 1 week in advance and little info about repeats etc.  Beeb XML might work.


Getting X to start after upgrading to 11.04 {#getting-x-to-start-after-upgrading-to-11.04 dir=”ltr”}

X wouldn’t start (the system booted straight to the terminal login and gave lots of errors about EDID).  I fixed this by installing the latest Radeon X11 open source driver.  


Making the cable {#making-the-cable dir=”ltr”}

I built a cable as per jwexqm, including the simple transistor circuit to composite vsync and hsync into a single composite sync(source 1, source 2), and a 3v battery on pins 16 and 18 of the SCART.  (I originally thought my ATI R390 could do composite sync on its own but then I noticed a message in dmesg saying “composite sync not supported”)  I used thick 75 ohm cable and this was a right PITA.  Apparently shielded CAT5 works very well and is far easier to solder.  

A more detailed cable construction guide is available, and a Linux program for calculating modelines are available but I didn’t really need either.


xrandr {#xrandr dir=”ltr”}

To do xrandr over ssh:


xrandr -d :0.0 –newmode “768x576pali” 14.76 768 789 858 944 576 580 583 625 -hsync -vsync interlace


xrandr -d :0.0 –addmode VGA-0 768x576pali


xrandr -d :0.0 –output VGA-0 –mode 768x576pali


To make these changes persistent, edit /etc/gdm/Init/Default and put the above 3 lines before /sbin/initctl -q emit login-session-start DISPLAY_MANAGER=gdm


Cinergy Card {#cinergy-card dir=”ltr”}

The driver appears to NOT work with 2.6.38 because that’s when V4L1 was completely removed in favour of V4L2 which I’m guessing the ngene driver does not support (there has been some discussion of this on the German forum so there’s a chance someone will get round to fixing the driver).  Ubuntu 11.04 comes with 2.6.38 so it’s necessary to either install a previous version of Ubuntu or downgrade the kernel.

Once Kernel 2.6.37 is installed, I think all that is necessary is to download the ngene.tar.gzfile (from page 4 of the forum) and untar, and then:

  • make
  • sudo make install
  • sudo depmod -a
  • sudo modprobe ngene


Then do lspci -vvvnn to see if the module has loaded


Installing a new kernel {#installing-a-new-kernel dir=”ltr”}

Install Kernel 2.6.37 (download from Kernel.org and then followthese instructions, make sure lirc_mceusb AKA ir_mceusb and lirc_dev are enabled as modules).  Make sure you read the section titled “Using Ubuntu Kernel Config” first. I didn’t do this so it’s not essential but probably is a good idea.

Use the program startupmanager to configure grub.

There is a ppa:kernel-ppa/ppa but I think that only provides the latest kernels for your distribution rather than previous kernels.


Required Kernel modules {#required-kernel-modules dir=”ltr”}

lirc_mceusb AKA ir_mceusb (search for mceusb)   ←- my 2.6.37 is missing this module!


IR {#ir dir=”ltr”}

Remote is Windows Media Center Transeiver
MythTV uses LIRC (Linux Infrared Remote Control) which requires irc_mceusb AKA ir_mceusb and lirc_dev  kernel modules.  LIRC should be installed automatically.  There is some mention of LIRC in MythTV Front End’s log and Xorg.0.log.  Here’s how to test the IR system.


DisplaySize {#displaysize dir=”ltr”}

Trying to get MythTV to understand that our TV is 16:9.  As per this, I first did the following:


jack@jack-htpc:~$ cat /usr/share/X11/xorg.conf.d/05-monitor.conf

Section “Monitor”

    Identifier  ”<default monitor>”

# For 1280x720 at 100dpi  (16:9)

    DisplaySize  325 182 # in millimeters



Xorg swallows this (according to the logs) but it makes no difference.  So I found that in the Appearance tab of Myth Front End, it’s possible to ask it to use separate modes for GUI and Video and here you can set it to 16:9.


Loading Videos {#loading-videos dir=”ltr”}



Things to record {#things-to-record dir=”ltr”}

  • Inside the Human Body
  • Grand Designs
  • Family Guy
  • Misbehaving Mums
  • The Apprentice
  • The Apprentice You’re Fired
  • Brother and Sisters
  • Ugly Betty
  • Outnumbered
  • The Graham Norton Show
  • Doctor Who
  • The Sky At Night


old notes… {#old-notes… dir=”ltr”}


Things to try:

  • Build a prototype, see here for modelines
  • a DVI-I to RGB component cable (TVCables, open again on 4th Jan) or this (also open 4th Jan); the MythTV wiki page says my card should work with Radeon drivers:
  • get the legacy driver to install (use an old version of Ubuntu if necessary) but this probably wont support standby very well?
  • buy a card which works!


TV-out not working is a known bug: https://bugs.freedesktop.org/show_bug.cgi?id=21948

I’ve also started a thread on ubuntu’s forum: http://ubuntuforums.org/showthread.php?p=10258386#post10258386

I’ve tried installing the latest kernel but that didn’t help


Notes {#notes dir=”ltr”}

If I go the nVidia route: http://www.x.org/wiki/NVIDIAProprietaryDriver

wouldn’t boot so added clocksource=jiffies to boot (source)


Remote is Windows Media Center Transeiver

it may be necessary to chroot into the newly installed system to add clocksource=jiffies to grub2’s startup config

ssh into the machine and do:
sudo apt-get update
sudo apt-get upgrade

Start the machine without a VGA monitor installed!

ATI Video drivers

  • OpenGL works with Open source drivers, doesn’t seem to work with either 10.2 or 9.3 closed source
  • I don’t think component works at all with open source drivers (it does work ok with closed-source, although it stutters on playback)


Proprietary drivers\

Installing AMD closed-source drivers, Component out, HD576i

Install the AMD/ATIdrivers 9.3 (the x1250 is a legacy product and so isn’t supported on the latest drivers) and then follow the instructions on: Unofficial ATI Ubuntu wiki(may need to uninstall first as shown here) (install with –buildpkg Ubuntu/9.04

May have to do a sudo apt-get -f install to sort out dependencies from old ATI driver

Also have to comment out “driver “fglrx”” in /etc/X11/xorg.conf

ATI open source drivers
(the open source drivers

Can’t yet get it to work.  Things to try:

  • find exact timings windows uses and add them to linux using xrandr
  • using KMS does work with xrandr, just need to use these commands:
    • $ xrandr –output S-video –set “tv standard” pal
    • $ xrandr –output S-video –same-as DVI-0
    • $ xrandr –addmode S-video 800x600
    • $ xrandr –output S-video –mode 800x600
  • Useful commands:
    • xrandr -q –verbose
    • xrandr –props
    • lspci -vvv
    • cat /var/log/Xorg.0.log
    • sudo emacs /etc/default/grub
      • sudo update-grub



To stop X:
sudo /etc/init.d/gdm stop


Cinergy TV card {#cinergy-tv-card dir=”ltr”}


This driver for the Cinergy card seems to work

install firmware 1.5 for TV tuner card as per http://www.linuxtv.org/wiki/index.php/Media-Pointer_MP-S2%C2%B2#Firmware


  • install V4B-DVB as per http://linuxtv.org/wiki/index.php/How_to_Obtain,_Build_and_Install_V4L-DVB_Device_Drivers
  • sudo apt-get install linux-source patchutils git libncurses5-dev
  • to get the media tree: git clone git://linuxtv.org/media_tree.git
  • then, in media_build/ do make tar DIR=../../media_tree
  • if this fails, edit media_build/Makefile and comment out the offending file(s)
  • edit v4l/KConfig and add two spaces after the tab on line 1512 (Add…)
  • edit v4l/.config and set to N any buggy modules


things to try:

  • Look in the Kernel - is CONFIG_DVB_NGENE=m ?  (see here)
  • Investigate “It has been confirmed that the Original driver ([2]) does work also for TerraTec Cinergy 2400i DVB-T (confirmed on OpenSuse 11.2 64b after few minor corrections due to API changes in kernel 2.6.31). Based on the README in the package it should support these cards: “
  • Try a new Kernel?