v17 [SOLVED] Lirc remote commands repeated endlessly
#1
Bug 
Hello,

my previous Kodi box is getting a bit dated now, especially when it comes to playback 4K content. Hence I'm currently setting up a whole new Kodi box with all new hardware. Unfortunately I have trouble getting the IR remote to work correctly.

The symptom is that single Lirc events are repeated endlessly in Kodi. For example when short pressing "down" on the remote (releasing the key immediately again) it takes roughly 1 second before I see something in Kodi, but then the menu selection keeps moving downwards really fast, as if I would expect when holding the "down" button. It stops at the very last entry of the main menu, but in the debug log I can see that Kodi thinks that the key is still pressed (lots of "OnKey: long-down") messages. This only stops when I hit some key on the regular keyboard (but happens again when I operate the IR remote again).

I think it must be an issue in Kodi since Lirc receives exactly one "down" event (verified with irw). I have already experimented with advanced settings (remotedelay=10, remoterepeat=800) but without any improvement.

The hardware and software:
  • x86_64 Hardware (Intel Core i3-7100 CPU @ 3.90GHz) with iGPU (Intel HD graphics)
  • Ubuntu 17.04 Zesty (kernel 4.10.0-35-generic #39-Ubuntu)
  • Kodi installed from PPA (ppa:team-xbmc/ppa), version 2:17.4+git20170822.1009-final-0zesty
  • IR Receiver: Atric IR-Wakeup USB Eco v1.2 (http://www.atric.de/IR-Einschalter/index.php)
  • lircd 0.9.4c-9 + lirc-drv-irman 0.5.2-1build1
  • One-For-All Smart Control 8 (URC 7980) programmed on MCE profile (magic code 1272)
  • no additional add-ons installed or configured

Output from irw during the test (shows exactly one remote keypress):

Code:
ffff1f040f800000 00 KEY_DOWN atric-mce


Logs and config files:
The test has been done immediately after booting up Kodi.

Many thanks in advanced for your help.
Reply
#2
I tried a Kodi nightly build in the meantime... no difference in behaviour.
But after various hours of browsing/testing/debugging I finally found the solution to my own problem.

While inspecting "/proc/bus/input/devices" I noticed a virtual device "lircd-uinput". A look into "/var/log/syslog" confirmed that there was some daemon "lircd-uinput" starting up. According to its manpage it "reads decoded button press events from a lircd output socket and injects these as key events to the kernel uinput device". Something external injecting additional events? Finally a hot lead...

My observations:
  • Kodi was reading the events from the lircd socket just fine
  • additionally "lircd-uinput" was reading the same events from the lircd socket and transmitting them via some virtual keyboard
  • the latter became possible since my button names "accidentially" matched the ones in namespace defined by the kernel (using KEY_UP, KEY_1, and so on is more than logical)
  • apparently the key release handling of "lircd-uinput" does not work with my IR receiver or would need additional configuration in "lirc-uinput" (but even with a working key release handling I would have had duplicate key presses in Kodi)
  • the key difference between both systems (the old HTPC and the new one) is obviously a different lircd version (lircd 0.9.4c on Ubuntu 17.04 vs. lircd 0.9.0 on Ubuntu 14.04.5) with a completely different default handling regarding uinput (?)

My solution is to disable "lircd-uinput" completely. The IR remote is meant for Kodi only (no other applications) and with Kodi having direct support for lircd there is no point in trying this virtual keyboard stuff working. Hence:
Code:
sudo systemctl stop lircd-uinput.service
sudo systemctl disable lircd-uinput.service
Reply

Logout Mark Read Team Forum Stats Members Help
[SOLVED] Lirc remote commands repeated endlessly0