Wi-fi doorbell

I recently moved house.  Unfortunately the doorbell was pretty rubbish, and you couldn’t hear it in most of the house.  Now, I could have gone to the local hardware shop and bought a new wireless doorbell but then, well, I’d have nothing to write a blog post about.

In my living room I have an O2 Joggler running Kodi, so my initial plan was to make something that would play a sound on the Joggler.  I also ended up adding a camera and mobile push notifications so that we can hear the doorbell wherever we are.



I wanted to make everything semi-permanent as there’s a good chance of me moving or switching things around in the future.   To that end I used some spade connectors to connect the wires to the button.  The connectors I bought were slightly too big so I had to squash then a bit with a pair of pliers, but they do the job.  The other end of the wires are connected to the Raspberry Pi’s GPIO pins.  To keep them removable, I soldered them on to the pins on the back on the female header, which then plugs into the male headers on the board.  Each pin is insulated with a small piece of heat-shrink wrap.

The button has 2 pins for the button itself (actually 3 – ground, normal open and normal closed, but I’m only using ground and normal open), and 2 for the LED ring, so I used 2 of the Pi’s GPIO pins for input/output, and 2 ground pins.  It also has a resistor built in for the LED, which made it simple to connect up.  I cut 2 lengths from the 5m of flex to give me the 4 cores I needed.

I drilled a 10mm hole in the front of the enclosure for the button and filed it out until it was the correct size.  The button included a rubber gasket to keep it weatherproof.  I also made a small hole in the top of the enclosure to run the flex out.  The enclosure is larger than I would have liked, but the back of the button is 35mm deep and finding an enclosure with the required depth but less with and height was difficult.

Doorbell with blue LED ring mounted in enclosure

I removed the old doorbell and its wiring from outside, and I mounted the new one in its place.  I ran the flex up through some trunking, and then in under a window seal to avoid drilling any holes in the frame.  Some more trunking hides the flex running over the front door, and into the Pi mounted on the wall.   I used some Sugru to stick the Pi’s case to the wall (the Pi itself can still be popped out) and to seal up the top of the enclosure.

Rasberry Pi Zero mounted on wall with USB cables and GPIO connectors

The webcam has a clip on the base which I used to mount it on the outside of the window.  I ran the cable under the seal alongside the flex, and connected it to the Pi’s USB port using a regular-to-micro USB adapter.  This was just a cheap webcam from eBay as a proof-of-concept, so I plan to replace this with a higher spec cam at some point.  I also used some Sugru to seal up the webcam’s casing.

USB webcam mounted outside window


This script is running on the Pi, launched on boot:

import os
import simplepush
from time import sleep
from gpiozero import LED, Button
from signal import pause
from kodijson import Kodi

led = LED(4)
button = Button(17)
kodi = Kodi("http://joggler:8080/jsonrpc")
pushid = "xxx"
pushpass = "yyy"
pushsalt = "zzz"
motiondir = "/var/lib/motion"
pingkodi = "ping -c 1 -W 1 joggler > /dev/null 2>&1"

def filterfiles(filename):
    name, extension = os.path.splitext(filename)
    return not os.path.isdir(motiondir + "/" + filename) and extension == '.jpg'

def getmtime(filename):
    return os.stat(motiondir + "/" + filename).st_mtime

def pressed():
    sleep(1) # Wait so that motion can capture a decent image
    filelist = os.listdir(motiondir)
    filelist = list(filter(filterfiles, filelist))
    newest = max(filelist, key=getmtime)
    os.system("scp " + motiondir + "/" + newest + " doorbell@webserver:~/")
    imageurl = "https://webserver/doorbell/" + newest
    streamurl = "http://doorbell:8081"
    if os.system(pingkodi) == 0:
        kodi.Player.Open({"item": {"file": "/home/joggler/doorbell.ogg"}})    
        kodi.Player.Open({"item": {"file": imageurl}})    
    simplepush.send_encrypted(pushid, pushpass, pushsalt, "Doorbell", imageurl + " \n" + streamurl, "doorbell")
def released():
button.when_pressed = pressed
button.when_released = released

led.blink(.5, .5, 3)


Motion is running all the time, automatically capturing images and video when the webcam detects movement. When the button is pressed, it grabs an image and uploads it to my local web server. If the Joggler is turned on (determined by trying to ping it), it then uses Kodi’s JSON-RPC API to play a doorbell sound on the Joggler, and tells it to display the uploaded image. It also uses Simplepush to send a push notification to my phone with the URL of the image (which I can access anywhere), and the URL of the live feed from Motion (which I can access if I’m in the house).

