[mythtv-users] Remote and blaster without LIRC?

Stephen Worthington stephen_agent at jsw.gen.nz
Wed Jun 12 14:42:21 UTC 2019


On Wed, 12 Jun 2019 09:28:30 -0400, you wrote:

>On 6/4/2019 12:50 AM, Stephen Worthington wrote:
>> On Mon, 3 Jun 2019 15:52:10 -0400, you wrote:
>>
>>
>>> This should be working, but it's not; MythTv responds to none of the
>>> button presses from the remote.
>>>
>>> Using lirc-setup, when picking mceusb hardware, it pretty much forces
>>> the driver to default, so, I ended up using default. Testing with irw,
>>> it works fine, and returns string  that match the strings in
>>> /etc/lirc/lircd.conf.d/mceusb.lircd.conf.  If I change a string in
>>> mceusb.lircd.conf and retest, I can see the changes in irw.
>>>
>>> Testing with ircat, it looks like it's working, but I'm not sure where
>>> the strings are config from.  Some buttons match the contents of
>>> /etc/lirc/lircd.conf.d/mythtv.lircrc, and some don't.  If I change a
>>> string in mythtv.lirc and retest, nothing changes.  I suspect ircat is
>>> getting strings from somewhere else.
>>>
>>> Below are the the contents of lircd_options_conf and a couple of
>>> examples; any suggestions on what to look for next?
>>>
>>> *Contents of "lircd_options_conf":*
>>> # Generated by lirc-setup
>>> [lircd]
>>> nodaemon = False
>>> driver = default
>>> device = /dev/lirc0
>>> 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
>>> lircd_conf = mceusb.lircd.conf
>>>
>>> [lircmd]
>>> uinput = False
>>> nodaemon = False
>>>
>>> [modinit]
>>> code = echo lirc > /sys/class/rc/rc0/protocols
>>>
>>> *example 1:*
>>> don at johnny:~$ irw
>>> 000000037ff07be0 00 KEY_DOWN mceusb
>>> 000000037ff07be0 01 KEY_DOWN mceusb
>>> 000000037ff07be1 00 KEY_UP mceusb
>>> 000000037ff07be1 01 KEY_UP mceusb
>>> ^C
>>> don at johnny:~$
>>> don at johnny:~$ ircat mythtv
>>> Down
>>> Up
>>>
>>> *example 2:*
>>> don at johnny:~$ irw
>>> 000000037ff07bdc 00 KEY_BACK mceusb
>>> 000000037ff07bdc 01 KEY_BACK mceusb
>>> ^C
>>> don at johnny:~$ ircat mythtv
>>> Escape
>>>
>>> *example 3:*
>>> don at johnny:~$ irw
>>> 000000037ff07bdd 00 KEY_OK mceusb
>>> 000000037ff07bdd 01 KEY_OK mceusb
>>> ^C
>>> don at johnny:~$
>>> don at johnny:~$ ircat mythtv
>>> Return
>>> ^C
>>> don at johnny:~$
>> >From the irw output above, the "default" driver setting is actually
>> using a driver named "mceusb".  The IRW output looks OK, but the arrow
>> keys are not the best ones to use as an example as they also tend to
>> work even without LIRC due to how the other paths for processing IR
>> input work.  The KEY_BACK example though is a key that normally does
>> not work without the LIRC setup being right, so that looks good.
>>
>> The "ircat mythtv" command should be looking at ~/.lircrc for its
>> config file.  On a normal MythTV system, that file is just a set of
>> include commands to read other files.  Here is mine from
>> /home/stephen/.lircrc:
>>
>> stephen at mypvr:~$ 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
>>
>> You need to run ircat from the same user as mythfrontend is run from,
>> in order for it to find the correct .lircrc file.  From the above, it
>> looks like you are doing that, but I can not be completely sure.
>>
>> In the files included from .lircrc, the convention is that each of
>> those files will have the settings for the program that matches the
>> file's name.  So all the settings for mplayer will be in the mplayer
>> file and all the settings for mythtv will be in the mythtv file.
>> However, the way LIRC works is that what matters is what is in each
>> individual setting, so if you get something in a different file that
>> has the settings for mythtv, it will work.  And it could override a
>> valid earlier setting that you have made with a later invalid one.  So
>> you need to watch out for that.  If you are not using any programs
>> other than mythtv with LIRC, and you want to absolutely rule out any
>> problems like that, you can just comment out all the other includes in
>> the .lircrc file by putting a # character at the start of the line.
>>
>> So all the LIRC settings for program "mythtv" should be in
>> ~/.lirc/mythtv.  Settings for program "mythtv" are identified by a
>> "prog = mythtv" line.  Here is my Escape / Back button:
>>
>> begin
>>      remote = devinput
>>      prog = mythtv
>>      button = KEY_BACK
>>      config = Escape
>>      repeat = 0
>>      delay = 0
>> end
>>
>> What that says is when LIRC receives an input from the "devinput"
>> driver, and is attached to program "mythtv", it should translate any
>> "KEY_BACK" signals it receives into the keystroke "Escape" and send
>> that to program "mythtv".  MythTV has settings in mythfrontend that
>> tell it what to do with the keystroke "Escape" when received from
>> LIRC:
>>
>> MariaDB [mythconverg]> select * from keybindings where keylist like
>> '%Esc%';
>> +-------------+------------+----------------------------+---------+----------+
>> | context     | action     | description                | keylist | hostname |
>> +-------------+------------+----------------------------+---------+----------+
>> | Global      | ESCAPE     | Escape                     | Esc     | mypvr    |
>> | Main Menu   | EXITPROMPT | Display System Exit Prompt | Esc     | mypvr    |
>> | Global      | ESCAPE     | Escape                     | Esc     | savaidh  |
>> | Main Menu   | EXITPROMPT | Display System Exit Prompt | Esc     | savaidh  |
>> | TV Playback | BACK       | Exit or return to DVD menu | Esc     | savaidh  |
>> | Global      | ESCAPE     | Escape                     | Esc     | gt70     |
>> | Main Menu   | EXITPROMPT | Display System Exit Prompt | Esc     | gt70     |
>> | TV Playback | BACK       | Exit or return to DVD menu | Esc     | gt70     |
>> +-------------+------------+----------------------------+---------+----------+
>> 8 rows in set (0.00 sec)
>>
>> If you are looking for keys in the database, as well as the
>> "keybindings" table for ordinary key bindings that work only from the
>> specified context, you need to search the "jumppoints" table for the
>> global jump points that work from anywhere (any context) in
>> mythfrontend.  And note that the "keylist" field is a comma separated
>> list of keys, not just a single key.
>>
>> The action in MythTV depends on the context, and the hostname.  Each
>> frontend in the database is identified by its hostname, and the
>> settings can be different for each frontend.  And you can see that in
>> the MythTV settings, the LIRC keystroke "Escape" is spelled "Esc",
>> just to confuse things further.  In mythfrontend GUI, you can find
>> those settings at Setup > Edit Keys.
>>
>> So in your case, to get the Escape / Back remote button to work, you
>> would want this in your ~/.lirc/mythtv file:
>>
>> begin
>>      remote = mceusb
>>      prog = mythtv
>>      button = KEY_BACK
>>      config = Escape
>>      repeat = 0
>>      delay = 0
>> end
>>
>> Note the change in the "remote =" line to "remote = mceusb", as that
>> is the driver name that irw is showing for your setup.  So take a look
>> at your ~/.lirc/mythtv file.  It likely has more than one set of
>> settings in it for "prog = mythtv", each set of setting having a
>> different "remote =" value.  What you need is a full set of those
>> settings, with "remote = mceusb".  Here is what I had in my original
>> ~/.lirc/mythtv file:
>>
>> stephen at mypvr:~/.lirc$ grep "remote =" mythtv.original | uniq
>>      remote = mceusb_hauppauge
>>      remote = vista_mce
>>      remote = mceusb
>>
>> So it is not unlikely that you have a set of "remote = mceusb"
>> settings in your ~/.lirc/mythtv file.  I have long since renamed my
>> original ~/.lirc/mythtv file to ~/.lirc/mythtv.original, and edited a
>> copy of it to suit my system, so I now only have "remote = devinput"
>> settings in it.  I would recommend that you do the same, but only have
>> "remote = mceusb" in your ~/.lirc/mythtv file.  Then you need to go
>> through all the keys on your remote, checking what is output by "ircat
>> mythtv" against that file, and then changing either the Mythfrontend
>> setting for the key to match the file, or the file setting in the
>> "config =" line to match Mythfrontend.  I recommend keeping the
>> Mythfrontend settings and changing the "config =" settings, as the
>> Mtyhfrontend settings are also what you use from a real keyboard, and
>> the defaults work well from a keyboard.  If you have a remote key that
>> does not produce output in ircat, you will need to create a new
>> begin/end block with the appropriate settings for it, with a "button
>> =" value that matches its irw output.  Each time you change something
>> in ~/.lirc/mythtv, you will need to restart ircat at least, so it will
>> read the new settings.  I am not sure if you also need to restart
>> lircd:
>>
>> sudo systemctl restart lircd
>>
>> I think that is unnecessary, but check to see if you need to.
>>
>> Once you have a set of "remote = mcuusb" settings that work, you can
>> consider the "repeat =" and "delay =" settings for them.  Those
>> control whether a key autorepeats, and how quickly it repeats,
>> respectively.  I have my arrow keys, the channel and volume keys, and
>> PgUp and PgDown set to "repeat = 1" and "delay = 1".  All other keys
>> do not autorepeat.  The "delay = 1" gives the fastest possible
>> autorepeat rate.  But those are just my personal preferences.

