[mythtv-users] Using IR Remotes without LIRC

Stephen Worthington stephen_agent at jsw.gen.nz
Fri Sep 26 17:21:22 UTC 2014


On Thu, 25 Sep 2014 18:55:04 -0600, you wrote:

>I just set up my FE with a USB MCE RC6 remote. I had a hard time
>figuring out how to get LIRC to work, as there are 1,001 Myth/LIRC
>tutorials out there on the 'net, most of which are out of date and the
>rest which disagree with each other. So after struggling for a while,
>I decided to just give up and use the kernel's built-in IR remote
>support, which works great. This website has pretty good
>documentation: http://atterer.org/mythtv-xmbc-remote-control-without-lirc
>
>However, I have one important observation. That is that after running
>ir-keytable -w, you MUST restart X for any newly added keys to be
>recognized by X! (Modified keys will be recognized as their new
>assignments without a restart.) This cost me a long evening of
>frustration until I figured it out.
>
>I used this as a reference to map MCE remote codes to valid keyboard
>codes the kernel/X/Myth would recognize:
>http://www.cs.fsu.edu/~baker/devices/lxr/http/source/linux/include/linux/input.h?v=2.6.11.8.
>Remember that if you want to use remote buttons with default codes
>>255 (>0xFF hex), remap them to something <255 from input.h. And
>restart X!
>
>I have reproduced my keymap here in case it helps other MCE RC6 remote
>users. Most keys are the default Myth keybindings, there are only a
>handful of custom keys I needed to add into Myth's keybindings in the
>FE setup (I bound Prev/Next as TimestretchDEC/INC and the Asterisk as
>ToggleAspect after removing it from ArbSeek). The original default
>assignments are listed in comments.
>
>scancode 0x800f0400 = KEY_0 (0x200) # NUMERIC_0
>scancode 0x800f0401 = KEY_1 (0x201) # (etc...)
>scancode 0x800f0402 = KEY_2 (0x202)
>scancode 0x800f0403 = KEY_3 (0x203)
>scancode 0x800f0404 = KEY_4 (0x204)
>scancode 0x800f0405 = KEY_5 (0x205)
>scancode 0x800f0406 = KEY_6 (0x206)
>scancode 0x800f0407 = KEY_7 (0x207)
>scancode 0x800f0408 = KEY_8 (0x208)
>scancode 0x800f0409 = KEY_9 (0x209)
>scancode 0x800f040a = KEY_DELETE (0x6f)
>scancode 0x800f040b = KEY_RESERVED (0x1c) # ENTER
>scancode 0x800f040c = KEY_SLEEP (0x8e)
>scancode 0x800f040d = KEY_M (0xe2) # MEDIA
>scancode 0x800f040e = KEY_MUTE (0x71)
>scancode 0x800f040f = KEY_I (0x166) # INFO
>scancode 0x800f0410 = KEY_VOLUMEUP (0x73)
>scancode 0x800f0411 = KEY_VOLUMEDOWN (0x72)
>scancode 0x800f0412 = KEY_PAGEUP (0x192) # CHANNELUP
>scancode 0x800f0413 = KEY_PAGEDOWN (0x193) # CHANNELDOWN
>scancode 0x800f0414 = KEY_DOT (0xd0) # FASTFORWARD
>scancode 0x800f0415 = KEY_COMMA (0xa8) # REWIND
>scancode 0x800f0416 = KEY_P (0xcf) # PLAY
>scancode 0x800f0417 = KEY_RECORD (0xa7)
>scancode 0x800f0418 = KEY_P (0x77) # PAUSE
>scancode 0x800f0419 = KEY_STOP (0x80)
>scancode 0x800f041a = KEY_F13 (0x197) # NEXT
>scancode 0x800f041b = KEY_F14 (0x19c) # PREVIOUS
>scancode 0x800f041c = KEY_W (0x20b) # NUMERIC_POUND
>scancode 0x800f041d = KEY_KPASTERISK (0x20a) # NUMERIC_STAR
>scancode 0x800f041e = KEY_UP (0x67)
>scancode 0x800f041f = KEY_DOWN (0x6c)
>scancode 0x800f0420 = KEY_LEFT (0x69)
>scancode 0x800f0421 = KEY_RIGHT (0x6a)
>scancode 0x800f0422 = KEY_ENTER (0x160) # OK
>scancode 0x800f0423 = KEY_ESC (0xae) # EXIT
>scancode 0x800f0424 = KEY_DVD (0x185)
>scancode 0x800f0425 = KEY_TUNER (0x182)
>scancode 0x800f0426 = KEY_EPG (0x16d)
>scancode 0x800f0427 = KEY_ZOOM (0x174)
>scancode 0x800f0432 = KEY_MODE (0x175)
>scancode 0x800f0433 = KEY_PRESENTATION (0x1a9)
>scancode 0x800f0434 = KEY_EJECTCD (0xa1)
>scancode 0x800f043a = KEY_BRIGHTNESSUP (0xe1)
>scancode 0x800f0446 = KEY_TV (0x179)
>scancode 0x800f0447 = KEY_AUDIO (0x188)
>scancode 0x800f0448 = KEY_PVR (0x16e)
>scancode 0x800f0449 = KEY_CAMERA (0xd4)
>scancode 0x800f044a = KEY_VIDEO (0x189)
>scancode 0x800f044c = KEY_LANGUAGE (0x170)
>scancode 0x800f044d = KEY_TITLE (0x171)
>scancode 0x800f044e = KEY_PRINT (0xd2)
>scancode 0x800f0450 = KEY_RADIO (0x181)
>scancode 0x800f045a = KEY_SUBTITLE (0x172)
>scancode 0x800f045b = KEY_RED (0x18e)
>scancode 0x800f045c = KEY_GREEN (0x18f)
>scancode 0x800f045d = KEY_YELLOW (0x190)
>scancode 0x800f045e = KEY_BLUE (0x191)
>scancode 0x800f0465 = KEY_POWER2 (0x164)
>scancode 0x800f046e = KEY_PLAYPAUSE (0xa4)
>scancode 0x800f046f = KEY_PLAYER (0x183)
>scancode 0x800f0480 = KEY_BRIGHTNESSDOWN (0xe0)
>scancode 0x800f0481 = KEY_PLAYPAUSE (0xa4)

