Logitech Harmony Generic Setup

From MythTV Official Wiki
Jump to: navigation, search

This article documents the setup of a Logitech Harmony Universal Remote to control a MythTV frontend. The information is intended to be generic enough to apply to all Harmony remotes, but the work was done using a Logitech Harmony 550. Some information may be specific to the 550 and some examples or details may not apply to other Harmony models.

This article is broken into two major sections. The first is the technical setup information. This provides information for getting a Harmony Remote working with any given MythTV installation using LIRC. Users reading this section are expected to understand certain concepts about their remote, MythTV and LIRC already.

The second section is more broad / general information about Harmony Remotes with LIRC. Some "basic" concepts are presented and some more general information (such as a quick review of the particular Harmony Remote used in this article) about this topic is presented.

Technical setup information

The following information was compiled in late April of 2008 using the hardware and software listed below.

Please do not add "works with" notes, the information in this article is intended to work for all distributions and setups. If there are some pieces for which the information provided does not work please identify below the hardware list what hardware/software does not work and add information in the relevant section of the article below.

Hardware/Software List:

  • OS: Fedora Core 6, Kernel Version: 2.6.22.7-57.fc6, x86_64 Version
  • MythTV: 0.20.2-168.fc6.x86_64
  • LIRC: 0.8.3-72_cvs20071104.fc6.x86_64 with kernel module lirc-kmdl-2.6.22.7-57.fc6-0.8.3-70_cvs20070827.fc6.x86_64
  • IR Receiver; some choices include:
  • Remote: Logitech Harmony 550, also used: OFA-8910 (the old remote I replaced)

Device Setup

The Harmony setup requires entering (not selecting from a list) each device's manufacturer and model number. Complile a list of all your devices before starting setup. Don't worry about a model for the MythTV system, we will identify our starting point for MythTV in a second.

Once your device list has been compiled, install the Harmony setup software on a Windows or Mac computer. Connect the Harmony Remote to one of the computer's USB ports and start the setup process.

To add the MythTV frontend choose PVR as the type, MythTV as the Manufacturer, and KnoppMyth as the model. For more information see The KnoppMyth Profile later in this article. Once this is done the remote should be "linked up" with the lircd.conf and lircrc files provided in later steps.

Note: As of February 2016 this profile appears broken. No keys send anything and in the Harmony set-up software the drop down boxes for each key have no functions.

Learn Additional IR Codes

The second step in setup (again done in the Harmony setup software) is to identify any functions that the MythTV (or other device) profiles DO NOT provide. For my system, I noticed that dot (the decimal between the major channel and minor channel in an HD channel format...e.g. 5.1) was not mapped on either my TV's profile (even though it's on my TV's remote) nor was it an option on the KnoppMyth (nor any other MythTV) profile. Since "." is the only way to get my TV to directly tune to an HD channel I needed to learn this command. Using the remote software and the original remotes go through the steps to learn the new needed IR commands.