I chose Simplepush as it supports end-to-end encryption, so no-one is intercepting the URLs of the uploaded images.

The led.blink() line is a handy way of indicating when the Pi has finished booting and the doorbell code has initialised.

Other than improving the web cam, I’d also like to send the push notifications to my partner’s phone, and it would be good to have an always-on device that uses less power than the Joggler to provide a doorbell sound if our phones and the Joggler are turned off or silenced. The picture that’s captured when the button is pressed isn’t from the perfect moment to capture the caller, so I can probably be smarter about deciding which picture(s) to upload. I should also add some logging to the script to debug any problems.

My favourite talk from OggCamp 17

I’ve just arrived from from OggCamp that took place in Canterbury last weekend.  As usual, I hosted a Lightning Talks session on the Saturday where 8 speakers delivered a series of 5 minute talks.  Among those was Rachel.  This was her first OggCamp, and she gave an off-the-cuff talk titled “Newbie to tech”.  She shared a bit about her job (I wasn’t expecting to hear the phrase “I grow eyeballs in a lab” this weekend), and her new found interest in wearable electronics.

The reason this was my favourite talk of the weekend is what this shows we’ve achieved with OggCamp. We’ve managed to create an event where someone new to the subject matter and to the community feels welcome and comfortable enough to stand up in front of everyone and say, “Hi, this is me.”  I think that’s pretty fantastic.

AutoHandbrake – DVD ripping wizard

This post is based on a talk a gave at OggCamp 17 in Canterbury last weekend.

At home I run an Emby server to store and stream my music and video libraries, primary to my living room PC which runs Kodi. I’ve got a reasonably large DVD collection which contains an mixture of movies and TV episodes, which I wanted to rip and store on my Emby server. (Note, this post won’t go into the ethics or legality of ripping DVDs, it’s purely a technical discussion).

Currently, the state of the art for ripping and encoding video from a DVD on Linux is Handbrake. Handbrake looks like this:

Screenshot of the Handbrake GUI

The process for ripping a DVD of TV episodes with Handbrake does something like this:

  1. Insert your DVD and let Handbrake scan it.
  2. Select the first title you want to rip.
  3. Select any subtitle tracks you want to include, and specify the subtitle mode (more in this later).
  4. If you want non-default encoding settings, select your encoding preset.
  5. Enter the name for the output file, including any episode numbers.
  6. Add it to the queue.
  7. Repeat all of the above steps for each episode on the DVD.
  8. Run all the jobs in the queue.
  9. Discover you forgot the change the episode number on one of the episodes and overwrote the previous file.

As you can see, doing this for a large number of DVDs is quite labour-intensive, and the Handbrake GUI doesn’t do you a lot of favours. Handbrake also includes a command-line interface which lets you specify all of the settings mentioned above as command-line arguments. However, this requires you know things like tile and subtitle track numbers for what you want to rip.

My solution to this has been to write AutoHandbrake (autohb for short). This is a tool written in Ruby, which uses HandbrakeCLI to find out what’s on a DVD, then present you with a series of questions, and generate HandbrakeCLI commands to rip all the titles you want with the same settings.

The first thing AutoHandbake does is work out what’s on the DVD. To do this, it extracts the list of titles, and performs some analysis of the number and duration. In the case of a movie, you usually have a single long title with the “main feature” flag set. In the case of a set of TV episodes, you usually have between 4 and 8 similar-length titles, along with one “main feature” title that is around the same length as the all the similar-length titles added together (this is the ‘Play All’ option). The script will try and work out which one it’s got, then tell you what it thinks and ask you if it’s correct.

Screeshot of Auto Handbrake, with the text "Single main feature found: Title 1 [41 minutes and 49 seconds]. Rip this feature?", options "Yes" and "No"In this case, the DVD contains a set of TV epsiodes, but the ‘Play All’ title isn’t marked as the main feature, so it’s decided the DVD contains a single feature. This is wrong, so selecting “No” will allow you to correct it.

List of titles. The first 4 titles have the duration 41:49 and are all selected.  The rest of the titles have different durations and are not selected.

Here we get a list of titles to select. The original iteration of AutoHandbrake simply presented command-line prompts, and you typed in the numbers of the titles you wanted. However, I now use a tool called xdialog (via the rdialog ruby gem), which lets you easily display a curses interface for the required prompts when you run from the command line (as I usually do). As an added bonus, if you’re running in a desktop session, you get a proper GUI instead, like this:

The same title list as the previous image, but with an X Windows interface instead of a curses interface.

