Kodi Community Forum

Full Version: [LINUX]Lirc in Natty receives keyboard input instead of correct IR-signal from remote
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi! I have just recently made a custom configuration of Ubuntu Server 11.04 for use as a HTPC with XBMC 10.1. The problem is that when I install lirc in 11.04 (never had this problem in 10.04) and run irw it receives keyboard input instead of the correct IR-code. I read something about this problem here but didn't understand it completely. Can anyone help me to make it behave as it should? My remote is a (Soundgraph) Antec Veris rm200.
From what I've found online, Natty seems to load an IR kernel module on boot. Then when you hit an arrow button on your remote, lirc and that module both generate events, and you jump two lines for every button press.

To fix this issue, you need to figure out which module Ubuntu is loading that you don't want. The lsmod command will list all of them. For me, the offending module was ir_rc6_decoder. My guess is it's a generic MCE module, so hopefully it'll be the same one for most people. To test this, type modprobe -r ir_rc6_decoder at the command line and see if your remote starts working properly.

Then you need to make sure the module doesn't load anymore (or at least gets removed afterwards). I'm not all that experienced with Linux, so I'm using the dirty solution of just unloading the module in my bootup script.

In the file "/etc/rc.local", after the line "# By default this script does nothing." and before "exit 0", you have to add the line:
modprobe -r ir_rc6_decoder
(replacing ir_rc6_decoder with whichever module turns out to be the problem for you)
After rebooting, the remote should work properly.

I'm sure someone will suggest a more efficient way of doing it, but it's working for me.
I must say that lirc guys (maintainers/developers/whatever) keep getting better and better at f*cking up!

It's impossible to install the same remote twice with the same procedure on 2 continuous Ubuntu versions.

10.04 and 10.10, for instance, are completely different... And not for the better, nooo! It is always a challenge to make it work. Always grabbing us by the short and curlies...

Way to go, lirc guys!!

rant mode off

h.udo
Hi,

hudo Wrote:I must say that lirc guys (maintainers/developers/whatever) keep getting better and better at f*cking up!

It's impossible to install the same remote twice with the same procedure on 2 continuous Ubuntu versions.

10.04 and 10.10, for instance, are completely different... And not for the better, nooo! It is always a challenge to make it work. Always grabbing us by the short and curlies...

Way to go, lirc guys!!

rant mode off

h.udo

hmmm ... no... the problem here are the ubuntu devs. Lirc (legacy) is a very old pice of software with own drivers. because more and more input devices are handled by kernel byself - which makes much sense - Jarod Wilson (the Lirc dev) has spend much work in integrating the lirc drivers to the kernel. thats now done for the most drivers. in general all remote drivers should (and now will) be act as event based devices like keyboards. this is also known for a longer time because of him's announcenments. he also spoke to the canoncial folks regarding this and needed changes, but it seems they are not able to rework this part in ubuntu in the right way. things like hardware.conf etc are very outdated things coming from old debian times. also ubuntu users are known to change things back to old deprecated methods if anything dont work like before instead working on new methods. i dont know which lirc version is shipped with natty, but i am sure its 0.8.7. 0.9.0 is out which has support for kernels from 2.6.36 and up (which is around a half year old) and dont ships anymore the old lirc drivers. if ubuntu loads both drivers (example mceusb from kernel and lirc_mce from lirc) its ubuntus fault because they build both drivers which are incompatible together. I use in openelec the kernel drivers since beginning, and if its included in the right way 90% all of the remotes in this world will work without configuring *anything* out of the box and with the same config (mceusb, imon, ati, it87, nuvoton and some more remotes). OpenELEC uses eventlircd instead lirc, but mostly to handle cheap HID based remotes (the one's who needs no driver and sends stupid key combos like for example "meta+shift+KEY_E" instead "KEY_ENTER"). so openelec is a 100% lirc free system (except from the "irw" tool for debugging), and can handle the most remotes without anyone must setup anything. Eventlircd can handle more then one connected remotes at the same time (you can connect 5 different receivers to a openelec box and can use 5 remotes the same time) and you can control all eventbased input devices like remotes, controllers, keyboards or something like powerbuttons with this. Eventlircd is actually a own project, but is planned to merged with lirc for later.

