Mailing List Archive

Lirc is a disaster in 18.04 - do not upgrade yet
I upgraded my laptop MythTV partition from 16.04 to 18.04.1 last
night. I knew I was going to have to do some work on the lirc setup,
as it has changed a lot. But it is a complete disaster.

The first problem I discovered was that my custom key table files for
my remotes (stored with the standard files from the package under
/usr/share/lirc) were deleted by the upgrade process. That is not
supposed to happen - new or changed files are supposed to be left
alone or the user asked for what changes are to be done. Fortunately,
I have copies of them on other machines and on my web server.

The new Python lirc-setup program does not run at all - it just
crashes asking for a module it can not find. All its files seem to be
scattered about in various places and not on the Python path system so
it can not find them. It clearly has never been tested at all! It is
possible that manually setting up the configuration files might work
(I have not tried that yet), but at the moment, I would recommend that
no-one who uses lirc should do the upgrade.

I have managed to get lirc-setup to the point where it is only looking
for its C support library (_client module), by putting links to things
from one directory to another. I have also tried compiling and
installing lirc from source code, but that suffered from the same
problems. I will be trying some more things tonight I hope and will
report progress.

I discovered one web site that said the only way they could get lirc
working on 18.04 was to get an older version from 16.04 and install
that instead.

I have a full backup of the laptop MythTV partition, so I can always
just revert to 16.04 if I need to - I will not actually need MythTV on
it until the summer holidays, so I have plenty of time to fix things
before then.

_______________________________________________
mythtvnz mailing list
mythtvnz@lists.ourshack.com
https://lists.ourshack.com/mailman/listinfo/mythtvnz
Archives http://www.gossamer-threads.com/lists/mythtv/mythtvnz/
Re: Lirc is a disaster in 18.04 - do not upgrade yet [ In reply to ]
On Fri, 17 Aug 2018 16:10:20 +1200, you wrote:

>I upgraded my laptop MythTV partition from 16.04 to 18.04.1 last
>night. I knew I was going to have to do some work on the lirc setup,
>as it has changed a lot. But it is a complete disaster.
>
>The first problem I discovered was that my custom key table files for
>my remotes (stored with the standard files from the package under
>/usr/share/lirc) were deleted by the upgrade process. That is not
>supposed to happen - new or changed files are supposed to be left
>alone or the user asked for what changes are to be done. Fortunately,
>I have copies of them on other machines and on my web server.
>
>The new Python lirc-setup program does not run at all - it just
>crashes asking for a module it can not find. All its files seem to be
>scattered about in various places and not on the Python path system so
>it can not find them. It clearly has never been tested at all! It is
>possible that manually setting up the configuration files might work
>(I have not tried that yet), but at the moment, I would recommend that
>no-one who uses lirc should do the upgrade.
>
>I have managed to get lirc-setup to the point where it is only looking
>for its C support library (_client module), by putting links to things
>from one directory to another. I have also tried compiling and
>installing lirc from source code, but that suffered from the same
>problems. I will be trying some more things tonight I hope and will
>report progress.
>
>I discovered one web site that said the only way they could get lirc
>working on 18.04 was to get an older version from 16.04 and install
>that instead.
>
>I have a full backup of the laptop MythTV partition, so I can always
>just revert to 16.04 if I need to - I will not actually need MythTV on
>it until the summer holidays, so I have plenty of time to fix things
>before then.

I believe I have now worked out how to fix the lirc install in 18.04.1
so that lirc-setup works. I am just working on a script to do it all
automatically, as it is a bit complex.

_______________________________________________
mythtvnz mailing list
mythtvnz@lists.ourshack.com
https://lists.ourshack.com/mailman/listinfo/mythtvnz
Archives http://www.gossamer-threads.com/lists/mythtv/mythtvnz/
Re: Lirc is a disaster in 18.04 - do not upgrade yet [ In reply to ]
I have now finished my script to properly install the lirc package on
Ubuntu 18.04 so that the Python 3 programs it installs (such as
lirc-setup) actually work. It is available from my web server:

http://www.jsw.gen.nz/mythtv/lirc-ubuntu-18.04-install.sh

