How to use MythTV with a Universal Remote Control

MythTV is free PVR software that enables watching and recording of cable and over-the-air TV on your PC. With the proper hardware (Hauppauge 1212 HD-PVR), you can even record encrypted HD content.

My TV card is the KWorld ATSC 110, which is only able to record unencrypted digital cable. That's okay though, since most of my favorite shows are on the major broadcast networks, which all transmit their shows unencrypted. The KWorld is also a much more affordable option than the HD-PVR.

Anyway, once you have MythTV up and running, there are many ways to control the interface from your couch. For example, I find the Adesso wireless keyboard works great for applications that don't support IR input, and also works great with MythTV.

When navigating the MythTV menus, I generally prefer to use my remote control, in place of the bulky wireless keyboard. So I managed to get my Sony RM-VL600 universal remote control working with MythTV. This is great for me, since I use my RM-VL600 to also control the rest of my AV setup, including my receiver, TV, and DVD player. This allows me to control all my AV sources with one device, including my PC running MythTV.

Keep reading to learn how I got my remote working with MythTV. These instructions can be adapted to work with any IR remote control that is compatible with LIRC.

Hardware Requirements

In addition to needing a remote control device, you will also need an IR receiver that is compatible with LIRC. LIRC is the software MythTV uses to read the commands sent by your remote. I've had great success using the USB IR receiver included with the Streamzap PC Remote.

The IR receiver that is included with the Streamzap is one of the few receivers that is fully supported by LIRC that is also able to work with most any remote control, including the RM-VL600. Visit http://lirc.sourceforge.net/remotes/ for a list of all remote controls known to work with LIRC.

The Streamzap remote itself can also be used with MythTV, but I'm focusing on using a universal remote here since it allows me to control all the devices in my AV system. The less remotes, the less confusion. A universal remote, if configured properly, makes for a simple, user-friendly home AV setup.

LIRC Configuration File

Pasted below is the LIRC configuration file that contains the remote codes outputted by the RM-VL600 when the VCR component button is pressed on the remote.

I chose the VCR output codes, since the other component outputs are more likely to actually correspond to a real device in your AV setup. Since very few people have VCRs these days anymore, it made the most sense to use the VCR codes and map them to MythTV inputs.

These codes should work with the RM-VL600 out-of-the-box using the default programmed-in VCR IR signals. The following file was generated with the help of the irrecord program, which is included with LIRC. You only need to use irrecord to generate the lircd.conf file if your remote is not already supported by LIRC.

# lircd.conf
#
# LIRCD conf file for the Sony RM-VL600 universal, learning remote control.
#
# this config file was automatically generated
# using lirc-0.8.6(default) on Sun Jul 25 15:36:37 2010
#
# contributed by Corey @ https://onpub.com/
# This file is maintained at:
# https://onpub.com/index.php?s=7&a=129
# For bug reports and suggestions, please leave a comment on the page at the URL
# above.
#
# brand:                       Sony
# model no. of remote control: RM-VL600
# devices being controlled by this remote: Streamzap USB IR Receiver
#
# The codes below are outputted by the remote after pressing the VCR component
# select button. These are the default VCR codes for this remote. Reprogramming
# the VCR component is not required. This file was generated by irrecord using
# the Streamzap USB IR receiver.

begin remote

  name  RM-VL600
  bits           12
  flags SPACE_ENC|CONST_LENGTH
  eps            30
  aeps          256

  header       2432   640
  one          1408   640
  zero          730   640
  gap          45982
  toggle_bit_mask 0x0

      begin codes
          KEY_OK                   0x8A8
          KEY_UP                   0x428
          KEY_DOWN                 0xC28
          KEY_LEFT                 0x468
          KEY_RIGHT                0x868
          KEY_PLAY                 0x588
          KEY_NEXT                 0x388
          KEY_PREVIOUS             0xD88
          KEY_STOP                 0x188
          KEY_PAUSE                0x988
          KEY_MENU                 0xB28
          KEY_INFO                 0x5A8
          KEY_ENTER                0xD08
          KEY_0                    0x908
          KEY_1                    0x008
          KEY_2                    0x808
          KEY_3                    0x408
          KEY_4                    0xC08
          KEY_5                    0x208
          KEY_6                    0xA08
          KEY_7                    0x608
          KEY_8                    0xE08
          KEY_9                    0x108
          KEY_CHANNELUP            0x088
          KEY_CHANNELDOWN          0x888
          KEY_SLEEP                0xF28
      end codes