As you can see from the dates below of the blog posts, this is known since more then a half year, so it seems canoncial has nothing done the last half year regarding this, even if it was already known on releasing maverick...

14.06.2010: http://wilsonet.com/?p=85
11.10.2010: http://wilsonet.com/?p=91
11.10.2010: http://wilsonet.com/?page_id=95
http://code.google.com/p/eventlircd/
RobotBanana Wrote:To fix this issue, you need to figure out which module Ubuntu is loading that you don't want. The lsmod command will list all of them. For me, the offending module was ir_rc6_decoder. My guess is it's a generic MCE module, so hopefully it'll be the same one for most people. To test this, type modprobe -r ir_rc6_decoder at the command line and see if your remote starts working properly.

This didn't fix it unfortunaly. I ran modprobe and then irw to see the changes but nothing changed. I also tried all other IR-related entries I could find. Did I mention that I use the Soundgraph Antec Veris rm200 remote? In case it can help me in finding the solution.

So Natty loads it's own IR-daemon, is that what you guys are saying? Could I use those instead of Lirc to control XBMC? Or does XBMC only work with lirc for the special commands (everything except basic navigation that I already can do with the keyboard inputs I send right now)? Can't I somehow program the Natty IR-module to send the correct keyboard input to do the action I want instead of lirc?

If it can help in anyway I will also post the modules found when running lsmod:
Code:
lirc_imon
vesafb
nls_iso8859_1
nls_cp437
vfat
fat
snd_hda_codec_hdmi
snd_hda_codec_realtek
rt2860sta
arc4
snd_hda_intel
snd_hda_codec
snd_hwdep
snd_pcm
snd_seq_midi
snd_rawmidi
snd_seq_midi_event
rt2800pci
rt2800lib
crc_ccitt
ir_lirc_codec
snd_seq
lirc_dev
rt2x00pci
ir_sony_decoder
ir_jvc_decoder
ir_rc6_decoder
snd_timer
snd_seq_device
fglrx
edac_core
rc_imon_pad
rt2x00lib
edac_mce_amd
mac80211
serio_raw
ir_rc5_decoder
imon
ir_nec_decoder
rc_core
k10temp
cfg80211
eeprom_93cx6
snd
vice
sp5100_tco
i2c_piix4
soundcore
snd_page_alloc
xhci_hcd
shpchp
lp
parport
usb_storage
firewire_ohci
firewire_core
usbhid
hid
uas
crc_itu_t
para_jmicron
r8169
ahci
libahci
Quote:So Natty loads it's own IR-daemon, is that what you guys are saying?
Yup.

Quote:Could I use those instead of Lirc to control XBMC? Can't I somehow program the Natty IR-module to send the correct keyboard input to do the action I want instead of lirc?

It may be possible, but out of the box only the basic navigation keys will work. For me, the "OK" button didn't even work, making the remote pretty useless even just for navigation. It would be much easier if you could just disable the Natty one.

I think your remote uses one of the iMON modules.
Try modprobe -r rc_imon_pad
and if that doesn't work, undo your change by typing modprobe rc_imon_pad
Then try modprobe -r imon to disable the other module.
Failing that, try modprobe -r rc_imon_pad so that both are now disabled at the same time.
When I try:
Code:
sudo modprobe -r imon

I get the following error message:
Code:
FATAL: Module imon is in use

I don't know if this changes anything but I have the Antec Fusion computer case with an iMON LCD built in using lcdproc and a volume knob which also uses lirc.
The only other one in there that looks like it could be related to the remote is edac_mce_amd. It's worth a try.

My guess is disabling imon might affect more than just the IR receiver, but if you want to test it out, just do an lsmod and look at the "Used By" column. Unload all of those listed for imon, then you might be able to disable imon.

If that's not it, you might need someone with more Linux knowledge than I have.
But can't I force the module to be unloaded in any way to see if it helps? Also, unloading edac_mce_amd didn't help :/
sraue Wrote:Hi,



