lirc broken on 18.04

Bug #1788235 reported by Frank Feuerbacher on 2018-08-21
32
This bug affects 5 people
Affects Status Importance Assigned to Milestone
lirc (Ubuntu)
Undecided
Unassigned

Bug Description

Lirc 0.10.0-2 is never configured after installation. Manually running "dpkg-reconfigure lirc " also does not do anything. I also noticed that /usr/share/lirc/remotes is empty, which is where I had my config file for Ubuntu 16.04.

This was an upgrade install from 16.04.
Searching the web indicates others have this problem. Some have reverted to the lirc from 16.04. Others recommend using pip3 to install lirc 0.10.10, but I have been unsuccessful so far.

tags: added: boinic
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in lirc (Ubuntu):
status: New → Confirmed
Stefan Pappalardo (sjuk) wrote :

I can confirm the issue on a recently fresh installed Ubuntu Server 18.04. The goal was to transform the installation to a HTPC running kodi and tvheadend (hts). Here are some links to guys who had the same experience and offer a workaround until the fix of the package.

Same experience:
https://forum.kodi.tv/showthread.php?tid=333904

Workaround:
https://twosortoftechguys.wordpress.com/2018/07/24/make-lirc-work-in-ubuntu-18-04/

Stefan Pappalardo (sjuk) wrote :

I've tried the workaround, and it worked for me as described. :-)

MarcRandolph (mrand) wrote :

@leamas-alec Any ideas on a proper fix?

enolive (enolive) wrote :

I can confirm that the workaround works.

I think the main problem is that bionic's lirc is using a different configuration file for lirc (lirc_options.conf instead of hardware.conf). I can make my remote work by setting the driver up in lirc_options.conf manually. By installing lirc-compat-remotes, you also get the /usr/share/lirc/remotes-directory with the configuration files back.

I'm having still issues with double pressed keys using this configuration, so for now I stick to the downgrade workaround.

xekon (xekon) wrote :

I just wanted to report that initially I was using Ubuntu 18.04 and the lirc from the repository worked, appears to be:

apt-cache show lirc
Package: lirc
Architecture: amd64
Version: 0.10.0-2

Thats on my system where it still works.

However a few days ago I updated another 18.04 system that had a working lirc, and it just completely stopped working after sudo apt-get update && sudo apt-get dist-upgrade

sudo irw (which was working perfectly fine) now shows:

Cannot connect to socket /var/run/lirc/lircd: No such file or directory

I noticed my arrow keys on the remote controller worked, but none of the other buttons did, and the only thing that changed was doing the dist-upgrade and rebooting. That caused one of my perfectly working system to quit working.

So I followed this workaround: https://twosortoftechguys.wordpress.com/2018/07/24/make-lirc-work-in-ubuntu-18-04/

It does indeed get me back to working.

My other system that is still using 0.10.0-2 will likely break next time I update it. I will have to use the workaround on it next im sure, will hold off a few days in case I think of anything else to investigate on the system prior to updating.

xekon (xekon) wrote :

I actually have lirc 0.10.0-2 working again:

I actually had lirc_0.10.0-2 installed and working (and it still does on my other system)

but for some reason after dist-upgrade and a reboot it was broken.

I followed the workaround listed 0.9, it worked.
I then unmarked the package as held and dist-upgraded again to see if it would work again with 0.10.0 (nope)

I then tried the workaround to 0.9 again! this time nothing worked.
I then did:

sudo apt purge ir-keytable lirc
sudo apt-get install -y lirc lirc-compat-remotes
sudo dpkg-reconfigure lirc
sudo irw

and now my remote is back to working with lirc_0.10.0-2

If I narrow down the exact cause I will post back, its very odd for sure, but for the moment I am working again with lirc_0.10.0-2

with lirc_0.10.0-2 irw shows output like this:

000000008001006c 00 KEY_DOWN devinput-32
0000000080010067 00 KEY_UP devinput-32
000000008001006c 00 KEY_DOWN devinput-32
0000000080010160 00 KEY_OK devinput-32
00000000800100ae 00 KEY_EXIT devinput-32

under lirc 0.9 for the few minutes I tried the 0.9 workaround irw showed like this:

