Friday 12 December 2014

New Apple based MythTV machine for home.

I've got a really low tolerance for television commercials. Since the introduction of free-to-air digital television in Australia, we've used a computer at home to record the broadcasts so we can watch stuff at our leisure, and skip the ads. I just installed version four of our hardware, going in a slightly different direction to the previous three.

So in chronological order, here's what I've done in terms of watching television:

  • A Via Eden 800 MHz (from memory) Mini-ITX motherboard, with power supplied via a 60W 12V power supply and pico-PSU, using a PCI DVB-T capture card and 2.5" 400GB hard drive. We ran Ubuntu on this machine, with MythTV. This machine was a complete dog. It was expensive and slow. I bought the mini-ITX motherboard because I was hoping for something that would fit in with our home stereo. It was hopelessly underpowered, despite claims that is was "good enough" to do SD content. It drew around 30W of power.

  • A Zotac ION Mini-ITX motherboard in the same case as the previous machine. This one used an Intel Atom processor and nVidia ION chipset, which had hardware acceleration that was quite capable of reliably displaying HD content. No PCI slot, so I bought a pair of ASUS U3100 USB DVB-T tuners. I added a WD green 1TB 3.5" hard drive in the space liberated by the tuner card. This one we kept for quite a while (I still have it in my donga with XBMC installed). My issues with this one were more around Ubuntu and myth than the actual hardware. It was pretty early in the days of VDPAU, so every time Ubuntu insisted on an upgrade the video hardware acceleration would break, and I'd spend a frustrating day or two googling for magic incantations to get the thing working again. Also the atom processor was quite sluggish - things like navigating menus was painful. Despite being more powerful than the Via board, it was rather more energy efficient, drawing 22W at idle and around 30W playing content.

  • One upgrade I got sick of it. I'd recently bought myself a nice macbook air for my study, so my old study machine went into the living room. This was a standard ugly desktop PC, with an Intel core 2 duo CPU and nVidia ION chipset in a normal micro-ATX form factor. It had enough power that it'd just work, VDPAU or not. I filled the case with sound absorbent foam in an effort to reduce the noise from the hard drives, and fitted some nice quiet Noctua fans and monster heat sink. I used a small 220W energy star sparkle power power supply in a bid to reduce power consumption, but only managed to get it down to 40W at idle. But it was good enough. We ran with this machine for about 4 years until it recently died.

So now on to our latest machine. Since the acquisition of the macbook air and a retina macbook pro for work, I've become quite keen on Apple hardware and OSX. The hardware is really high quality and just works. The software doesn't break on every update like you tend to get with Ubuntu. I took a deep breath and ordered a spanking new 2014 model Mac mini. I went for the mid-spec model, with i5 processor, Iris graphics, 1TB hard drive and 8GB ram. The plan was to install MythTV under OSX and be free of the linux "almost there" annoyances once and for all.

One gotcha. My DVB TV tuner cards won't work under OSX. Turns out there are no USB tuner cards that work on OSX. My only options are a "HDhomerun" network tuner, or else to build a separate (linux) backend on a different machine with my USB tuners attached to that, effectively replicating the HDhomerun network tuner but adding disk.

That's my long term plan - buy a low power box like an Intel NUC or another Mac mini, install Ubuntu on it, attach a pile of disk and hide it in a cupboard running my backend. That way it'll be doing what linux boxes like to do - running services. No need for X11, no unity, no display. I'll SSH into it when I want to do maintenance.

For now I just made a dual-boot mac mini, and am running MythTV under Ubuntu, so much the same as our previous box but much smaller, neater hardware.

Getting Ubuntu and myth running on the mac mini was a bit more of a pain that I anticipated. You'd think it'd be straightforward on mainstream hardware, but no. Here's the steps I went through, more for my own reference to reduce the random google-fu next time than anything else:

  • Install rEFIt under OSX and repartition the hard drive using the OSX disk tools to make room for Ubuntu. I chose to give OSX 200GB and leave 800GB for Ubuntu.

  • Install Ubuntu 14.04.1 from a USB key. Relatively straightforward - instructions are here.

  • Get my Apple bluetooth mouse and keyboard running. Gotchas were not pairing with the mouse, and upower being retarded and annoying me with "battery 0%" warnings every time I pressed a key. The fix for upower is rather satisfyingly to nuke it. It's not like you need power management on a machine plugged in to the wall, anyway.

  • Install mythbuntu under Ubuntu. Importantly don't install mythbuntu by itself, as it doesn't include all the tools that are needed to get everything else (bluetooth mice etc) working.

  • You'd think that in 2014, after a decade of myth, that a fresh install of the current stable version would work. Alas no. Myth development people are adamant that their product will never get widespread use, and they do this by only half setting up their database connections. Much stuffing about was necessary before the backend and frontend would talk to the mySQL database. No links for this, as by the time I found the incantations I was about ready to give up on myth entirely and didn't write stuff down. Anyway, I'm sure the problems will be different next time.

  • Go through the same Unity "legacy full screen support" pain that I've had to do ever since Canonical forced this useless desktop on everybody.

So yeah, now we've got a stable myth install running on our shiny new mac mini. The operating system is terrible, but the hardware makes up for a lot of that. It just works, and pulls a measly 11W at idle, and that's including the pair of Asus DVB tuner cards, which are about 1W each.

Alas it's no good for playing my music collection, as I was hoping for. The plan to run a separate backend with OSX frontend is still there, so I never again have to deal with unity, bluetooth, upower, or all the other user interface annoyances that accompany every linux machine I've ever dealt with.

Here's a photo of our hardware. On top of the mac mini is an apple TV, which we use for watching Orange is the new Black, and a wifi hotspot. The tuner cards are hiding under the power cable for the apple TV.

Edit: But wait, there's more! Another incantation is needed before my Apple dvd will talk to linux.


Miles said...

You could run vmware esxi (a virtual machine hypervisor) on the mac mini and run both operating systems at the same time so you don't need an addditional mac mini. Probably will be a bit of a hassle to set up but once esxi is super stable and works great. You would also need a usb video adapter or some such to output to a tv since esxi is designed to run headless since it's really for servers.

Suzy said...

I run VMware on my work machine. This was one of my first thoughts, but Google tells me the USB DVB tuners won't work on a virtual USB port, so that killed that idea.

Miles said...

ah, bummer. I do wonder if vmware would be a little different since it is a bare metal hypervisor rather than one hosted by an OS. Might not matter though and would probably require actual testing to figure out. I'm tempted to buy one of those usb capture cards and test it out on my mac pro/esxi work setup. Wouldn't mind having a similar setup to capture tv at home.