hmmm ... no... the problem here are the ubuntu devs. Lirc (legacy) is a very old pice of software with own drivers. because more and more input devices are handled by kernel byself - which makes much sense - Jarod Wilson (the Lirc dev) has spend much work in integrating the lirc drivers to the kernel. thats now done for the most drivers. in general all remote drivers should (and now will) be act as event based devices like keyboards. this is also known for a longer time because of him's announcenments. he also spoke to the canoncial folks regarding this and needed changes, but it seems they are not able to rework this part in ubuntu in the right way. things like hardware.conf etc are very outdated things coming from old debian times. also ubuntu users are known to change things back to old deprecated methods if anything dont work like before instead working on new methods. i dont know which lirc version is shipped with natty, but i am sure its 0.8.7. 0.9.0 is out which has support for kernels from 2.6.36 and up (which is around a half year old) and dont ships anymore the old lirc drivers. if ubuntu loads both drivers (example mceusb from kernel and lirc_mce from lirc) its ubuntus fault because they build both drivers which are incompatible together. I use in openelec the kernel drivers since beginning, and if its included in the right way 90% all of the remotes in this world will work without configuring *anything* out of the box and with the same config (mceusb, imon, ati, it87, nuvoton and some more remotes). OpenELEC uses eventlircd instead lirc, but mostly to handle cheap HID based remotes (the one's who needs no driver and sends stupid key combos like for example "meta+shift+KEY_E" instead "KEY_ENTER"). so openelec is a 100% lirc free system (except from the "irw" tool for debugging), and can handle the most remotes without anyone must setup anything. Eventlircd can handle more then one connected remotes at the same time (you can connect 5 different receivers to a openelec box and can use 5 remotes the same time) and you can control all eventbased input devices like remotes, controllers, keyboards or something like powerbuttons with this. Eventlircd is actually a own project, but is planned to merged with lirc for later.

As you can see from the dates below of the blog posts, this is known since more then a half year, so it seems canoncial has nothing done the last half year regarding this, even if it was already known on releasing maverick...

14.06.2010: http://wilsonet.com/?p=85
11.10.2010: http://wilsonet.com/?p=91
11.10.2010: http://wilsonet.com/?page_id=95
http://code.google.com/p/eventlircd/

I'm aware of all that. My point is that LIRC users can't catch a brake... every single time the system is updated/version changes, we go on a Tolkien adventure! Nothing works like we are used to.
Final point, please stop breaking things! Change modules/API/ABI/whatever in one step.

Its embarrassing for a seasoned user trying to make things work again and going nuts. New users just give up! That's my point...

Sorry guys for hijacking the thread!

h.udo
so...

i never used ubuntu, but now i have installed natty (live) freshly on a second notebook. i also have a imon remote here and it works. the only thing you must do is a create a own lircmap because the the codes shipped in lircmap.xml for "devinput" devices are wrong. thats the steps i have do:

  1. install natty-live
  2. install xbmc
  3. install lirc and configure like:
    • using linux-input-layer
    • transmitter: none
    • custom event device: /dev/input/by-id/usb-15c2_0045-event-if00
  4. now with irw you can see all keycodes the remote sends
  5. change lircmap.xml with the codes you get with irw:
    • copy the whole "linux-input-layer" section and rename this new section to "devinput"
    • remove the line "<altname>devinput</altname>" from the "linux-input-layer" section
    • change the keycodes with the one irw produces (for example: KEY_1 to KEY_NUMERIC_1 etc...)

dont know what you have do but for you the lirc_imon module is loaded. thats the old lirc driver which dont work together with the "imon" module which comes from kernel. uninstall any pakage that provides this drivers or create a blacklist.conf in /etc/modules.d/ and put in a line like "blacklist lirc_imon".
gunnarflax Wrote:But can't I force the module to be unloaded in any way to see if it helps?

If you unload all of the modules that imon is listed as used by, then you should be able to unload imon itself. "Forcing" it to unload is more complicated.

If that doesn't work out for you, sraue's suggestion should. Wink
That was also my experience with Maverick.
I assembled a friend's machine last month with an imon (15c2:0036) and it worked... after a lot of reading. I owned the exact same remote 2 years ago and the 'procedure' was completely different.

Things evolve. If it's for the better, I'm all for it.

h.udo