Once we’ve selected the titles we want to rip, we want to choose which subtitles to use.

AutoHandbrake prompt, question "Add subtitles with default settings? (Language eng, Forced Only: yes, Burned in: yes)", options "Yes", "No".

By default AutoHandbrake will try and autodetect subtitles in the default language. It will also rip use the “forced only” flag, (only include subtiltes where a character is speaking in a different language) and the “burned in” flag (encode the subtitle text directly onto the video, rather than just including the track in the file). It’s fine to accept these options, but for some reason auto-detecting subtitles requires handbrake to scan through the whole title and extra time. Answering “no” here lets us specify the track ourselves.

List of subtitle tracks. 2 options with the text "English", the first is selected.

Sometimes you’ll have options for several languages. Often there are more than one “English” options. I always just choose the first one, and I’ve never had a problem.

Text input, labelled "Enter the title for file and folder naming", the content is "Stargate Sg1"Next we’re asked to enter a title. This will be used to name the destination folder for the ripped files, and the start of the filenames (the whole filename if we’re ripping a movie). The DVD has a “title” field in its metadata which will be used as the default value. Sometimes this is spot on, usually it just needs a bit of fixing, but sometimes it’s complete nonsense. I’ve also had some interesting results here; for example, the first “Star Trek” film in the alternative timeline has the DVD title as “Start Trek XI”.

Text input, labelled "Enter season number for episode naming (Leave blank for none)". Text entered is 10.

If we’re ripping a set of epsiodes rather than a single movie, we’ll be asked for the season number. This will be appended to the file name in the format “S##”, so if we enter a number less than 10 it will have the leading 0 added.

Text input, labelled "Enter first number for episode naming", text entered is "1"

The final input is for the first episode number on the disc. If you have 4 episodes starting with episode 5, entering 5 here will auto-number the episodes 05, 06, 07 and 08. Combined with the title and season number, this gives us file names that looks like “Stargate SG-1 S10E02”.

Prompt displaying a list of HandbrakeCLI commands to rip and encode 4 titles.Now we’ve got our queue of HandbrakeCLI commands. We can check that we’ve selected the right options, and the generated titles are as we expected. Selecting “Yes” here will run the commands and rip the videos!

Terminal window showing the output of the HandbrakeCLI commandThis part of the process could do with some improvement. Currently it drops us to the terminal at this point and we just see the output of HandbrakeCLI. This shows us the time left in the current tasks, but doesn’t really give us an idea of the overall progress. This currently only shows if you’ve run AutoHandbrake from the terminal, otherwise you wont see any output at this point and you just have to wait for it to finish. When its done, the DVD drive will automatically eject the disc.

Usage information for AutoHandbrake, listing the available command line options.There are several options that you can specify a when invoking AutoHandbrake. The input device and output directory are the only ones that are really required. If you know what you want to rip, the rest of the arguments allow you to specify things like the title and season number in the command, in which case it wont ask you for them later.

Another interesting option is “min-duration”. Some publisher will fill the DVD with junk titles of a few seconds long, presumably to make it harder to find what you want to rip. By specifying a minimum duration of a few minutes, you can have Autohandbrake ignore these shorter titles, giving you just the likely candidates to choose from.

You can see, download an contribute to AutoHandbrake on Github.

Dell Precision 5520 Ubuntu Review

Dell kindly sent me a Precision 5520 to review for the Ubuntu Podcast. This post goes into detail about some things we couldn’t fit in the show.

In the box

The box the laptop shipped in contained the laptop, the power supply (power brick and UK plug), and a Thunderbolt Ethernet dongle.  The laptop itself was smartly presented in its own smaller padded box.


The laptop itself has an attractive metal body with carbon fiber or something similar on the surface around the keyboard.  A nice detail is that the underside of the body features a plate etched with the model number, which flips over to show the normal regulation compliance emblems hidden underneath.


On the left, the device has the charging port (straight barrel connector), HDMI, 1 USB-A 3.0 port, a 3.5mm combined headphone/microphone jack, and 1 USB-C/Thunderbolt port.  On the right, there is another USB-A 3.0 and anSD card slot.  This side also features an Kensington lock port and a battery indicator.  Both of the USB-A ports support power sharing.

I tried plugging a pair of stereo headphones into the 3.5mm jack.  While audio played, the volume was noticeably lower in the left ear.  As there’s only 2 USB-A ports, I plugged in a mouse, keyboard and Ethernet dongle using a bus-powered USB hub.  Unfortunately, devices kept dropping out on the hub.  I switched to using the supplied Ethernet dongle and plugging in the mouse and keyboard directly, which worked without an issue.

While there aren’t a huge number of ports available on the body of the device, there are docking options available.  A USB-C dock is available with extra USB ports, ethernet, audio output, and ports to drive 2 monitors.  There’s also a Thunderbolt dock available with the similar ports, but the ability to drive 3 monitors.  I didn’t receive a dock with my review unit.


My review unit featured the top options for most of the hardware.  This specification retails for around £2,618 on the Dell website, while the base specification retails for around £1,649.

  • Intel Xeon Quad-core 3GHz CPU (base Core i5, 2.5GHz)
  • 32GB DDR4 RAM (base 8GB)
  • UHD (3840×2160) 15.6″ touch screen (base FHD (1920×1080), non-touch)
  • Intel WiFi 802.11ac/Bluetooth (standard)
  • 512GB SSD (base 500GB HDD)
  • NVIDIA Quadro M1200 w/4GB GDDR5 GPU (standard)
  • 6-cell 97Wh battery (base 3-cell 56Wh)


I found the keyboard satisfying to type on.  The keys take a decent amount of force to get moving, and go down soothly with no sponginess.  The Super key is printed with a Windows logo, no vinyl sticker like Entroware, and no custom-printed keycap like Tuxedo.  The model I was sent had a US-layout keyboard, although the Dell UK site offers a UK keyboard as standard.  The keyboard lacks some keys such as Scroll Lock and Pause, which is an understandable omission but is slightly irksome for me as I use Pause as the summon key for Tilda.

The touchpad is big and soft to the touch, with just the right amount of friction.  It supports multi-touch, supports clicking down anywhere for the primary button, and clicking the bottom-right area for secondary click.  By default, it’s configured to use “natural” scrolling, which matches the scroll behaviour of the touchscreen.

The screen fills the space inside the lid with only about a 2cm bezel all the way around.  The light from the screen is incredibly bright, so much so that I found it uncomfortable to look at a white page on full brightness.  It can be adjusted to a range of levels so it’s not hard to find a comfortable setting.  The screen is readable in direct sunlight, although has a glossy finish so is quite reflective when there is a dark background.  The touch screen works well, although only supports single touch, and picks up finger prints easily.

This was my first experience of a HiDPI screen.  The picture is very sharp and good quality, but doesn’t offer a particular advantage over an FHD screen for general use.  The place where it really makes a difference is with high-resolution photos and videos, which reveal a huge amount of detail not visible on lower DPI screens.


First boot

The laptop came loaded with Ubuntu 16.04 LTS.  On first boot in launched into the OEM setup, which allows you to connect to WiFi, create a user, configure the locale, and create a recovery USB stick.  It finishes by installing updates, then reboots for you to log in to your new user.  This all went as expected, and the WiFi connected without a problem after reboot, something I’ve had issues with before.

In the interests of full disclosure, at this point I should mention that this was the second unit I had to review.  The first unit I was sent has a bug in the OEM setup which caused it to crash.  The error messages weren’t very friendly, and it left me unable to set up the machine.  Dell sent me a replacement unit, which worked without a problem.

Upon reboot, the LightDM login automatically scales to take the HiDPI screen into account.  However, after login, the Unity desktop wasn’t automatically scaled.  For usability, I adjusted the UI scale to 2x in the Screen Display settings, which gave me the equivalent screen estate of an FHD screen.

One serious letdown about the initial setup is that the Super key is disabled by default, and no key has been configured to replace it for usage with Unity.  This means that upon first boot, the list of Unity keyboard shortcuts is missing a lot of key features around the Dash, Launcher and window management.  There’s an article on Dell’s help website which explains how to re-enable the key, but as someone who makes heavy use of Unity’s keyboard shortcuts, I don’t feel like this represents a good default Ubuntu experience.

Default software

The initial package selection differs from vanilla Ubuntu 16.04.  There’s a Dell-specific APT repository enabled that’s hosted by Canonical, and several hardware drivers installed, ensuring that all the hardware works as intended.

Something about the default package selection which confuses me somewhat is the choice of web browsers.  Instead of Ubuntu’s default Firefox, you get Chrome and Chromium, which both have icons at the top of the Launcher.  As standard with Ubuntu 16.04, The QML Browser app is also installed and available from the Dash, and the Amazon icon in the Launcher uses this, which adds an additional inconsistency since this browser doesn’t pick up the UI scaling.

The rest of the installed apps are pretty much standard, with the addition of Dell utilities for installing drivers and creating recovery media.