end remote

# end of lircd.conf

Copy and paste the lines above in to a file called lircd.conf in your /etc/lirc directory and re(start) the lircd service.

Depending on what Linux distribution you are using (I'm using Fedora), the location of this file may be different. Consult your Linux distro's LIRC documentation if you're unsure. You can test to see if LIRC is working by pressing a few buttons on your remote after starting up the irw program.

MythTV Configuration File

Copy and paste the lines below in to a file called lircrc and save it to your ~/.mythtv home directory. This file maps the LIRC key/button definitions to MythTV frontend actions.

# start of MythTV lircrc file

# Thanks to the following Ubuntu Forums thread for help creating this file:
# http://ubuntuforums.org/showthread.php?t=1065804
# See also: http://www.mythtv.org/wiki/LIRC#LIRCRC

# Record
begin
  prog = mythtv
  remote = *
  button = KEY_RECORD
  repeat = 3
  config = R
end

# Skip Backwards
begin
  prog = mythtv
  remote = *
  button = KEY_PREVIOUS
  repeat = 3
  config = <
end

# Pause
begin
  prog = mythtv
  remote = *
  button = KEY_PAUSE
  repeat = 3
  config = P
end

# Skip Forward
begin
  prog = mythtv
  remote = *
  button = KEY_NEXT
  repeat = 3
  config = >
end

# Cancel / Back
begin
  prog = mythtv
  remote = *
  button = KEY_STOP
  repeat = 3
  config = Esc
end

# Show OSD
begin
  prog = mythtv
  remote = *
  button = Go
  repeat = 3
  config = I
end

# Mute
begin
  prog = mythtv
  remote = *
  button = KEY_MUTE
  repeat = 3
  config = F9
end

begin
  prog = mythtv
  remote = *
  button = KEY_1
  repeat = 3
  config = 1
end


begin
  prog = mythtv
  remote = *
  button = KEY_2
  repeat = 3
  config = 2
end


begin
  prog = mythtv
  remote = *
  button = KEY_3
  repeat = 3
  config = 3
end


begin
  prog = mythtv
  remote = *
  button = KEY_4
  repeat = 3
  config = 4
end


begin
  prog = mythtv
  remote = *
  button = KEY_5
  repeat = 3
  config = 5
end


begin
  prog = mythtv
  remote = *
  button = KEY_6
  repeat = 3
  config = 6
end


begin
  prog = mythtv
  remote = *
  button = KEY_7
  repeat = 3
  config = 7
end


begin
  prog = mythtv
  remote = *
  button = KEY_8
  repeat = 3
  config = 8
end


begin
  prog = mythtv
  remote = *
  button = KEY_9
  repeat = 3
  config = 9
end

# Number Zero
begin
  prog = mythtv
  remote = *
  button = KEY_0
  repeat = 3
  config = 0
end

# Select
begin
  prog = mythtv
  remote = *
  button = KEY_OK
  repeat = 3
  config = Return
end

# Menu
begin
  prog = mythtv
  remote = *
  button = KEY_MENU
  repeat = 3
  config = M
end

# OSD browse
begin
  prog = mythtv
  remote = *
  button = KEY_ENTER
  repeat = 3
  config = O
end

begin
  prog = mythtv
  remote = *
  button = KEY_UP
  repeat = 3
  config = Up
end

begin
  prog = mythtv
  remote = *
  button = KEY_DOWN
  repeat = 3
  config = Down
end

begin
  prog = mythtv
  remote = *
  button = KEY_LEFT
  repeat = 3
  config = Left
end

begin
  prog = mythtv
  remote = *
  button = KEY_RIGHT
  repeat = 3
  config = Right
end

begin
  prog = mythtv
  remote = *
  button = KEY_INFO
  repeat = 3
  config = I
end

# end of MythTV lircrc file

Conclusion

Now that you've configured both LIRC and MythTV for the remote, be sure to restart LIRC and then restart your MythTV frontend. You should now be able to navigate your MythTV UI with your remote control!

If you have any feedback, feel free to comment below.