Updated to 18.04 LTS, lirc was a PITA

For discussion related to MythTV which doesn't belong in another forum.

Moderator: Forum Moderators

Post Reply
mathog
Junior
Posts: 62
Joined: Thu Dec 15, 2016 5:22 pm
United States of America

Updated to 18.04 LTS, lirc was a PITA

Post by mathog » Sun Nov 03, 2019 5:50 am

Upgraded from 16.04 LTS to 18.04 LTS today, and as expected lirc was a big problem.

Tried to follow the instructions here:

https://lists.gt.net/mythtv/users/624610

But it wasn't step by step, and what I tried did not work initially. That was:

Code: Select all

1.  Upgrade to 18.04 LTS and then reboot.
2.  Run the script  http://www.jsw.gen.nz/mythtv/lirc-ubuntu-18.04-install.sh
3.  sync; reboot
#  lirc was unresponsive.
4.  apt remove lirc
5.  run the script again. 
6.  sync; reboot
#  lirc was unresponsive.
DO NOT run that script twice, big mistake! It appends to /etc/systemd/system/lircd-dev.service twice and then lircd-dev.service will not start since it has two copies of everything. That was 15 minutes down the drain figuring out that self inflicted problem.

Code: Select all

7.  Reread that entire thread and then did
sudo systemctl disable lircmd
sudo systemctl disable lirc-uinput
sudo systemctl disable irexec 
sync;reboot
# lirc was unresponsive
8.  systemctl list-units | grep -i lirc
#there are THREE services: lircd.socket, lirc.service, and lircd.service
#That seemed wrong.  So...
9.  systemctl stop lircd.service
10. systemctl stop lirc.service
11. systemctl start lirc.service
12. irw
#YES, it now responds to the remote!
13. systemctl disable lircd.service
14. sync; reboot
# lirc works!
I don't know if the script provided lirc.service or lircd.service.

So, if I had to do this all over again, I would try, starting right after the upgrade to 18.04

Code: Select all

1.  apt remove lirc
2.  sudo systemctl disable lircmd
3.  sudo systemctl disable lirc-uinput
4   sudo systemctl disable irexec 
5.  run the script
6.  systemctl list-units | grep lirc
# if lircd.service is present do:
7.  systemctl disable lircd.service
8.  sync; reboot
At least that is my best guess!

Tomorrow mythtv gets upgraded from 0.29 to 0.30, and the netflix inserting script will be run.

mathog
Junior
Posts: 62
Joined: Thu Dec 15, 2016 5:22 pm
United States of America

Re: Updated to 18.04 LTS, lirc was a PITA

Post by mathog » Sun Nov 03, 2019 6:08 am

This is what it looks like when it is working:

Code: Select all

systemctl list-units | grep -i lirc
  lirc.service                                                                              loaded active running   LIRC Daemon                                                                
  lircd.socket                                                                              loaded active listening lircd.socket 

systemctl status lirc.service
● lirc.service - LIRC Daemon
   Loaded: loaded (/etc/systemd/system/lirc.service; enabled; vendor preset: enabled)
   Active: active (running) since Sat 2019-11-02 22:30:00 PDT; 35min ago
  Process: 973 ExecStart=/usr/sbin/lircd -H udp -d 5000 -P /var/run/lirc/lircd.pid (code=exited, status=0/SUCCESS)
  Process: 942 ExecStartPre=/bin/mkdir -p /var/run/lirc (code=exited, status=0/SUCCESS)
 Main PID: 1011 (lircd)
    Tasks: 1 (limit: 2340)
   CGroup: /system.slice/lirc.service
           └─1011 /usr/sbin/lircd -H udp -d 5000 -P /var/run/lirc/lircd.pid

Nov 02 22:30:00 mediahog lircd-0.10.0[973]: Info: lircd:  Opening log, level: Info
Nov 02 22:30:00 mediahog lircd-0.10.0[973]: Warning: Running as root
Nov 02 22:30:00 mediahog lircd-0.10.0[973]: Info: Using remote: RM-VL600_8201.
Nov 02 22:30:00 mediahog lircd-0.10.0[1011]: Notice: lircd(udp) ready, using /var/run/lirc/lircd
Nov 02 22:30:07 mediahog lircd-0.10.0[1011]: Notice: accepted new client on /var/run/lirc/lircd
Nov 02 22:30:07 mediahog lircd-0.10.0[1011]: Info: Initializing UDP: 5000
Nov 02 22:30:07 mediahog lircd-0.10.0[1011]: Notice: using UDP port: 5000, resolution: 61
Nov 02 22:30:07 mediahog lircd-0.10.0[1011]: Info: Listening on port 5000/udp
Nov 02 22:30:15 mediahog lircd-0.10.0[1011]: Notice: accepted new client on /var/run/lirc/lircd
Nov 02 22:30:30 mediahog lircd-0.10.0[1011]: Notice: accepted new client on /var/run/lirc/lircd

systemctl status lircd.socket
Failed to dump process list, ignoring: No such file or directory
● lircd.socket
   Loaded: loaded (/lib/systemd/system/lircd.socket; enabled; vendor preset: enabled)
   Active: active (listening) since Sat 2019-11-02 22:29:56 PDT; 35min ago
   Listen: /run/lirc/lircd (Stream)
   CGroup: /system.slice/lircd.socket

Nov 02 22:29:56 mediahog systemd[1]: Listening on lircd.socket.

ps -ef | grep lirc
root      1011     1  0 22:29 ?        00:00:01 /usr/sbin/lircd -H udp -d 5000 -P /var/run/lirc/lircd.pid
#preceding is for an HDHomeRun network tuner

(cd /etc/lirc; ls -alR)
drwxr-xr-x   2 root root  4096 Nov  2 18:48 lircd.conf.d
-rw-r--r--   1 root root  1071 Nov  2 18:15 lirc_options.conf
-rw-r--r--   1 root root  1124 Nov  2 18:15 irexec.lircrc
-rw-r--r--   1 root root  1062 Dec 25  2017 hardware.conf
-rw-r--r--   1 root root   121 Jan 27  2016 lircmd.conf
./lircd.conf.d:
total 48
drwxr-xr-x 2 root root  4096 Nov  2 18:48 .
drwxr-xr-x 3 root root  4096 Nov  2 18:48 ..
-rw-r--r-- 1 root root 35018 Aug 13  2017 devinput.lircd.conf
-rw-r--r-- 1 root root   615 Aug 13  2017 README.conf.d
#preceding list may include files which are no longer actually used by lirc

ls -al /var/run/lirc
total 4
drwxr-xr-x  2 root root  80 Nov  2 22:30 .
drwxr-xr-x 30 root root 940 Nov  2 22:38 ..
srw-rw-rw-  1 root root   0 Nov  2 22:30 lircd
-rw-r--r--  1 root root   5 Nov  2 22:30 lircd.pid

ls -al /sys/class/rc*
total 0
drwxr-xr-x  2 root root 0 Nov  2 23:01 .
drwxr-xr-x 64 root root 0 Nov  2 22:29 ..
#preceding because somewhere I read that /sys/class/rc0 must be present, apparently not
lsmod | grep ir
#nothing relevant, apparently either built into the kernel or does not require a module

wesnewell
Senior
Posts: 512
Joined: Mon Jun 23, 2014 6:54 pm
Location: Wylie TX, USA
United States of America

Re: Updated to 18.04 LTS, lirc was a PITA

Post by wesnewell » Sun Nov 03, 2019 4:36 pm

That's why I removed lirc a few years back and have been using the kernel built in support for ir devices ever since, ir-keytable.
Advantages;
It's built into the kernel.
It works with all apps, because it works like a keyboard. No more lircrc for every app.

There's also using one of many mini keyboards as a $10 alternative to using an ir remote.
BE/FE-Asrock AB350 Pro AMD Ryzen 3 2200G, 6 atsc tuners. Frontends-GF8200's,,AMD Athlon II's. Mythtv user since 2005.

User avatar
heyted
Senior
Posts: 103
Joined: Sun Jun 08, 2014 2:14 am
Location: South Florida
Contact:
United States of America

Re: Updated to 18.04 LTS, lirc was a PITA

Post by heyted » Mon Nov 04, 2019 1:20 am

+1 for ir-keytable
Ted | My blog

nexzzt
Newcomer
Posts: 9
Joined: Wed Jun 18, 2014 3:58 am
Australia

Re: Updated to 18.04 LTS, lirc was a PITA

Post by nexzzt » Mon Nov 04, 2019 1:44 am

I need to be able to run scripts via remote button presses, so while ir-keytable is great, it didn't suit my needs. So I did this:
https://twosortoftechguys.wordpress.com ... ntu-18-04/

mathog
Junior
Posts: 62
Joined: Thu Dec 15, 2016 5:22 pm
United States of America

Re: Updated to 18.04 LTS, lirc was a PITA

Post by mathog » Tue Nov 05, 2019 9:07 pm

wesnewell wrote:
Sun Nov 03, 2019 4:36 pm
There's also using one of many mini keyboards as a $10 alternative to using an ir remote.
There are a lot of those, mostly from companies I have never heard of. Which models are known to work with linux? Which has an acceptable pointing device (trackpad or whatever)? We wouldn't want an actual mouse for this, as we would be forever hunting around in dim light trying to find it.

Thanks.

wesnewell
Senior
Posts: 512
Joined: Mon Jun 23, 2014 6:54 pm
Location: Wylie TX, USA
United States of America

Re: Updated to 18.04 LTS, lirc was a PITA

Post by wesnewell » Tue Nov 05, 2019 10:05 pm

BE/FE-Asrock AB350 Pro AMD Ryzen 3 2200G, 6 atsc tuners. Frontends-GF8200's,,AMD Athlon II's. Mythtv user since 2005.

blm-ubunet
Junior
Posts: 81
Joined: Sun Jun 15, 2014 1:08 am
Cambodia

Re: Updated to 18.04 LTS, lirc was a PITA

Post by blm-ubunet » Tue Nov 05, 2019 10:59 pm

@nexzzt
Now that either systemd/gnome/Xorg/other all seem work to prevent access to key events..
Xbindkeys is useless now, because it is too low in the food chain.

https://github.com/wertarbyte/triggerhappy
https://github.com/burghardt/esekeyd (is in std debian/*buntu repos)

I use Esekeyd to be able use keyboard multimedia keys (mute vol+ vol-) to control volume on HT amp.

mathog
Junior
Posts: 62
Joined: Thu Dec 15, 2016 5:22 pm
United States of America

Re: Updated to 18.04 LTS, lirc was a PITA

Post by mathog » Wed Nov 06, 2019 9:21 pm

wesnewell wrote:
Tue Nov 05, 2019 10:05 pm
Any of these should work fine.
https://www.ebay.com/sch/i.html?_from=R ... e&_sacat=0
One ordered. It should be a lot easier to work with that on a browser than trying to coerce lirc to convert universal remote keypresses into usable browser navigation commands.

Thanks.

mathog
Junior
Posts: 62
Joined: Thu Dec 15, 2016 5:22 pm
United States of America

Re: Updated to 18.04 LTS, lirc was a PITA

Post by mathog » Sun Nov 10, 2019 11:31 pm

Received the Rii i8+ mini keyboard. It does allow full control of the browsers once they are started directly with an EXEC and not through the firefox lirc py script, since the latter seems to block all other input to those programs. However, this makes me long for the eyes I used to have rather than the ones now in my head! I would need binoculars and a pair of bifocals to be able to see the tiny keys on the keypad, the even tinier type in the browser on the 1080p screen at 3 meters, and the video content on that screen, all in focus and at usable sizes.

Anyway, the key input problem is solved.

Unfortunately video issues still abound.

The machine has an Athlon 64 X2 Dual Core Processor 4000+ CPU. The graphics card is a GeForce GT 730, the driver is nvidia-driver-440. All software is up to date (for Ubuntu 18.04 LTS.)

Video acceleration works fine when playing back a mythtv recording. Typically that uses about 23% CPU for mythfrontend and 6% for irq/nvidia. But play Taylor Swift's "Shake it off" video (randomly chosen test) full screen on youtube with h264ify in either Firefox or Chrome and usage is much higher. Firefox shows 75% for "Web content", 13% "GPU process", 11% "firefox". Chrome shows 79 + 27 + 24 % in 3 separate Chrome processes. "Nerd info" shows avc/mp4 (so h264ify worked) and connection speed typically >40000 kpbs. Both of them drop frames, pause, and in other ways misbehave. Failures are variable, sometimes it works OK for a while, other times not. This network speed test:

http://www.dslreports.com/speedtest

(cable mode) varied between 135 and 200 Mbps (not tested at the same time as the video was playing).

Netflix works almost acceptably in Chrome, not well at all in Firefox. Oddly Chrome works better at full screen than at "nearly full screen".

I also tried the modified Chromium said to have VAAPI working using the instructions here:

https://www.linuxuprising.com/2018/08/h ... rated.html

except installed with:

install chromium-browser=78.0.3904.63-0ubuntu1~ppa1~18.04.1 chromium-codecs-ffmpeg-extra=78.0.3904.63-0ubuntu1~ppa1~18.04.1

because the version in 18.04 is now newer than the one in that repository, so "apt install chromium-browser" installs the wrong one. This wouldn't play netflix video at all. Not sure why.

This is all very disappointing. Adding a newer graphics card wouldn't help at all because the browsers are not using GPU acceleration (or doing so very poorly). That leaves upgrading the CPU as the only hardware fix, and given the age of the motherboard, that would basically be a full rebuild.

Perhaps somewhere there is a video accelerated app just for netflix or youtube that runs on Ubuntu?

mathog
Junior
Posts: 62
Joined: Thu Dec 15, 2016 5:22 pm
United States of America

Re: Updated to 18.04 LTS, lirc was a PITA

Post by mathog » Sun Nov 10, 2019 11:49 pm

Code: Select all

snap install electronplayer
Installs "electronplayer". It plays netflix and youtube and others, but seems not to have any GPU acceleration either. It was using about 140% of CPU in 3 processes while showing netflix full screen, for instance. Same sorts of pauses as was seen with chrome.
Last edited by mathog on Mon Nov 11, 2019 12:12 am, edited 1 time in total.

User avatar
heyted
Senior
Posts: 103
Joined: Sun Jun 08, 2014 2:14 am
Location: South Florida
Contact:
United States of America

Re: Updated to 18.04 LTS, lirc was a PITA

Post by heyted » Mon Nov 11, 2019 12:03 am

Perhaps somewhere there is a video accelerated app just for netflix or youtube that runs on Ubuntu?
I haven't tried this plugin for Kodi in a long time, but maybe https://kodi.tv/addon/plugins-video-add-ons/youtube would be better.
Ted | My blog

mathog
Junior
Posts: 62
Joined: Thu Dec 15, 2016 5:22 pm
United States of America

Re: Updated to 18.04 LTS, lirc was a PITA

Post by mathog » Mon Nov 11, 2019 12:37 am

It does not look like Netflix supports anything above 720p on a linux browser.

Code: Select all

https://help.netflix.com/en/node/23742
and widevine (DRM software) does odd things restricting resolutions which might cut it back even further.

Post Reply