000000037ff07bde 00 KEY_RIGHT mceusb
000000037ff07be6 00 KEY_STOP mceusb
000000037ff07be6 01 KEY_STOP mceusb
000000037ff07be9 00 KEY_PLAY mceusb
000000037ff07be9 01 KEY_PLAY mceusb
000000037ff07be7 00 KEY_PAUSE mceusb

Alec Leamas (leamas-alec) wrote :

Now, considering these reports one cannot IMHO really say that lirc is 'broken'. What could be said is that the upgrade to the new version requires manual steps, none of which mentioned in this report.

The manual steps are documented in the file /usr/share/doc/lirc/README.Debian.gz -- this is presented in the upgrade message for lirc.

From xekon's note it's clear that the new lirc installation is using the default setup. It just cannot work as expected. However, the documentation is pretty clear and there is even a migration script.

xekon (xekon) wrote :

While I am sure LIRC has a lot of uses. I would wager 90% of its users are using kodi. At times it can be difficult to find a good howoto guide, that walks you through a freshly installed ubuntu system, to a working LIRC remote. I am very happy to have mine working again.

I forgot a couple steps, here was all of them:

sudo apt purge ir-keytable lirc
sudo apt-get install -y lirc lirc-compat-remotes
sudo dpkg-reconfigure lirc
sudo irw
sudo systemctl stop lircd-uinput.service
sudo systemctl disable lircd-uinput.service

also some discussion here: https://forum.kodi.tv/showthread.php?tid=324727

Alec Leamas (leamas-alec) wrote :

> While I am sure LIRC has a lot of uses. I would wager 90% of its users are using kodi.

This might be the truth as seen from the kodi community. However, from an upstream lirc point of view I cannot really see that the number of kodi users are dominating in any way.

> forgot a couple steps, here was all of them:

While these steps worked for you, other users will have other needs. That said, disabling/stopping lircd-uinput might be a good idea in many cases. The last update to lirc has it disabled by default.

> also some discussion here: https://forum.kodi.tv/showthread.php?tid=324727

That discussion is utterly confused and does not mention the need to migrate (manual or automatic) the old 0.9.0 setup to the new one. Also, some users in that thread are using the default driver while other seem to be using the devinput one. No one seems to be reading the documentation, but still seems to be able to establish the "fact" that lirc is broken.

If it was possible to file a bug against the Kodi community overall I would consider doing that ;)

On top of that Kodi is the one and only application which misuses lirc by using the raw events from the socket -- this makes lirc seriously crippled compared to the real stuff. I filed a bug on this long ago, but at a glance it seems to be lost.

Unless there is more input I will close this as not-a-bug.

xekon (xekon) wrote :

I appreciate that input! I learned a lot just from reading what you posted there.

Is there more documentation at a website that I could read to learn more?

I am particularly interested in the info about the raw events from the socket.

I am wondering if I can get lirc to work with kodi without doing it that way.

appreciate the info.

Alec Leamas (leamas-alec) wrote :

> Is there more documentation at a website that I could read to learn more?

The official site is http://lirc.org. Among other things, here is an updated Configuration Guide.

> I am particularly interested in the info about the raw events from the socket.

At the same site there is info on the APIs, in particular the Client API. The problem is that Kodi uses the raw events (documented in lircd(8)) instead of using that API. Changing this in a stable application as Kodi requires some serious thinking to not break existing setups -- using the proper client API functionality must basically be opt-in, I guess. That said, scanning the docs will reveal the functionality in the API which is missing in the raw socket interface.

The first step should be to file a bug against Kodi for not using the API and the corresponding loss of lirc functionality (and, ironically, added configuration complexity).

xekon (xekon) wrote :

I will try to file a bug, they just recently moved their bug tracker to github: https://github.com/xbmc/xbmc/issues

Thank you.

Alec Leamas (leamas-alec) wrote :

Seems that we agree that the idea that lirc as of 18.04 is "broken" is plain wrong.

The problem is about making a correct upgrade which involves manual steps as described in README.Debian (with a notification in the upgrade message).

Sebastien Bacher (seb128) wrote :

Trying to understand the bug here, the title is not very describtive, how is it broken? reading the comments the issue seems to be rather "lirc can't be easily configured" is that correct? (you miss a "dpkg-reconfigure lirc" UI that allow easy configuration)?

