[mythtv-users] Calling all lirc gurus

Doug Scoular (dscoular) dscoular at cisco.com
Sun Dec 23 03:15:41 UTC 2018

Hi All,
	I just upgraded my mythbuntu system from 16.04.5 to 18.04 and it was impressively smooth.

	However, I have two issues with my lirc setup, after reading a lot of misinformation about 
	removing lirc, I discovered that the lirc config files changed format radically and just needed
	some manual rewriting.

	I followed the instructions at lirc.org, as best I could, to update the appropriate files. 

	BTW I'm running version 0.10.0[1207] of lirc (the standard one that came with 18.04).

	I now have a working remote (again) with these two annoyances:

		1) After booting up the first key pressed on the remote repeats endlessly.
		2) The KEY_SLEEP key on the remote is somehow causing the system to sleep.

	Problem 1) is cured, temporarily, by hitting any key on the keyboard and after that the remote works 
	perfectly aside from problem 2).
	Problem 2) In my 16.04.5 setup hitting KEY_SLEEP on my remote called the irexec 
	daemon which was configured to run a script using home-assistant. I don't 
	ever want the system to actually sleep. I want to use the remote's KEY_SLEEP key 
	to talk to irrexec. Any ideas what is causing the KEY_SLEEP to get past irexec?

	Even after reading and googling every recent article as well as the explanations on the wiki;
	I find myself just as confused as when I started.

	I'm pretty sure my mceusb device is being treated as an IR remote rather than an actual keyboard
	but maybe the remote's power key is special. I'm not sure. All I know is everything was perfect
	under 16.04.5.

	Also, when the looping problem occurs, I see spurious X events when I run xev. In this
	example, of me pressing the up arrow key on the remote. The following loops over and 
	over. I don't understand why X is even seeing this the event should go to lirc and, then,
	the application (mythfrontend):

KeyPress event, serial 37, synthetic NO, window 0x4400001,
    root 0x1e1, subw 0x0, time 1321786, (89,64), root:(960,540),
    state 0x0, keycode 111 (keysym 0xff52, Up), same_screen YES,
    XLookupString gives 0 bytes:
    XmbLookupString gives 0 bytes:
    XFilterEvent returns: False

	As soon as I hit a key on my Logitech K400 keyboard, the looping 
	immediately  stops and I see the single space key event from the 

KeyRelease event, serial 38, synthetic NO, window 0x4400001,
    root 0x1e1, subw 0x0, time 1764624, (89,64), root:(960,540),
    state 0x0, keycode 65 (keysym 0x20, space), same_screen YES,
    XLookupString gives 1 bytes: (20) " "
    XFilterEvent returns: False

	Interestingly, from this point onwards xev sees no more remote key presses.

	I had thought that since I've told lirc to use the devinput driver that no
	key events from the remote should reach X. I thought they would be
	the responsibility of lirc. 

$ xinput
⎡ Virtual core pointer                          id=2    [master pointer  (3)]
⎜   ↳ Virtual core XTEST pointer                id=4    [slave  pointer  (2)]
⎜   ↳ Logitech K400                             id=10   [slave  pointer  (2)]
⎜   ↳ lircd-uinput                              id=11   [slave  pointer  (2)]
⎣ Virtual core keyboard                         id=3    [master keyboard (2)]
    ↳ Virtual core XTEST keyboard               id=5    [slave  keyboard (3)]
    ↳ Power Button                              id=6    [slave  keyboard (3)]
    ↳ Power Button                              id=7    [slave  keyboard (3)]
    ↳ C-Media Electronics Inc.       USB PnP Sound Device       id=8    [slave  keyboard (3)]
    ↳ Media Center Ed. eHome Infrared Remote Transceiver (0471:060c)    id=9    [slave  keyboard (3)]
    ↳ Logitech K400                             id=12   [slave  keyboard (3)]
    ↳ lircd-uinput                              id=13   [slave  keyboard (3)]
	I've created a git repository containing my lirc config files just in case anyone
	can help solve 1) the repeating problem and 2) how to disable the remote's
	sending of KEY_SLEEP. I'll try to put as much detail up there as I can. Just ask
	and I can upload more details:


	irw captures the remote key events as expected:

$ irw
0001006700000001 00 KEY_UP devinput-64
0001006c00000001 00 KEY_DOWN devinput-64

	And ir-keytable looks like it is seeing the correct device:

$ ir-keytable
Found /sys/class/rc/rc0/ (/dev/input/event4) with:
        Name: Media Center Ed. eHome Infrared Remote Transceiver (0471:060c)
        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-6
        bus: 3, vendor/product: 0471:060c, version: 0x0101
        Repeat delay = 500 ms, repeat period = 125 ms

	Apologies for the long post...

	Compliments of the Season,

“The big print giveth and the small print taketh away.”

More information about the mythtv-users mailing list