As I mentioned before, getting the iMON display working was a bit troublesome. However, I managed to get it all working. Since it was so problematic, I'd like to share details of how I did it.
Before continuing on, I have to give huge thank you to Dean Harding for setting up the codeka.com forums and for all the work he did with the iMON. Also, thanks to many of the people in those forums who provided followup info and helped troubleshoot/patch things to work with newer versions of the hardware (especially madCoder for his patch for the 0038 model).
Also, I just want to say that, while the following instructions may seem a bit long, it really doesn't take that much work. A lot of this will just be verbose text. I'm trying to provide as thorough instructions as possible and describe whats going on, so that if you run into problems (ex: your configuration is a bit different), hopefully you will understand what needs to be done and figure out how to work around it.
Step 1 - Determine which version of the iMON you have
First, you need to get the ID of your iMON device. Run the lsusb command and look for a line that says Soundgraph. Before that will be the ID string. In my case, it's 15c2:0038, with the 15c2 being the vendor ID and the 0038 the product ID. If this is the version you have, then the rest of the instructions on this page should hopefully get you up and running.
If you have the 15c2:ffdc version, you have the original, and you can probably just follow Deans instructions from codeka.com. If you have another version number, then that means either Soundgraph has changed the device again, or you don't actually have the LCD (perhaps you have the VFD, which is a very different device). In either case, you can have a look around at the codeka.com forums and see someone has figured it out.
Step 2 - Determine if usbhid is controlling the iMON
Originally, the instruction I found for setting up the iMON display didn't work. I followed them to the letter, but had no luck. Well, as it turns out, it seems newer versions of the kernel (I'm running Debian 2.6.24) have support for the iMON in the usbhid driver. That means when the usbhid driver starts, it takes control of the iMON. Later, when the lirc_imon module loads, it's unable to take over the device.
So the first step necessary in setting up the iMON is to make sure the usbhid driver hasn't taken control of it. Run "cat /proc/bus/usb/devices". The output of this will be 1 block of info for each USB device in on the system. You want to find the block(s) that has Vendor=152c and ProdID=0038. Then look down a few lines further in the block and look for the line that contains "Driver=". That will tell you what driver is loaded for that device. If the driver is "usbhid", you need to continue on to disable it. If it's "(none)", you can just skip step 3. If you see lirc_imon, then you already have the proper driver loaded. Anything else and you are on your own.
---------------------------------------------------
Edit: It has come to my attention that /proc/bus/usb/devices doesn't exist on all systems. Apparently not every distribution has usbfs mounted. You can run the command
mount -t usbfs none /proc/bus/usb
to mount it, and then /proc/bus/usb/devices should exist.
---------------------------------------------------
Step 3 - Prevent usbhid from controlling the iMON
Assuming the usbhid driver has been loaded, you now need to disable that. You probably don't want to completely disable the usbhid driver, because that can prevent other devices from working properly (such as usb keyboards and mice). Instead, you want to tell the driver to ignore your particular device. The following instruction work for the 2.6.24 kernel under Debian.
1) Edit /etc/modprobe.d/usbhid (create it if it doesn't exist) and add the following line. The first hex code is the vendor ID, the second is the product ID, and the 0x0004 means ignore this device.
options usbhid quirks=0x15c2:0x0038:0x0004
2) Run the command: depmod -ae
3) You need to rebuild your initrd. If you are running a typical installation, you can do this by running:
update-initramfs -u
In my case, I'm doing a diskless boot over NFS, so I had to do it slightly different. Edit /etc/initramfs-tools/initramfs.conf and make sure BOOT is set to nfs. The run "mkinitramfs -o initrd.img.netboot". Finally, copy the new initrd.img.netboot over to the appropriate location on the tftp boot server (and rename it if you are using a different filename in your setup).
Once this is all done, a reboot should use the new settings and stop loading usbhid for your iMON. Run the "cat /proc/bus/usb/devices" once again. This time, the driver should be listed as (none). If it is still usbhid, do NOT continue on with these instruction until you've figured out how to deal with it for your particular distribution.
Step 4 - Installing LIRC
The basic installation instruction come from this post in the codeka.com forums. The patches to deal with the 0038 model come courtesy of this post by madCoder. In addition, I've made a few small changes to the patch to deal with the iMON pad remote and the front panel buttons on the Thermaltake DH-101 case. Other cases with front panel buttons likely require this same patch. If you don't have this case, I don't really see any harm in using my patch anyway.
You can get detailed info from the above 2 posts, but I'll summarize it below to help you keep things in order between both posts. Also, I'll provide links to actual patch files you can download, because copying and pasting the patch files from the forum are likely to get you "malformed patch" errors because of formatting issues.
Also, before beginning, you'll want to make sure you don't already have an installation of LIRC by running "apt-get remove lirc"
1) Make sure you have the prerequisites for LIRC installed as listed on this page. In my case, I was able to do that through apt-get:
apt-get install libtool automake1.9 autoconf
2) Download the current version of LIRC from CVS.
3)
UPDATE:
With the latest version of lirc (as of sometime in early 2009) all the necessary patches have been included into the CVS version of lirc. It is now possible to get full iMon support without applying any patches to the CVS branch (at least until SoundGraph decides to create a new iMon device with different control codes :)
Anyway, I'm crossing out the info that is no longer needed (but I'm leaving it here in case anyone has any use for it)
The 0038 version of the iMON hardware requires you to patch the LIRC code first. Download this patch and then install it by running the following command from within your LIRC directory:
patch -p1 < lirc-imon_0038-v2.patch
UPDATE:The code in CVS has changed slightly, and a critical part of the patch no longer applies automatically. Until I get a chance to update the patch, you will need to do the following AFTER applying the patch:
- Edit drivers/lirc_imon/lirc_imon.c
- Find this line:
{ USB_DEVICE(0x15c2, 0xffdc) },
- Add this line after it:
{ USB_DEVICE(0x15c2, 0x0038) }, /* IR & LCD */
Then you can continue with the next step
UPDATE 2:It looks like cvs has been updated to handle the new version of the imon. However, from what I've heard, it appears that the patch applied to cvs wasn't as comprehensive as the patch I applied, and some of the buttons on the pad remote as well as some of the case front panel buttons might not work.
I haven't yet had a chance to look at the new version to see what it takes to get it going. In the mean time, if you would like to try with the old version from CVS, you can download the version I used from:
http://ronfrazier.net/mythtv/downloads/lirc-cvs.tar.gzip
4) Run autogen.sh and setup.sh. This will give you the configuration dialog. Choose the following sequence:
Driver Configuration -> USB Devices -> Soundgraph iMON IR/LCD
Save configuration & run configure
5) Run make, make install, and then modprobe lirc_imon.
With the 0038 version, you should have devices setup for /dev/lcd0, /dev/lcd1, /dev/lirc0, and /dev/lirc1. In addition, you are also going to have a device for /dev/lirc, but thats not really important. The actual devices we need are lirc0 and lirc1.
Notice to Ubuntu users: I received an email from Sascha Zucca who said that after following these instructions, he did not get all of the appropriate devices showing up under /dev. After working through the problem with him, he discovered that Ubuntu was loading its modules from a different directory than the lirc installer was putting the compiled files in. As a result, even after installing the new modules, lirc was loading the old version without the iMON fixes. Here is how he told me he fixed it:
i had to
mv /lib/modules/2.6.24-16-generic/ubuntu/media/lirc/lirc_imon/lirc_imon.ko{,.OLD}
and
ln -s /lib/modules/2.6.24-16-generic/misc/lirc_imon.ko /lib/modules/2.6.24-16-generic/ubuntu/media/lirc/lirc_imon/
I've since received a half dozen emails from other users who encountered the same problem. Performing the same fix worked for each of them (taking into account that the path will be slightly different for different versions of Ubuntu). Also, take note of the line wrapping. Those are actually only 2 commands.
FYI - Why are there 2 LIRC devices?
The iMON pad remote acts like a mouse/keyboard in addition to a remote. In the old version, it was my understanding that this was all handled through one LIRC device. However, the 0038 version splits it into 2 devices. All of the mouse/keyboard related keys come through the lirc0 device (the directional pad, left click, enter, the number button, ect....however NOT including the Mouse/Keyboard toggle button). Everything else comes through the lirc1 device (play, eject, colored buttons, zoom, etc...plus the Mouse/Keyboard toggle button). Finally, if you have front panel button, they will also come through the lirc1 device (at least they do on the DH-101).
If you have no plans to use the included remote, and plan to use a separate LIRC receiver with a different remote, you might think you can just skip the lirc0 part and use lirc1 for the front panel buttons. However, that may not work. Even if you don't use the iMON's IR receiver, it will still pick up some of the IR signals from certain remotes. When it does you will run into a problem. The iMON buffers up the inputs from each device separately, but maintains the sequence of events between the 2 buffers. If you only run the lirc1 device, everything will work fine until the iMON picks up an IR signal that it decides to put in the lirc0 buffer. When that happens, the lirc1 buffer will appear to have locked up and will not generate any more events. In reality, it's just maintaining the event sequence, and the next event is waiting to be removed from the lirc0 device. Until you do that, you will see no more events coming from the lirc1 device.
Now, on to the testing.
Step 5 - Testing and using LIRC
First you are going to need a lircd.conf file. For the pad remote, you can download this file. For the Thermaltake DH-101, you can download this file. If you want to use them both, you can just combine them into the same file. Whichever file you use (or both files combined), you will need to put that file in /etc/lircd.conf.
Once lircd.conf is in place, you can do the actual testing of LIRC. You need to get both devices up and running. The way to do this it to run 2 copies of lircd. The first one needs to listen to a socket and output its events there. The second one connects to the remote socket, gets events from there, and combines those with its own events. Each of the 2 processes will be listening to a different iMON device. Run the following 2 commands:
/usr/local/sbin/lircd --driver=default --device=/dev/lirc0 --pidfile=/var/run/lirc0.pid --listen=8765
/usr/local/sbin/lircd --driver=default --device=/dev/lirc1 --pidfile=/var/run/lirc1.pid --output=/dev/lircd --connect=localhost:8765
Now you can run the irw program and start pressing buttons on the remote and/or front panel, and you should see the event output on the screen. If you have a different case and don't get output from the front panel buttons, you will need to record a custom configuration file for it using irrecord.
First, you need to kill off the lircd processes (kill `pidof lircd`). Then you need to run irrecrd, but you need to point it at the right LIRC device:
irrecord --device=/dev/lirc1 frontpanel-lircd.conf
Follow the instructions to create your config file. When it's done, you will want to add the contents of frontpanel-lircd.conf to your /etc/lircd.conf file. Then restart both lircd processes and try irw again. Everything should be fine (hopefully)
Congratulations
If you made it this far, then you must have got everything working. Now you probably want to do something useful with the LCD. The most common program to control it is LCDproc. I've covered getting LCDproc setup with the iMON in this post.
If you have any questions or problems, be sure to leave a post in the comments below, or email me (you can find my email address through the "My MythTV Patches & Add-ons" link at the top of the right hand column). Or you can post about it in the iMON forum over at codeka.com