I considered not using lirc also, when I had the same problems on
upgrading to Mythbuntu 12.04 LTS.  But I found the advantages of
retaining it were sufficient for me to persevere and get it going
again.  The two things that I needed it for are the ability to control
whether and how fast keys autorepeat, and the ability to assign
different keystrokes to buttons for different programs.  The latter
was the deal breaker, as I have a number of videos that will only play
properly in mplayer so I needed to have the remote working properly
with both mythfrontend and mplayer.  Since they use very different
keystrokes for various commands, there was no way I could make that
happen without lirc.

I also need to run lirc for my IR transmitter.

Just a few days ago, an update (probably a new kernel) once again
broke lirc for my MCE remote, which I was still running using the old
lirc drivers.  My Hauppauge TD-500 and HVR-900r2 remotes, using the
kernel devinput driver since 12.04, were unaffected.  There was no
devinput support for my MCE remote when I upgraded to 12.04, so it was
not changed to devinput back then.  I have just finished creating a
proper keytable for my MCE remote that matches the one I use for the
Hauppauge remotes.  That way, I was able to reuse all the lirc setup I
have for them without many changes - I just added a few new keys for
new buttons supported on the MCE remote that are not on the Hauppauge
remote.

I am not entirely sure I have everything right yet, but I have put the
results on my web server if anyone wants to try using it:

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

There is a README file telling how to set things up and personalise
your configuration.  Please let me know if there are any problems or
suggestions.  It contains both my Hauppauge and MCE configurations.


More information about the mythtv-users mailing list