Thursday, May 13, 2010

Media PC - Tame your remote using an IR blaster and EventGhost


While the remote that I use for my Media PC works pretty much out of the box with Windows 7 and Windows Media Center it would be really nice to change a few things and add some extra functionality.

All of the buttons in RED above now have new functions while not interfering with either Windows Media Center or general control..

Fortunately, with an USB-UIRT IR blaster and Eventghost, you can do just about everything you need without the hassle of resorting to a programmable remote (which I hate for a variety of reasons).

Let me go over the things that I changed to give you an idea of just a few of the things you can do.  It is likely you will want different features, but this should should help you get started.

Problems to solve:
  1. The IR remote doesn't seem to have the ability to wake the PC from standby (totally unacceptable that I'd need to have to get up to turn on my Media PC!)
  2. It would be nice to control basic TV functions (specifically turn on/off the TV, change inputs, and select picture zoom mode).  Get rid of the remotes cluttering my living room!
  3. Same for my receiver:  Turn on (and automatically select the audio input), and turn it off.  Also, I'd like the ability to turn up / down the receiver's volume.   I'd like to retain the ability to control the volume in Media Center as well.  Again, the goal is to not need my receiver's remote.
  4. I'd like one button launch capability for Hulu, Zinc.tv, and...
  5. Having a one button DVD eject / insert is handy
  6. I use Squeezeslave for audio streaming.  I want a button to raise the window Squeezeslave runs in (so the remote can control it), and a button to restart it in case it hangs (rarely a problem, but it does happen).  The idea is that I don't want to have to turn my TV on to see what is going on when I'm listening to music only.
None of these problems are deal-killers, but solving them really adds to my enjoyment of the system.  I rarely have to reach for another remote or the keyboard for day-to-day use of my Media PC.

USB-UIRT overview


The USB-UIRT (shown attached to the side of my Media-PC) provides three basic functions.  It can receive IR commands, transmit IR commands and most importantly learn an IR command.  You can order one here for $50, and you download the drivers here.  There are two versions of the USB-UIRT (one with a 56khz sensor or one without).  The 56khz frequency is rarely used by IR remotes, but having the sensor increases the likelyhood that it will work with any remote.  At only $5 more, I opted for it even though I didn't need it.

Also, since the USB-UIRT will be transmitting IR commands to my TV and receiver you might want an IR led to attach directly to your TV or other device.  They are really cheap, just make sure you get one that is "non-blinking" so that the USB-UIRT has enough power to drive it.  You simply plug it into the back of the USB-UIRT and stick the LED on to whatever device you want to control.  Here is a link to one.  However, you may find that the USB-UIRT's built-in front facing transmitter is powerful enough to be "seen" by your TV.  This is the case for me, but I do find that sometimes I have to press the buttons more than once.  I'm sure if I added an external LED transmitter it would be a bit more reliable.

Getting the USB-UIRT to "wakeup" the Media PC from standby.

This feature alone is worth the price of the USB-UIRT.  To get this to work, you need a simple utility called lrnhelper and should do a one-time configuration.  You can download it here.

Run the utility and select the USB-UIRT Setttings menu:


Since the IR remote receiver (which you see stuck on top of the USB-UIRT) always blinks when I press any button on my remote, I didn't want the USB-UIRT to blink as well (one blinking LED is enough).  So, on the USB-UIRT menu above, I only enabled blink on Transmitting IR.

Next, select the USB-UIRT Wake-Up configuration menu:


First, click on Learn.  You will need to hold the IR remote a couple of inches away from the USB-UIRT and press the button on the remote that you wish to have wake up your PC.  In my case, I wanted the power button (in the upper right corner of the remote) to do this.  Once the code is learned, make sure "Enable USB-UIRT Wake-Up Feature" is checked.

You are done and can exit the utility.  Test the wakeup feature by putting the computer to sleep and using the IR remote to wake it up.

NOTE:  You may have to enable wake on USB event functionality.  I am using the really handy Media Center Standby Tool for this, but you can also do this in Windows.  MST is so useful, I'll writeup a separate post on it.

Setting up EventGhost

For all of the rest of the features, we need an application program that can deal with IR remotes.  There are lots to choose from, but I wanted one that already worked with the USB-UIRT and was easy to use.  I've tried a few, but really liked EventGhost.  It is a little tricky to get used to, but really powerful and easy once you learn it.  It works really well and has an amazing array of features.

You can download EventGhost here.

Get familiar with the screen:


There are two panes.  On the left you have events that occur (such as keyboard presses, mouse clicks, IR button presses, and even system activities like tasks starting, etc.  On the right is your configuration with you can edit and save.

Add the plugins for devices you want to control


The first plugin you want to add is for the USB-UIRT.  This allows EventGhost to see events generated by this device.  You may also want to add (as I have) the plugin for keyboard events and the HID device that represents the remote itself.

NOTE about the IR remote.  The remote that I've chosen actually is a bit of a hybrid device.  As far as the operating system is concerned it appears to be another keyboard and mouse, NOT an IR remote.  This is a great feature for compatibility, but a bit confusing at first.  This is what allows it to control Windows Media Center without any configuration.  It simply emulates the keyboard strokes that perform basic media center functions.

Add a command to start when your computer boots


In my case, I want a program to start running as soon as my computer starts fresh.  This program "SqueezeSlave" allows me to stream audio (music) from my main music server to my Media PC.  Since my Media PC as multiple audio outputs, I simply directed one of these outputs (digital optical) to my receiver.  This way I don't have to have my TV on to listen to music.

In order to do this, I added an "Action" to start an application under the "Autostart" area of my configuration.  Then I simply wrote a quick batch file to run SqueezeSlave.  I could have just run Squeezeslave directly, but the batch file is smart enough to restart it if it crashes.

Program EventGhost to do things when you press buttons on the remote


To get EventGhost to start Hulu Desktop, I simply create a new macro, shown above I have two macros for Hulu and Zinc.tv.   Capturing events is super simple, just point your remote and press the key.  You will see the events show up in EventGhosts' left pane.  Then simply drag and drop them into the macro.

As I noted above, the IR remote emulates a keyboard.  So, some of the buttons appear to be a keypress.  The button I used for Hulu shows up as a Left-Control "O".  Also, it occasionally comes across with an extra Null.  I simple associated both events with the same macro so that either one will trigger Hulu.

One problem I ran into is that Hulu launched this way doesn't always go come to the "front" in terms of window focus.  This is no problem as EventGhost has controls for finding windows, pausing, then automatically raising a window to the front.

The end result is that I press one button and up pops Hulu Desktop.

Note:  With my IR remote, you have to be a bit careful which buttons you try to remap.  If you try to map a button that is a common key on the keyboard, it could be have unexpected consequences.  So, experiment a bit to make sure it works for you.

How to handle buttons that toggle


EventGhost doesn't have a super clean way of handling macros that perform a toggle function.  For example, I want the button for my receiver to turn on and select the correct audio input (Digital Coax in my case).  When pressed again I want it to turn off my receiver.  This amounts to three distinct IR commands to be transmitted.

The first step is create two macros that alternatively enable and disable each other.  Above you see two macros call "RecvPower-isoff" and "RecvPower-ison".  They are triggered by the same event (Left-Control M) but are never enabled at the same time.  Once one is enabled and activated, it performs it's function, then disables itself and enables it's opposite.  Pretty primitive, but it works.

Of course, you will also want to have each macro send the appropriate IR commands via the USB-UIRT.  You do this by adding an USB-UIRT action.  You can then configure that action by learning the IR code from whatever remote you want to emulate (in this case, my receivers IR remote).

If this all seems overwhelming....

It isn't really.  However, it will take you a while to get the configuration setup the way you like it.

My recommendation is to start slowly and add one function at a time until you get comfortable with how EventGhost works.   After a while you will find that it can do just about anything you imagine and really does make your Media PC much nicer to use.

There is lots of documentation for you to read through on the main website.

You won't get this nailed it an hour, but the time you spend will be well worth it.



3 comments:

  1. George, have you done any playing around with iphone/itouch apps that drive the PC through wi-fi? None of the IR problems. I tried one that worked well, until I paid for it, then the licensing/authentication was not very good.

    ReplyDelete
  2. Oops. Just saw your other post about remotes that refers to MediaMote. I'd love to hear if you have experimented with any yourself. The one that I tried was MobiMote, and it worked well until the licensing/authentication problems forced me to dump it.

    ReplyDelete
  3. Hello,

    That is a great question and thanks for the comments.

    Yes, I've used the Boxee App, MediaMote, and at least one other for Windows Media Center (I can't recall the name at the moment). I did spend some time looking for good ones, but that was a few months ago (things do change rapidly!)
    I've also used iPeng for SqueezeBox control, and an AppleTV app.

    BTW: The Apple TV's standard remote is so bad, that anything done on the iPhone/iTouch/iPad is bound to be leaps and bounds better.

    However, truthfully, I haven't found much appeal for using apps to control my media center. My general impression is that they mostly try to emulate remote and keyboard behavior and don't do a very good job. Perhaps I'm spoiled, but I think my IR remote does 99% of what I want. For the remaining bit, there is no substitute for a full wireless keyboard. You really don't want to do general PC administration stuff on a virtual keyboard (not very fun IMO).

    There is also the issue of using your iPhone/iTouch as a shared device with other family members. My IR remote doesn't need charging and I'm pretty sure it will work even when dropped (as it has been)!

    What I really have hope for is the iPad. It has all kinds of potential as a device to control everything in the house. However, it is just a tad expensive and awkward as simply a remote replacement.

    In the end, I'm still curious about using apps to control my Media Center, but only make occasional use of them so far.

    Anyway, that's my experience.

    ReplyDelete

Copyright (c) 2010 CuttingTheBills.com. All Rights Reserved.