problems with xubuntu 18.04 backend and CIR

For discussion of topics specific to MythTV on linux
Post Reply
rex65
Newcomer
Posts: 5
Joined: Sat Jul 14, 2018 1:19 pm
Australia

problems with xubuntu 18.04 backend and CIR

Post by rex65 »

Hi all,
I've purchased a new Intel NUC and have done an Xubuntu 18.04 install and a 0.29 mythtv install. I have a HDHomerun Connect Quatro tv tuner.
I have two problems and can't find a solution after a few days of searching...
First mythbackend starts before the network is ready so the it doesn't connect to the HDHomerun tuner, Have tried editing mythtv-backend.service adding ExecStartPre=/urs/bin/nm-online --quite --timeout=10 without success just hangs and doesn't start mythbackend. To fix I have to run "sudo systemctl stop mythtv-backend" and "sudo systemctl start mythtv-backend" to get the frontend to work. Any other solutions to this problem?

My other problem is to get the CIR to work with a remote control. Have created a file autostart.xx with modprobe nuvoton-cir commands etc but when trying to run I get permission denied. I can't figure out how to get this to work.

Computer is an Intel NUC7i7BNH, upgrading from another NUC with Ubuntu 16.04 with mythtv 0.29 but have the dual tuners and no remote.
MikeB2013
Senior
Posts: 519
Joined: Mon Jul 25, 2016 4:16 pm
Great Britain

Re: problems with xubuntu 18.04 backend and CIR

Post by MikeB2013 »

For the mythbackend starting problem before networking see https://lists.gt.net/mythtv/users/609209#609209

There is a slightly easier way to do this using systemctl edit feature (saves creating directories, files, and setting permissions):
run in a terminal session "sudo systemctl edit mythtv-backend.service" and then paste the following three lines:
[Unit]
Wants=NetworkManager-wait-online.service
After=NetworkManager-wait-online.service

You still need to do the "sudo systemctl enable NetworkManager-wait-online.service" and then reboot.

Mike
rex65
Newcomer
Posts: 5
Joined: Sat Jul 14, 2018 1:19 pm
Australia

Re: problems with xubuntu 18.04 backend and CIR

Post by rex65 »

Thanks Mike for the info above. Unfortunately it didn't work, I tried both methods. I assume Xubuntu would complain if NetworkManager-wait-online.service wasn't installed etc.
The HDHomerun is connected directly to the NUC with IPv4 address set to 169.254.160.236, netmask 16, gateway empty. This works fine with Mythbuntu.
The tuners are setup in Mythbackend using Device ID not IP address and the tuners scan channels fine.
Mythbackend log has error "Unknown tuner type =0xffffffff800000000" which I assume is because the backend starts up before the network.

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

Re: problems with xubuntu 18.04 backend and CIR

Post by wesnewell »

I think this is what you need to edit, /etc/init.d/mythtv-backend. Stick a sleep command at the start for however long you want to pause the backend startup. man sleep.
BE/FE-Asrock AB350 Pro Ryzen 3 3200G, 6 atsc tuners. FE's-GF8200's Athlon II, Ryzen 3 2200G. Mythtv user since 2005.
MikeB2013
Senior
Posts: 519
Joined: Mon Jul 25, 2016 4:16 pm
Great Britain

Re: problems with xubuntu 18.04 backend and CIR

Post by MikeB2013 »

There is another possible "fix", not the best but it may get you out of the problem with networking so you can investigate further at your leisure. I believe there are some other posts about HDHomerun and networking, but I am not familiar with such devices.

It simply delays mythbackend startup for 20 seconds :
sudo systemctl edit mythtv-backend.service and paste following 2 lines, followed by a reboot
[Service]
ExecStartPre=/bin/sleep 20

Mike
User avatar
bill6502
Developer
Posts: 2307
Joined: Fri Feb 07, 2014 5:28 pm
United States of America

Re: problems with xubuntu 18.04 backend and CIR

Post by bill6502 »

I think the one MIke's talking about is this:
viewtopic.php?f=29&t=1467&p=7164&hilit= ... vice#p7138
The sleep solution will work most of the time. In my tests
17 seconds is typical, but I know I had one case that took
minutes. It was after powering down my server and the
HDHR itself.

I'm not a fan of using sleep for issues similar to this, but admit to using it
on occasion.
wesnewell
Senior
Posts: 731
Joined: Mon Jun 23, 2014 6:54 pm
Location: Wylie TX, USA
United States of America

Re: problems with xubuntu 18.04 backend and CIR

Post by wesnewell »

For ir remotes. I now use ir-keytable. I used lircd for years until I upgraded to 18.04lts and had problems with lircd. Run ir+keytable to see what you're ir receiver is capable of.
wes@mythfe0:~$ sudo ir-keytable
[sudo] password for wes:
Found /sys/class/rc/rc0/ (/dev/input/event14) with:
Name: Media Center Ed. eHome Infrared Remote Transceiver (0471:0815)
Driver: mceusb, table: rc-rc6-mce
lirc device: /dev/lirc0
Supported protocols: lirc rc-5 rc-5-sz jvc sony nec sanyo mce_kbd rc-6 sharp xmp
Enabled protocols: lirc rc-5 rc-5-sz jvc sony nec sanyo mce_kbd rc-6 sharp xmp
bus: 3, vendor/product: 0471:0815, version: 0x0000
Repeat delay = 500 ms, repeat period = 125 ms
Then run ir-keytable -t as root to see your code for each button on the remote. Then create your /etc/rc_keymaps/<filename file> file.
Exp:
wes@mythfe0:~$ cat /etc/rc_keymaps/myremotes
# table *, type:rc-5 rc-5-sz jvc sony nec sanyo mce_kbd rc-6 sharp xmp
# CODE KEY BUTTON RCRP05B
0x0f KEY_F12 :POWER
0x2b KEY_L :LIVE
0x29 KEY_T :LIST
0x26 KEY_B :JUMP START
0x21 KEY_COMMA :SKIP BACK
.........
Then, add driver info into /etc/rc_maps.conf.
Exp:
mceusb * /etc/rc_keymaps/myremotes
reboot to get all keys to work.
man ir-keytable
BE/FE-Asrock AB350 Pro Ryzen 3 3200G, 6 atsc tuners. FE's-GF8200's Athlon II, Ryzen 3 2200G. Mythtv user since 2005.
rex65
Newcomer
Posts: 5
Joined: Sat Jul 14, 2018 1:19 pm
Australia

Re: problems with xubuntu 18.04 backend and CIR

Post by rex65 »

Thanks for the solution... Sleep worked!
Before I move on to the CIR I need to sort a playback issue with tearing. Happens on all video playback settings in mythtv but also in VLC. Might have to reinstall Xubuntu 18.04 or revert back to 16.04.
If the problem persists I'll start a new thread.
Thanks again for your help.
MikeB2013
Senior
Posts: 519
Joined: Mon Jul 25, 2016 4:16 pm
Great Britain

Re: problems with xubuntu 18.04 backend and CIR

Post by MikeB2013 »

For the tearing issue have a look at https://www.mythtv.org/wiki/Intel_Integrated_Graphics bottom of the page.

Mike
rex65
Newcomer
Posts: 5
Joined: Sat Jul 14, 2018 1:19 pm
Australia

Re: problems with xubuntu 18.04 backend and CIR

Post by rex65 »

Thanks Mike all good now.
Mythological
Newcomer
Posts: 5
Joined: Mon Jun 02, 2014 9:12 pm
Canada

Re: problems with xubuntu 18.04 backend and CIR

Post by Mythological »

wesnewell wrote:
Sun Jul 15, 2018 3:55 pm
For ir remotes. I now use ir-keytable. I used lircd for years until I upgraded to 18.04lts and had problems with lircd.
Just FYI, the problem in Ubuntu 18.04 (and most likely other Ubuntu flavors) is that they have a bad version of lirc in their repository. There is an article here that tells how to work around the problem:

Make LIRC work in Ubuntu 18.04, so that you can use your infrared remote in Kodi

While it mentions Kodi in the title there is nothing Kodi-specific about it, and it probably would also work equally well for MythTV users having problems getting an IR remote to work under 18.04. Might be worth a try in situations where you can't get the remote to work or you are experiencing weird issues like unrecognized buttons, double button presses, sporadic button recognition, etc. I'd only use it if you are actually having issues with your remote under 18.04, though.
wesnewell
Senior
Posts: 731
Joined: Mon Jun 23, 2014 6:54 pm
Location: Wylie TX, USA
United States of America

Re: problems with xubuntu 18.04 backend and CIR

Post by wesnewell »

Since switching to ir-keytable, I no longer have to worry about all the lircrc crap. The remote works just like a keyboard. Only drawback to it is it doesn't support double key presses like CTL+, ALT+, etc., and of course it only support protocols that your ir receiver supports. But that's not much of an issue. As for lirc, good riddance imo. I created my own remote code and loaded the codes to all 54 buttons of my JP1 remotes. Full alphabet, number keys, plus others. And can use it in any app.
BE/FE-Asrock AB350 Pro Ryzen 3 3200G, 6 atsc tuners. FE's-GF8200's Athlon II, Ryzen 3 2200G. Mythtv user since 2005.
rex65
Newcomer
Posts: 5
Joined: Sat Jul 14, 2018 1:19 pm
Australia

Re: problems with xubuntu 18.04 backend and CIR

Post by rex65 »

Regarding CIR and remote control... I'm stumped.
Trying to use an eyetv remote, seems nec protocol works. ir-keytable -t button press works giving 0x4545xx for key press of keys (eg ESC gives 0x454518). Keytable has this in so when I press that key I see
1024.012865: event type EV_MSC(0x04): scancode = 0x454518
1024.012865: event type EV_SYN(0x00).
1024.024009: event type EV_KEY(0x01) key_down: KEY_ESC(0x0001)
Mythfrontend only works with arrows and OK, no other buttons work. Tried setup-edit keys, but no key press of remote works.
Have tried other remotes, Philips SRU6006, Panasonic TV but neither are recognised with any other protocols.
Do I need to buy a different remote, understand what I'm doing wrong, use my iPhone with an app?
Cheers.
Mythological
Newcomer
Posts: 5
Joined: Mon Jun 02, 2014 9:12 pm
Canada

Re: problems with xubuntu 18.04 backend and CIR

Post by Mythological »

wesnewell wrote:
Wed Jul 25, 2018 5:33 am
Since switching to ir-keytable, I no longer have to worry about all the lircrc crap. The remote works just like a keyboard. Only drawback to it is it doesn't support double key presses like CTL+, ALT+, etc., and of course it only support protocols that your ir receiver supports. But that's not much of an issue.
Perhaps not for you, but what you in effect seem to be saying is that your remote doesn't have the same level of functionality that it used to. For me, that's a huge issue. And I don't want my remote to work like a keyboard, I want it to work like a remote - but mainly, I want it to just work!
wesnewell wrote:
Wed Jul 25, 2018 5:33 am
As for lirc, good riddance imo. I created my own remote code and loaded the codes to all 54 buttons of my JP1 remotes. Full alphabet, number keys, plus others. And can use it in any app.
Funny, I feel just the opposite. To me, ir-keytable is the software I was happy to say good riddance to. It seemed terribly difficult to configure and I could never get it to work correctly. Whereas, LIRC "just works" after you pick your remote from a list during setup.

If you like ir-keytable then by all means use it, but for me trying to make it work was an exercise in frustration and futility, whereas getting LIRC to work could not have been much simpler once I got hold of a non-buggy version. Note that when I refer to LIRC I am talking about the LIRC package that you need to install (the article I mentioned in my previous post explains how), not any built-in functionality that is packaged with Ubuntu.
wesnewell
Senior
Posts: 731
Joined: Mon Jun 23, 2014 6:54 pm
Location: Wylie TX, USA
United States of America

Re: problems with xubuntu 18.04 backend and CIR

Post by wesnewell »

With ir-keytable you only need to setup 1 file for everything, and there's really just one other file you need to edit. Here's the file /etc/rc_keymaps/myremotes. This tells the remote what keypress to execute when you press that button. Note that the first line tells it what protocols to support, and while I created my own keycodes with the nec protocol, you could have any number of remotes that use any of these protocols in the file and they would all work.

# table *, type:rc-5 rc-5-sz jvc sony nec sanyo mce_kbd rc-6 sharp xmp
# CODE KEY BUTTON RCRP05B
0x0f KEY_F12 :POWER
0x2b KEY_L :LIVE
0x29 KEY_T :LIST
0x26 KEY_B :JUMP START
0x21 KEY_COMMA :SKIP BACK
0x22 KEY_DOT :SKIP FWD
0x11 KEY_X :SKIP FWD-RIGHT ARROW|BAR
0x24 KEY_R :RECORD
0x23 KEY_Z :STOP RECORDING
0x20 KEY_P :PAUSE
0x1f KEY_P :PLAY
0x13 KEY_M :MENU
0x14 KEY_G :GUIDE
0x2a KEY_I :INFO
0x25 KEY_ESC :EXIT
0x19 KEY_ENTER :OK
0x15 KEY_UP ;UP ARROW
0x16 KEY_DOWN :DOWN ARROW
0x17 KEY_LEFT :LEFT ARROW
0x18 KEY_RIGHT :RIGHT ARROW
0x0a KEY_VOLUMEUP :VOL+
0x0b KEY_VOLUMEDOWN :VOL-
0x0d KEY_PAGEUP :CH+
0x0e KEY_PAGEDOWN :CH-
0x12 KEY_O :LAST
0x01 KEY_1 :1
0x02 KEY_2 :2
0x03 KEY_3 :3
0x04 KEY_4 :4
0x05 KEY_5 :5
0x06 KEY_6 :6
0x07 KEY_7 :7
0x08 KEY_8 :8
0x09 KEY_9 :9
0x00 KEY_0 :0
0x28 KEY_SEMICOLON :DASH
0x1c KEY_W :ASPECT
0x1a KEY_V :PG+
0x2d KEY_HOME :DAY-
0x2c KEY_END :DAY+
0x10 KEY_S :PG-
0x35 KEY_C :ON DEMAND
0x0c KEY_Y :MUTE
0x2e KEY_SLASH :FAV
0x1b KEY_Q :PIP
0x1d KEY_N :SWAP
0x1e KEY_E :MOVE
0x33 KEY_K :PIPCH+
0x34 KEY_J :PIPCH-
0x27 KEY_H :INPUT
0x2f KEY_F :A YELLOW
0x30 KEY_U :B BLUE
0x31 KEY_A :C RED
0x32 KEY_D :D GREEN

The only other thing that's needed is to make sure your remote is supported in /etc/rc_maps.cfg. I added the mceusb line below for my custom remote, but there are a bunch already there if you look at the file and those remotes work without adding anything to this file. And those work out of the box iirc.

# Format:
# driver - name of the driver provided via uevent - use * for any driver
# table - RC keymap table, provided via uevent - use * for any table
# file - file name. If directory is not specified, it will default to
# /etc/rc_keymaps.
# For example:
# driver table file
# cx8800 * ./keycodes/rc5_hauppauge_new
# * rc-avermedia-m135a-rm-jx ./keycodes/kworld_315u
# saa7134 rc-avermedia-m135a-rm-jx ./keycodes/keycodes/nec_terratec_cinergy_xs
# em28xx * ./keycodes/kworld_315u
# * * ./keycodes/rc5_hauppauge_new

mceusb * /etc/rc_keymaps/myremotes

Once setup all you have to do is edit mythtv keys to coincide with whatever you want. And the remote works in everything, Terminal, notepad, anything a keyboard works in, which about everything. You don't need any other support files fror each app like with lirc.
BE/FE-Asrock AB350 Pro Ryzen 3 3200G, 6 atsc tuners. FE's-GF8200's Athlon II, Ryzen 3 2200G. Mythtv user since 2005.
Post Reply