sbs20

DIY Devices - Media Centre

2021-07-10 DIY devices Raspberry Pi Kodi tvheadend

WMC

In 2005 I bought a Windows Media Centre - it ran a fanless Pentium mobile processor and worked reliably for about 10 years. But the NIC failed. There was no HDMI port. Windows XP was getting long in the tooth and it wouldn't run Windows 7.

So in 2015 I bought a new one; a fanless i5 (4690s) desktop with 8gb RAM, a 512gb disk and a dual-tuner PCI tuner card. Running Windows 7 with Media Center it was my PVR as well as a portal to all my films and TV. It (then) cost around £1,000 (without an OS) and consumes somewhere in the region of 120w. Prompted by a minor disaster, I replaced it with a more flexible, smaller, and better setup for much less cost and less power.

In late 2018, having just moved house, I awoke one morning to smell burning. To cut a long story short, I found my prized fanless i5 media centre emitting smoke. And through the vents I could see fire-like light glowing where it shouldn’t. I immediately pulled the power. Nothing truly bad happened – except that £1,000 had literally gone up in smoke. And I’d lost the ability to record TV. (For those, interested, I was no longer running MCE but Media Portal TV Server, Kodi and Windows 10.)

Fire

Slightly lost at what to do, I realised I had a spare Raspberry Pi, so decided to purchase one of the TV Hats. It was only single tuner, but I figured it would only manage one TV stream anyway and for the sake of £20 would buy me some time while I figured out what I was going to do longer term. I repurposed a Celeron NUC as a Kodi client (running LibreElec) and installed Tvheadend on the new PVR server – the Raspberry Pi. Tvheadend blew my mind – it was so much better than Media Portal with much better series recording features, a headless web front-end (so I could SSH tunnel to my home network and set things to record), better integration with Kodi and of course native Linux underneath, enabling cronned rsync backups (it’s only storing video data on an SD card).

I was converted.

A couple of months later, I decided to buy a Hauppauge WinTV Dual HD freeview tuner and plug that in too. I had to install a custom driver and the Raspberry Pi would only recognise one of the tuners but I now had a dual tuner PVR again (one from the TV hat and one from the Hauppauge). Once Raspbian Buster was released, however, the proper driver had made it into the 4.19 kernel which meant I now had 3 tuners. And it still worked fine. Not only that, but Tvheadend was smart about how it used the tuners. I don’t know a huge amount about this, but I believe that multiple TV channels are multiplexed in a single broadcast frequency – so, e.g. BBC1, BBC2, ITV1 and ITV2 might be bundled together. It seems Tvheadend can intelligently extract all four channels at the same time using just one tuner. So theoretically one could record all channels within three different frequencies (maybe 18 channels?) simultaneously! In reality, disk IO and processor will likely get in the way, and it’s a pretty unlikely scenario. But the point is: I have a £30 computer, with a £50 dual tuner, £20 single tuner, £10 SD card, £7 case, £5 power supply consuming 15w of power and it’s better than my old setup.

PVR

What else? #

Well, because the PVR is separate from the Kodi client, the Kodi box can be turned off without impacting the ability to record TV. It means there is sufficient tuning capacity to watch live TV from other WiFi-Kodi-capable devices where there isn’t a coax antennae available – so I have since setup a second Kodi client (also LibreElec) but on a Raspberry Pi connected to a second TV - where there is no TV aerial. The remote control works using HDMI-CEC.

My decisions #

I chose Tvheadend because it was recommended for use with the Pi TV Hat. I have only tried NextPVR and Media Portal TV Server as alternatives so don’t claim to have exhaustive knowledge about this – but Tvheadend works extremely well for me

I chose LibreElec for Kodi since I wanted it to be a dedicated media device and had no need to do more. OSMC has “more Linux” underneath it but that just isn’t required for my use case. OpenElec seems to be less well supported these days.

I chose a NUC 5CPYH for my main Kodi client mostly because I had it available. In its favour, it is relatively inexpensive, small, low power and also has an inbuilt IR receiver and is faster than most ARM boards (considerably so than a Raspberry Pi). Against: it is not fanless, and it consumes more power than an ARM board.

I chose the Hauppauge WinTV Dual HD tuner because it was a manufacturer I recognised, was inexpensive and was known to work with a Raspberry Pi.

Epilogue #

What happened with the fanless i5 device? Well first, I think the reason it started to burn was a short circuit – the sparking was occurring where the tuner card met the motherboard. I think this was caused by pushing it back against the wall, and the coax cable pushed the PCI tuner card along the PCI slot just far enough to be bad. I won't ever know for sure. Anyway, I got in touch with the original vendor, Quiet PC, and it turns out they had a spare socket 1150 motherboard which was so old they couldn’t really sell it – they gave it to me for £50 with a 4 week warranty. I disassembled the computer, pulling out the CPU, RAM and, well, everything, then re-seated the whole lot. And it works! But it's no longer a media centre...