Kodi Leia Linux with LIRC remote
#1
Hello

I've been going back and forth between Kodi 17.6 and 18 as on my QNAP linux install, I keep returning to Kodi 17.6 because I cannot get my IR remote to work.

I'd greatly appreciate some assistance from anyone that's managed to get Leia working with a MCE remote, via LIRC.  (ir-keymaps was a ball-ache so I gave up on that before 17.6).

I've pulled tonight 2 Feb from ppa/unstable - so if the latest RC.
This is Ubuntu 16.04 and lird is v 0.9.0 so it's not that thread about later versions of LIRC not playing nice with 18.04.

Further notes follow - thanks in advance

Regards
Chris

From what I can see the irw /dev/lircd command is presenting commands as expected, for example :
Code:
000000008001006c 00 KEY_DOWN devinput
0000000080010067 00 KEY_UP devinput
000000008001006a 00 KEY_RIGHT devinput
0000000080010069 00 KEY_LEFT devinput

But Kodi just won't see all the commands, including these key ones.
Code:
0000000080010160 00 KEY_OK devinput

From what I can see Kodi loads the system Lircmap.xml file but isn't attempting to connect to the LIRC service. 

I wondered if following link is anything to do with this, but setting LIRC_SOCKET_PATH="/dev/lircd" also doesn't seem to change the behaviour.
https://github.com/xbmc/xbmc/pull/13761#...r181572360


Kodi v17.6 kodi.log it's possible to see LIRC process starting using :/dev/lircd, and connection successful.
But Kodi 18 those lines are not present at all, so presumably some keyboard emulation is going on, which is why the special keys don't work.
I can see Lircmap.xml loading in both cases.
My Harmony doesn't emulate a keyboard well which is why I'm not using ir-keymaps


Is there some switch that I can assign that will show if Kodi is attempting to connect to LIRC ?
Reply
#2
Hi,

I have the same problem. After the update to Kodi 18 only the direction keys and the volume of my remote control work.  I am currently using Ubuntu 16.04.

regards
Frank
Reply
#3
Since you mentioned PPA I am assuming Deb or Ubuntu... what version of lirc is used on your distro?  On Arch (lirc 0.10.1) I have no such issue.  Running either 17.6 or 18.0 and my IR remote just works.  See the link in my sig... is your lirc/remote setup this way?
Need help programming a Streamzap remote?
Reply
#4
(2019-02-03, 13:19)graysky Wrote: Since you mentioned PPA I am assuming Deb or Ubuntu... what version of lirc is used on your distro?  On Arch (lirc 0.10.1) I have no such issue.  Running either 17.6 or 18.0 and my IR remote just works.  See the link in my sig... is your lirc/remote setup this way?
 ubuntu 16.06.  lircd is version 0.9.0.
Kodi info says git 20190128-d8134c - compiled 28 Jan

Fairly certain not a driver issue because irw /dev/lircd returns keypresses on "devinput" fine

I note on the page I linked that it mentions a compile-time option for LIRC support. 

I wonder if the "unstable" RC has that turned off but there's no way of knowing because nothing in the kodi logs (that I can see)
I also thought that setting the environment variable per the comments in that link might work - but nothing in the logs that I can see suggests that kodi is getting to use LIRC on the /dev/lircd port where qnap ubuntu is configured.
The kodi log messages for those button presses that are acted upon are physical button presses, not the LIRC port.

If I go to "ppa/stable" it fetches 17.6 and then works "out of the box" - no further configuration needed.


I'll checkout your link later - thank you

Cheers
Chris
Reply
#5
(2019-02-03, 13:19)graysky Wrote: what version of lirc is used on your distro?
I use lirc 0.9.0-0ubuntu6. It should be the current version. All keys in the terminal are also recognized with irw /dev/lircd. And the configuration works fine with Kodi 17.6
Reply
#6
Quote:By default the client connects to the hard-coded default path, usually /var/run/lirc/lircd. The environment variable LIRC_SOCKET_PATH can be used to connect to another socket.

Source: http://www.lirc.org/html/lirc_client.html

Your Linux distro changes the default path, hence you have to set this environment variable to point the client to the right path.
Reply
#7
I've found a solution to the problem. FernetMenta gave the decisive hint. The following commands work for me:
Code:
sudo mkdir -p /var/run/lirc
sudo ln -s /dev/lircd /var/run/lirc/lircd
At the end of page Ubuntuusers Wiki you will find the solution.

regards Frank
Reply
#8
Hi

I think the only thing I didn't have already was the step where you prevent the LIRC being setup as a keyboard.  I also don't have /etc/lirc/lirc_options.conf file.  but then I also don't have LIRC 0.9.4

Applying bits of your repo, presonalising for my devices:

xorg.conf.d

/etc/X11/xorg.conf.d/

I didn't have that dir but in this link I found correct dir below
http://marklodato.github.io/2013/10/24/h...-lirc.html

/usr/share/X11/xorg.conf.d

I did that - unfortunately the only impact is irw /dev/lircd responds with nothing at all, and even the cursor keys in kodi fail to work.

