How To Setup IR Remote Control Access In Ubuntu Linux

What HTPC setup would be complete without a remote control to command your rig from across the room? For the VCR, I chose the SIIG Vista MCE Remote for its compatibility and range of functions. It also happened to be reasonably-priced at Micro Center when I bought it.

To get started, plug in your IR receiver USB dongle and install LIRC from the terminal:

sudo apt-get install lirc

During installation, you will be presented with a dialog asking you to select the specific remote control you have.

Screen Shot 2015-04-08 at 3.49.35 PM

For the SIIG Vista MCE remote, choose “Windows Media Center Transceivers/Remotes (all)”

Screen Shot 2015-04-08 at 3.49.51 PM

Then, choose your brand of IR blaster (if applicable). In this example, I do not have one installed, so I chose “None”.

Screen Shot 2015-04-08 at 3.50.02 PM

Allow the installation to finish, then install LIRC X Utilities from the terminal with the following command:

sudo apt-get install lirc-x

Test your remote’s communication with the irw terminal command.

Point the remote at the receiver and press a few buttons, you should get some coded output on the screen. If so, congratulations! Press C to quit IRW.

If there is no output, verify that the dongle is working (there’s usually a red light that accompanies keypresses) and that the correct remote was selected in setup. You may need to reboot for the computer to recognise the new hardware.

For more on remote control setup, click here.

How To Setup IR Remote Control Access In Windows With WinLIRC

WinLIRC, unlike its Linux-based sibling, is a finicky priss to get working. I tried to follow the setup guide on their website, but it was getting late and I could no longer make heads or tails of what they were trying to convey. Starting fresh this morning, I took to futzing around with the settings until I had it working correctly.

Installing WinLIRC is as simple as downloading the zip file from SourceForge and extracting it to any location on your computer. For simplicity, I stuck the application folder in C:\

Screen Shot 2015-04-12 at 12.17.00 PM
“Program Files”? Shit just gets lost in there!

When you first run WinLIRC, you will get this error message off the bat:

CREDIT: WinLIRC
CREDIT: WinLIRC

Okay, I haven’t even defined a configuration, so obviously nothing’s going to work! Thanks, WinLIRC! Click “OK” and you’ll be taken to the main Setup window.

10 In the top section, choose the Input Plugin that is compatible with your remote. Since I’m using the SIIG Vista MCE Remote, I’m going to choose one of the MCEVista* plugins, and since my copy of Windows is 64-bit, I need the MCEVIsta64.dll plugin to drive my remote.

Screen Shot 2015-04-12 at 12.22.00 PM In the next section, you have to specify the configuration for the remote itself. Some fine folks have done a great job of writing a configuration file for almost every remote you might run across, so going to pop over to their website and grab /remotes/mceusb/lirc.conf.mceusb (right-click->”Save link as…”), saving it into the WinLIRC folder.

Screen Shot 2015-04-12 at 12.29.50 PMClick “OK” at the bottom, and you will likely get this message:

CREDIT: WinLIRC
CREDIT: WinLIRC

GOTO 10

CREDIT: WinLIRC
CREDIT: WinLIRC

tumblr_lcttnsi9AX1qb5bn1Screen Shot 2015-04-12 at 12.43.25 PM

GOTO 10

CREDIT: WinLIRC
CREDIT: WinLIRC

Rage_table_flipSo, how do you get it to work? The trick is that you can’t simply right-click->”Run as administrator”. Oh, no! You have to edit the properties so that it runs at elevated privileges all the time!

No, not here. One more step....
No, not here. One more step….

In the Properties dialog, click the “Compatibility” tab, and, at the bottom, don’t simply check “Run this program as administrator”. Click the button underneath that says “Change settings for all users”. THEN check “Run this program as administrator”!

Screen Shot 2015-04-12 at 12.52.20 PM
Okay, NOW you can check the box.

Try running WinLIRC again and you should see the system tray icon come up and you should no longer get the dreaded “Error Window of Doom”.

Now that you have WinLIRC properly configured and receiving signals from your remote, you’re going to need some way to parse those signals into useful commands….

Parsing IR Remote Control Signals In Windows Using EventGhost