I have tested it on a clean 18.04.1 install on a virtual machine and
on my laptop (18.04.1 upgraded from 16.04). But it needs testing -
consider it to be beta software. If you try it, please let me know if
it works properly, or if you had any problems.

To use it, download it, do a "chmod a+x" on it, and then run it as
root. It has to download the source code for the lirc package,
compile it and then use the source code directories as the source of
missing headers and libraries so that a pip3 install of part of the
package will work. To do all that, it may have to install several
packages other than the lirc package, if they are not already
installed, including a lot of other packages that are required for
those packages. It cleans up after itself, but will leave behind some
newly installed packages.

I have not yet actually used lirc-setup to get a working lirc config
on my laptop - I will be getting to that over the next few days as I
have time.

WARNING: If you upgrade a working lirc setup from 16.04 or before,
where you have customised config files referenced in
/etc/lirc/hardware.conf and stored under /usr/share/lirc, make sure
you take copies of the customised files and put them somewhere safe
before doing the upgrade to 18.04. Somewhere under /root or
/home/<username> is safe. The 18.04 upgrade will delete all files
under /usr/share/lirc!!!

_______________________________________________
mythtvnz mailing list
mythtvnz@lists.ourshack.com
https://lists.ourshack.com/mailman/listinfo/mythtvnz
Archives http://www.gossamer-threads.com/lists/mythtv/mythtvnz/
Re: Lirc is a disaster in 18.04 - do not upgrade yet [ In reply to ]
On Wednesday, 29 August 2018 9:50:23 PM NZST Stephen Worthington wrote:
> I have not yet actually used lirc-setup to get a working lirc config
> on my laptop - I will be getting to that over the next few days as I
> have time.

I used your script to install lirc - thanks. The main issue I found with lirc-
setup was the gi.require_version requirements. I needed to move them up to
after the import gi but before the rest of the related imports.

So in /usr/lib/x86_64-linux-gnu/python3.6/site-packages/lirc-setup/
mvc_control.py

import gi
gi.require_version('Gtk', '3.0')

and in /usr/lib/x86_64-linux-gnu/python3.6/site-packages/lirc-setup/
mvc_view.py

import gi
gi.require_version('Gtk', '3.0')
gi.require_version('Vte', '2.91')

After that it worked.

Thanks

--
Regards
Scott Newton


_______________________________________________
mythtvnz mailing list
mythtvnz@lists.ourshack.com
https://lists.ourshack.com/mailman/listinfo/mythtvnz
Archives http://www.gossamer-threads.com/lists/mythtv/mythtvnz/
Re: Lirc is a disaster in 18.04 - do not upgrade yet [ In reply to ]
On Sat, 08 Sep 2018 20:11:34 +1200, you wrote:

>On Wednesday, 29 August 2018 9:50:23 PM NZST Stephen Worthington wrote:
>> I have not yet actually used lirc-setup to get a working lirc config
>> on my laptop - I will be getting to that over the next few days as I
>> have time.
>
>I used your script to install lirc - thanks. The main issue I found with lirc-
>setup was the gi.require_version requirements. I needed to move them up to
>after the import gi but before the rest of the related imports.
>
>So in /usr/lib/x86_64-linux-gnu/python3.6/site-packages/lirc-setup/
>mvc_control.py
>
>import gi
>gi.require_version('Gtk', '3.0')
>
>and in /usr/lib/x86_64-linux-gnu/python3.6/site-packages/lirc-setup/
>mvc_view.py
>
>import gi
>gi.require_version('Gtk', '3.0')
>gi.require_version('Vte', '2.91')
>
>After that it worked.
>
>Thanks

I did not have any problems running lirc-setup - what symptoms were
you having that required these changes?

I have now met the next roadblock - the liblirc_client.so library does
not work. This takes KEY_* output from the /var/run/lirc/lircd socket
and translates them using the ~/lircrc settings for each program. When
I use "strace ircat mythtv" in 18.04.1, I can see the KEY_* values
being read from the socket, but no translation or output happens.
Under 16.04, strace shows what I expect - the KEY_* values get
translated and the correct data is output. So now I am working on
debugging this.

