Friday, August 18, 2006

IR control through a wall

Doing it the old way

All of my kit is now inside a cupboard - well out of IR line-of-sight. Of course, I still have my PVR350-bundled IR receiver and this is positioned just below the bottom edge of the plasma screen. It continues to happily accept instructions from the Hauppauge remote across the room. However, it only controls the MythTV interface. My cable feed (NTL Pace box) is indirectly controlled via Myth using a homebrew IR sender.

I now need to control two other devices located in the cupboard; my AV amp and DVD player. I looked at several solutions including dedicated wireless and wired IR relays. I didn't like the wireless solution due to additional power requirements and visibility of an IR receiver box. The wired solutions were better and Keene's looked about right for me. However, in an attempt to save a few quid, I decided to see if I could extend the capacity and range of my existing lirc/homebrew IR sender to accomodate the amp and DVD.

Replacing the IR sender

The existing sender was an extremely basic, low-powered design and only worked if the IR led was literally stuck to the front of the NTL box. Adding more leds into the mix wasn't going to happen with the basic circuit, so I decided to build a new high-power IR sending circuit using this schematic. It has the advantage of being able to drive several IR leds and a normal led (for monitoring) while still being passively powered off of the serial port.

After ordering the components and some veroboard, I set about transferring the schematic to a suitable board layout and soldering the circuit together.

It worked fine although I made the mistake of putting one of the IR leds directly in front of the NTL box. In that configuration, IR signals were being received but weren't being recognised properly. It turned out that the power increase was so significant that the IR was just too strong for the box! After moving it away from the NTL box and actually bouncing the IR off of the opposing wall, signals were received perfectly. This also meant that I only needed a single IR led to control all of the kit in the cupboard rather than needing one led per device as I had expected.

Controlling the amp and DVD player

The next stage was to setup lirc to allow me to manage the AV kit. I had a choice of:
  1. Relaying all signals from existing remotes through to the individual units
  2. Using any remote to control any piece of kit
  3. Using one remote to control all kit
I had originally envisaged (1) as that was my expectation from buying a dedicated IR amp/relay. Although I have my Yamaha AV amp's remote control programmed for my DVD, it would still have meant using at least two remotes for Myth; the Hauppauge and the Yamaha.

I liked the idea of (2) and started testing but soon found that neither my Yamaha remote nor my Sony DVD remote would work with the Hauppauge IR receiver. I guess they operate at different frequencies. Incidentally, the panasonic TV signals mapped into the Yamaha remote did work ,so at least theoretically, I could have remapped all of the Yamaha keys using panasonic codes and then interpretted them within lirc to be re-transmitted as native Yamaha codes... Yep, that's why I didn't do this.

Anyhow, although limited to the Hauppauge remote, I could potentially use that to control everything as in (3).

One remote to rule them all

Now it was time to coax lirc into managing all IR signals and doing the right thing(TM). lirc doesn't have the concept of pass-through. All IR signals are decoded and optionally acted upon. Actions can consist of interception by running applications like mythfrontend and mplayer or executing shell commands via irexec. Commands can include using irsend to pass IR signals back out through the IR sender circuit.

As I couldn't teach lirc about either of my remote controls, I needed to find suitable lircd configs for them. I found a Sony DVD config that just about worked (had to send commands twice?) but the closest Yamaha config only had a small subset of functions defined - far fewer than I needed. After using various sources of info, including IR code sheets from Yamaha's UK site, I had a suitable config. Now I could drive the kit using the IR sender.

Mapping everything onto one remote

Next, I had to write a suitable .lircrc to enable correct interpretation of incoming IR signals. While doing this, I enabled lirc's mode functionality and also created a few macros to chain multiple actions off of a single button press.

Although there are some reliability issues with the DVD control and some finishing touches left, it's working ok. Once I've re-installed my kit on to a permanent AV rack and tuned the IR setup some more, I'm fiairly confident that I'll get all of this to work properly.

Addenda: Disabling interrupts

I read on the lirc site about the need for the serial IR transmitter driver to disable interrupts while sending commands. Hadn't really considered this before as the only time commands were sent was to change channel on the NTL box, however I'm now experiencing some knock-on effects of this. eg. I now get minor picture stutter when changing volume...


Post a Comment

<< Home