Now that we’ve learned the secret to getting WinLIRC to run correctly, it’s time to decode those signals into commands that Windows can use. To do this, we’re going to use a powerhouse automation tool that is unique to Windows called EventGhost.

EventGhost is a plugin-extensible application that takes input from any myriad of devices or programs and, through the use of a simple IF/THEN programming setup (think IFTTT), calls the desired response within Windows, a particular application, or even connected devices.

Getting the VCR remote set up in EventGhost was more of a headache than I anticipated, and required a lot of scanning fora and a little noodling to get working correctly. However, once I found the proper combination of versions, plugins, and conditions, it’s working like a champ!

First, you have to download and install EventGhost. At the time of this writing, the newest version (0.4.1.r1700, released 4 Mar 2015) seems to be the culprit behind my inability to get the plugins working, so make sure you go with (as of right now) v0.4.1.r1694, released 27 Jan 2015. If there is development between now and the time you’re working on this, just bear this tip in mind if the latest version does not seem to be working.

When you first run EventGhost, there will be quite a bit of detritus that you won’t likely need already programmed as examples. Disable or delete everything in the Configuration Tree except “Volume Control”

The default configuration tree.

To enable remote control commands, you must activate the MCE Remote plugin. To add the plugin, choose “Add Plugin…” from the “Configuration” menu.

Select “Microsoft MCE Remote” from the list.

Do not install the version marked for Vista/Win7 as it is rather finicky and difficult to work with, requiring the installation of an alternate MCE IR service that is buggier than that scene in Temple of Doom.

Pictured: Attempting to work with AlternateMceIrService in Windows 7 (CREDIT: LucasFilm)

The settings for this plugin will allow you to set a custom button release timeout, which will be handy if your system is registering multiple button presses from your remote. I have mine set to 0.75 seconds, which seems to be just enough time. Play around with this setting to find something that works for you.

Additionally, the settings dialog will prompt you to disable HID service for the remote. You do not need to do this except under special circumstances. The HID service in Windows 7 works fine.

Test to make sure that the correct button presses are being registered in the left sidebar. If they are, congratulations! Your remote is now working in Windows and you can customise buttons to your heart’s content!

How To Use A Remote Control With Kodi In Windows

Kodi, as we’ve discussed before, is the most powerful all-in-one home theatre solution for the 21st century that combines a comprehensive metadata-driven viewing experience for all your local media as well as the ability to extend functionality through the use of plugins for many kinds of streaming media. The one problem with this setup is that Kodi does not recognize Windows Media Remote commands out of the box and will require a separate process to parse those commands into something useable.

If you have EventGhost properly setup to receive and interpret IR commands from your remote control, there is a stock plugin available for EG that will translate those keypresses into Kodi commands, allowing you to easily program a remote control with Kodi.

Highlight “Autostart” in the EventGhost Configuration Tree. Right-click and choose “Add Plugin…” From the plugin menu, scroll down to “XBMC2” in the “Program Control” folder, highlight, and click “OK”.

Screen Shot 2015-04-15 at 7.38.48 PM

Unless your Kodi/XBMC settings are different from the defaults, go ahead and click OK on the next screen as well. EventGhost will prompt you to add actions, but you don’t need to. All of your macros and actions have now been added to the “XBMC2” folder in the Configuration Tree.

The next part is somewhat tedious, but only required once. Press each button on the remote to register the event in EG. Then, drag each button press event to the corresponding macro in the XBMC2/Buttons folder.

Screen Shot 2015-04-19 at 10.17.25 AM
Once your buttons are programmed, you are ready to use your remote with Kodi!

Control Kodi and Stream to Your Android Device With Yatse

I’ve been playing with the Yatse Android app for a little while now, and it blows away the stock Kodi/XBMC remote control app! With the free version, you get a much slicker interface and a lot of great bells and whistles as it provides a more robust second screen experience.

With the paid version, you can download media to your device (great for trips) and even stream media on your home network (great if you want to watch something besides Korean melodrama on Hulu)!

If you don’t want to spring for a Microsoft IR remote or just don’t have the room to install one, definitely give the Yatse remote app a shot, and even if you do have the IR commander set up (like me), it’s still a great value for all the extra features!