As mentioned above, the laptop features a dedicated Nvidia graphics card.  I ran the Superposition benchmark at various settings, although the only preset that provided a reasonably smooth experience was 720p Low, scoring 1930.  I also installed Tomb Raider through Steam (only usable in Big Picture mode due to the desktop UI not scaling) and ran the benchmark there. On 720p/Ultimate settings, it managed an average of 51 FPS.  On 1080p/Ultimate settings, it still managed a respectable 33 FPS.  Unfortunately, at native resolution, it only managed 9 FPS on average.

When the graphics are being exercised, the fan kicks into gear to an extent that is hard to ignore.  The noise isn’t at an irritating pitch, but it’s clearly audible over the sounds of the game.

Battery endurance

I tested the battery endurance with each GPU by setting the screen brightness to minimum (still perfectly usable), the keyboard light off, the Wifi connected, and left it untouched to discharge.

With the Nvidia GPU, the 97Wh battery lasted 6:30. With the Intel GPU, it lasted about 11 hours.

I also tested the standby, which went for 18 hours with 8% battery drain.  Notably, when recharging, the top-left quadrant of the laptop’s body gets very hot.


The Precision 5520 is a great looking laptop on the outside, with a fantastic screen and innards to match.  It’s marketed as a “mobile workstation” and definitely fits into that role, offering an excellent option for upgrade from a class of machine such as a Macbook Pro.  The price point is above what most would consider for a personal device, but offers a good range of options for a professional purchase. Personally, I would stick with the FHD non-touch screen, as the UI scaling still has some gaps, and the single-point touch screen doesn’t offer much attraction given the very nice touchpad.
As an experienced Ubuntu user, I’d be very happy to have this device as my daily driver, as I’m confident that I could customise it to my preferences.  I would however have some reservations about recommending it to a first-time Ubuntu user, as I’d fear some of the changes from vanilla Ubuntu would create a confusing experience.

Marching with Unite For Europe

If a democracy cannot change its mind, it ceases to be a democracy. – David Davis

The flag of the European Union, flying in front of Westminster Palace.

Unite for Europe, Parliament Square, 25/03/2017

On Saturday I marched to Parliament Square, London with Unite for Europe, in protest against Brexit. If you asked me beforehand why I was marching, I’d have found it hard to articulate an answer, beyond “because I have to do something”. But now I’ve had time to digest the views and stories expressed on the day, I think I can explain it a bit better.

I was marching for the children, holdings signs with slogans like “I want my future back”. They will have to live with the impact of Brexit for the longest, yet they had no say in the referendum. They’ve been brought up with a promise of the chance to study, to travel and to live anywhere in the EU. They probably go to school with friends who’s parents are EU nationals. If the Government continues on its current course, by the time we leave the EU a lot more of them will be of voting age, but will not have had a say on the issue. Their future is being taken away, without their consent.

I was marching for the EU nationals, who have made their lives, their careers, and their families here. Many of them have fallen in love with UK nationals. Many have fallen in love the the UK itself. They work here, pay their taxes here, and are net contributors to our public services. They had no vote in the referendum, and now they’re being told they might not be welcome any more, treated like bargaining chips by the Government.

I was marching for the Remain voters. 16 million people who cast their vote against Brexit, who are now being ignored and told that “The Will Of The People” doesn’t include them. Who speak out against their country heading down the wrong track, and are called names by politicians and journalists alike, who wish to see them cowed and silenced. They are still here, and they aren’t going away.

I was marching for the Leave voters. People who cast their votes in good faith, on the promise that the UK could leave the EU but remain the in the single market. On the promise of £350 million per week for the NHS. Who are now being used as pawns by a government desperately seeking to justify a wholesale withdrawal from the EU, EEA, Customs Union, Euratom and anything else they can while they’re at it. They didn’t vote for this, and they deserve better.

Democracy is not one question, asked once. 52% vs 48% is not a mandate for sweeping constitutional change. The Government and Parliament cannot outsource their accountability to a referendum. We must stand up, all of us, and hold the Government to account. If we voted Leave, we must make sure we get the Brexit we voted for, or reject it. If we voted Remain, we must ensure the Government and our parliamentary representatives cannot continue to ignore us. We must speak for those who stand with us, but are denied a voice.

The Government will make its Article 50 notification this week. This is the beginning of a 2-year process. Once we know the result of the negotiations, we must have a say in whether we accept it or not.

Blu-Ray playback with Kodi