_______________________________________________
mythtvnz mailing list
mythtvnz@lists.ourshack.com
https://lists.ourshack.com/mailman/listinfo/mythtvnz
Archives http://www.gossamer-threads.com/lists/mythtv/mythtvnz/
Re: Lirc is a disaster in 18.04 - do not upgrade yet [ In reply to ]
On Wed, 29 Aug 2018 21:50:23 +1200, you wrote:

Version 1.2 of my lirc install script is now available:

http://www.jsw.gen.nz/mythtv/lirc-ubuntu-18.04-install.sh

The major change is to create a /etc/systemd/system/lircd-dev.service
file that will automatically create a link from the /run/lirc/lircd
socket to /dev/lircd where the MythTV programs like mythfrontend and
mythtv-setup expect the socket to be. This link used to be created
automatically in 16.04 somehow (I am not sure where it was done from).
But in 18.04 that is not happening, hence the need to do get my script
to set up a way to do it. If you have already used the script, you
can just cut and paste the new section to a .sh file and run it,
rather than uninstalling lirc and running the whole script again.

The other major thing that I needed to do to get lirc working with
MythTV was to make sure my devinput device name was the same as in my
~/.lircrc file. In 16.04, the device name was "devinput", but using
the standard setup files for lirc 0.10.0 in 18.04, the name was
"devinput-32". This name comes from the
/etc/lirc/lircd.conf.d/devinput.lircd.conf file, which has replaced
the old /usr/share/lirc/remotes/devinput/lircd.conf.devinput file. In
the old file, the two different remote definitions were both named the
same as "devinput". The only difference between the two definitions
in the old file was the "pre_data" setting line, which is "0x0001" for
a 64 bit device, with a "post_data_bits 32" setting. For a 32 bit
device, the "pre_data" setting line is "0x8001" and there is no
"post_data_bits" or "post"data" setting. The same applies in the new
/etc/lirc/lircd.conf.d/devinput.lircd.conf, except that the two
devices have been given different names: "devinput-64" and
"devinput-32".

To fix the mismatched names, you can either change all the ~/.lircrc
file settings (in the included files in ~/.lirc/) - change all the
"devinput" values to "devinput-32", or do what I did, which is to
change the name of the 32-bit device in
/etc/lirc/lircd.conf.d/devinput.lircd.conf from "devinput-32" to
"devinput".

So now I have lirc working in 18.04.1 with MythTV, but there is still
one bug - fairly often, when I use an arrow or number key on the
remote and let it autorepeat, it keeps on autorepeating forever. As
far as I can tell so far, it seems that lirc may not be shutting of
the direct path for keystrokes from the devinput device to programs,
and they may (on autorepeats) sometimes get keystrokes from lirc and
directly from devinput. Only the arrow and number keys work directly
- all the rest need lirc working, unless you set up the devinput
config differently. So the problem only occurs when using keys that
work on the direct path.

_______________________________________________
mythtvnz mailing list
mythtvnz@lists.ourshack.com
https://lists.ourshack.com/mailman/listinfo/mythtvnz
Archives http://www.gossamer-threads.com/lists/mythtv/mythtvnz/
Re: Lirc is a disaster in 18.04 - do not upgrade yet [ In reply to ]
Version 1.3 of my lirc install script is now available:

http://www.jsw.gen.nz/mythtv/lirc-ubuntu-18.04-install.sh

This seems to now fix all the problems with getting lirc to work with
MythTV in 18.04.

The final problem I had was getting extra repeating keystrokes
appearing in X programs when using autorepeating arrow or number keys.
That seems to have been caused by the default setup for lirc
automatically enabling the lircmd and lircd-uinput daemons, which are
unneeded and hence I had not configured them. Their default
configuration seems to cause the arrow and number keys to be sent
untranslated via an alternate path to X. So if you have already
installed lirc with older versions of my script, all you need to do to
fix this is to run these commands as root:

systemctl stop lircmd
systemctl stop lircd-uinput
systemctl disable lircmd
systemctl disable lircd-uinput

They are now included in the script.

_______________________________________________
mythtvnz mailing list
mythtvnz@lists.ourshack.com
https://lists.ourshack.com/mailman/listinfo/mythtvnz
Archives http://www.gossamer-threads.com/lists/mythtv/mythtvnz/