Linux iMON pad remote controller with lirc

September 11, 2008 by · 2 Comments
Filed under: Hardware, Linux 

Introduction
In short, the SoundGraph iMON PAD that came with my SilverStone LC20 doesn’t work very well with the default ubuntu 8.04 installation. I’ve previously discussed how to get the VFD running, and am now turning my attention to the remote control and how to get it decently working in mythtv with lirc.

Let’s start by looking at the following image:
In short, red files are “main steps” which the “packets” flow from the remote control, and finally reaching lircd where they are converted from a binary stream into something intelligeble (with the help of the lircrc file, which specifies names for the different hex codes).

blue boxes are configuration files, green boxes are “users” of lircrc — ie, they will connect to lircd and receive all the updates from lircd as needed. Finally, magenta boxes are different things needed to build to get stuff running.

Installation
Everything will work out of the (ubuntu 8.04) box more or less, except for the big blobby nice mousepad on the remote control. That one is a mouse — sort of — and doesn’t work at all for me, your mileage may vary however (ie, it didn’t work for me, it might change fast)

Install Xorg, mythtv, mplayer, linux-kernel sources (needed later) and lirc via apt-get or your prefered frontend. Configure the packages, start xorg and make mythtvfrontend start from the .xinitrc if you so wish, and then start via the startx script, or rather make it start up as you feel most comfortable with. I’m an old fart and I like my startx.

Once all this is set up, all things should work, except the remote control, as already said. Most buttons will work, but not the big blobby knob (a.k.a. mousepad).

HACK
Well, it’s time to hack the horrible hack I guess. Download lirc-0.8.3 from www.lirc.org. Also, download the pad2keys patch from http://brakemeier.de/electronics/vdr/lirc-imon.html.

1. Unpack the lirc package.
2. Patch the lirc package with the pad2keys patch (it will most likely fail with some chunks, just look at the patch, and add the code manually, are you a hacker or not?!).
3. Configure and make the lirc package. Don’t install it.
4. run uname -r, note your kernel version (2.6.24-19-server for example).
5. run “locate lirc_imon.ko” (have you updated your locate database? man updatedb, hint hint). If there are more than one in the list showing up, find the one in /lib/modules//blah blah.
6. Copy lirc-0.8.3/drivers/lirc_imon/lirc_imon.ko to the file you found in step 5, and replace the old one.
7. Either reboot, or if you know how to rmmod lirc_imon.ko and modprobe the new one. This might fail if you followed my previous post on islcd=0 etc, if you did, remove that line again.

Don’t forget to edit your lircd.conf with the new IR codes from the brakemeyer.de webpage. Set PAD key’s to good values, such as this:

Up 0x690281B7
Right 0x688A81B7
Down 0x688291B7
Left 0x6A8281B7

Finally add them to your lircrc in a good way, such as this:

begin
prog = mythtv
button = Up
config = Up
delay = 2
repeat = 1
end

begin
prog = mythtv
button = Down
config = Down
delay = 2
repeat = 1
end

begin
prog = mythtv
button = Left
config = Left
delay = 2
repeat = 1
end

begin
prog = mythtv
button = Right
config = Right
delay = 2
repeat = 1
end

So, you’re now a hacker of immense proportions. Celebrate with some mead and grow a beard like the rest of the hackers ;-).

Ubuntu 8.04 lirc_imon VFD’s

September 10, 2008 by · Leave a Comment
Filed under: Hardware, Linux, Ubuntu 

I got a silverstone LC20 chassi with a built in iMON vacuum fluorescent display (VFD) and IR remote control. I recently upgraded to Ubuntu 8.04 from 7.10 — yes I know, I am a bit late, but generally you don’t have to deal with kinks like this one when that happens.

Ubuntu 7.10 -> 8.04 changed the behaviour of the lirc_imon module pretty little, yet radically. The old default was to treat all iMON driven screens as VFD’s, but it now defaults to treat all iMON modules as LCD modules instead.

This results in tons of errors being pumped out (10’s-100’s per second), like this one:

Sep 9 21:35:00 fs1 kernel: [ 71.481262] /var/lib/dkms/lirc/0.8.3~pre1/build/drivers/lirc_imon/lirc_imon.c: lcd_write: invalid payload size: 32 (expecting 8)

Also, the VFD will not work. To make a long story short, to fix it, you need to tell the kernel module that the VFD is in fact a VFD and not a LCD, by giving the kernel module the option islcd=0. For example, in /etc/modprobe.d/options:

options lirc_imon islcd=0

I hope this helps anyone out there. I will soon try to have something together on getting the iMON PAD working properly. The basics was simple to get working, but the “mousepad” has been a general pain to get up and running properly.