[mythtv-users] IR control via evdev

Stephen Worthington stephen_agent at jsw.gen.nz
Thu Aug 9 15:23:42 UTC 2018


On Thu, 9 Aug 2018 11:07:23 -0400, you wrote:

>On 8/8/2018 1:47 PM, Stephen Worthington wrote:
>> On Wed, 8 Aug 2018 11:19:39 -0400, you wrote:
>>
>>> I'm building a new box with Ubuntu 18.04 and trying to get the remote
>>> working, but ran into a snag.  I'm following the instructions here:
>>>
>>> https://www.mythtv.org/wiki/User_Manual:IR_control_via_evdev
>>>
>>> This worked:
>>>
>>> don at andy:~$ sudo ir-keytable -t
>>> Testing events. Please, press CTRL-C to abort.
>>> 182.735877: event type EV_MSC(0x04): scancode = 0x800f0401
>>> 182.735877: event type EV_KEY(0x01) key_down: KEY_NUMERIC_1(0x0201)
>>> 182.735877: event type EV_SYN(0x00).
>>> 182.869726: event type EV_MSC(0x04): scancode = 0x800f0401
>>> 182.869726: event type EV_SYN(0x00).
>>> 183.132071: event type EV_KEY(0x01) key_up: KEY_NUMERIC_1(0x0201)
>>> 183.132071: event type EV_SYN(0x00).
>>>
>>> , but this did not:
>>>
>>> don at andy:~$ sudo ir-keytable -t -d /dev/event/input3
>>> /dev/event/input3: No such file or directory
>>>
>>> don at andy:~$ sudo ir-keytable -t -d /dev/event/input4
>>> /dev/event/input4: No such file or directory
>>>
>>> My box has /dev/input/event*, but does not have /dev/event.  Trying the
>>> next command:
>>>
>>> don at andy:~$ sudo ir-keytable
>>> Found /sys/class/rc/rc0/ (/dev/input/event10) 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-6
>>>          bus: 3, vendor/product: 0471:0815, version: 0x0000
>>>          Repeat delay = 500 ms, repeat period = 125 ms
>>>
>>> I have /dev/input/event10, so tried:
>>>
>>> don at andy:~$ sudo ir-keytable -t -d /dev/input/event10
>>> Can't open lirc device: No such file or directory
>>>
>>> , so purged lirc, and tried it again; got the same results:
>>>
>>> don at andy:~$ sudo apt-get remove *lirc* --purge
>>> don at andy:~$ sudo ir-keytable -t -d /dev/input/event10
>>> Can't open lirc device: No such file or directory
>>>
>>>
>>> Any suggestions?
>>>
>>> Don
>> I do not see any problem there.  You have ir-keytable working seeing
>> an MCE remote on rc0 (/sys/class/rc/rc0/), and the setup shown seems
>> fine.  Just use that, and use "-s rc0" if you really need to select
>> the remote.  But it is defaulting to the correct device without any -s
>> or -d options.  I think you will find that "ls -al /sys/class/rc" will
>> show only one remote.
>>
>> And be aware that lirc in 18.04 is a much later version (0.10.0) than
>> in 16.04 (0.9.0).  It uses different config files and programs
>> (lirc-setup and irdb-get).  So old configuration guides for lirc will
>> likely lead you astray.  See:
>>
>> http://www.lirc.org/html/configuration-guide.html
>
>Hmmm, maybe I don't have a problem, I think I misunderstood the 
>instructions.  I thought I needed to include the device specification 
>when adjusting the timing, and had to use -d, but it accepts -d or -s or 
>default (no specification).  With the -t (testing) switch, default and 
>-s work, but -d gave an unexpected result.
>
>-t (testing) result with default:
>don at andy:~$ sudo ir-keytable -t
>Testing events. Please, press CTRL-C to abort.
>
>-t (testing) result with -s:
>don at andy:~$ sudo ir-keytable -t -s rc0
>Testing events. Please, press CTRL-C to abort.
>
>-t (testing) result with -d:
>don at andy:~$ sudo ir-keytable -t -d /dev/input/event4
>Can't open lirc device: No such file or directory
>
>The wiki page instruction uses the -d switch to adjust timing, so I 
>assumed it wouldn't work.  But, it looks like all three work when 
>setting the timing:
>
>result with default:
>don at andy:~$ sudo ir-keytable -D 500 -P 125
>Repeat delay = 500 ms, repeat period = 125 ms
>Changed Repeat delay to 500 ms and repeat period to 125 ms
>
>result with -s:
>don at andy:~$ sudo ir-keytable -D 500 -P 125 -s rc0
>Repeat delay = 500 ms, repeat period = 125 ms
>Changed Repeat delay to 500 ms and repeat period to 125 ms
>
>result with -d:
>don at andy:~$ sudo ir-keytable -D 500 -P 125 -d /dev/input/event4
>Repeat delay = 500 ms, repeat period = 125 ms
>Changed Repeat delay to 500 ms and repeat period to 125 ms
>
>Note: I attached a different receiver (same model of hardware) and 
>re-ran ir-keytable, which gave me a different event number:
>don at andy:~$ sudo ir-keytable
>Found /sys/class/rc/rc0/ (/dev/input/event4) 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-6
>         bus: 3, vendor/product: 0471:0815, version: 0x0000
>         Repeat delay = 500 ms, repeat period = 125 ms
>
>
>All the remote buttons work in ir-keytable testing, but several don't 
>work in Myth, so I'll work on the keymapping next.  Mine should be 
>similar to '/lib/udev/rc_keymaps/rc6_mce' .  Thanks for the help,
>
>Don

I am not sure why ir-keytable has a problem with using the
/dev/input/event devices, but I have seen that with mine before.  Some
just did not work, like what you are seeing.  So I just used the rc<x>
device names and forgot about that problem.

You might like to download my old setup for 14.04 from my web server:

http://www.jsw.gen.nz/mythtv/mythbuntu-devinput-lirc.bz2

It has my setup for remapping things, and some explanations about how
to go about it.  It is a bit out of date now though - some files have
moved a bit, and the /etc/lirc config files will be rather different
for lirc 0.10.0 in Ubuntu 18.04.  The bits about changing the
ir-keytable mappings and doing lirc and MythTV key mappings should all
be pretty much the same though.  It is a pain having three layers of
mappings to configure and check, but I have not had to touch mine
since I did them for the 14.04 move of the IR drivers into the kernel,
so it was worth the effort.  I will have to adjust the /etc/lirc files
when I upgrade to 18.04, but I am not anticipating any nasty problems
with my MCE remote as it is a pretty common one.


More information about the mythtv-users mailing list