Note: This is the step where additional IR codes for MythTV can be added. Lets say, there is an old OFA programmable remote laying around with functions for Swap, PIP, and Move already mapped. Instead of using things like Blue and Green to support these functions the Harmony Remote can learn these codes into NEW commands and then with a modification of the lircd.conf and lircrc files later, use the new functionalty (and don't forget to re-map the old functionality) for these buttons.

The Harmony setup software gives full control over all of the IR commands the remote recognizes. There is an ability to add new commands, delete commands or re-learn old functions from an original remote. Important: when learning new IR commands on the Harmony Remote keep in mind that mixing remote types/signal types (say RC-5 style commands with RC-6 style commands) will not allow LIRC to recognize the keys properly. I have no idea if or how translation works when learning from one remote to another remote, however I do know that when trying to learn "dot" on my Harmony I originally used my TV's remote to train it and after 3 attempts I still didn't have "dot" correctly mapped on my Myth Profile, however I then turned around and used my OFA remote (which had originally learned "dot" from my TV remote) and learned dot into the MythTV profile the first time. The original TV remote is of indeterminate type (it's a Sharp remote) but the OFA is definitely putting out RC-5 commands (the same as the KnoppMyth profile). Something to keep in mind when learning new IR commands.

Tweak the PVR Device Profile

The third step in the process is the last in the Harmony setup software. This step manipulates all the buttons on the remote to get them to produce the expected output with the most descriptive information associated with them.

Maneuver to the edit buttons part of the PVR Device profile for this step.

On the first screen (the list of all the hard buttons on the remote) add/change the setup to get the viable codes produced by each button. By default most of the correct mappings are already provided by the KnoppMyth profile:

Button IR Mapping Code
UpArrow DirectionUp
DownArrow DirectionDown
Mute Mute
Volume Up VolumeUp
Volume Down VolumeDown
Channel Down ChannelDown
Channel Up ChannelUp
Prev ChannelPrev
Up DirectionUp
Down DirectionDown
Left DirectionLeft
Right DirectionRight
Ok Select
Button IR Mapping Code
Menu Menu
Exit Exit
Guide Guide
Info Info
Stop Stop
Skip Back Replay
Skip Forward Advance
Play Play
Record Record
Rewind Rewind
Fast Forward FastForward
Pause Pause
1 1
Button IR Mapping Code
2 2
3 3
4 4
5 5
6 6
7 7
8 8
9 9
0 0
*
#
ButtonA
ButtonB
  • Note: UpArrow and DirectionUp are the same.
  • Note: DownArrow and DirectionDown are the same.
  • Note: *, #, ButtonA and ButtonB are blank (they send no codes).

Next head to the "soft" button configuration area (tab to the right) to configure the soft button pages. Each page consists of four soft buttons. The box to the left is the name of the soft button that will appear on the LCD Screen on the remote and the drop down box to the right denotes the code that that soft button will send. Only those codes not already assigned to hard buttons will appear in this list.

I have the pages setup as follows (grouped by function):

Page 1

NameIR Code
Main Menu(PowerToggle)
Recorded(InputPictures)
Video(InputVideos)
Music(InputMusic)

Page 2

NameIR Code
TV(InputTV)
Weather(InputRadio)

Page 3

NameIR Code
LdCutList(NumberInput)
HOME(Red)
END(Yellow)

Page 4

NameIR Code
ChngInput(Go)
PiP(Blue)
Swap(Green)

Pages 1 and 2 are "Jump Point" pages, these help get around MythTV quickly. The jump points I have setup are Main Menu, Recorded Shows, MythVideo, MythMusic, LiveTV and MythWeather which are in order of how I tend to use my Myth System. Feel free to make changes to the menu as needed, the important thing is to map the proper IR code to the proper menu option. The 6 items on Pages 1 and 2 can be mapped in any way since at a later step we will assign the F3 - F8 keys to the various jump points. Keep in mind that in the lircrc file PowerToggle = F3, InputPictures = F4, InputVideos = F5, etc.

Page 3 is mostly dedicated to editing. LdCutList loads up the current cut list (it's the "Z" key in myth) while home and end allow jumping between commercial markers (Previous/Next). The home and end keys have other functions and uses in the Myth system but these are the main uses.

Page 4 is dedicated to those commands dealing with Multiple Tuners and Picture-in-Picture TVs. The "Go" IR Command will change the tuner card input (swap between tuner cards) while the "Blue" and "Green" IR commands will load up PiP functionality and swap between the windows.

Also, don't forget on these two screens to add any new functionality (say the "dot" button) that has been added to the remote by mapping the new feature to a button on the Harmony Remote (whether hard button or create a soft button for it). When all new and existing functionality has been mapped to either hard or soft buttons, the last configuration item in this step is to manipulate the wait time between various events if needed/wished. Go to the "Modify Device Timings" area to do so.

LIRC Setup

To setup LIRC to recognize the IR Sequence of the remote buttons (both soft and hard buttons), copy the following into /etc/lircd.conf.

# Please make this file available to others
# by sending it to <lirc@bartelmus.de>
#
# this config file was automatically generated
# using lirc-0.8.3-CVS(default) on Mon Apr 21 22:25:08 2008
#
# contributed by Douglas Wagner
#
# brand:   Logitech Harmony (KnoppMyth Profile)
# model no. of remote control: 550
# devices being controlled by this remote: MythTV
#

begin remote

  name  Harmony550KnoppMyth
  bits           13
  flags RC5|CONST_LENGTH
  eps            30
  aeps          100

  one           895   885
  zero          895   885
  plead         910
  gap          116038
  min_repeat      2
  toggle_bit_mask 0x800

      begin codes
          Blue                     0x17A9
          Green                    0x17AE
          Red                      0x178B
          Yellow                   0x17B8
          Go                       0x17BB
          OK                       0x17A5
          NumberInput              0x178E
          JumpMusic                0x1799
          JumpPictures             0x179A
          JumpRadio                0x178C
          JumpTV                   0x179C
          JumpVideos               0x1798
          PwrToggle                0x17BD
          Stop                     0x17B6
          Replay                   0x17A4
          Skip                     0x179E
          Play                     0x17B5
          Rec                      0x17B7
          Rew                      0x17B2
          Fwd                      0x17B4
          Pause                    0x17B0
          Guide                    0x179B
          Info                     0x178A
          Exit                     0x179F
          Menu                     0x178D
          VolumeUp                 0x1790
          VolumeDown               0x1791
          ChannelUp                0x17A0
          ChannelDown              0x17A1
          ChannelPrev              0x1792
          DirectionUp              0x1794
#         UpArrow                  0x1794 Same as DirectionUp
          DirectionDown            0x1795
#         DownArrow                0x1795 Same as DirectionDown
          DirectionLeft            0x1796
          DirectionRight           0x1797
          Mute                     0x178F
          1                        0x1781
          2                        0x1782
          3                        0x1783
          4                        0x1784
          5                        0x1785
          6                        0x1786
          7                        0x1787
          8                        0x1788
          9                        0x1789
          0                        0x1780
      end codes

end remote

Next reboot lircd as appropriate to the distribution of Linux used. For Fedora this would be going into /etc/init.d and running ./lircd restart.

Note: If additional commands have been added to the remote through learning other IR Functions, these new commands will need to be added to the lircd.conf file to get them recognized. If the default KnoppMyth profile with no additions is being used, skip forward to Testing with IRW.

Adding to the lircd.conf file

To "train" LIRC with the new commands on the remote, we use the irrecord application on a new copy of the lircd.conf file to learn the new commands and then merge the important lines back into the /etc copy and finally reboot LIRC again. Make sure that LIRCD is running before continuing this process.

Run the following in an empty directory so as not to overwrite any important files:

cp /etc/lircd.conf ./lircd.conf
irrecord -d /dev/lirc lircd.conf

This SHOULD attempt to load the current lircd.conf file created above and add to it the new IR signal sequences. The application will prompt for a control name (make sure not to use an existing name already in the lircd.conf file) and then prompt to hit the button on the remote so it can recognize the signal. End the process by hitting enter (a blank) on a control name and it will write the file out.

It is very important to start with the current lircd.conf file. Not all remotes speak the same protocol, if the commands learned into the harmony are not of the same protocol as the rest of the commands loaded by the KnoppMyth configuration then LIRC will fail to recognize them. If, during irrecord, the message "Something went wrong" pops up, this generally means that the IR sequence cannot be understood under the current protocol. The reason to start with the existing lircd.conf file is to ensure that no mix of protocols gets merged into one remote set, which would cause problems down the road. Instead by starting with the existing file LIRC will automatically use an RC-5|CONST_LENGTH protocol to detect the new commands. If the new commands are not of that type they will fail to be recorded.

ADVANCED

If commands cannot be recorded: There are two options.

  1. Record the commands into another learning remote under the RC5|CONST_LENGTH protocol. This can be done by obtaining a learning remote, like the OFA-8910, programming it as in the Article Here for a 0081 Profile VCR, and learning the command into it. I've had success with this personally as my Sharp TV remote would not allow me to learn the "dot" button into my Harmony directly but when I learned "dot" from my OFA-8910 (that I had learned from my Sharp Remote) it had no problems recognizing the signal. Do this "double training" for each of the new functions to learn on the Harmony Remote.
  2. Setup a New Remote for the additional functions. One LIRC file can contain information for multiple remotes, simply append the remote descriptor (from "begin remote" to "end remote" onto the end of an existing lircd.conf file. To create a new remote configuration file use the irrecord command above but do not use lircd.conf as the second parameter, use something like "testfile". This will take the user through the FULL LIRC learning process, including pressing a bunch of buttons for LIRC to understand the protocol.

When performing protocol learning (the first step in irrecord), it is extremely important to only press those functions that are signaled from the new remote, and to NOT press any functions from the RC5 protocol. For instance, lets take a profile where all of the buttons came from the KnoppMyth base profile, but the *, #, ButtonA and ButtonB buttons have been re-programmed with functions from a non-RC5 remote. When irrecord is run, it will first prompt the user to press and hold multiple buttons so that it can determine the signal protocol of the remote. When doing this DO NOT press any of the pre-mapped RC5 buttons (like Stop or Play), this will screw up the profile. Press ONLY the newly mapped buttons (*, #, ButtonA, and ButtonB in the example above). Better yet would be to use the original remote that the learned commands came from (not the harmony, the original) to setup the first part of the LIRC file. Once LIRC starts prompting for button names and signals THEN switch back to the harmony remote. It is recommended in this case (where the original remote is used to train LIRC about the remote protocol) that the original remote is NOT USED to train the specific button signals, ONLY the protocol. This is because minor mistakes in the learning process (i.e. the harmony didn't catch every pulse or break) may be overcome if the specific functions are trained into LIRC from the learned remote whereas if the training comes from the original remote those "mistakes" may cause the Harmony Remote function not to be correctly recognized.

Once the entire LIRC learning process has been completed, copy the contents of "testfile" (from "begin remote" to "end remote") onto the end of the existing working lircd.conf file. Once a final lircd.conf file exists in the working directory, copy that lircd.conf back over the top of /etc/lircd.conf. This should give a full working LIRC profile with all of the buttons on the Harmony Remote recognized.

Testing with IRW

After putting the lircd.conf file in place in /etc, LIRC should now properly recognize the harmony remote. The next step is to use the irw program to test the remote. The task here is to verify that all buttons on ALL remotes work as would be expected.

Make sure lircd has been restarted after placing the completed lircd.conf file into /etc and run "irw" from the command line.

The console should simply sit there doing nothing at this point waiting for input. Set the remote to device mode and direct it to the MythTV device (whatever it's been called in the setup, probably "PVR") by hitting the "devices" button (usually a hard button) and then selecting the soft button corresponding to the PVR device.

At this point, one at a time, press all of the buttons on the harmony remote. Each button press should register a couple (2 - 5 or so) lines on the console screen with the button name and the remote device name (If using my lircd.conf file above, lines like "Play Harmony550KnoppMyth") should print on the screen. Go through every button on the remote and ensure that all of the buttons are mapped to valid codes through LIRC, take note of any buttons that when pressed produce no output. Don't forget the soft buttons on the remote also, each of those send valid codes as well.

If each hard and soft button on the PVR profile produces a proper name printed for the button pressed, then LIRC will properly recognize the remote and this step is complete. If any of the buttons on the Harmony Remote do not produce a valid name printed then there is more tuning that needs to be done.

If a button, when pressed, produces no output on the Console screen the following are things to check:

  • Does the button have a code mapping assigned to it through the Harmony setup software? Some buttons (*, #, ButtonA, ButtonB, UpArrow, DownArrow, etc.) do not have mappings set to them automatically. Go back through the harmony setup of the PVR device (button commands section) and ensure that all hard buttons and soft buttons are setup as identified above. Regardless of whether any changes are made or not save the profile and update the Harmony Remote in case that was missed or failed in steps 1 - 3 above and try the button with IRW again.
  • If the buttons still do not register follow the steps above for setting up a new command in the lircd.conf file and when prompted to add commands add each of the failed buttons back in. Give them names like "Play2", "Stop2", etc. so that the missing/bad codes are obvious. With the new commands in the lircd.conf file and the new lircd.conf back in /etc (don't forget to restart lircd) re-run IRW and ensure that ALL buttons again are properly displaying. Don't just check the new buttons check them all again to ensure the edits didn't destroy something else. Please make note of the buttons / codes that failed and edit some notes here about that. When all of the buttons work, delete the old non-working commands from the lircd.conf file and re-name the "2" commands back to their originals or the next step will fail.

If a button, when pressed, produces an event that it should not produce, check the following:

  • Ensure that the correct IR Code is assigned to the button in question in the Harmony setup software. Check the rest of the article here for information on what commands are provided by the KnoppMyth profile and ensure that the correct code is assigned to each button (listed in a step above) on the harmony remote. It is very important that each button on the remote be mapped as explained above or odd results will occur. Check the extended information in Section 2 of this article for information about how LIRC, MythTV, and the Harmony Remote/Setup Software work together to produce a valid code in MythTV.
  • If all IR codes are mapped properly in the Harmony setup software, edit the setup in whatever way needed to make the buttons come out correct. Directly editing the /etc/lircd.conf file to change the names associated with each IR Signal is okay to do but should not be needed if the steps above are followed.

One quick note about editing the lircd.conf file: The button names as specified above in the boxed out area above are required as is. Move those button names around to the IR codes as needed but the names must stay the same or there will be a need to edit the lircrc file in the next step.

Also note that LIRC uses the first entry in the lircd.conf file that matches the incoming signal. For buttons like "UpArrow" and "DownArrow" which send the same IR Sequence as "DirectionUp" and "DirectionDown" there is really no use having them enabled in the lircd.conf file. If "UpArrow" were before "DirectionUp" in the list then every "Up Arrow" or "Direction Up" press would generate an "UpArrow" event, causing issues in the lircrc file. Note also that this is the same between remotes. If there is more than one remote sending IR signals to the LIRC system then each button must produce a different IR sequence, otherwise at best the "remote" identifier may not be correct, and at worst the buttons and functionality may be completely wrong. For example if the following entries are in the lircd.conf file:

begin remote

     name = Remote1
     play                            0x12345
...
end remote

begin remote

     name = Remote2
     pause                           0x12345
...
end remote

When the user presses the pause button on Remote2, LIRC will generate a Remote1/Play event, thus causing the pause button on remote two to actually play the recording! Check the lircd.conf file closely for duplicate entries to ensure that this configuration issue doesn't occur.

Again, once any new lircd.conf file is in place and lircd has been restarted, re-check the entire button setup with IRW.

Setup MythTV / Xine / MPlayer to recognize LIRC / remote commands

Once all of the harmony buttons are working with LIRC, there is one step left to get MythTV to work: setting up an lircrc file.

NOTE: If not all of the buttons on the Harmony Remote work with LIRC at this point, part of the functionality of the remote will not be available within Myth / other applications. LIRC MUST work first before this step will have any meaning.

Copy the following information into the "MythTV" user's home area (If following Jarod Wilson's guide this would be /home/mythtv) into the following:

/home/mythtv/.mythtv/lircrc 

Make sure the file is named lircrc and not .lircrc and that it resides in the .mythtv subdirectory of the myth user's home.

# ~/.mythtv/lircrc
# 
# MythTV native LIRC config file for
# a Logitech Harmony Remote with a 
# profile based off of MythTV/Knoppmyth.
#
# The original profile is based on a
# Hauppuage PVR-250 Remote.
# 
# By Douglas Wagner, 2008/04/21
# Most of the below comes from 
# Jarod Wilson's excellent guide
# to setting up MythTV on Fedora.
#

#@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
#@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
#			Myth TV Mappings
#@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
#@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

#########################################
#	Channel Buttons
#########################################

# Channel Up
begin
prog = mythtv
button = ChannelUp
repeat = 4
config = Up
end

# Channel Down
begin
prog = mythtv
button = ChannelDown
repeat = 4
config = Down
end

# Cycle through channel history
begin
prog = mythtv
button = ChannelPrev
repeat = 4
config = H
end

#########################################
#	Volume Control Buttons
#########################################

# Increase Volume
begin
prog = mythtv
button = VolumeUp
repeat = 4
config = F11
end

# Decrease Volume
begin
prog = mythtv
button = VolumeDown
repeat = 4
config = F10
end

# Mute
begin
prog = mythtv
button = Mute
repeat = 4
config = F9
end

#########################################
#	Navigation Buttons
#########################################

# Direction Up
begin
prog = mythtv
button = DirectionUp
repeat = 4
config = Up 
end

# Direction Down
begin
prog = mythtv
button = DirectionDown
repeat = 4
config = Down
end

# Direction Left
begin
prog = mythtv
button = DirectionLeft
repeat = 4
config = Left
end

# Direction Right
begin
prog = mythtv
button = DirectionRight
repeat = 4
config = Right
end

# OK/Select
begin
prog = mythtv
button = OK
repeat = 4
config = Enter
end

# Escape/Exit/Back
begin
prog = mythtv
button = Exit
repeat = 4
config = Esc
end

#########################################
#	Video Management Buttons
#########################################

# Play
begin
prog = mythtv
button = Play
repeat = 4
config = Space
end

# Stop
begin
prog = mythtv
button = Stop
repeat = 4
config = Esc
end

# Pause
begin
prog = mythtv
button = Pause
repeat = 4
config = P
end

# Rewind (10 sec default)
begin
prog = mythtv
button = Rew
repeat = 4
config = Left
end

# Fast forward (30 sec default)
begin
prog = mythtv
button = Fwd
repeat = 4
config = Right
end

# Skip forward (10 min default)
begin
prog = mythtv
button = Skip
repeat = 4
config = PgDown
end

# Skip backward (10 min default)
begin
prog = mythtv
button = Replay
repeat = 4
config = PgUp
end

# Record
begin
prog = mythtv
button = Rec
repeat = 4
config = R
end

#########################################
#	OSD/Guide Buttons
#########################################

# OSD browse
begin
prog = mythtv
button = Guide
repeat = 4
config = O
end

# Display EPG while in live TV,
# View selected show while in EPG
begin
prog = mythtv
button = Menu
repeat = 4
config = M
end

# Bring up OSD info
begin
prog = mythtv
button = Info
repeat = 4
config = I
end

#########################################
#	Number Buttons
#########################################

begin
prog = mythtv
button = *
repeat = 4
config = _
end

begin
prog = mythtv
button = 0
repeat = 4
config = 0
end

begin
prog = mythtv
button = 1
repeat = 4
config = 1
end

begin
prog = mythtv
button = 2
repeat = 4
config = 2
end

begin
prog = mythtv
button = 3
repeat = 4
config = 3
end

begin
prog = mythtv
button = 4
repeat = 4
config = 4
end

begin
prog = mythtv
button = 5
repeat = 4
config = 5
end

begin
prog = mythtv
button = 6
repeat = 4
config = 6
end

begin
prog = mythtv
button = 7
repeat = 4
config = 7
end

begin
prog = mythtv
button = 8
repeat = 4
config = 8
end

begin
prog = mythtv
button = 9
repeat = 4
config = 9
end

#########################################
#	Commercial Cut Point Buttons
#########################################

# Load Commercial Cut Points
begin
prog = mythtv
button = NumberInput
repeat = 4
config = Z
end

# Seek to Previous Commercial Cut Point
begin
prog = mythtv
button = Red
repeat = 4
config = home
end

# Seek to Next Commercial Cut Point
begin
prog = mythtv
button = Yellow
repeat = 4
config = end
end

#########################################
#	Picture-in-Picture Options
#########################################

# Change TV card input
begin
prog = mythtv
button = Go
repeat = 4
config = C
end

# Toggle Picture-In-Picture
begin
prog = mythtv
button = Blue
repeat = 4
config = V
end

# Swap PIP
begin
prog = mythtv
button = Green
repeat = 4
config = N
end

#########################################
#	MythTV Jump Points
#########################################

# Jump to Main Menu
begin
prog = mythtv
button = PwrToggle
repeat = 4
config = F3
end

# Jump to Recorded Programs
begin
prog = mythtv
button = JumpPictures
repeat = 4
config = F4
end

# Jump to MythVideos
begin
prog = mythtv
button = JumpVideos
repeat = 4
config = F5 
end

# Jump to MythMusic
begin
prog = mythtv
button = JumpMusic
repeat = 4
config = F6
end

# Jump to Live TV
begin
prog = mythtv
button = JumpTV
repeat = 4
config = F7
end

# Jump to MythRadio
begin
prog = mythtv
button = JumpRadio
repeat = 4
config = F8
end

#@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
#@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
#			MPlayer Mappings
#@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
#@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

### MPlayer commands

begin
prog = mplayer
button = Menu
repeat = 4
config = osd
end

begin
prog = mplayer
button = Pause
repeat = 4
config = pause
end

begin
prog = mplayer
button = Play
repeat = 4
config = seek +1
end

begin
prog = mplayer
button = Stop
repeat = 4
config = quit
end

begin
prog = mplayer
button = Mute
repeat = 4
config = mute
end

begin
prog = mplayer
button = Rew
repeat = 4
config = seek -10
end

begin
prog = mplayer
button = DirectionLeft
repeat = 4
config = seek -10
end

begin
prog = mplayer
button = Fwd
repeat = 4
config = seek +30
end

begin
prog = mplayer
button = DirectionRight
repeat = 4
config = seek +30
end

begin
prog = mplayer
button = Exit
repeat = 4
config = quit
end

begin
prog = mplayer
button = Skip
repeat = 4
config = seek +600
end

begin
prog = mplayer
button = Replay
repeat = 4
config = seek -600
end

#begin
#prog = mplayer
#button = +100
#repeat = 4
#config = vo_fullscreen
#end

#@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
#@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
#			Xine Mappings
#@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
#@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@


begin
prog = xine
button = Play
repeat = 3
config = Play
end

begin
prog = xine
button = Pause
repeat = 3
config = Pause
end

begin
prog = xine
button = Stop
repeat = 3
config = Stop
end

begin
prog = xine
button = Exit
repeat = 3
config = Quit
end

# Move 10 seconds back.
begin
prog = xine
button = Rew
repeat = 3
config = SeekRelative-10
end

# Move 30 seconds forward
begin
prog = xine
button = Fwd
repeat = 3
config = SeekRelative+30
end

# Go to Input % of Video
begin
prog = xine
button = Go
repeat = 3
config = SetPosition%
end

# Go to Beginning of Video
begin
prog = xine
button = Red
repeat = 3
config = SetPosition0%
end

# Go to 1/3 of Video
begin
prog = xine
button = Blue
repeat = 3
config = SetPosition33%
end

# Go to 2/3 of Video
begin
prog = xine
button = Green
repeat = 3
config = SetPosition66%
end

# Go to End of Video
begin
prog = xine
button = Yellow
repeat = 3
config = SetPosition95%
end

# Incriment Audio Volume
begin
prog = xine
button = VolumeUp
repeat = 3
config = Volume+
end

# Decrement Audio Volume
begin
prog = xine
button = VolumeDown
repeat = 3
config = Volume-
end

begin
prog = xine
button = Mute
repeat = 3
config = Mute
end

begin
prog = xine
button = Guide
repeat = 3
config = Menu
end

begin
prog = xine
button = Menu
repeat = 3
config = RootMenu
end

begin
prog = xine
button = DirectionUp
repeat = 3
config = EventUp
end

begin
prog = xine
button = DirectionDown
repeat = 3
config = EventDown
end

begin
prog = xine
button = DirectionLeft
repeat = 3
config = EventLeft
end

begin
prog = xine
button = DirectionRight
repeat = 3
config = EventRight
end

begin
prog = xine
button = OK
repeat = 3
config = EventSelect
end

begin
prog = xine
button = Skip
repeat = 3
config = EventNext
end

begin
prog = xine
button = Replay
repeat = 3
config = EventPrior
end

begin
prog = xine
button = Info
repeat = 3
config = OSDStreamInfos
end

begin
prog = xine
button = NumberInput
repeat = 3
config = OSDMenu
end

begin
prog = xine
button = 1
repeat = 3
config = Number1
end

begin
prog = xine
button = 2
repeat = 3
config = Number2
end

begin
prog = xine
button = 3
repeat = 3
config = Number3
end

begin
prog = xine
button = 4
repeat = 3
config = Number4
end

begin
prog = xine
button = 5
repeat = 3
config = Number5
end

begin
prog = xine
button = 6
repeat = 3
config = Number6
end

begin
prog = xine
button = 7
repeat = 3
config = Number7
end

begin
prog = xine
button = 8
repeat = 3
config = Number8
end

begin
prog = xine
button = 9
repeat = 3
config = Number9
end

begin
prog = xine
button = 0
repeat = 3
config = Number0
end

The previous file sets up MythTV, Xine, and MPlayer to be fully useable with the remote. A full list of supported commands can be obtained for MythTV in section 11 of the Myth User Docs. Xine and MPlayer's command list can be obtained through a command line switch to each of the applications:

  • For Xine: xine --keymap=lirc. Piping this out to a file (xine --keymap=lirc > xine_keymap.txt) may be adviseable due to the length of the output.
  • For MPlayer: mplayer -input cmdlist. Again piping this out to a file (mplayer -input cmdlist > mplayer_keymap.txt) may be advisable.

Xine's command produces output in the following format:

# quit the program
begin
        remote = xxxxx
        button = xxxxx
        prog   = xine
        repeat = 0
        config = Quit
end

This is the standard format for all lircrc entries.

  • The "remote" option is optional, but can be useful if there are multiple remotes used, and buttons need to be mapped differently between remotes.
  • The "button" option is required and specifies the string that LIRC will produce when seeing an IR code (from the lircd.conf file). This must match exactly.
  • The "prog" option tells the system that if program "x" has focus for input send "config" to it. Prog can be mythtv, xine, mplayer or others. If xine is the current program with focus then when "button" Play is pressed the LIRC system will parse the lircrc file for the prog=xine line not the prog=mythtv line (for instance, which would produce a different "config")
  • The "repeat" option is optional but probably necessary for most installations. This tells LIRC to ignore x number of repeat signal sends. This keeps one button press from generating multiple events in LIRC.
  • The "config" option is the "key" or "command" sent to the application.

When LIRC receives an IR signal it sends the text from lircd.conf that maps to that IR signal to the LIRC system (e.g. When LIRC receives 0x17B5 it sends "Play"). LIRC then looks through the lircrc file for a corresponding remote/button/prog match. The prog is the program currently in focus, the remote is the remote definition comming from the lircd.conf file and the button is the text LIRC sent.

Example

For a full example using the above configuration files lets assume the following:

  • Xine has been opened in XWindows and is the current application under focus.
  • I have pressed the "Play" button on my harmony remote.

The LIRC system receives the code 0x17B5 and searches the lircd.conf file for that code. It finds it under a remote definition section with a name Harmony550KnoppMyth, and it's value is text value for that code is "Play".

LIRC then sends "Play" and "Harmony550KnoppMyth" upstream. The system then receives "Play" and "Harmony550KnoppMyth" and knows the application under focus is "xine".

The lircrc file is parsed and the following entry is found:

begin
prog = xine
button = Play
repeat = 3
config = Play
end

"prog", "button" and "remote" (if there) is matched and "config" is sent to the application with focus, in this case causing xine to start playing the video. If "remote" is not there the first matching "prog" + "button" entry is assumed.

Setup MythTV jump points, other Myth config items, and final cleanup

As a final short step, Jump Points and other options in mythtv need to be configured for use by the remote.

To begin with, the * button in the lircrc file has been mapped to _ for use in separating the Major channel and Minor channel in a HD Channel definition. If something other than _ is used the user has 2 options:

  1. Edit the lircrc file and change the "config" that * produces to produce another character.
  2. Modify MythTV's setup in mythsetup to use "_" as the separator for Major/Minor channel numbers in an HD channel.

Either of these will work.

Also, the KnoppMyth profile contains codes for 5 jump points around the myth system. Jump Points are configured in the main MythTV application (NOT mythsetup) in Setup/Key Bindings. The top selection in the list is "JumpPoints" with jump points that are listed all around the various points in the system.

By default (in the lircrc file) F3 - F8 are the JumpPoint keyboard shortcuts and should be mapped to the jump points required. If the jump points defined (Main Menu, TV, Videos, Weather, Music, Recorded Shows) aren't the best for the system being setup, map the F3 - F8 keys to any jump points desired. Don't forget to go back into the harmony setup application and change the name of the soft buttons to match the Jump Point names to give them some correlation.

When mapping the jump points, there may be a pop up that occurs saying something about the F keys are already mapped. The mappings I found were unused by the system and were simply defaults (they mapped to something like IVTV/YellowButton, BlueButton, etc. something like that), if these key commands conflict with something used feel free to use a different key combination. Change the lircrc file under the "MythTV Jump Points" section to match the key bound to the jump point with the corresponding jump point command coming from LIRC.

An item of note when mapping keyboard commands to jump points: The OS Default key commands take precedence over the MythTV key command. For instance, Ctrl-F4 in my XWindows/KDE installation maps to "Show Desktop". Any time I tried to bind Ctrl+F4 as a key command in Myth it would immediately jump me out of Myth and show the KDE Desktop. To bind keys like this, first go into the XWindows installation/desktop manager and unbind/rebind any keys to be used in Myth then bind them to MythTV Events/Jump Points.

The KnoppMyth Profile

There were several profiles to choose from when I went to setup my MythTV integration with the Harmony Remote. Many reviews talked about using the WinTV-PVR profiles from Hauppauge, some talked of the MythDora profile, and KnoppMyth is the "example" provided by the software upon setup. There is also a MythBuntu profile and several others out there.

It was my experience when setting this up that most of the profiles were built upon the Hauppauge PVR remote. This is a bit of a "standard" remote in the MythTV community emulating an RC-5 (phillips, etc.) style remote. The main concern with profile selection here is the number of distinct IR codes that the profile provides. The more distinct IR codes provided, the more functions and features the remote can control in MythTV, Xine, MPlayer, etc.

As a quick note on some of the reasons why I chose to start with the KnoppMyth profile. To begin with I had selected a Hauppauge WinTV-PVR350 as my starting point, based upon some articles I found on the net and the mailing list about how others had gotten this remote to work. Unfortunately the basic set of IR codes provided by that profile are VERY limited, barely enough to fill the basic hard buttons on the remote itself. While completely usable, this would provide a very limited experience with MythTV and a user would likely find themselves running for a keyboard regularly when using some of the less basic functionality (for instance editing recordings). While the keyboard has it's place, having a small number of functions mapped on the remote is limiting in many ways. At this point I loaded both the KnoppMyth and and MythDora profiles to my remote to see what codes were available with them and was MUCH more pleased by these profiles. The KnoppMyth profile contains 45 distinct IR codes while the MythDora profile contains a full 58 distinct IR codes. Remember that "soft buttons" on the harmony remotes are somewhat unlimited and as such the more distinct IR codes available the more functionality the remote can provide.

I chose the MythDora profile and went down that path till I got to the point of setting it up in LIRC. Unfortunately try as I might I could not get this remote to be recognized or recorded in any other format but an RC-6 style remote in "Raw" mode. This DID work (the codes were recognized in Myth), however often times one key press of the button would produce multiple results to the point where I felt this setup was a bit "indeterminate" when it came to trying to navigate the Myth Menu system, and would be much worse for trying to manage maneuvering around in a video or recorded program. I'm sure there are ways to make this work better (tweaking the repeat items and such) I felt much more comfortable with my OFA-8910 and it's RC-5 style profile. Of note, the MythDora profile was the only profile in the bunch I found that was NOT based off of a Hauppauge remote (or didn't look like it).

Looking at KnoppMyth (again based off of what looks like the popular "grey" remote for the Hauppauge WinTV-PVR-250) I found it was being identified as an RC-5 remote with distinct timings to eliminate some of the issues with "raw mode" LIRC. Given that it had 40+ distinct codes (over the 350s ~30) I decided to start working with it to see what I might be missing. At the end of the process I can safely say that all major keyboard commands are properly mapped onto the remote. Looking through the list from section 11 of the MythTV documentation, I find only a few commands I would have to go back to the keyboard for and those are not commands I typically use, your mileage may vary.

Note that even with all of these commands the "#", "*", "A" and "B" buttons on the harmony remote are NOT mapped. Depending upon preferences some of the "soft buttons" could be moved to hard buttons in the interface but I personally prefer soft buttons since they are "renameable" for those functions that aren't immediately obvious. While "HOME" could be assigned to the * button on the remote the question is whether that makes sense and is is memorable enough not to have to go back to some documentation in the future to figure it out.

The following table lists the MythTV keyboard commands managed by my Harmony Remote and the associated IR commands provided by the KnoppMyth installation.

Function Code 1 Code 2
UP DirectionUp ChannelUp
DOWN DirectionDown ChannelDown
LEFT DirectionLeft Rew
RIGHT DirectionRight Fwd
RETURN OK
ESC Exit Stop
SPACE Play
PAGE DOWN Skip
PAGE UP Replay
HOME Red
END Yellow
C Go
H ChannelPrev
I Info
M Menu
N Green
O Guide
P Pause
R Rec
V Blue
Z NumberEnter
F9 Mute
F11 VolumeUp
F12 VolumeDown
1 1
2 2
3 3
4 4
5 5
6 6
7 7
8 8
9 9
0 0
F3 PwrToggle
F4 JumpMusic
F5 JumpPictures
F6 JumpRadio
F7 JumpTV
F8 JumpVideos

Basic information and concepts for LIRC, MythTV and Harmony Remotes

Review of Harmony Remotes in general and the Harmony 550 in specific

The Harmony Remote is very much like many other programmable remotes I've had in the past, with the exception that the 550 is about 3 times more expensive than any of these other remotes and in general this line ranges from 3 to 30 times more expensive (depending on the model) than other similar programmable remote controls. In any case, with a remote this expensive, it is imperative to know whether the added functionality is worth the cost.

The biggest change with these remotes is the concept of "activities". Macros in remotes have been around for a long while, most of the programmable (even analog) remotes have some kind of macro feature built in to them, allowing the remote to turn on 3 devices simultaneously at the touch of a button. If, as it did when I was looking at these remotes for the first time, this is the mental picture that comes to mind in regards to "activities", let me assure my readers that this isn't anywhere close to how "activities" on these remotes work. The thing about the harmony remote is it's not just a programmed remote that understands the various controls on the original device remote...this is how the programmable remotes work. The harmony remotes go a step beyond that. It's not just that the harmony remote knows about all the codes on the original remote for the device in question, it also inherently understands that device's capabilities as well.

For instance, I have a Sharp LCD HDTV. The TV has 5 different input channels which I have setup for watching the various components in my entertainment center. Not only does the harmony remote understand that there is a button on the remote that allows the selection of the input channel, it also understands that there are 5 total input channels and that for me to watch my PVR I need to be on Input #4. In the analog remote macro world the macro would probably include 4 pushes of the "change input" command to get it to cycle down to input #4, but this macro would always have to be fired from the selection box being on "Watch TV" otherwise 4 button presses may not put the remote on input 4. Since the harmony remotes understand my TV has 5 inputs and input 4 is where my PVR is, it "knows" internally how to pull up input 4 no matter what I'm doing, even without a specific button on the remote that says "go to input 4".

The remote also understands the state of my entertainment center at any given point based upon the activities I've selected. When I want to Watch TV it turns the TV on for me and sets me to the input channel to watch my TV. When I decide I would rather watch a DVD movie it understands the TV is on but on the wrong input channel so it switches the channel and then turns on the DVD player for me. When I'm done with my movie and decide I'd just like to listen to a bit of music it turns off the DVD and TV and turns on the stereo while keeping my sound system/receiver on the whole time. When I'm done listening to the stereo and want to go out I hit the power button and it understands that the DVD and TV are already off, but the stereo and receiver are still on so it turns off those two components and leaves the rest alone. All in all, when setup correctly, even my 4 year old has no problem navigating an entertainment center with a TV, VCR, DVD Player, PVR, Stereo System and Sound System. The whole shebang is configurable through a desktop application (available for Mac/Windows only I think which may be a huge drawback for some out there) that connects to the Logitech Harmony website to download and customize profiles for each of the devices and then store the whole thing back up on the website (no danger of a hard drive crash destroying the only copy of a remote definition that was setup 3 years ago).

However this system is not without it's issues. The "learning" features of my particular remote (and most of the Harmony line if other reports on the web are to be believed) are iffy at best. It took me at least 4 tries and 2 remotes to get the "dot" function (the separator between the major channel number and the minor channel number on an HD channel) to be stored and saved in my 550 (and might I just ask why the "dot" button is NOT included in the database for the remote for my SPECIFIC TV?). There also seems to be no way to "custom program" an IR code into the remote. With my OTA-8910 I was able to enter a function on the remote where I could type in specific codes for each button to allow it to send separate codes for each button on a specific loaded profile...that is simply not possible with the harmony line. If the original remote is gone, and the code in the online database doesn't work or isn't there, there really are only 2 options: start the "needle in the haystack" search for a profile that works with the device but which has the needed function included, (and let me just say this would be an almost IMPOSSIBLE task) or do without it. One would think that for $100 - $1000 that there'd be a way to say "this button is missing, find it for me please" and have Logitech's systems find the proper codes...or have a way for the user to program his or her own without the use of the remote.

My last, and probably largest complaint about the Harmony remotes, is not actually about the remote itself at all, but about the web setup system. Simply take the test drive on Logitech's website and it's obvious what I mean when I say that setting up "odd" devices (pretty much anything not made by a specific manufacturer to the specific purpose it's designed for) is obscenely difficult. When the initial setup starts asking for devices (or the user goes back into the system at a later date and decides to add a device) it prompts the user to select the device to add from a drop down list (say "TV or PVR or DVD-Player"), then to select the manufacturer from the drop down, then to type in a model number. While this works great for devices like TVs, it doesn't work nearly so well for "odd ball" equipment like, for instance, a MythTV PVR...can anyone give me the model number of their MythTV Installation? The problem is that it's this model number that determines the default remote profile that is loaded to the remote for that device...type in the wrong Model Number and/or not have a model number and it's very unlikely the remote will be properly setup for the needed devices. Again, a lot of the frustration can be removed by following this guide as I already have a valid place to start from figured out and documented for MythTV.

Please note, programming a Harmony Remote is NOT a friendly task. Even with their wizards and help and automation I cannot imagine any Harmony setup that would not include going into some of the device options and changing things like the button layout or learning more IR commands, and at that point, while the system tries to be helpful, it's far from "user friendly." God help it if a device isn't fully supported (like my DVD player) and a non-technical user has to start going into options that require things like modifying the Power on Delay and knowing what the difference between the Inter-Key Delay and the Inter-Device delay are or what they're for. Once setup properly these remotes make EXCELLENT all-family remotes, even the youngest of kids can turn on and use a complex entertainment system with one of these remotes. Getting the remote setup initially to do all the work, however, is a long and somewhat arduous task. It doesn't help that setting up the remote requires being tethered to a computer for the majority of this task.

What Makes a Harmony Remote Unique

There are a lot of different remotes out there, and there is a somewhat successful argument to be made that a $20 OFA JP1 remote would do just as well with a MythTV system as a $200 harmony remote. There are, however, some differences from the MythTV perspective that make the harmony remotes "superior" to their learning/programmable cousins. The first and foremost of these differences is the concept of the programmable "soft" buttons. Each of the harmony remotes has physical labeled buttons on them (these are termed "hard" buttons, things like stop, play, ok, the number keys, etc.), the number of which will vary by model. Each of these remotes also supports a limited (but large) number of electronic "pages" of buttons that are accessed by navigating to the page of logical (or "soft") buttons and pressing one of the corresponding hard buttons to the left or right of the configuration item. The end result is that apart from the 40+ "hard" buttons on a typical harmony remote, it is also possible to access multiple pages of 4 "logical" buttons, for an additional 20 - 30 and even more commands available per device. It can be extremely hard for a power user to find a MythTV remote that controls ALL of Myth's various functions. For as programmable as most "learning" remotes are they all have the same limitation: every one of them have a limited number of buttons on them that can be pressed to perform a function that LIRC can trap and turn into a command for MythTV or other software. While the harmony remotes do have some limitations, the limitations are far fewer than any of the other non-computerized programmable remotes. And for most power users who are willing to spend some time and effort, the payoff is likely to be an ability to run a totally keyboard/mouseless installation of Myth yet have all the functions and commands available at the touch of a button...or a few.

The other major difference between standard programmable remotes and the Harmony line is that the "soft" buttons are not just programmable, they're renameable as well. For anyone who's looked at the 9 pages of commands that MythTV supports (and that's without adding more through key mappings) or the 18 pages of commands that Xine supports having an ability to know, at a glance, what the button about to be pressed will do makes a lot of difference. With most programmable remotes the standard procedure is to find those functions that are needed on the remote and to map them to buttons on the learnable remote. A lot of this makes sense because things like play generally end up on the play button. However for something like "load cut list" or "advance to x% of the way through the movie" it's unlikely that any remote will ever include that button. So instead the common practice is to find a button that's not used (say "PIP" for those who don't have a Picture-In-Picture on their TV) and "remap" it to mean that feature, this is easy enough to do through LIRC. However it also means that when the remote is used someone has to remember that "PIP" actually means "load cut list". With the harmony remote this isn't a problem, when the user selects the IR code that will map to "Load Cut List" (whatever this IR code happens to be) they are able to name it "LdCtLst" or some such and have that displayed on the soft button LCD screen, much easier than remembering button to function mapping lists or hoping the sheet of paper these mappings were written down on doesn't get lost.

Generic Remote, Generic IR System

As is stated in other places, setting up a Harmony Remote and LIRC together is a bit of a chicken and egg scenario. The concept of the Harmony Remote is that it will output whatever type of IR signal a device needs to control the device. Because devices all have their own proprietary receivers and signal configurations so that pressing a button on the TV's remote doesn't send a signal to the DVD player to stop playing, universal remotes (not just the harmony remotes) are built so that they can output the signals for each device in the device's own native "language".

LIRC then is built in the same way. Because all of the various remotes for the various devices out there have their own signal configurations to interface with the various proprietary devices, trying to use a remote built for a specific TV to control a Myth box requires a system that generically understands and reads IR signals and translates them in some kind of configurable way so that proprietary remotes can control a generic device.

What this leads to is a remote that can send any signal to any device and a receiver that can receive any signal from any device...and while this seems like a great solution (can't go wrong with that) it leads to headaches making decisions about what to use on both ends.

The biggest concept to keep in mind while setting up these systems to work together is that there is customizeability on both ends. Taking an easily working standard (say a remote that doesn't have to use "Raw" input mode through LIRC) on one end means overall ease of configuration across the board. While going away from the information contained in this document is perfectly acceptable (and in some cases a reconfiguration using a different starting point or different remote type may work better for some users) the choices made from where to start were made with ease of maintenance and stability of the end result in mind. When going off the beaten path of the article here, make sure to be careful about what profiles can be chosen to start with as some choices can lead to headaches and ultimate complete re-configuration in the end. In general stay away from any starting point that requires "raw" mode LIRC configurations.

Another big concept is that this system is only as limited as the codes the user can program into it. Other than the limitations of the remote itself (this will depend based upon how many devices the remote controls and the max number of keys any one remote can learn) the only limitation is how many different IR codes can be programmed into the remote itself. As stated above, with "soft buttons" available to be programmed, there is a huge number of choices that can be programmed into a remote. If there are 3 remotes all outputting the same style of codes but on different pulse/length frequencies sitting around the house (i.e. There are 3 remotes outputting the same protocol but all the buttons use a different signal sequence) every one of those buttons could technically be learned on ONE remote mapping to have access to a huge number of commands. Keep in mind that just because the button on the original remote says "Stop" doesn't make the signal special where LIRC and MythTV comes in. That "stop" could mean anything it's programmed to mean, it's just a pulse/length signal that is different from any other pulse/length signal that LIRC is told about.

When following this guide, if the starting point doesn't give enough "configuration" for a specific MythTV installation it's a matter of finding more IR codes that can be taught to the remote (having a cheap JP1 programmable remote around could in this case be hugely beneficial) and simply programming those signals into both the remote and LIRC. Using the tools in the LIRC Package (mode2, irrecord and IRW) are invaluable in this process of finding more codes to add more functionality.

Finally when mapping new features to the harmony remote keep in mind that while a hard button on the remote (say "ButtonB") may not have a feature mapped to it, deciding to use this for "Load Cut Points" may not make a whole lot of sense down the road or to other users of the remote. Considering that the soft buttons are renameable, for any functions that aren't immediately obvious (Like "stop" on the button labeled "stop") it may be a better idea to create a new soft button with an appropriate name/description than to map the function to a hard button with no changeable name.

IR Command Name, Button Name, LIRC Name and MythTV Function Mapping

The IR Command names (the "Name" being mapped to the various buttons and soft buttons on the remote...the items appearing in the drop down list) are just that: Names. These names have no bearing on the final commands that get sent to MythTV. Just because the command in the remote profile says "Play" doesn't mean it HAS to be what presses the play button.

There are 4 "levels" of command names that can all be manipulated to perform the specific task. The 4 levels are:

  • Remote Profile Name
  • Remote Button Name
  • LIRC Mapped Name
  • MythTV Command

The remote profile name is the name within the harmony setup software that appears in the dropdown lists. As noted above, this is nothing more than an identifier that refers to a specific, non-repeated IR sequence of flashes and waits that produce a single, unique IR signal. It may help to understand this by knowing that instead of an IR command called "Play" in the KnoppMyth profile the creator of this profile could just as easily have called this "IRCode_324" or "0x1159". Keep in mind that in this system, ANY distinct IR sequence can produce ANY distinct function in MythTV. These IR sequences could be named 01, 02, 03, 04, etc. all the way down and could be assigned as such in any random order and the whole thing would STILL work...though not with the files I provide in the first section. For now, keep in mind that the IR Sequence the remote will send out is given an identifying name in the harmony software.

The Remote Button Name is the name of the button as it appears on the remote: Rew, Fwd, Rec, ^, Ch+, Guide, etc. In the harmony software this is the left side column in the button editing area. The "hard" buttons have unchangeable names and map directly to the buttons as they are identified on the remote control. Assigning an IR sequence to the "UpArrow" button allows the button on the remote with the ^ on it to function. The IR sequence assigned to it is less important, it's JUST a unique sequence that identifies that button from all other buttons on the remote. The names on these buttons are the visual cue as to what will happen when that button is pushed. It is important to have the code assigned to this button properly sending MythTV the correct key command.

The LIRC Mapped Name is the name given to identify an IR Sequence in LIRC, specifically in the lircd.conf file. Again this name could be ANYTHING and doesn't necessarily need to be "Play" "Pause" "Mute" etc. Again, each LIRC mapped name is simply an identifier for a unique IR signal received by the LIRC software and is later translated to a unique key sent to the downstream application.

The MythTV Command is the specific key or function for MythTV to execute. Most of these keys or functions are setup through the "edit keys" interface in MythTV, but most of them have general defaults that are typically not changed. These commands tell MythTV what to do in any given situation. The "P" command causes Myth to pause a running video or un-pause if pressed a second time. F9 causes Myth to Mute or Unmute, etc.

To better illustrate how all of this fits together lets take one key command, we'll use menu up, and see how this command flows from the harmony setup software all the way down to Myth TV.

To begin with we have to identify the command for the action in Myth and the command for the action on the remote to take to cause that action. In Myth the "Menu Up" command is the up arrow key. Ignoring redoing all of Myth's key mappings a second this is the ONLY part of the system where there is little choice, which is why this is the place to start. At the end the remote MUST send the "UP ARROW" command to Myth to get Myth to move the menu selection box up one item. Once it's understood what has to be sent by the remote, now we need to identify what button on the remote should send the "Up Arrow" to Myth. A logical choice is the "up arrow" on the directional button, but so is the "Up Arrow" on the button, and so may be the "ChannelUp" button. Conversely if a user is used to using a keyboard and directional arrows on a number pad the 2 button may be an appropriate choice to be the "Up Arrow" key, or an arbitrary key (say "Stop") could be used to send the "Up Arrow". Any of these will work, there are no restrictions as to which button CAN send the command, just keep in mind that a remote where the "Stop" button sends "Up Arrow" may not be the most acceptable solution. Lets assume that we go with the most logical choice and make "up arrow" on the remote's directional button send "Up Arrow" to the Myth system.

First go into the Harmony software for the remote and edit controls. In the edit area find the control that maps to the directional up arrow on the remote (Marked "Up" on the left side column). Next to it is a drop down list of IR Sequence Names. We'll continue by taking two examples from the KnoppMyth profile: DirectionUp and Blue. In either case, select "DirectionUp" or "Blue" from the dropdown list next to the "Up" button name. Save the selection back to the remote to continue.

So far we have an IR sequence mapped to a button on the remote...whether this IR sequence is named "DirectionUp" or "Blue" it doesn't matter, and the selected button on the remote is logically significant to the user to produce the up arrow. So at this point the user will press the button on the remote and expect the menu to move.

Next we have to translate the IR Signal (Named either "DirectionUp" or "Blue" or any other name if selected) sent by the remote into a key command that MythTV will recognize. We start by telling LIRC (through an lircd.conf) file that a specific IR Sequence of flashes, pauses and frequency maps to a particular name. Again we'll continue with two examples. In the first example we tell LIRC that the "DirectionUp" signal should map to a name called "MenuUp". In the second example we tell LIRC to map the "Blue" signal to a name "Fred". When the user now presses his or her "Direction Up" button on the remote LIRC takes in the sequence and translates it to "MenuUp" or "Fred" respectively and sends "MenuUp" or "Fred" to the application that currently has keyboard focus in the operating system. LIRC has done it's job and sent "Fred" to the upstream application.

Next the application, in our case MythTV, has to receive "MenuUp" or "Fred" and translate it to "Up Arrow" for use. MythTV reads a config file called lircrc and pulls the following from the file:

begin
prog = mythtv
button = "MenuUp"
config = "Up"
end

begin
prog = mythtv
button = "Fred"
config = "Up"
end

In the above config file if program mythtv receives either "MenuUp" or "Fred" it will execute the "Up" command which internally means it needs to move the menu selector up a level. This is the reason why the "names" given to these signals don't matter.

To get LIRC to recognize the Harmony Remote:

  • Have any unique IR code mapped to a button on the remote
  • Have LIRC recognize that IR code and translate it to a button name.
  • Have an lircrc file that recognizes LIRC's button name and maps it to a valid command in the application itself.

It doesn't matter what code is attached to what button or what LIRC name is given to what code, to setup the remote with the least hassle the reader should definitely NOT change anything from the setup steps listed in this article. All of the work of assigning an IR code to A button, matching up the IR code with the LIRC IR code, mapping that IR code to a button, and then recognizing that button through MythTV (and others) has already been done. While anything can be changed in this setup and have it still work, this article is about setting up a Harmony Remote with the least hassle. Mapping all of the IR codes to the proper buttons on the remote as instructed, and using the lircd.conf and lircrc files provided here will get the remote up and running within a matter of minutes to hours instead of days.

Notes

Performance

Some reviews about the Harmony remotes have identified an issue with the performance of the remotes with navigating among menu systems like Myth's. This is a valid argument for a default configuration but this is not an actual defect with the product. Due to the number of devices a Harmony remote supports and the internal macroing system that it uses there are challenges with many devices. By and large some devices respond (accept IR commands and process them) quicker than other devices do. Some devices have very long power-up cycles but perform relatively quickly after they are powered up, others take forever to process any IR command. Because of this there are three user controllable timings on the Harmony Remote for each device, and these timings control, among other things, how quickly the Harmony sends commands back to back.

With most analog programmable remotes pressing a button twice produces two events. Pressing the button twice rapidly sends two separate commands, however it depends on the IR system of the device being sent the commands to as to whether it will process both commands or not. If the device has a slow IR processing system sending two commands back to back rapidly may only produce one event, it is up to the user to press the buttons at the correct pace for the IR system to recognize the separate events. The Harmony remotes (again due to the macroing system and internal software) inherently understand (based upon the delays controlled in the delay settings for each device in the harmony setup) how quickly or slowly that device responds to IR commands. When a button on the harmony remote is rapidly pressed, these buttons are queued up in internal memory and sent at the right pace to the device for processing. What this means is that even if that device has a slow IR processing system, buttons can still rapidly be pressed down to get to something on the screen but the remote may lag behind those presses as it waits for the delays to pass. Due to the default (I think) 500ms wait time between commands a non-tweaked remote feels sluggish on a menu system like MythTV's since it is so easy to get ahead of the remote and have to wait for it. Again this is completely controllable within the setup for the device and can be made as quick or slow as the devices IR system can handle.

Note about the above setup: For the information in Section 1, the setup was done with a harmony at the default wait time between commands. I don't know if changing this wait time "after the fact" (i.e. using my lircd.conf file above with a remote set at something other than the default wait time) would produce odd results in LIRC or not. I do know that as part of the setup irconfig did ask me to press a specific button as quickly as possible so it could identify delay between commands. If anyone out there has experience with using the above lircd.conf (or any lircd.conf) with a remote set to a much faster (slower is probably not a problem) delay between commands than the config file was produced at, please feel free to edit this section and add any additional experiences or information.

Additional Notes

After some investigation it looks as though the reason for the slow button presses with the Harmony has more to do with which remote your Harmony is emulating. Some remotes which the Harmony supports take a very long time (~1 second) to send each button press, while other remotes are very fast. This has nothing to do with the delay settings and nothing to do with "the number of devices this remote has to support" or any of the long-winded rubbish stated above.

I suspect Logitech has spent more time perfecting the IR codes for more common devices (e.g Sony TVs), and less time on less common devices (e.g MythTV or KnoppMyth).

This can easily be seen by pressing the same button multiple times on your Harmony remote, there's a small icon on the remote which displays whilst sending button presses. Pressing the 'Vol +' button ten times quickly whilst emulating a Sony remote, the icon is only displayed for a second after the last press. However, doing the same whilst emulating a KnoppMyth remote or similar the icon is displayed 5-7 seconds after the last press.

So the solution could be that you should use a more common remote control emulation when sending to lirc, if your hardware supports it. My receiver only supports a subset of RC5 so this is proving quite tricky for me.

See Also

External Links