[mythtv-users] Raspberry Pi 4 FrontEnd Remote Control Issues

Stephen Worthington stephen_agent at jsw.gen.nz
Sun May 10 09:07:27 UTC 2020


On Sat, 9 May 2020 19:20:04 -0500, you wrote:

>
>Hi Folks!
>
>Have a Raspberry Pi 4, 4 GB, which I’m using as a FrontEnd – seems to 
>work fine. What I would like to do is be able to use the television’s 
>remote control instead of a keyboard. Have used MythTV and before that 
>Mythbuntu and always used a keyboard, so this is my first time trying to 
>use a remote.
>
>TV is a Seiki, found a LIRC configuration file at 
>https://gist.github.com/gisikw/a2ffa7f45efa0d9c3bee . AFAICT I’ve 
>configured it in correctly as /irw/seems to output correctly 
>“000000040be52ad 00 KEY_OK seiki” when I tap the “OK” key; the ‘00’ will 
>increment if I hold the key.
>
>Problem is nothing happens when I’m in MythTV – menu just sits there 
>with pressing OK, Up, Down, Left
 random keys. At this point I have the 
>Pi plugged in to a monitor up here in the Computer Room (the TV is 
>downstairs). Setup > General > Remote Control:
>
>     LIRC daemon socket:         /var/run/lirc/lircd (guess so: default 
>and a file [purple] there)
>
>     Enable CEC Control Interface:     Checked, as are all four options 
>in the submenu
>
>*s**udo systemctl status lircd.service*says its ‘active (running)’, no 
>errors listed.
>
>No idea where to look to correct whatever is wrong so asking for 
>guidance here; looked in the archives but nothing helpful in the way I 
>typed in search terms.
>
>TIA!
>
>Barry

If irw is working, you are a long way down the path of getting it
going.  The next thing to do is to run irw and try every key on the
remote and make sure that they are all recognised.  You need to have
mythfrontend shut down while doing that.  It all the keys are working,
then you do not need to go back to ir-keytable and fix things there,
so that would be a bonus.

Once you have all the keys working, then to get them recognised in
MythTV, you have to configure two things: the lirc output, and
possibly the mythfrontend input keys.  The first of these is the lirc
configuration that tells lirc how to translate the keystroke data you
are seeing from irw into keystrokes for each of the programs that will
take input from lirc, such as MythTV, Kodi, mplayer or irexec.  Each
program that uses input from lirc links in the lirc library code to do
that.  When the program starts up, the lirc library code looks for a
table of keystroke translations customised for the program.  These
tables are normally found in a .lircrc file in the home directory of
the user running the program.  The .lircrc file contains one table for
each program, identified by a name the program gives to the lirc
library code.  All the various MythTV programs that use lirc
(mythfrontend, mythtv-setup.real, mythavtest, ...) use the same lirc
name: mythtv.  The .lircrc file is usually just a list of "include"
statements that include other files, one file per set of program
definitions.  So here is what is in .lircrc in Ubuntu:

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

So all the actual definition files for the programs are stored in
$(HOME)/.lirc

Here is the start of my /home/stephen/.lirc/mythtv file:

# 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

begin
    remote = devinput
    prog = mythtv
    button = KEY_OK
    config = Return
    repeat = 0
    delay = 0
end

Each begin/end block is one keystroke definition for one program. Lirc
does not care which file the definitions are in, it is just a
convention to use one file per set of program definitions.  So if you
are cutting and pasting and forget that you copied a definition with a
different program name in the "prog = " line, you will not get the
result you want.

So you need to check if you have the .lircrc and .lirc/* files.  If
the MythTV install for Pi4 has not installed them, you will need to
get them from somewhere.

In your case, your "remote = " name should be "seiko" as that is what
irw is showing as the remote name.  So in your $(HOME)/.lirc/mythtv
file, you will likely need to change all the "remote = " lines to read
"remote = seiko", using a global change.  That will be the thing that
is preventing even the arrow keys from working at the moment.

The format of the .lircrc file definitions is on this page:

https://www.lirc.org/html/configure.html

Each key definition needs to have the "button = " value set to the
keystroke that you see in irw, and the "config = " value set to the
keyboard key that mythtv uses for that function.  The MythTV
keystrokes are set up in:

mythfrontend > Setup > Edit keys

The "config = " value has to match the keystroke for a key set at the
bottom of an Edit keys window (allowing for different syntax for Ctrl-
and the like).

You should set "repeat = 1" only for keys you want to autorepeat, such
as the arrows and maybe PgUp and PgDn.  For repeating keys, try
setting "delay = 1" and see if the autorepeat is the correct speed.
Adjust as required.

Any changes in the .lircrc files will only be seen when you shut down
mythfrontend and restart it.

Before going any further, you should check to see if any of the other
systemd services associated with lirc are installed and running.  On
Ubuntu, apart from lirc itself (lircd.service, lircd.socket and
lircd-setup.service), there are three other services installed:

irexec.service
lircd-uinput.service
lircmd.service

With only the default configuration, one or more of these can
interfere with the proper operation of lirc (for example, causing
doubled keystrokes).  So they all need to be stopped and disabled:

sudo systemctl stop <servicename>
sudo systemctl disable <servicename>

If at some later time you ever need them, configure them properly then
enable and start them.

So now if you start mythfrontend, things should be working at least
somewhat.  You will need to test all keys to make sure each one is
working properly.

Another useful test program is ircat.  If you shut down mythfrontend
and run:

ircat mythtv

then ircat will load the lirc keystroke definitions for "mythtv" and
will respond to them.  So when you push a key on the remote, the
output you should see is what is on the matching "config = " line.


More information about the mythtv-users mailing list