supported cards
help and faq
using tvtime
common problems
report bugs

email the webmaster

## Configuring lirc for tvtime

#### Billy Biggs, 21 Sep 2003

lirc is a driver, client library and set of utilities for using infrared remote controls with Linux applications. This document describes how to configure lirc to work with tvtime. Everything accessible via the keyboard can be done through your remote control.

### 1. Set up lirc

lirc consists of a kernel piece and a userland daemon called lircd which must be run. Once this is setup, you can configure lirc to signal tvtime when remote control buttons are pressed.

### 2. All about irexec

tvtime is signalled from lirc using a helper application called `irexec`. `irexec` runs as a daemon listening for remote control events and executing commands specified in the lirc config file. In tvtime, we use `irexec` to run our own helper application, `tvtime-command`, to send a command to a running tvtime process.

`irexec` should be run as the user under which tvtime will run, and can be started with the `--daemon` option to have it run in the background. I don't know where this should be added, but you must somehow ensure that `irexec` has been started before running tvtime. I would like to improve this somehow, but I'm not sure what is best.

### 3. Setting up your .lircrc

The `.lircrc` entries for tvtime look like this:

        begin
          prog = irexec
          button = the_one_you_want_on_your_remote
          config = tvtime-command quit
        end

Button names are assigned in your lircd config file, and often look like VOL_DOWN or CH+. These should be assigned to corresponding tvtime commands. A full list of commands can be found on the using tvtime webpage under the section Controlling tvtime via tvtime-command.

### 4. Suggested lirc setup

We have put together an example `.lircrc` file that demonstrates how we believe a user would set up their remote control.

- An example .lircrc file

This shows the commands that we feel are important and gives a case study for how to configure lirc for tvtime.

### 5. Configuring the power button as both tvtime start and exit

Many remotes have a power button, and a nifty trick is to have that button map to both turning tvtime on and off. This can be configured by adding this entry to your `.lircrc` file:

        begin
          prog = irexec
          button = POWER
          config = tvtime &
          config = tvtime-command QUIT
        end

This button has two commands defined, on the first press it will start tvtime, and on the second press it will send a QUIT message.

### 6. Menu navigation on remotes without menu buttons

Many remote controls, like the one featured on the right, do not have separate menu navigation buttons but instead double-up the channel up/down and volume up/down buttons for menu navigation. tvtime 0.9.11 includes the commands UP, DOWN, LEFT and RIGHT for this dual-purpose. When not in the menu, the UP and DOWN commands control channel navigation, while the LEFT and RIGHT commands control volume.

### 7. Problems when tvtime runs at realtime priority

You may experience some missed events if you run tvtime as root or have set tvtime setuid root and have one of the following capture cards:

- Prolink PixelView Pro
- Avermedia and Avermedia 98 cards
- Leadtek Winfast TV 2000 and 2000 XP
- Flyvideo cards (98, 98FM)
- Typhoon TView
- BestBuy EasyTV
- KWorld

Running tvtime as a user prevents tvtime from aquiring realtime priority, allowing the lirc driver for these cards to poll more frequently for events. This problem may also be fixed by using a low-latency patched kernel. We hope to provide a better solution to this problem when we understand it better.

### 8. Bugs and suggestions

If you have any suggestions on how we can simplify or better automate the setup process of using tvtime and lirc, please send an email to vektor@dumbterm.net.

### 9. ChangeLog

- Nov 4, 2003: Added a section about realtime priority problems, and updated the section on menu navigation keys.
- Oct 9, 2003: Added a section with an example lircrc file.