lirc_options.conf
I might give this a go next if the intent is to set the device to /dev/lirc0 instead of /dev/lircd.  But if I've set the environment variable per the Kodi and LIRC doc I'm not sure if I should need to do that.   Before then I've located the script that starts up the lircd service and that sets mine to /dev/lircd - so will probably give that a go first.

Related to that I swear I used to be able to listen to my port with just the command "irw" but now I need to type "irw /dev/lircd".   I wonder if these are related somehow



Next steps
Changing port to match the default as above - but if that doesn't work I'll give up on this as a bad job as I'm beginning to think that something changed in Kodi 18 and doesn't connect to LIRC port.

So final workaround if kodi is listening to keyboard commands is to try editing the lircd.conf file in /etc/lirc to instead send keyboard commands.   So, OK becomes "enter"; pageup instead of Channel Up, and whatever kodi normally likes for volup, etc. etc.
Reply
#9
I only skimmed this on a small screen but if the issue is the distro package is using a lirc path that isn't the default or at least what Kodi expects, wouldn't the solution be to either have the PPA people change the compile-time options for Kodi to reflect the distro's choice of the lirc path or better yet, correct (bug report) the distro package of lirc and have it use the expected path?  As a work-around, as FernetMenta mentioned, you can explore setting an environment variable to correct this with the packages as-is.
Need help programming a Streamzap remote?
Reply
#10
(2019-02-03, 21:04)SirBoss Wrote: I've found a solution to the problem. FernetMenta gave the decisive hint. The following commands work for me:
Code:
sudo mkdir -p /var/run/lirc
sudo ln -s /dev/lircd /var/run/lirc/lircd
At the end of page Ubuntuusers Wiki you will find the solution.

regards Frank
  

This works! (nearly there)

I had thought about symlinking but I had symlinked /dev/lirc0  to /dev/lircd.  That didn't work

I had not done /var/run/lirc/lircd which works.
Now I just need to make the symlink stick because this distro is destroying it each reboot.

Interestingly once linked irw works now without needing to enter the socket address.  Even when I was using 17.6 I had needed to type in irw /dev/lircd, so perhaps kodi 18.

 
(2019-02-03, 18:11)FernetMenta Wrote:
Quote:By default the client connects to the hard-coded default path, usually /var/run/lirc/lircd. The environment variable LIRC_SOCKET_PATH can be used to connect to another socket.

Source: http://www.lirc.org/html/lirc_client.html

Your Linux distro changes the default path, hence you have to set this environment variable to point the client to the right path.     
 
LIRC_SOCKET_PATH environment variable doesn't work

Kodi is failing to use LIRC_SOCKET_PATH to connect to /dev/lircd.

as I mentioned in OP I had already tried 
 
  • Setting env in .desktop and running kodi:
"      Exec=env LIRC_SOCKET_PATH=/dev/lircd kodi-standalone" 
  • Setting .desktop to call script and running kodi:
       export LIRC_SOCKET_PATH=/dev/lircd
       kodi-standalone


Additionally I then tried
 
  • Setting environment in /etc/environment
       Adding LIRC_SOCKET_PATH=/dev/lircd into etc/environment
 
  • Changed desktop file to :
Exec=/home/kodi/kodi_alsa.sh

And with kodi_alsa.sh being a shell script which export environment variable and sources another script to run kodi

 


Thank you both very much.

Cheers
Chris
Reply
#11
Update : 1 last try I edited /usr/bin/kodi-standalone to insert ENV command, and /usr/bin/kodi actually inserting a export LIRC_SOCKET_PATH=/dev/lircd command
That also doesn't work.   Have asked on qnap forum where someone else said they had this last year with Kodi 18 and got the LIRC_SOCK_PATH approach to work and I'll also update her.

In meantime I now need to figure out how to make the symlink stick as /var/run/lirc keeps being recreated minus the symlink.   (contains a file as a pointer to the PID of the device)
Reply
#12
ubuntu 16.06.  lircd is version 0.9.0.

This is stone age! That version of lirc does not support LIRC_SOCK_PATH. You have to live with the workaround of creating a symlink.
Reply
#13
(2019-02-04, 09:32)FernetMenta Wrote: This is stone age!
Yes I know. Only sometimes you can not choose this. My system is an Qnap TS-453mini and Kodi runs on a kind of virtual machine which is connected to the hostsystem (called Linux Station).  And because of the existing system kernel, only Ubuntu 16.04 is possible. In the course of the year the kernel will be updated, so that possibly a Ubuntu 18.04 will work.
Reply
#14
(2019-02-04, 10:15)SirBoss Wrote:
(2019-02-04, 09:32)FernetMenta Wrote: This is stone age!
Yes I know. Only sometimes you can not choose this. My system is an Qnap TS-453mini and Kodi runs on a kind of virtual machine which is connected to the hostsystem (called Linux Station).  And because of the existing system kernel, only Ubuntu 16.04 is possible. In the course of the year the kernel will be updated, so that possibly a Ubuntu 18.04 will work.  

 How'd you get the symlink to stick please?  Thanks
Reply
#15
If you add the following code to the /etc/rc.local file, the link will be preserved:
Code:
mkdir -p /var/run/lirc/ && ln -s /dev/lircd /var/run/lirc/lircd
Reply

Logout Mark Read Team Forum Stats Members Help
Kodi Leia Linux with LIRC remote0