Sebastien Bacher (seb128) wrote :

The configuration format/system units, etc are described in https://sourceforge.net/p/lirc/git/ci/debian-0.10/tree/debian/README.Debian . Does that cover the questions/problems described there? In any case having a better description of what you are trying to do and what you expect/isn't as you think it should be would be useful

xekon (xekon) wrote :

Hi Alec Leamas and Sebastien Bacher, I did not actually open this bug report. Somebody else did. I merely added to it my experience, also from my point of view you are both exactly right, because currently my Lirc 0.10.0-2 is working perfectly :)

Alec Leamas (leamas-alec) wrote :

@seb128: The missing UI refers to the reconfiguration UI which was part of lirc up to 0.9.0. This reflected even older code containing kernel modules where lirc was rebuilt from source depending on configuration. Nowadays lirc is a just a server with configuration files and there is no need to make anything special at configuration time.

There are new tools available to assist in configuration, but these can and should be used after installation.

Bottom line seems to be that the expectation was that nothing is changed. However, it is. The decision to make a breaking change was not taken lightly, it actually took several years, but eventually it became necessary.

Sebastien Bacher (seb128) wrote :

@»ekon, @Alec, thanks for your comments, reading those it looks like you are stating that there is no real bug, just that the changes in the software and its configuration files confused users that were used to the old way? E.g nothing that needs to be resolved? Or is there some action needed?

xekon (xekon) wrote :

sudo apt purge ir-keytable lirc
sudo apt-get install -y lirc lirc-compat-remotes
sudo dpkg-reconfigure lirc (no screen opens, but i ran this anyway incase it creates files)
sudo irw
sudo systemctl stop lircd-uinput.service
sudo systemctl disable lircd-uinput.service

sudo cp /usr/share/kodi/system/Lircmap.xml /home/batman/.kodi/userdata/Lircmap.xml

sudo dpkg-reconfigure lirc (no screen opens, but i ran this anyway incase it creates files)

afterwards onmy ubuntu 18.04 system I was able to type at the command line:

sudo irw and point my IR remote at it and press buttons and the output worked:
000000008001006c 00 KEY_DOWN devinput-32
0000000080010067 00 KEY_UP devinput-32
000000008001006c 00 KEY_DOWN devinput-32
0000000080010160 00 KEY_OK devinput-32
00000000800100ae 00 KEY_EXIT devinput-32

next I launched kodi, and all remote functions were working as well!

the last line with sudo cp Lircmap.xml is to copy the default map, obviously you should veryify the paths here exist on your system. Also this line is only necessary if your using Lirc for Kodi purposes.

xekon (xekon) wrote :

-------------------------------------------------------
sudo apt purge ir-keytable lirc
sudo apt-get install -y lirc lirc-compat-remotes
sudo dpkg-reconfigure lirc
sudo irw
sudo systemctl stop lircd-uinput.service
sudo systemctl disable lircd-uinput.service

sudo cp /usr/share/kodi/system/Lircmap.xml /home/batman/.kodi/userdata/Lircmap.xml
-------------------------------------------------------

The dpkg-reconfigure lirc line, no screen opens, but i ran this anyway incase it creates files.

afterwards onmy ubuntu 18.04 system I was able to type at the command line:

sudo irw and point my IR remote at it and press buttons and the output worked:
000000008001006c 00 KEY_DOWN devinput-32
0000000080010067 00 KEY_UP devinput-32
000000008001006c 00 KEY_DOWN devinput-32
0000000080010160 00 KEY_OK devinput-32
00000000800100ae 00 KEY_EXIT devinput-32

next I launched kodi, and all remote functions were working as well!

the last line with sudo cp Lircmap.xml is to copy the default map, obviously you should veryify the paths here exist on your system. Also this line is only necessary if your using Lirc for Kodi purposes.

xekon (xekon) wrote :

@seb128) So to answer your question directly, Yes, that is what I was saying, at least in my situation, that Lirc is functioning properly and I have zero complaints.

I have not yet tested the ir sending functionality yet, but ir receiving is working here. I planned to test sending ir commands to control my stereo receiver from my other (main) remote once I get some free time.

Alec Leamas (leamas-alec) wrote :