I recently upgraded my HTPC’s optical drive to Blu-Ray (primarily for The Force Awakens). The DRM on Blu-Rays is problematic when you’ve built your own player – you can’t just stick the disc in and hit the play button like you can with DVDs. I’m using MakeMKV1 which lets you rip Blu-Rays for encoding with Handbrake, but I don’t really have the storage to be ripping Blu-Rays on an ongoing basis. Fortunately, MakeMKV also allows a disc to be streamed over UPnP, which Kodi supports natively.

To make this a bit more usable, I’m using a script to launch the stream with MakeMKV’s CLI interface, wait until the UPnP share is ready, then switch Kodi to the share ready to select the title from the disc.

I’m using the Advanced Launcher addon for Kodi to create a launcher for disc_trigger.sh. I’ve created a Favourite for the launcher and added it to the main menu. Now the process is:

  • Insert disc
  • Activate launcher
  • Wait until it’s ready
  • Select title and watch
  1. MakeMKV is proprietary, but free-as-in-beer as it’s in “perpetual beta”. You do however need to keep updating the beta registration code, so I paid for a license as I want this to be “setup and forget”.

Why I’m voting “remain”

First up, I’m not an expert on the UK’s relationship with the EU. Let’s face it, who is? I got a B in A-level politics about 10 years ago, so I have a general understanding of the mechanism by which EU law effects us, but that’s about as far as it goes.

The question posed by the referendum isn’t one of whether we change in one direction or another. It’s whether we keep the status quo, or change from it. However, the situation we’d change to is entirely unclear. There may or may not be benefits to changing. It seems like in the short term things might be chaotic, but in the long run they might be better, for some people, or they might not, and the post-leave plan is so vague (we don’t even know who’ll be deciding or implementing it) there’s no way to tell.

The uncertainty is the issue I have here. If we had some clear idea about what leaving the EU meant, it might be worth consideration. But since it’s so unclear, a vote to leave is essentially saying that the current situation is so terrible that literally anything would be better than what we’ve got. I don’t believe that’s the case, so that’s why I’m voting remain.

Playing WINE games with the Steam Controller

While I do the majority of my gaming through Steam on Ubuntu, there’s always a few games around that I’d like to play and aren’t out for Linux, so I play then through WINE.  This morning I discovered that it’s  possible to play WINE games with your Steam Controller.  As usual with WINE, your mileage may vary, but here’s what I did.

Firstly, you can’t just install the Windows version of Steam.  I don’t know if it would recognise the controller, but even if it would, Steam wont run Big Picture Mode if it’s running in WINE, so you’re out of luck there.

The trick is that you can add launchers for non-steam games (or actually, any application) to your steam library.  These will run with the Steam Overlay, and therefore will support Steam Controller configurations.  To do this, you’ll need to create a .desktop launcher file for your game.  You can do this with a text editor, but I used Arronax.

arronaxSet a title and an icon if you like, then for the command, enter the command to launch your game using WINE.  If you’re using the default WINE prefix, then this can be as simple as:

wine ~/.wine/path/to/your/game.exe

However, I tend to install WINE games using PlayOnLinux, which installs games into separate prefixes, with appropriate versions of WINE.  This means the default command doesn’t cut it.  Instead I created the following a shell script, and set the .desktop file’s command to execute that shell script.  Here’s an example that I used:

export WINEPREFIX=/home/steam/.PlayOnLinux/wineprefix/DiabloIII
export WINELOADER=/home/steam/.PlayOnLinux/wine/linux-x86/1.7.15/bin/wine
export WINESERVER=/home/steam/.PlayOnLinux/wine/linux-x86/1.7.15/bin/wineserver
"$WINELOADER" "$WINEPREFIX/drive_c/Program Files/Diablo III/Diablo III Launcher.exe"

You can find the appropriate wine version by looking at the configuration dialogue for the game in PlayOnLinux.  Note that PlayOnLinux can generate a .desktop files for a game, but these launch PlayOnLinux, and don’t appear to work when launched through Steam.

Once you’ve created your shell script and .desktop file, launch Steam in desktop mode, access your library and select “Add a game… > Add a Non-Steam Game…”.  This will show a list of applications in /usr/share/applications.  Click “Browse” and find the .desktop file you have created, then press “Add Selected Programs”.  The game will now appear in your library.

Launch Big Picture Mode, and select the game from your library.  You can now configure the controller as normal, and the Steam Overlay will launch with the game, giving you full support for the controller!

Steam Controller Review

It’s been about a year since I built my Steam Machine, and since then I’ve tried various solutions for playing PC games on my TV while sitting on my sofa.  These have included:

  • A Gamecube controller (my all-time favourite gamepad), which is great but doesn’t have as many buttons as games expect,
  • An XBox 360 controller which is the de facto standard controller for games with gamepad support, but doesn’t work with all games.
  • A Wii Remote, which works for games that need a mouse pointer, but is tiring to use for long periods and tricky to configure well.
  • When I’ve been really desperate, my Rii wireless mouse/keyboard, which is OK in a pinch but far from ideal.

The promise of the Steam Controller is that it “lets you play your entire collection of Steam games on your TV—even the ones designed without controller support in mind.”  When this was announced it seemed like to Holy Grail of input devices, the solution to all of my problems, so of course when I heard I could pre-order one this year for delivery a month before they went on general sale, I snapped one up.  I’ve now racked up a good view hours of gaming on games with various types of control systems, so does it fulfil it’s promise? TL;DR.

The hardware

A steam controller in its box.

The Steam Controller


The first analogue stick appeared on the N64 controller, then the Playstation Dual Shock controller was released with 2 analogue sticks.  Since then, controllers have pretty much featured 2 analogue sticks, 4 shoulder buttons/triggers, a D-pad, 4 general purpose buttons, and a couple of “system” buttons.  Each has had it’s own USPs, and Valve have clearly taken inspiration from a lot of places. Some similarities I’ve noticed are:

  • The Gamecube controller’s “cradling” grip.
  • The Gamecube’s 2-stage analogue+digital triggers.
  • Touch pads, seen on the PS4 and PS Vita.
  • A gyroscope (seen in some Gameboy games, the PS3 sixaxis and the Wii Remote Plus).

However, unlike any of these gamepads, the Steam Controller does away with the dual analogue stick/d-pad set up in favour of a single analogue stick, and 2 clickable touch pads, 1 under each thumb.  This allows for similar accuracy to using a touchpad or trackball, an an immense amount of versitibility.  The right pad is flat, while the left pad features an cross-shaped indentation, allowing it to easily emulate a D-Pad.

As well as the standard shoulder buttons, triggers and general purpose A/B/X/Y buttons, the Steam Controller sports a left and right “grip” button, which sits under your two smallest fingers on each hand. Squeezing the controller activated this button, which can be used in a number of ways, as we’ll see below.

The N64 controller features an optional “Rumble Pak”, which introduced what we might now call haptic feedback to console controllers.  All controllers since have featured something similar, merrily vibrating the let us know when we take damage or something near us explodes.  The Steam Controller doesn’t have a “rumble” feature in the same way, but it features a remarkable haptic feedback system for it’s analogue controls.  The analogue stick and triggers can be configured with an actuation threshold, which will provide you with a “clunk” when you cross it.  Similarly, the touch pads can vibrate slightly as your thumb moved over them, giving you a sensation similar to a mouse’s scroll wheel, or a trackball.

None of these features is in itself revolutionary, but the way they’re used together, and crucially the way the software allows you to configure them, creates a completely game-changing experience.

The software

The Steam Controller is not a gamepad.  It’s an input device that can be used to emulate a gamepad, a mouse, a keyboard, or bits of each at the same time.

A screenshot of the controller configuration interface from Steam Big Picture Mode.

Steam Controller Configuration interface.

This is all handled by an addition to Steam’s user interface.  When you select a game in Steam Big Picture Mode, you have the option to configure your controller for that game.  This provides you with an interface that lets you map each pad, stick, button and click to a control on one of the aforementioned devices.  I won’t go into detail, but spending half an hour exploring the configuration options available is mindblowing.

A screenshot showing the options available for configuring the controller's touch pads.

Touch pad configuration options

Configuring a gamepad to emulate a mouse or keyboard is certainly nothing new (I’ve used qjoypad and WiiCan to do similar things in the past), but nothing before has had the flexibility and ease of use that Steam has achieved.  I’ve certainly never seen a controller configuration tool that you can use with the controller you’re configuring.

Once you’ve configured your controller (either manually, using one of Steam’s templates, or using a configuration shared by the Steam community), you launch the game and Steam activates your configuration.  You can even tweak the configuration in-game or call up the innovative dual-pointer on-screen keyboard by pressing the Steam button on the controller and bringing up the Steam Overlay.

The games

I’ve played a number of games with different control systems to really test out the Steam Contoller’s ability to play any game.  Here’s a bit about how the controller can be set up to play each type of game:

First-Person Shooter (Borderlands 2).

Borderlands 2 has gamepad support, so the simplest way to play with the Steam controller is to use the “Gamepad” preset.  This uses the left touchpad as a D-pad, and the right touchpad as an analogue stick. However, to really get the best experience, you can use the “Gamepad with precision aim” preset, which uses the right pad as a trackball, giving you a mouse-look style experience.

The grip buttons are mapped as extra A and X buttons, which gives you the nice option of keeping your thumbs on the movement controls while using those functions.

Real-Time Strategy (Xenonaughts)

RTS games rely on you having a mouse pointer to select units and issue commands.  For games like this, the right pad can be used to control the mouse pointer, while the triggers provide the mouse buttons.  Other buttons can be bound to keyboard keys used for selecting pre-defined groups of units, or switching to different views.

Third-Person Action/Adventure (Don’t starve)

As with Borderlands 2, Don’t starve has controller support, so using the Gamepad preset is all you need.  In an non-FPS game, the precision aim option isn’t so useful.

First-Person Adventure, not controller aware (Minecraft)

Many first-person PC games are controlled with the WASD keys for movement, and the mouse to control the camera.  The keys within easy reach of WASD are used for other functions like jumping and running.  Steam provides a “Keyboard (WASD) and mouse” preset with this configuration in mind – the rest of the buttons can be tweaked as required for the particular game.

Point-and-click adventure (Deponia)

As the name suggests, these games rely almost entirely on the mouse, with a few keys used for opening inventory and menus.  I found a community configuration for Deponia that had the mouse and just the few other functions required mapped to the buttons.

Isometric RPG (Pillars of Eternity)

Once again, these games tend to be mouse-driven to tell your characters where to go and what attacks to use, as well as to manage inventory and equipment, and select dialogue options.  A community configuration provided a nice mouse set up, with the added bonus of the right touch pad being used to move the view around (usually this might be controlled by right-clicking the mouse or using arrow keys).  One slight downfall on this sort of game is that they often make use of a large number of use-defined hotkeys, of which the controller is limited.  However, it is possible to use the grip buttons as modifiers, so “A” could be bound to the “1” key, “Left Grip+A” to the “5” key, and “Right Grip+A” to the “9” key, allowing for more hotkeys to be used.

First-person shooter, Steam Controller Support (Portal 2)

A final bonus of the Steam Controller is that Valve are making an API available for developers to bake support right into the game.  In this case, rather than mapping to gamepad/mouse buttons or keyboard keys, the controller can be mapped straight to available functions in the game (e.g. “Orange Portal” instead of “Mouse 1”).  Also, the game can display appropriate hints like “Left Grip to duck” rather than “Button 15 to duck”.  I expect we’ll be seeing more of this.

The verdict

I’m yet to find a game that I’m not comfortable playing with the Steam Controller and the right configuration.  While certain aspects of the controller take some getting used to, Valve have excelled themselves, to the point where I wouldn’t even consider using another controller for my PC gaming. 10/10.

Setting up a Steam Controller on Ubuntu

I recently received my pre-ordered Steam Controller, which I’ve be itching to use with my home-built HTPC/Steam Machine.  I do all my gaming (and everything else) on Ubuntu, and discovered at that the time the pre-releases were shipped, there was a bit of tweaking to do to get the controller working.  Thanks go to this Ask Ubuntu question and this Steam Community thread.  If you are using Ubuntu 15.10 or later, steps 1-3 shouldn’t be necessary, and hopefully a fix will be in place by the time the controllers are on general sale.

  1. Before you plug in your controller, edit (or create) file /lib/udev/rules.d/99-steam-controller-perms.rules.  This already existed on my system.  Edit to to contain at least these lines (it may also contain others):
    SUBSYSTEM=="usb", ATTRS{idVendor}=="28de", MODE="0666" 
    KERNEL=="uinput", MODE="0660", GROUP="yourusernamehere", OPTIONS+="static_node=uinput"

    Make sure you change “yourusernamehere” to the user you run steam as, or if there are several, the name of a group containing them all.  This will ensure that the controller is correctly recognised and can emulate a gamepad.

  2. Run sudo apt-get install python3-autopilot.  This will install some packages which will add you to a group with write access to /dev/uinput.  This is necessary for the controller to work properly.
  3. Reboot
  4. Plug in your steam controller dongle.
  5. Press the Steam button. It should beep and light up (if not, check the batteries are installed).
  6. Launch Steam.  You should see a notification that your controller is detected.
  7. Launch Big Picture Mode (if you don’t, Steam will tell you to).
  8. Ensure the Steam overlay is enabled in Settings -> In-game.  If not, your controller configurations will simply not work.
  9. Select a game, pick a controller configuration, and play!