OpenELEC 4.0 Released (XBMC 13.0)

With the release of OpenELEC 4.0, XBMC 13 (Gotham) is now available!  For those of us driving a media center with a Raspberry Pi, this is great news (there’s significant performance improvements on the RPI).

Anyhow, it turns out that the upgrade process from OpenELEC 3.x is extremely simple.  Just extract the downloaded package, and in the target folder you’ll find four files – KERNEL, KERNEL.md5, SYSTEM, and SYSTEM.md5 .   Using Windows Explorer, browse to your media center (eg, \\mediacenter), and drop those files into the upgrade folder.  Reboot the media center, and it automatically upgrades.

On mine, there were a few PVR addons that enabled themselves I didn’t want, so I just disabled them and rebooted again, and all appears fine.

Recordings Purge Script for MythTV

Edit 25th Feb:  Discovered a bug in the logic, apparently UNION order isn’t guaranteed.  Reworked the script so it does the right thing now.

I’ve now converted my prior HTPC setup over to using an HDHomeRun and MythTV on my Microserver.  The former MediaPortal box now runs exclusively OpenElec XBMC.  Anyway, MythTV has a proper database backend and a set of Python/Perl bindings, which is great for customization.

I have a pretty specific want for my recording schedules, which ARGUS (on MediaPortal) wasn’t able to do, and which MythTV is not quite able to do.  Namely, I want to record a certain number of a specific series, and then only record more of them if they get watched.  The oldest watched episode should be discarded to make room, so you always maintain N episodes that are unwatched, but you don’t record new episodes if you already have N episodes unwatched.

MythTV’s native “Expire old and record new” functionality does not do this (it will keep recording episodes to maintain N new episodes, overwriting older episodes even if unwatched with new ones).  The “Auto-expire” functionality won’t do this (it will only delete episodes if running out of disk space).

Enter the following script.  Yes, the SQL query is freakin’ huge.

#!/usr/bin/python -W ignore::DeprecationWarning
# Purges watched episodes from schedules so that new episodes can be
# recorded
# Only purges the oldest watched recording, and only if the schedule
# wouldn't record because it's reached the maximum episodes
# I'm terrible at Python.

from MythTV import MythDB, Recorded
import sys
import MySQLdb

db = MythDB()

cur = db.cursor()

# Fetch all candidate recording ids
      COUNT(recorded.basename) AS count
      AND record.inactive=0
      AND record.maxnewest=0
      AND record.recordid = recorded.recordid
      AND NOT recorded.recgroup = 'LiveTV'
      AND NOT recorded.recgroup = 'Deleted'
      AND recorded.preserve = 0
      AND recorded.autoexpire = 1
  ) AS candidates
  candidates.maxepisodes <= candidates.count