> @»ekon, @Alec, thanks for your comments, reading those it looks like you are stating that there is no real bug, just that the changes in the software and its configuration files confused users that were used to the old way? E.g nothing that needs to be resolved?

Right, from my point of view this should be closed as not-a-bug.

Alec Leamas (leamas-alec) wrote :

So, changing status.
@xekon: dpkg-reconfigure doesn't do anything at all...

Changed in lirc (Ubuntu):
status: Confirmed → Invalid
echoxxzz (echoxxzz) wrote :

Kodi definitely works with the latest versions of Lirc and the problem is very easy to fix so stop downgrading your systems to an older version of Lirc!!!!

The problem is Kodi defaults to looking for a Lirc socket at /dev/lircd which doesn’t exist anymore. In Lirc > 0.9.0 the socket is now defined within the /etc/lirc/lirc_options.conf file and defaults to /var/run/lirc/lircd.

To get Kodi working with the latest versions of Lirc do one of the following:

1. Modify the /etc/lirc/lirc_options.conf file and change the output variable to /dev/lircd. You’ll need
to restart the lircd service or reboot.

2. Start Kodi with the -l argument and manually specify the Lirc socket.

e.g: kodi -l /var/run/lirc/lircd

3. Modify the /lib/systemd/system/lircd.service to create a symlink from /dev/lircd to
/var/run/lirc/lircd each time the lircd.service or system is restarted:

e.g: Edit the file so it looks like the following.

[Service]
Type=simple
ExecStart=/usr/sbin/lircd –nodaemon
ExecStartPost=/bin/ln -sf /var/run/lirc/lircd /dev/lircd

Reboot

Lastly, and this maybe a problem specific to my setup, but I kept getting repeating remote button presses the first time I started Kodi after a reboot. Launching Kodi a second time and the problem was gone. I found that disabling the lircd-uinput service fixed the problem and now Kodi starts up properly and my remote works perfectly.

e.g: sudo systemctl disable lircd-uinput.service

What I still cannot get working is the lirc-setup app (which replaces dpkg-reconfigure lirc). I’ve tried doing pip3 install /usr/share/lirc/lirc-0.10.0.tar.gz suggested elsewhere but just more errors. I don’t really need it as I can manually edit the conf files; not to mention the defaults (using the devinput driver) worked with my MCEUSB remote.

Alec Leamas (leamas-alec) wrote :

> Kodi definitely works with the latest versions of Lirc and the problem i
> is very easy to fix so stop downgrading your systems to an older version of
> Lirc!!!!

Right.

> The problem is Kodi defaults to looking for a Lirc socket at /dev/lircd which
> doesn’t exist anymore.

Has anyone cared to file a bug against kodi on this?

> 3. Modify the /lib/systemd/system/lircd.service to create a symlink
> from /dev/lircd to /var/run/lirc/lircd each time the lircd.service or
> system is restarted:

Please, no. The files in /lib/systemd/system should not be tampered with, they are
replaced on package update without mercy. Instead, copy /lib/systemd/system/lircd.service
to /etc/systemd/system and modify that copy (it overrides the /lib/systemd one).

Also note that lirc_options.conf supports code: stanzas which are executed as
root before lircd is launched. Linking could be done here instead of patching the service
file.

And, finally: the /dev directory is just not aimed for this kind of files, it's supposed
to be handled by udev. So, creating links here should be avoided if at all possible.

> e.g: sudo systemctl disable lircd-uinput.service

Indeed. Debian upstream by default disables this service in last update. Using
'systemctl disable --now lircd-uinput.service' is probably the best to both stop and disable.

> What I still cannot get working is the lirc-setup app (which replaces dpkg-reconfigure lirc)

Also this is fixed in debian upstream. Until it trickles down, the dirty work-around is
something like:

    # libdir=/usr/lib/x86_64-linux-gnu/python3.6/site-packages
    # cp /usr/share/lirc/python-pkg/config.py $libdir/lirc
    # ln -s $libdir/lirc /usr/lib/python3/dist-packages/
    # ln -s $libdir/lirc-setup /usr/lib/python3/dist-packages/

echoxxzz (echoxxzz) wrote :

Thanks Alec. I'm a Linux nobi and your fixes are definitely better suggestions.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers