[mythtv-users] lircd unreliable after Ubuntu upgrade 16.04 > 18.04
Stephen Worthington
stephen_agent at jsw.gen.nz
Fri Mar 15 02:18:23 UTC 2019
On Thu, 14 Mar 2019 14:38:00 -0700, you wrote:
>On Wed, Mar 13, 2019 at 7:29 PM Stephen Worthington
><stephen_agent at jsw.gen.nz> wrote:
>>
>> On Wed, 13 Mar 2019 21:24:18 +0100, you wrote:
>>
>> >On 13/03/19 19:05, Allen Edwards wrote:
>> >>
>> >>
>> >>
>> >> On Wed, Mar 13, 2019 at 10:48 AM Zach Cutlip <uid000 at gmail.com
>> >> <mailto:uid000 at gmail.com>> wrote:
>> >>
>> >> Hello,
>> >>
>> >> After upgrading my MythTV setup from Ubuntu 16.04 (lirc 0.9.0) to
>> >> Ubuntu 18.04 (lirc 0.10.0), and jumping through various hoops to get
>> >> lircd working again, I'm finding it to be very unreliable.
>> >>
>> >> Any suggestions, or things to try?
>> >
>> >
>> >Most likely an upgrade problem. The upgrade to 0.9.0 requires manual
>> >intervention [1]
>> >
>> >Cheers!
>> >--alec
>> >
>> >
>> >[1] https://bugs.launchpad.net/ubuntu/+source/lirc/+bug/1791409
>>
>> The lirc package as installed by 18.04 is broken. There are a number
>> of problems with it, but the one that is most obvious is that
>> lirc-setup does not work at all (it can not find required library .so
>> files). Your problem sounds like one of the other problems, which is
>> that it sets up systemd to run lircmd, lirc-uinput and irexec as
>> daemons, but does not set up valid configuration for those daemons. So
>> they run in the background and one (I think it is lircd-uinput) steals
>> keystrokes from the main lirc daemon. So try running these commands
>> and see if it fixes your problem:
>>
>> sudo systemctl stop lircmd
>> sudo systemctl stop lirc-uinput
>> sudo systemctl stop irexec
>> sudo systemctl disable lircmd
>> sudo systemctl disable lirc-uinput
>> sudo systemctl disable irexec
>>
>> Alternatively, if you want to fix all the problems I found in 18.04's
>> lirc package, you can download and run the script I wrote:
>>
>> http://www.jsw.gen.nz/mythtv/lirc-ubuntu-18.04-install.sh
>>
>> It fixes lirc-setup, the above problems and probably a few more I have
>> forgotten about. It needs to be run with sudo or as root. I am a bit
>> surprised that your lirc is working at all - the 16.04 to 18.04
>> upgrade does not normally produce a working lirc setup, so you must
>> have done a lot of manual configuration.
>
>Hi Stephen,
>
>You are right; I didn't have a working lirc setup at all after
>upgrade. I had to troubleshoot quite a bit to get it working again
>even to the degree that it is.
>
>I don't think any of these are running:
>
> $ ps -ef | grep -E 'lircmd|lircd-uinput|irexec'
>knath 12295 11492 0 14:24 pts/1 00:00:00 grep -E
>lircmd|lircd-uinput|irexec
>$ ps -ef | grep lirc
>root 12435 1 0 14:29 ? 00:00:00 /usr/sbin/lircd --nodaemon
>
>I stopped & disabled the services just in case though.
>
>Is there anything else I can check, or diagnosis I can do?
>
>Here's my lirc_options.conf if it helps:
>
>[lircd]
>nodaemon = False
># driver = devinput
>driver = default
># device = auto
>device = /dev/lirc0
>output = /var/run/lirc/lircd
>pidfile = /var/run/lirc/lircd.pid
>plugindir = /usr/lib/i386-linux-gnu/lirc/plugins
>permission = 666
>allow-simulate = No
>repeat-max = 600
>#effective-user =
>#listen = [address:]port
>#connect = host[:port]
>#loglevel = 6
>#release = true
>#release_suffix = _EVUP
>#logfile = ...
>#driver-options = ...
>
>[lircmd]
>uinput = False
>nodaemon = False
>
># [modinit]
># code = /usr/sbin/modprobe lirc_serial
># code1 = /usr/bin/setfacl -m g:lirc:rw /dev/uinput
># code2 = ...
>
>
># [lircd-uinput]
># add-release-events = False
># release-timeout = 200
># release-suffix = _EVUP
>
>And here's the start to my lircd remote definition, which has always
>worked perfectly until now:
>
>begin remote
>
> name Tivo_S2
> bits 32
> flags SPACE_ENC|CONST_LENGTH
> eps 20
> aeps 200
>
> header 9000 4500
> one 562 1687
> zero 562 562
> ptrail 562
> repeat 9000 2250
> gap 108000
> min_repeat 1
> toggle_bit 0
>
> frequency 38000
>
> begin codes
> TIVO 0x00000000A10CE00F
> TV_POWER 0x00000000A10C0807
> TV_INPUT 0x00000000A10C2C03
> WINDOW 0x00000000A10C220D
> LIVE_TV 0x00000000A10C8807
> INFO 0x00000000A10CC807
> GUIDE 0x00000000A10C6C03
> UP 0x00000000A10C2807
> LEFT 0x00000000A10CE807
> RIGHT 0x00000000A10CA807
> DOWN 0x00000000A10C6807
That looks OK, but check that your lirc hardware is actually appearing
as the /dev/lirc0 device.
However, MythTV looks for a /dev/lircd device for the keystroke
outputs from the lirc daemon. Do you have that? I had to link the
default lirc output device (/var/run/lirc/lircd) to /dev/lircd to make
it work, as I could not find any way to configure MythTV to use the
new location for the lirc output device, and changing the setting in
lirc_options.conf made other programs unable to work with lirc. If
you look at my script, you will find that it creates a
lircd-dev.service file in /etc/systemd/system to do this automatically
when the lirc daemon is started:
root at mypvr:/etc/systemd/system# cat lircd-dev.service
[Unit]
Description=Create the /dev/lircd device (linked to /run/lirc/lircd)
as required by MythTV.
After=lircd.service
[Service]
Type=simple
ExecStart=/bin/bash -c "ln -s /run/lirc/lircd /dev/lircd"
[Install]
WantedBy=multi-user.target
Note that /var/run/ is a link to /run, so /run/lirc/lircd is the same
as /var/run/lirc/lircd in the lirc_options.conf file.
Also, check your MythTV .lircrc files:
root at mypvr:/home/stephen# cat .lircrc
#Custom lircrc generated via mythbuntu-lirc-generator
#All application specific lircrc files are within ~/.lirc
include ~/.lirc/mythtv
include ~/.lirc/mplayer
include ~/.lirc/xine
include ~/.lirc/vlc
include ~/.lirc/xmame
include ~/.lirc/xmess
include ~/.lirc/totem
include ~/.lirc/elisa
include ~/.lirc/irexec
root at mypvr:/home/stephen# head -n 24 .lirc/mythtv
# lircrc for devinput with Hauppauge Nova TD-500 and Hauppauge
HVR-900R2 remotes (with lirc 0.9.0),
# and MCE remotes.
# Save it in ~/.lircrc
begin
remote = devinput
prog = mythtv
# Guide key
button = KEY_EPG
# config = S
config = Ctrl+Alt+G
repeat = 0
delay = 0
end
begin
remote = devinput
prog = mythtv
button = KEY_EXIT
config = Escape
repeat = 0
delay = 0
end
To work in your setup, all the entries for MythTV (with prog=mythtv
lines) will have to have the remote= lines set to match the driver=
setting in your lirc_options.conf file. So they should have "remote =
default", where mine have "remote = devinput".
More information about the mythtv-users
mailing list