>Still working on it, but getting close.  It looks like mythtv frontend 
>is using /home/don/.lirc/mythtv, but ircat is using something else.  
>Nothing was changing when testing with ircat, so I picked an obscure 
>button to experiment with.
>
>With this configuration, ircat displayed a "Z" and mythtv frontend had 
>no response to pressing the DVD button.
>begin
>     remote = mceusb
>     prog = mythtv
>     button = KEY_DVD
>     config = Z
>     repeat = 3
>     delay = 0
>end
>
>I changed it to this:
>begin
>     remote = mceusb
>     prog = mythtv
>     button = KEY_DVD
>     config = PgDown
>#    config = Z
>     repeat = 3
>     delay = 0
>end
>
>...ircat still showed a "Z" and mythtv frontend did a page down. Hmmm, 
>another mystery.
>
>
>don at johnny:~$ ircat -c ~don/.mythtv/lircrc  mythtv
>Z
>Z
>^C
>don at johnny:~$
>
>Note: ~don/.mythtv/lircrc  >  ~don/.lirc

I have no idea why ircat would not see the change.  But since it is
mythfrontend you need working, and it is, that should not be too much
of a problem.  You might like to try:

ircat -c /home/don/.lircrc mythtv

to make 100% sure that it is loading the correct config.  I can not
see any reason for there being a problem with the link, but bypassing
it makes sure.  In fact I think it is mythfrontend that needs the
link, and ircat will be loading its settings from ~/.lircrc anyway.
You could also make sure you are in the /home/don directory and then
try:

ircat mythtv

in case it loads .lircrc from the current directory.


More information about the mythtv-users mailing list