My Steam Box – Amazon Instant Video on Ubuntu

While my Steam Box is running XBMC for media playback, there’s one service I use which XBMC can’t provide: Amazon Instant Video (formerly Lovefilm Instant).

AIV can be streamed through various apps or through Silverlight in a web browser. However, none of these options are supported on desktop Linux.  Of course, with the Ubuntu ecosystem being what it is, “not supported” is far from “impossible”.

The solution to the problem comes in the form of Pipelight – a browser plugin for Firefox which runs Silverlight and other Windows-only browser plugins in a special version of Wine.  This clever little hack (installed from a PPA through apt-get) allows you to watch Silverlight content within Firefox for Linux! It’s worth noting that I use the pipelight-multi package which allows you to set up Pipelight and Pipelight’s WINE installation for specific users, rather than for every user on the system.

With this problem solved, I wanted to make the user experience of accessing AIV a bit smoother.  To acheive this, I created a small autorun script which runs when the lovefilm user logs in to openbox.  The script contains the following commands:

switch-to-xbmc &
pkill -u lovefilm

This means that firefox launches on login. Firefox is configured to open AIV when it starts, and to run in fullscreen mode, has all but a few toolbar buttons removed and consolidated into a single toolbar. When we’re done watching, we close firefox, which lets switch-to-xbmc execute to return us to the XBMC menu, then pkill kills any other processes belonging to the lovefilm user, logging it out.

The final issue with using AIV on a TV is that the web page is noisy and not designed to be used on a big screen on the other side of the room. To fix this I’ve written a GreaseMonkey userscript (very much a work-in-progress) to remove a lot of the Amazon bumf and reformat the page to make it work better on a large screen.

My next and final post in this series will look at how I’ve got Steam and some associated utilities set up.

My Steam Box – Media Playback

For media playback on my Steam Box/HTPC I’m (mostly) using XBMC.  This lets me play videos from my server and watch DVDs from my DVD drive.  On top of this basic functionality I’ve installed the BBC iPlayer and YouTube plugins to allow me to stream content from the web.


I mentioned in my hardware post that I’d purchased a DVB-T2 USB dongle to allow me to watch HD TV.  For the past several years, the standard solution for TV/PVR functionality on Linux has been MythTV.  However, these days XBMC also has a good deal of this functionality in its PVR plugins, as long as you can get a backend service installed to operate the tuner.

One of these options is, of course, MythTV Backend. However, after struggling through the “Setup Wizard” being asked every question under the sun and still not getting it working, I gave up and found TVHeadEnd.  This gives you a simple web interface which detects your hardware and scans for channels with ease.  Adding the TVHeadEnd PVR plugin to XBMC gave me live TV and PVR functionality with minimum fuss.


XBMC gives you several remote control options, including a web interface and a service for other remote control apps to connect to.  I have a remote control widget on my android phone which works well enough, but I’ve found it easiest just to use the regular keys on my Rii Touch keyboard.


I’m not a particular fan of XBMC’s default Confluence theme, in particular it’s menu which only shows the selected option.  After looking around and finding this guide on Lifehacker, I switched to the Transparency theme which has a much better menu, and could be customised to have just the bits I need.

Switching Users

I mentioned in my last post that I’d written scripts using dm-tool to switch between users.  To run these from XBMC I installed the Advanced Launcher addon. This addon lets you create launchers for any executable within XBMC, and add them to the main menu in themes that support it.  Using this method I created launchers for the switch-to-steam and switch-to-lovefilm scripts on the main menu.

My Steam Box – OS and Software

In my last post I went over the hardware I used for my new Steam Box/HTPC all-in-one living room PC.  In this post I’m going to go over how I’ve got the OS set up and touch on the software I’m running to provide me with gaming and media playing functions.  I’ll then go over the details of each function in separate posts.

To start with, I did a vanilla Ubuntu 12.04 LTS desktop install.  I’d considered going for SteamOS, but to be honest, Big Picture Mode isn’t quite there yet, and I know where I am when it comes to getting extra packages and cool hacks for Ubuntu.  One part of SteamOS I was really impressed with is how they’ve set up Steam and the desktop session on separate profiles letting you can switch easily between the two functions, so I chose to emulate that on my set up.

The 3 main functions I wanted were media playback, a basic desktop (mainly for administrative tasks) and a desktop session to run Steam.

For administrative functions, I created a user called “mark” during installation (as I usually do).  Mark is a sudoer, with a standard 12.04 Unity desktop.

For media playback, I installed XBMC.  I created an unprivileged user called “xbmc”, set to auto-login to the XBMC standalone session with no password, making XBMC the initial interface on boot.

For gaming, I created a second unprivileged user called “steam”, set to log in to a Unity desktop session with no password.  Steam is set to auto run on log in, and display the Library tab in Grid view (showing the artwork for each game like Big Picture Mode does).

