[mythtv-users] Remote and blaster without LIRC?

Stephen Worthington stephen_agent at jsw.gen.nz
Fri May 24 09:42:31 UTC 2019


On Thu, 23 May 2019 22:33:10 -0400, you wrote:

>I think I just spent the last couple of days going down LIRC blind 
>alleys.  Can someone point me to a current guide to setup an MCE 
>receiver/blaster?  Or, maybe, just some sample files with settings that 
>apply to this version of LIRC?
>
>Don

I have not run a blaster for a long time, so I can not help with that.
I only did it before the config changed.  I hope the LIRC
documentation will help with that:

http://www.lirc.org
http://www.lirc.org/html/configuration-guide.html

The LIRC docs do have decent information about how to configure a
remote also.

Here is information on my working MCE setup.  The first thing to
remember is that LIRC has finally been upgraded from the ancient
version in 16.04 to a modern version in 18.04.  So its config files
are different, and there is a new Python program lirc-setup to run to
set it up.  The old /etc/lirc/hardware.conf file is no longer used.
You need to run lirc-setup (I think it needs to be run as root) and
tell it to download the MCE remote config file (devinput) and
configure LIRC to use that.  It may already be set up that way as
default, but there are some names to change to make it work.

Here is my setup:

root at mypvr:/lib/udev/rc_keymaps# ll rc6* hauppauge
-rw-r--r-- 1 root root 2838 Feb 11  2018 hauppauge
-rw-r--r-- 1 root root 1475 Feb 11  2018 rc6_mce

These are the files I use for my Hauppauge and MCE remotes.  They are
the key mappings used by ir-keytable.  You need to run ir-keytable -t
and check that each key on your remote is producing a keystroke listed
in the rc6_mce file.  If you find a key that is not working, then you
will need to set up a modified copy of the rc6_mce file - let me know
and I will tell you how.  Remember to stop lircd when using
ir-keytable:

sudo systemctl stop lircd

This is the first LIRC config file:

root at mypvr:/etc/lirc# cat lirc_options.conf
# These are the default options to lircd, if installed as
# /etc/lirc/lirc_options.conf. See the lircd(8) and lircmd(8)
# manpages for info on the different options.
#
# Some tools including mode2 and irw uses values such as
# driver, device, plugindir and loglevel as fallback values
# in not defined elsewhere.

[lircd]
nodaemon        = False
driver          = devinput
device          = auto
output          = /var/run/lirc/lircd
pidfile         = /var/run/lirc/lircd.pid
plugindir       = /usr/lib/x86_64-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


The lirc_options.conf file is largely unchanged - just check that it
says "driver = devinput".

The next LIRC config file is:

root at mypvr:/etc/lirc# cat lircd.conf
# Populated config files can be found at http://sf.net/p/lirc-remotes.
The
# irdb-get(1) and lirc-setup(1) tools can be used to search and
download
# config files.
#
# From 0.9.2 config files could just be dropped as-is in the
lircd.conf.d
# directory and be included by this file.

include "lircd.conf.d/*.conf"

The lircd.conf file is unchanged - it now just loads all the changed
config from the lircd.conf.d directory:

root at mypvr:/etc/lirc# ll lircd.conf.d
total 48
drwxr-xr-x 2 root root  4096 Oct  6  2018 ./
drwxr-xr-x 3 root root  4096 Oct  6  2018 ../
-rw-r--r-- 1 root root 35015 Oct  6  2018 devinput.lircd.conf
-rw-r--r-- 1 root root   615 Aug 13  2017 README.conf.d

And here is the start of my devinput.lircd.conf file:

root at mypvr:/etc/lirc/lircd.conf.d# head -n 30 devinput.lircd.conf
# Rename to devinput.lircd.dist if not using devinput driver
# Re-generate for current kernel using lirc-make-devinput
#
# Generated by lirc-make-devinput on 4.4.0-91-generic
# Date: Thu Aug 17 11:08:45 UTC 2017

begin remote
        name            devinput-64
        bits            16
        eps             30
        aeps            100
        pre_data_bits   16
        pre_data        0x0001
        post_data_bits  32
        post_data       0x00000001
        gap             132799
        toggle_bit      0
        driver          devinput

        begin codes
         KEY_0      11
         KEY_1      2
         KEY_102ND      86
         KEY_10CHANNELSDOWN      0x1b9
         KEY_10CHANNELSUP      0x1b8
         KEY_2      3
         KEY_3      4
         KEY_3D_MODE      0x26f
         KEY_4      5
         KEY_5      6

The devinput.lircd.conf file may already be present, but if not,
lirc-setup can download and install it.  Note that I had to change the
"name" setting in the second half of that file from "devinput-32" to
"devinput".  That is the name I am using in my $HOME/.lircrc included
files (see below) in the "remote = devinput" lines.  It was much
easier to change it in one line there, rather than change all the
"remote = devinput" lines to "remote = devinput-32".  Depending on
your remote, you might need to use the devinput-64 section of the
devinput.lircd.conf file and rename that, rather than the devinput-32
section.  Sorry, I can not remember how I worked out that my remote
needed devinput-32.

Programs that support LIRC for IR input normally read the file
$HOME/.lircrc to load their LIRC config.  MythTV conforms to this.  In
a standard MythTV setup with LIRC, that file is just a set of include
commands for the files containing the actual LIRC configs for the
various programs that are using LIRC:

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/.lirc# head -n 30 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

begin
    remote = devinput
    prog = mythtv
    button = KEY_OK
    config = Return

In the $HOME/.lirc files, the "button = " values must match the
keystroke KEY_ names in the rc6_mce file, and the "config = " values
must match the value expected by the program named in the "prog = "
line.  So for MythTV programs ("prog = mythtv"), the "config = "
values must be defined in mythfrontend > Setup > Edit keys (database
tables jumppoints and keybindings).

To check that LIRC is sending the right things to MythTV, you can shut
down all MythTV GUI programs (mythfrontend, mythtv-setup.real, ...)
and then from a command prompt started from the GUI screen, run:

ircat mythtv

That will display what would be sent to MythTV when you do a button
press on the remote.


More information about the mythtv-users mailing list