2011-04-11, 02:01
Although there is already a howto for iMon under the new input layer of the newer kernels (> 2.6.35), this one is for using the iMon in MCE mode free of bugs and keep it working.
First of all, I have to say that the new imon driver and the new input layer/lirc system of the newer kernels are riddled with horrible bugs and I spent countless hours to finally find a solution and a fix.
The new IR system in linux works like this:
Kernel IR core -> Driver/Module producing input events -> Lirc listening to dev input -> XBMC listening to Lirc
It's quite complicated and involves many layers, and with the peculiar iMon with its mode switches (iMon/MCE) it's rather buggy and difficult, but with my instructions it should work:
Instructions
First follow these instructions from Lyka's guide:
Then we need to change to MCE mode. To do this we need 2 things:
1. To change the imon's IR protocol from "other" to "MCE"
2. And to load the imon MCE keymap to kernel, so the mce codes get picked up.
And we need them to be done in every reboot/resume/thaw.
Fortunately both of these can be done through the use of the ir-keytable from v4l-utils, though it has several bugs and it doesn't work. But fear not because I fixed all of them and made a patch:
1. download this git snapshot of v4l-utils
With ir-keytable now working, you need to create a new udev rule (this one took me the most time to make) to change to the MCE mode and to load the keymaps in each reboot/resume/thaw or just plain module load:
Now continue to follow the rest of Lyka's guide:
And you are done! You should reboot now and it should work!
Check it with reboot, suspend and hibernate to make sure everything works correctly.
I hope you find this useful.
First of all, I have to say that the new imon driver and the new input layer/lirc system of the newer kernels are riddled with horrible bugs and I spent countless hours to finally find a solution and a fix.
The new IR system in linux works like this:
Kernel IR core -> Driver/Module producing input events -> Lirc listening to dev input -> XBMC listening to Lirc
It's quite complicated and involves many layers, and with the peculiar iMon with its mode switches (iMon/MCE) it's rather buggy and difficult, but with my instructions it should work:
Instructions
First follow these instructions from Lyka's guide:
lyka Wrote:With Ubuntu 10.10 due to some changes to lirc and its modules, my harmony-mce remote stopped to work. I decided to try to use IMON codes and follow the new way of lirc:
Quote:sudo dpkg-reconfigure lircthen select
Quote:Linux input layer (/dev/input/eventX)
on "IR transmitter" i picked none.
on "Custom event interface for your dev/input device: " open a new shell and run:
Quote:cat /proc/bus/input/devices
you will face somethig like this:
Quote:I: Bus=0003 Vendor=15c2 Product=0038 Version=0001
N: Name="iMON Remote (15c2:0038)"
P: Phys=usb-0000:00:0b.0-6/input0
S: Sysfs=/devices/pci0000:00/0000:00:0b.0/usb2/2-6/2-6:1.0/rc/rc0/input5
U: Uniq=
H: Handlers=kbd mouse1 event5
B: EV=100007
B: KEY=fff 0 0 400000 108c0320 2d50082 0 0 30000 4 119000 4196 14100801 809e1680 0 2000000 10004002
B: REL=103
select the event you want lirc to listen, in my case:
Quote:/dev/input/event5
Then we need to change to MCE mode. To do this we need 2 things:
1. To change the imon's IR protocol from "other" to "MCE"
2. And to load the imon MCE keymap to kernel, so the mce codes get picked up.
And we need them to be done in every reboot/resume/thaw.
Fortunately both of these can be done through the use of the ir-keytable from v4l-utils, though it has several bugs and it doesn't work. But fear not because I fixed all of them and made a patch:
1. download this git snapshot of v4l-utils
Code:
mkdir ~/src
cd ~/src
wget "http://git.linuxtv.org/v4l-utils.git?a=snapshot;h=0bcc28a1d4ad19dfe40fff570670e8d26952a274;sf=tgz" -O v4l-utils-git.tgz
tar zxf v4l-utils-git.tgz
cd v4l-utils
wget http://pastebin.com/raw.php?i=3KwdVuKH -O keytable-imon-fixes.patch
patch utils/keytable/keytable.c < keytable-imon-fixes.patch
make
make install
With ir-keytable now working, you need to create a new udev rule (this one took me the most time to make) to change to the MCE mode and to load the keymaps in each reboot/resume/thaw or just plain module load:
Code:
sudo wget "http://pastebin.com/raw.php?i=pjY3G8q0" -O /etc/udev/rules.d/10-imon-mce.rules
Now continue to follow the rest of Lyka's guide:
Quote:after this try
Quote:irw
and check if it works.
my device prints something like:
Quote:000000008001001c 00 KEY_ENTER devinputsince my remote declare himself as "devinput" i had to edit Lircmap.xml:
Quote:sudo gedit /usr/share/xbmc/system/Lircmap.xml
You can change them following your taste.
Quote:<remote device="devinput">
<pause>KEY_PLAY</pause>
<stop>KEY_STOP</stop>
<forward>KEY_FASTFORWARD</forward>
<reverse>KEY_REWIND</reverse>
<left>KEY_LEFT</left>
<right>KEY_RIGHT</right>
<up>KEY_UP</up>
<down>KEY_DOWN</down>
<select>KEY_ENTER</select>
<pageplus>KEY_CHANNELUP</pageplus>
<pageminus>KEY_CHANNELDOWN</pageminus>
<back>KEY_BACKSPACE</back>
<menu>KEY_MENU</menu>
<play>KEY_PLAY</play>
<info>KEY_COMPOSE</info>
<skipplus>KEY_NEXT</skipplus>
<skipminus>KEY_PREVIOUS</skipminus>
<volumeplus>KEY_VOLUMEUP</volumeplus>
<volumeminus>KEY_VOLUMEDOWN</volumeminus>
<mute>KEY_MUTE</mute>
<power>KEY_POWER</power>
<title>KEY_PROG1</title>
<display>KEY_ZOOM</display>
<tab>KEY_SCREEN</tab>
<home>KEY_EXIT</home>
<backslash>KEY_CYCLEWINDOWS</backslash>
<myvideo>KEY_VIDEO</myvideo>
<mymusic>KEY_MEDIA</mymusic>
<mypictures>KEY_CAMERA</mypictures>
<mytv>KEY_TV</mytv>
<subtitle>KEY_SUBTITLE</subtitle>
<language>KEY_LANGUAGE</language>
<one>KEY_NUMERIC_1</one>
<two>KEY_NUMERIC_2</two>
<three>KEY_NUMERIC_3</three>
<four>KEY_NUMERIC_4</four>
<five>KEY_NUMERIC_5</five>
<six>KEY_NUMERIC_6</six>
<seven>KEY_NUMERIC_7</seven>
<eight>KEY_NUMERIC_8</eight>
<nine>KEY_NUMERIC_9</nine>
<zero>KEY_NUMERIC_0</zero>
</remote>
And you are done! You should reboot now and it should work!

Check it with reboot, suspend and hibernate to make sure everything works correctly.
I hope you find this useful.