There’s also a third unprivileged user called “lovefilm” which logs in to an openbox session with no password, but I’ll talk about that more in its own post.

To switch to each user, I’ve created a scripts called “switch-to-xbmc” etc. which use the dm-tool utility.  These can be called from the appropriate interface (a menu item in XBMC, a non-Steam application launcher in Steam) to quickly switch to between users.

In the next post I’ll talk about how I’ve set up XBMC for media playback in a bit more detail.

My Steam Box – Hardware

Having played with SteamOS for my last post, I decided that it would be a lot more fun if my gaming PC, rather than being in my spare room connected to a small screen, was in my living room attached to my big TV.  In addition to this, I had several devices under my PC to provide me with various media-viewing functions (streaming services, DVD playback, TV), which was a pain and took up a lot of room.  To this end, I elected to build a box which could do all these jobs in one.  I’ve now got the box in a “stable” enough state that I thought it time to write about it, starting this post with the hardware.


I started the build by cannibalising the insides of my existing gaming PC, which I’d upgraded not long ago.  This gave me a starting point of an AMD A8 APU (quad-core with integrated 3D accelerated graphics), 8GB of RAM, a motherboard along the lines of this one, and a 240GB SSD.

It also gave me a very noisy heatsink. This was a problem as a box sitting under my TV needs to be quiet. After some research I bought a Zalman CPNS8900 Quiet heatsink, which does a great job of cooling with minimal noise and a low profile, but takes up a lot of horizontal room around the processor. So much, in fact, it lent against one of the RAM DIMMs.

To solve this problem along with screen limited resolution due to my TV’s poor VGA support, I upgraded my motherboard to An AsRock FM2A88M Extreme 4+ which had 3 key features: the FM2 socket for the processor, an HDMI port to ease connection to the TV, and 4 RAM Slots, meaning I could move the 2 DIMMs away from the processor allowing room for the heatsink. As an added bonus, the stock heatsink mount was screwed on rather than using plastic toggle bolts at the old one had, making mounting the Zalman much easier than it had been as I could just screw it onto the existing back plate.

The final piece of the puzzle was a power supply. Again, I wanted something quiet so went for a Corsair CM430M which is 80+% efficient and has a 120mm fan. It’s also modular, meaning only the required cables need to be attached, so reducing cable management needs inside the case.

Photo showing the inside of the steam box from above.

Obligatory internal shot, taken from above. The big power supply in the bottom right draws air from vents in the underside of the case and straight out the back, while the big heatsink on the left draws air in through vents above and out through vents in the side and back. Note the RAM slot nearest the heatsink is obstructed. Top-right is a short-depth DVD drive, with the SSD mounted underneath.


When building a PC you can basically pick 2 qualities from powerful, small, and quiet. My main concerns for this machine were power (for gaming) and quietness, meaning I’d inevitably be building something fairly big.  I plumped for a SilverStone ML03B – a half-height MicroATX case which isn’t the most beautiful case, but is really well designed and fits everything inside nicely. I’ve written a full review here.

Photo showing the front of the Silverstone case, with a DVD drive and Gamecube USB adaptor installed.

The completed steam box viewed from the front, with Gamecube USB adapter on top.


I’ve always been a big fan on Nintendo controllers, I’ve still got a few Gamecube controllers as well as a couple of Wii Remotes.  With the launch of Steam’s Big Picture Mode, Valve are encouraging games developers to make their games with well with gamepads.  For those games, I use a Gamecube controller via this USB adapter (found via the Dolphin Emulator site).  I’ve owned several Gamecube-USB adapters, but this one is particularly good, firstly because it has 2 inputs, and secondly because it’s the only adapter I’ve found which works with Wavebird wireless controllers.

For games designed to be used with a mouse cursor, I connect a Wii Remote using a bluetooth dongle and a USB-powered sensor bar.

I also needed a keyboard and mouse that I could use from across the room.  There’s some nice IR remotes out there, but I went for the easy option and got a Rii Touch handheld keyboard with built-in touchpad.  I initially bought a bluetooth model but bluetooth connectivity requires pairing the device and the OS to boot before it can connect, which wasn’t terribly smooth.  I ended up with the  proprietary RF version which connects as long as the USB port has power, and just appears as a regular wired keyboard and touch pad to the OS.  It’s not perfect perfect but I’d give it 9/10 as a solution.


While my TV has Freeview built in, I didn’t have a way to watch live HD channels.  To enable this I bought a PCTV nanoStick T2, a USB DVB-T2 (Freeview HD) dongle.  Notably, this is the only USB DVB-T2 tuner which has support in the Linux kernel at the time of writing, so it Just Works with no additional drivers needed.


That’s all for the hardware at the moment. In my next post I’ll look at how I’ve set up the OS and Steam.