for record in cur.fetchall() :
        cur2 = db.cursor();
                  -- Subselect fully watched episodes
                    1 AS deletepriority
                    recorded AS b
                    b.recordid = ?
                    AND b.preserve=0
                    AND b.autoexpire=1
                    AND b.watched=1
                    AND NOT b.recgroup = 'LiveTV'
                    AND NOT b.recgroup = 'Deleted'
                  -- End of watched episodes
                  ) UNION (
                  -- Subselect bookmarked episodes
                    2 AS deletepriority
                    recorded as c,
                    recordedmarkup as d
                    c.recordid = ?
                    AND c.preserve=0
                    AND c.autoexpire=1
                    AND c.watched=0
                    AND NOT c.recgroup = 'LiveTV'
                    AND NOT c.recgroup = 'Deleted'
                    AND d.chanid = c.chanid
                    AND d.starttime = c.starttime
                    AND d.type = 2
                  -- End of bookmarked episodes
                ) AS e
                ORDER BY
                LIMIT 1
        """, (record[0], record[0]))
        for row in cur2.fetchall() :
                print row[0] + " : " + row[1] + " (" + row[2] + ") [" + str(row[3]) + "]"
                recs = list(db.searchRecorded(basename=row[2]))
                if len(recs) == 0:
                        print '  error - could not find episode by basename!'
                for rec in recs:

I’ll break down what this does.

  • For each active autoexpirable recording schedule, see if the number of autoexpirable, nonpreserved, nondeleted recordings exceeds or matches the maximum number of allowable recordings.
  • For each of those schedules, find the oldest fully watched or bookmarked, nonpreserved, autoexpirable, nondeleted recording and delete it.

If you put this in crontab to run once a day, you’ll find that each of your schedules will do what I outlined above.

The great thing about this is that it allows you to set up recording schedules for anything (where you don’t care about episode order) that looks vaguely interesting, set an appropriate maximum (5 or so), and it’ll only keep recording them if they’re actually getting watched.

This is the functionality I want for children’s television, and now I’ve got it.

ARGUS-TV 2.1 with Shepherd for EPG

If you’re having trouble with the new ARGUS TV plugin messing up your EPG by it being off by an amount equal to your timezone, this can be corrected by running the following;

tv_grab_au --component-set augment_timezone:timeoffset=Auto

Once that’s run, when you go to fetch your EPG, do this instead;

env TZ="Australia/Adelaide" tv_grab_au

Assuming you’re in Adelaide, of course.  Substitute with whatever timezone is appropriate.  That forces Shepherd to embed your timezone into the XML timestamps, which makes ARGUS work properly again.  Otherwise Shepherd uses local time for its timestamps, whereas because no timezone is specified ARGUS assumes they’re in UTC, causing everything to be off by your timezone offset.

MKV Video Conversion with AVIDEMUX

I’ve been spending way too much time today engaging in epic battle with Avidemux (a good tool, although I’m pretty angry at it right now) trying to get it to convert videos into a specific format, from the command line.  Anyway, I finally figured it out.

What I wanted was to get it to do the conversion from the command line so I can run it in a batch fashion.  I wanted the output video to be exactly X264 AVC (which is MPEG4 Part 10 I believe), with AC3 audio, and in an MKV container.  This format is required so that it will work with everything I have, ie;

  • MediaPortal
  • XBMC
  • Windows Media Player
  • VideoRedo

VideoRedo is unbelievably fussy about what it will accept, and only the above combination seems to work with everything. Well, straight MPEG-2 works as well, but that’s huge.

You’d think that doing the above would be easy.  Anyway, it’s really not.  But now I’ve nutted it out, it will be in the future…

Create a new file, named .  Put this somewhere you can get at.  The contents are;

#PY  #--automatically built--

adm = Avidemux()
adm.videoCodec("x264", "general.params=CQ=10", "general.threads=99", "general.fast_first_pass=True", "level=31", "vui.sar_height=1", "vui.sar_width=1", "MaxRefFrames=2", "MinIdr=100", "MaxIdr=500", "i_scenecut_threshold=40", "MaxBFrame=2", "i_bframe_adaptive=0", "i_bframe_bias=0", "i_bframe_pyramid=0", "b_deblocking_filter=False", "i_deblocking_filter_alphac0=0", "i_deblocking_filter_beta=0", "cabac=True", "interlaced=False", "analyze.b_8x8=True", "analyze.b_i4x4=False" , "analyze.b_i8x8=False", "analyze.b_p8x8=False", "analyze.b_p16x16=False", "analyze.b_b16x16=False", "analyze.weighted_pred=0", "analyze.weighted_bipred=False", "analyze.direct_mv_pred=0", "analyze.chroma_offset=0", "analyze.me_method=0", "analyze.mv_range=16", "analyze.subpel_refine=7", "analyze.chroma_me=False", "analyze.mixed_references=False", "analyze.trellis=1", "analyze.psy_rd=0.000000", "analyze.psy_trellis=0.000000", "analyze.fast_pskip=True", "analyze.dct_decimate=False", "analyze.noise_reduction=0", "analyze.psy=True" , "analyze.intra_luma=21", "analyze.inter_luma=21", "ratecontrol.rc_method=0", "ratecontrol.qp_constant=0", "ratecontrol.qp_min=0", "ratecontrol.qp_max=0", "ratecontrol.qp_step=0", "ratecontrol.bitrate=0", "ratecontrol.vbv_max_bitrate=0", "ratecontrol.vbv_buffer_size=0", "ratecontrol.vbv_buffer_init=0", "ratecontrol.ip_factor=0.000000", "ratecontrol.pb_factor=0.000000", "ratecontrol.aq_mode=0", "ratecontrol.aq_strength=0.000000", "ratecontrol.mb_tree=False", "ratecontrol.lookahead=0")
adm.audioCodec(0, "Aften")
;adm.audioSetDrc(0, 0)
adm.audioSetShift(0, 0,0)
adm.setContainer("MKV", "forceDisplayWidth=False", "displayWidth=1280")

Now create a new Powershell script somewhere.  Replace the reference to and avidemux_cli.exe to point to the appropriate paths on your system;

# Converts a video file to the following format:
# Video Codec:  x264 AVC (MPEG4 Part 10)
# Audio Codec:  AC3
# Container: MKV

  [string]$profile = "c:\util\",

begin {
  if (! $target) {
    write-error "Fatal:  Must provide target folder!"

process {
  $file = $_
  if ($_ -and $target) {
    $sourcename = $file.FullName
    $targetname = (Get-Item $target).FullName + "\" + $file.BaseName + ".mkv"
    c:\util\avidemux\avidemux_cli.exe --load "$sourcename" --run "$profile" --save "$targetname" --quit

end { }

Now that’s done, you can process a whole bunch of AVI’s in the current folder to the folder D:\Scratch like this;

dir *.avi | makemkv.ps1 -target D:\Scratch
And you’re done.  Phew.

Raspberry Pi and Argus TV/MediaPortal

I recently set up my Raspberry Pi so that I could watch TV and videos from my MediaPortal media center.
I wanted to do this because I previously had an old laptop in the bedroom for that purpose, and it was noisy.  The RPI offers absolute silence, no moving parts, and very low power consumption.
In order to do this, a bit of hardware is required…
EDIT – I’ve since adjusted things so that I’m now using OpenElec on the RPi, and things are much better.  The experience on OpenElec is really good.

Parts List

  • A Raspberry Pi.  Mine’s the release version with 256Mb of RAM.  A case for it would be a good idea.
  • A 2Gb SD card to run RaspBMCOpenElec
  • A MPEG-2 license code from the Raspberry Pi store.  I really strongly recommend you have this, MPEG-2 playback will be balls without it (which is pretty much all live TV and recorded content).
  • A powered USB hub. The RPI can only sink a small amount of current, which is easily exceeded.
  • A micro USB cable to power the RPI from the hub.
  • A cable to connect the RPI’s USB ports to the hub.
  • A RC6 compatible media center remote and receiver. A suitable type will run for under $20 on eBay.
  • A monitor with DVI or HDMI inputs.  If you are using DVI you will need a HDMI-to-DVI cable.
  • A set of analog speakers or your monitor to support audio over HDMI.
  • A network point. I’m using a TL-PA411 Ethernet-over-power setup since I didn’t want to run a CAT5 cable across the room.
Anyway, a breakdown of the special software/hardware components follows;

The USB Hub

The RPI can only sink a very low amount of current through its USB ports.  If you draw too much current, it typically manifests itself as lockups on the RPI at random times.  Running any USB devices through a proper powered hub avoids this.  And you can power the RPI itself from the powered hub, meaning you only need one power adapter.

The Remote Control

You can find an appropriate remote control on eBay for about $20.  The model displayed above is an HP Media Center remote control, and it conforms to the RC6 protocol standard.  This type of remote will ‘just work’ with RaspBMC OpenElec, no configuration required.  It also has an IR Blaster to control a TV, but I don’t about configuring that.


RaspBMC is a distribution of XBMC compiled specifically to run on a Raspberry Pi.  Go to and get the Windows installer, and follow the instructions.  Installation is very straightforward, and then you should have a booting Raspberry Pi with XBMC on it.

If you have a MPEG-2 license (VERY STRONGLY RECOMMENDED) for your RPI, you can enter it into the RaspBMC configuration page once you’ve installed.


OpenElec is a distribution of XBMC which is intended for use on appliances.  It’s a full distribution, including all the plugins you’d want.  Installation is straightforward.  You’re really going to need a Linux box of some type to do this easily, for those of you without access to a Linux box, go and download something like Knoppix and run it off a CD.

You can get an install guide for OpenElec on a Raspberry Pi at the OpenElec Wiki.  It’s strongly recommended that you go to the Raspberry Pi store and buy an MPEG 2 license for your RPI.  In order to set up that license, follow the overclocking guide at this link, and insert the key into your config.txt.

Note that you can safely enter in the overclocking settings in config.txt which correspond to the first step of overclock.  That will give the same default level of overclock that you get with RaspBMC.  Be cautious though.

ARGUS TV / ForTheRecord

As discussed earlier, I use MediaPortal for a media center.  MP does the TV recordings, but LiveTV, Scheduling and watching recordings are all handled by ARGUS TV (formerly known as ForTheRecord).  In order to be able to watch live TV with RaspBMC OpenElec using this setup, you need to use the ForTheRecord (or ARGUS TV) plugin in RaspBMC OpenElec.

Configuration of the plugin is straightforward.  Go to System->Settings->LiveTV, and enable LiveTV.  Then go to System->Settings->Addons, and enable the ForTheRecord plugin under PVR Clients.  Be aware that you should turn the timeouts up a fair bit, the RPI is slow.

Yes, yes, but how well does it work?

It’s ok.  The RPI is quite sluggish when it comes to navigation in RaspBMC and when changing channels.  Skipping ahead on a recording results in horrible artifacts until the next i-frame is reached (which may be up to 10 seconds).  However, it plays most things without complaint, can just be turned off when you’re done with it, and is silent, small and cheap.

The experience with OpenElec is markedly better than with RaspBMC.  It’s not going to break any performance records, but it plays media fine, with no artifacting on skipping.  Skipping is sluggish, but acceptable.  Pretty decent for something so cheap and low power.

MediaPortal Screen Tearing

Lately I’ve been having an issue where MediaPortal playback is choppy and suffers from screen tearing.  It turns out this happens when the Windows 7 Aero theme gets turned off.  I’m not sure why it’s getting turned off sometimes, but at any rate you can force it on through the guide here;

I’ve applied this on my Media Center.  We’ll have to see if it does the job.

Media Center Comparisons

I’ve either tested or used for an extended period of time several different media center products for the PC, so I thought I’d write some opinions I have about each one of them.  Take this with a grain of salt, since everyone’s requirements and aesthetic tastes are different.

For each media center product, I’ve included a few plugins or other software that I’ve considered mandatory to the product.

Windows 7 Media Center
URL:  Built into Windows 7 Ultimate Edition
O/S:  Windows 7 32-bit
Plugins:  MediaBrowser, DVRMS Toolbox, ShowAnalyzer

The default Media Center product you’ll have available when using Windows 7.  Functional and fairly reliable, WMC7 is pretty low on the feature list out of the box.  I used this for a long time, and it was easy to work.

Unfortunately though, it’s not very configurable, and you’ll need a lot of plugins to get it working properly.  MediaBrowser is an excellent product for organizing your movies and TV series and downloading fanart / covers / other metadata for them.  DVRMStoolbox & ShowAnalyzer are pretty much mandatory to get commercial skipping working.

One significant con with using WMC7 is that it by default records everything in the proprietary WTV format, which not a lot of commercial analyzers and video editors can actually read.  You can convert from WTV to other formats using Microsoft’s wtvconvert utility, but it would be nice for it to just record in mpeg or something instead.

You can connect Media Extender appliances and XBOX360/PS3’s to a WMC7 install, but you cannot connect another Windows PC to a WMC7 install for watching live tv.  You can however share all the folders that you have media in and just point your second PC at it, but it’s not very optimal.

You can use the over-the-air EPG with WMC7, but it’s not advised.  You pretty much have to use IceTV in Australia, which provides a good quality EPG for use, along with a plugin that allows you to set recordings via the IceTV website.

The big catch with IceTV is that they only set the program start/end times on the quarter-hour boundaries, which means that you will need to set a fairly lengthy pre-record and post-record time to make sure you actually catch all of your shows.  Other than that, IceTV is good, but expensive.

XBox Media Center
O/S:  Windows 7 32-bit (and others)

XBMC is a good looking media player.  I discounted it very early in the piece because it can’t utilize TV tuners to do recording.  It’s only for playback.

O/S:  Fedora 16 64-bit
EPG:  Shepherd

Full-featured Linux-based media center solution.  Looks great with the Mythbuntu theme, and comes with grabbers to fetch TV show and movie metadata and such.  It also acts in a backend/frontend architecture, so you can run multiple frontends on different PCs to watch live TV from multiple places – something you can’t do with Windows Media Center.

The Shepherd EPG only runs on Linux and is a scraper to derive EPG data direct from the providers.  It’s free, and it tends to have much more precise timing than IceTV does.

A major point in MythTV’s favor is that it has an extremely detailed scheduling system.  You can set schedules according to some pretty complex search criteria and such in order to get exactly what you want.  It also provides a web interface direct to your MythTV box for reviewing the EPG and setting recordings, which is very, very handy.  It also makes its recordings in plain MPEG-2 format, for easy editing.

The main issues that I had with MythTV is that the nvidia driver I have was very poor at dealing with corruption in the incoming video signal (resulting in a storm of blockiness with any issues), and that the drivers for the USB tuners I have frequently would break on coming out of sleep, resulting in loss of tuners.  I also had some other issues that were hardware related, but I won’t hold that against MythTV.

O/S:  Windows 7 32-bit (and others)
EPG:  IceTV or Shepherd (with work!)
Plugins:  MP-TVseries, Moving Pictures, ForTheRecord, ComSkip

MediaPortal is a competitor for XBMC and WMC7, and is quite popular.  It’s come a long way in the last few years since I tried it last.  The default skin looks good, and it also works in a front-end / back-end architecture.  You can run multiple frontends by installing the MediaPortal client on other PCs and watch live TV through your HTPC.

By default it’s pretty plain, but with the addition of a few plugins you can get all the functionality you need pretty easily.  The default over-the-air EPG is as usually pretty terrible, but you have the ability to use IceTV (with no IceTV Interactive functionality!).  Or, with some trickery it’s possible to use Shepherd if you have a Linux box around (hello, HP Microserver) to do the grabbing for you and generate the appropriate xmltv output to go into MediaPortal.

MP-TVseries and Moving Pictures are compementary plugins to organize your TV shows and movies and fetch metadata / art for them.  They work well out of the box, although you may have to play with the naming of your media a bit to make them work 100% properly.  I haven’t figured out how to get MP-TVseries and Moving Pictures working on a remote client yet.

ComSkip is a common commercial analyzer.  Since MP records in plain MPEG-2 Transport Stream (.ts) format, ComSkip can analyze it just fine for commercials.  Get a good INI file for it.

ForTheRecord is a plugin replacement for MediaPortal’s default scheduler.  It makes the scheduler vastly more powerful, and also provides a remote administration tool for setting up recordings and reading the EPG.  You’ll have to find some way to drop your EPG tvguide.xml into ForTheRecord’s XMLTV folder for it to actually read it in though (more on that later.  With FTR in place, MP’s scheduling capabilities rival MythTV’s.


With the exclusion of XBMC (ruled out because it can’t record), all three solutions will work as a media center.  Currently I’m using MediaPortal, and I really like it how I can run a remote MediaPortal client on Windows PCs to watch live TV – something you can’t do with Windows Media Center.

Windows Media Center has some advantages in easy of setup and use, however.  MythTV has advantages in customizability and cost (no Windows license required!).  But WMC uses a proprietary .WTV format, and MythTV has some issues with Linux device drivers.

MythTV – Aborted. Back to Windows.

Well, I gave MythTV a good go, but in the end I had to ditch it.  I had endless problems getting my USB tuners to come back up reliably after sleep, and I also had some strange crashes and other issues.

For reasons that anyone with a wife and small children will understand, it’s a high-severity incident of the worst degree when your media center keels over for some reason in the middle of the day just before nap time.  So, back to Windows.
Anyway, I had a few adventures with that – my first Windows install corrupted itself and died after a week, which wound out being because of some bad RAM installed in the HTPC box.  Removed that and rebuilt it again, and it appears OK.  What’s notable is that I had that RAM installed when I was running Fedora, which makes me think that perhaps all the problems I was having with MythTV were actually the bad RAM all along…
Currently, I’m running with MediaPortal instead of Windows 7 Media Center, on Windows 7 32-bit.  I’ve also done some cleverness with Shepherd so that I’m able to use the Shepherd EPG on Windows (details to follow).
Installation and setup is pretty straightforward for Windows running a Media Center.  I’ll give more detail in following posts, but what you’ll need is this;
  • Windows 7 32-bit (64-bit will work too, but it’s a bit more complicated with codec setup)
  • Shark007’s codec pack (contains all the codecs you’ll need)
  • UltraVNC (for remote management)
  • Microsoft Hotfix KB977178 (fixes problems with large hard drives vanishing on resume from sleep)
After installation, set the following registry keys;

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management\LargeSystemCache = 1 

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\LanmanServer\Parameters\Size = 3

This prevents issues with nonpaged pool exhaustion on Windows 7 when running a media center.  You may also want to look at TweakPrefetch, but SuperFetch is a lot less obtrusive on Win7 compared to Vista, so your mileage may vary.
Anyway, I’ll write up a brief comparison of four different media center types shortly.  It’s a shame to have gotten rid of MythTV since it provided a lot of great features, but I couldn’t have my tuners randomly not coming back up when resuming from sleep.

MythTV – Teething Problems

As discussed earlier, I’ve been rebuilding my Media Center with MythTV running on Fedora 15.  I’ve been having a number of … issues … with it.  Fortunately I’ve gotten a lot of them finally nailed down.

Tuner Issues

I had two Hauppauge HVR-2200 tuners.  One of them just flat out didn’t work, and the other worked, but the second tuner on it was frequently poor.  I’ve since pulled them both out and intend on putting them into my Windows main PC the next time I have it out to see if they work.

I’ve replaced them with a Leadtek WinFast DTV Dongle Gold and a Leadtek WinFast DTV2000DS.  The Gold is a USB key-format DVB-T tuner (single tuner), and the DTV2000DS is a PCI dual-tuner.

The Gold just worked.  And so did the DTV2000DS, for that matter.  The DTV2000DS interestingly enough is actually a dual USB tuner built onto a PCI to USB bridge.  Annoyingly though, the two tuners are completely indistinguishable to udev, resulting in an inability for udev to make distinct adapters for them.  A solution for this when I come up with one.

Anyway, I had a number of difficulties with them.  Primarily sometimes on powerup the second tuner doesn’t work, or it randomly stops working.  What I’ve done is to add this to /etc/rc.d/rc.local;

echo -n -1 > /sys/module/usbcore/parameters/autosuspend

This prevents the kernel suspending power to the USB ports, which apparently causes issues with these tuners.  Secondly, in a bid to make it work consistently, I also added the following to a new file /etc/modprobe.d/tda18271.conf;

options tda18271 cal=0

This disables radio calibration on module load for the tuners.  My suspicion is that radio calibration was throwing the tuners off when the modules are loading.  This may be bunk, but so far it works.

Lastly, I’ve also discovered a way to test the tuners from the command line.  I’m considering adding this to the bootup procedure so that I can verify that all three tuners are fully operational before letting MythTV use them – to prevent instances of a recording being made that’s garbage.

Fedora 16 Upgrade

In my bid to try and get all the tuners working properly (the other issue I had was the second tuner on the DTV2000DS suddenly stop working and not work again), I upgraded my MythTV box to Fedora 16.  This was actually pretty painless, except for one really big gotcha.

Fedora 15 Mythbackend runs as root.  Fedora 16 Mythbackend runs as mythtv.  This means that you won’t have write access to the spooler drive, and it basically breaks Myth.  Until I get around to fully fixing up the permissions, I’ve changed /lib/systemd/mythbackend.service to run as mythtv.

Sleep / Hibernation

I have a number of issues trying to get sleep/hibernate working.  If I use pm-suspend, the graphics card doesn’t restart.  If I use pm-hibernate, initially the box just simply locked up.  I determined the lockup was due to the tuner drivers, so I wrote a script to stop the Myth Backend service and unload the modules on hibernate.

But then I discovered that frequently on waking up some of the tuners wouldn’t work!  I haven’t got a solution for this yet, but I’m working on it.

All in all, it’s been a worthwhile exercise, but I’ve been getting a lot of grief from the TV tuners.  I’ve left it alone for this week, but in a week or so I’ll try and get hibernation working again.

From WMC7 to MythTV…

After reading some more about what can be done with MythTV, I thought I’d take the plunge.  Previously, my Media Center was running Windows 7 Ultimate with Media Center.  I have two Hauppauge HVR-2200 PCI-Express dual tuners, and an nVidia 9500 GT graphics card with HDMI output.  I also have a huge pile of recorded TV in Windows Television (WTV) format, which was quite the obstacle because only Media Center can play that.

So, I decided to settle in with MythTV running on Fedora 15.  There’s a heap of build guides on the Web, follow them if you want to do similar.  I’ll just mostly talk about the issues I had.

Old Recorded TV

Firstly, I copied off all my previously spooled recorded TV in WTV format and using VideoRedo, remuxed them into plain MPEG2 Program Stream (.mpg) files, which MythTV (and nearly anything) can play.  At a later time I’ll transcode all the things I want to keep to H.264 in an MKV container, but for now I just want everything playable.  VideoRedo can remux a WTV pretty quickly, so I did all that on my main PC while I was messing with the HTPC.

HTPC Setup – OS Choices

I decided to go with Fedora 15 x64 instead of 16.  For one, 16 had just been released, and I was concerned there may be setup problems with it.  Fedora 15 is tried and true, and it should just “work”.

For a window manager during setup, I did not select Gnome or KDE.  I used XFCE.  I don’t see the need for a hugely fat window manager on a media center.  XFCE does the job quite nicely.

For RPM repositories, I elected to use RPMfusion.  The choice was more stylistic than anything, but it’s very much recommended you use either RPMfusion or ATrpms, not both.

After basic setup, I had to head over to, and follow the setup instructions for my tuners.  Note that Fedora already has the drivers for them all, I just needed to drop the firmware into /lib/firmware .

For the MythTV theme, I used Mythbuntu, primarily because it’s clean and easy to navigate, looks acceptable, and not too heavyweight.

Bzzt!  One tuner down!

It took me a while to notice, but it turns out that one of my tuners (both are Hauppauge HVR-2200’s based off the saa7164 driver) won’t load firmware – it says the image is corrupt and therefore doesn’t work.  Unfortunately, I don’t know if it ever worked under Windows.  It shares an IRQ with the graphics card, which may have something to do with it.

Anyway, after much stuffing about, I’ve called it a loss and pulled the card.  I’ve since put in a Leadtek Winfast DTV Dongle Gold instead to supply a third tuner.  Again, firmware from and the drivers were already included in Fedora.  It “just worked”.

I’ll put Hauppauge tuner into one of the main PCs when I next have one out and see if it works at all.  At any rate, it doesn’t matter much because MythTV can take two channels out of the one multiplexed stream, and so I can potentially record up to six things at once, on up to three transponders (so, I could do ABC1/ABC2 + 9/GO + 10/ONE or similar).

Programme Guides

I was previously a customer of IceTV because they offer an excellent EPG service for WIndows Media Center users.  I definitely recommend them for WMC users.  But now I’m not a WMC user, so I swapped over to Shepherd instead.  Shepherd requires a small amount of setting up, but now it’s configured the data I’m getting looks pretty clean and useable.

I’ll see how it goes compared to IceTV.

Autostart Configuration

In order to get MythTV to autostart on system boot, you configure /etc/gdm/custom.conf , and in the [daemon] block, add the following;


That will make your mythtv user auto-login.  Then, in XFCE, go to Settings -> Session and Startup, and add mythwelcome to the startup.  On boot, your MythTV frontend should start up.

Auto-Kill Frontend with IR Remote

First, put irexec -d in your XFCE startup.  That will cause your remote to be operatable outside of Myth.  Well, first set up your remote following the LIRC instructions, but anyway.  Make a .lircrc like this;

    remote = mceusb
    prog = irexec
    button = Power
    config = /usr/local/bin/
    repeat = 0
    delay = 0

And then make that kill the frontend with “killall mythfrontend”.  Now, pressing the Power button your remote will kill your front end instantly.  Mythwelcome should then start it back up again.

Graphic Artifacts in VDPAU

I’ve noticed when using VDPAU (nVidia hardware accelerated video decoding) that I seem to be seeing visual artifacts – specifically glitches of white and red on the surfaces of things that are moving.  When I disable VDPAU I don’t see that, but I want to use VDPAU.  So, I’ve gone and grabbed a new GT520 video card, and I’ll see how that goes.  It might also be a driver issue, so I’ll have to find out.

Digital Audio – A Lesson in Pain

Ouch.  I had a devil of a time getting digital audio working.  I wanted to get digital audio going out my coax port to my amp (which supports DTS).  Sounds pretty easy, right?  Not on your life.

First I got digital audio working!  Yay!  But then I noticed that I couldn’t control the volume.  And then I noticed that it was only stereo.  DOH!  Then I got volume control working.  And then I got surround working.  But then I noticed that I couldn’t play anything that had AC3 audio.  DOH!  Then I got AC3 working, but then I noticed that the volume control was broken again.

Finally, I gave up and ran the analog output of my HTPC into my amp and just ran off that.  It works great.  Sigh.

What I want to see about doing is whether my TV can do digital passthrough out, because then I could just run the amp from the TV and it would “auto-select” what channel to run off.  I might see about that when I feel up to it.

I imagine half the problem is me just having little understanding of how digital audio works.  I might have to settle with having no volume control off the remote (and only on the amp), and then configure an IR blaster to control the amp volume and mute that way.  That’s probably the “right” way.

Results As Of Now

As of now, I’ve got my MythTV box set up so that it can record, play recorded TV, the remote control works, and DPMS monitor suspend is operational so it’ll shut down the screen.  My video library has been moved across to it (although I haven’t fully done the renaming and metadata collection for everything).  EPG is set up and working.  I still need to get automated sleep and wakeup working.

Still remaining is making another foray into digital audio.  I’m not looking forward to that.