Dependencies
To use LIRC's setup.sh script you need the dialog package. It
already should be installed on most systems. The setup.sh script makes
configuration of LIRC much easier but using it is not obligatory.
If you want to compile and use all tools, you also need an
installed svgalib (used by smode2) and the X Windows
header files (needed by irxevent and xmode2). You
can get svgalib from
ftp://sunsite.unc.edu/pub/Linux/libs/graphics/. The configure
script will notify you if some necessary files are missing and the
according tools won't be compiled.
Irman (=UIR) : To use your Irman with LIRC you need the
latest
libirman library. At the time this has been written the
current libirman version was 0.4.2. Former versions won't work. Please
also read Updating from lirc-0.5.4.
Kernel modules: All devices that require a kernel module
will need the properly configured kernel sources being available
somewhere in /usr/src/. During the build process of this package the
kernel Makefile and the current kernel configuration will be used to
work around some other problems that would arise if we used our own
Makefile. That means that you will have to build your own kernel which
is a good idea anyway. Make sure you use the standard kernel which you
can download at www.kernel.org.
Don't use any kernel sources that have been modified for your
distribution. For example you won't be able to compile some modules
for kernels that come with S.u.S.E. 7.0. Please refer to the
documentation of your distribution or read the README file in
the kernel source directory to get more information on how to compile
and set up an own kernel. More documentation is available at the Linux Documentation
Project.
If you want to use a home-brew receiver, an Anir Multimedia Magic,
a Packard Bell receiver or if you want to use the SIR IrDA driver you
should compile the Linux kernel serial port driver as a module. The
according kernel option that has to be set to m is
Standard/generic (dumb) serial support in the Character
devices section of the kernel configuration dialogue. Usually the
serial port driver grabs all ports it auto-detects as soon as it is
loaded and the LIRC modules won't be able to use any of them.
There are two solutions for this problem. Either you load the LIRC
module before the kernel serial port driver is loaded (that's why you
have to compile it as a module) or you call setserial /dev/ttySx
uart none to release the according port. setserial usually is
already called during boot-up in some init script whose location
depends on the distribution you use.
TV cards: To use any TV card remote controls you will need
either at least kernel version 2.4.0 or you use Gerd Knorr's current
bttv
package together with a kernel version of 2.2.4 or higher. In any case
bttv version 0.7.45 or higher is required. As LIRC during compilation
uses the bttv header files you will have to copy the current bttv
files into your kernel sources. The I2C driver also requires the new
I2C stack that was introduced in 2.3.x. Patches for 2.2.x kernels
are also available.
For most TV cards we rely on bttv autodetection. That way
you don't have to give any parameters to the module as they are
selected internally depending on the information the bttv module gives
us. This means that you should pay attention that your TV card is
detected correctly by bttv.
Technisat MediaFocus I: You will have to install the driver for this card.
Supported Hardware
Generally speaking everything that can receive or send infrared
signals can be supported by LIRC. The project began with support for
home-brew receivers and transmitters for the serial port and later
support for analogous hardware for the parallel port was added. At
that time the focus of the project was to provide an infrared solution
that is both very cheap and easy to assemble. The following links
point to instructions how to build your own receiver/transmitter.
Current versions of LIRC now support many more commercially
available solutions. Examples are the Irman, built-in IrDA ports or TV
cards. Drivers for even more hardware are likely to appear in the
future. If you are a programmer who wants to maintain such a driver
you are welcome to join the project.
Compiling
Before compiling the binaries you have to choose which driver to
use. This can easily be done with the setup.sh script. Just
type ./setup.sh from the shell prompt. After selecting your
driver you can exit the setup with "Save configuration &
run configure".
If you don't have dialog installed you will have to do it
the hard way and give the correct parameters to the configure script
manually. See ./configure --help for a detailed description
of the possible parameters. You will have to at least choose a driver
with the --with-driver=X option.
After having configured the package just type make and
lean back.
Note: You won't find a configure script in the CVS version
of LIRC. You will have to generate it first by executing
./autogen.sh. You need at least libtool-1.3.3, automake-1.4
and autoconf-2.13 to do this properly.
Installation
Installing the compiled programs is really easy, just type make
install. All binaries and modules should be installed at the
usual places. The necessary devices should be generated in the
/dev/ directory and all configuration files should be copied
to its proper destination if you happen to use some hardware where
configuration files are already available.
The core program of LIRC is lircd, the LIRC system daemon
that does all of the decoding of infrared signals. LIRC comes with a
second daemon program: lircmd. lircmd depends on lircd and
translates remote control activity to mouse movements. Just like all
other daemons both lircd and lircmd should be started at system boot
time and do their work in background. If you want to start them
automatically at boot time you will have to add an init script for them
to your system. Unfortunately the syntax and location of this init
script is highly dependent on the distribution you use so you will
have to figure it out yourself how this works on your system. Good
news is that there already are some init scripts available in the
contrib/ directory of the LIRC package.
Warning: Never compile daemons with "Disable
daemonize" turned on and place them in some init script unless
you have a rescue disc nearby...
Now you should adjust the file permissions of /dev/lircd
(this is the Unix domain socket that clients use to connect to lircd)
so others than root can connect to lircd. You can also create
a special group for this purpose.
If your hardware requires a kernel module you should make sure that
the kernel will find the correct module if a program tries to access
/dev/lirc. This can be done by inserting the following line
to your /etc/conf.modules (/etc/modules.conf for
current kernel versions):
alias char-major-61 lirc_driver
Note that here driver is a placeholder for the actual driver
you are using (serial, parallel, etc.).
If your driver requires some special parameters to work you can
specify them at the same place. For example you can set the IRQ and
port the serial port drivers shall use by adding the following line to
/etc/conf.modules:
options lirc_serial irq=4 port=0x3e8
This will override the default values you have selected during setup.
The configure script will tell you which kernel module you need.
Finally you might want to add /usr/local/lib to
/etc/ld.so.conf so the lirc_client library is found
by the run-time linker. Don't forget to call ldconfig
afterwards for the change take effect.
Testing your hardware & configuration
If you have build the infrared hardware yourself you are probably
eager to find out if it really works. If you have not build the
hardware yourself you can skip the first test. For most receivers it
even won't work because it makes no sense.
Type su to get root privileges and start
mode2. This should load the kernel module into the kernel and
display the infrared signals. Hold your remote control to your
infrared receiver and press some buttons. You should see an output
like this (the values of your remote will probably be different) :
pulse 93
space 4965
pulse 108
space 4969
pulse 93
space 7496
pulse 93
space 7489
pulse 93
space 47915
pulse 138
space 7475
pulse 93
space 7494
pulse 93
If you don't see anything, try to find out: (a) if you selected the
correct driver with the correct settings (port, IRQ), (b) if you
use a remote which works and (c) if your hardware works. The voltage
input of the infrared receiver should be 5V +/- 0.5V, the output pin
of the receiver should be about 0.5V less than the input voltage.
From time to time there should be long spaces (>30000). If you can
see very long pulses this usually means that sense auto detection of
your serial port IR receiver circuit has failed. You can override
sense auto detection by loading the device driver with the following
option:
insmod lirc_serial sense=0 if your receiver circuit is active
high or
insmod lirc_serial sense=1 if your receiver circuit is active
low.
Well, the driver seems to work, now let's test if lircd also does
its job. This only works, if lircd uses a config file which fits to your
remote control. Use irrecord in the case the
LIRC distribution doesn't provide a config file suitable for your
remote and it still is not available at the LIRC homepage. A more
detailed discussion of creating new config files is available in the
section about, you guess it: Adding new
remote controls.
Then start the decoder daemon with (make sure it is in your path):
lircd [config file]
The following program dumps the decoded key codes from lircd to
stdout: irw
This looks like this (depending on your remote):
0000000000f40bf0 00 1_DOWN ANIMAX
0000000000f40bf0 01 1_DOWN ANIMAX
0000000000f40bf0 02 1_DOWN ANIMAX
0000000000f40bf0 03 1_DOWN ANIMAX
0000000000f40bf0 04 1_DOWN ANIMAX
0000000000f40bf0 05 1_DOWN ANIMAX
0000000000748bf0 00 1_UP ANIMAX
0000000000748bf0 01 1_UP ANIMAX
0000000000748bf0 02 1_UP ANIMAX
0000000000718ef0 00 RED_BUTTON_UP ANIMAX
If the driver test worked, but you now see nothing, then check
/var/log/lircd. If you still see nothing suspicious compile
lircd in DEBUG mode and look at the log file again. In debug mode
lircd has an additional command line option that lets you choose the
detail level of debug information.
Uninstall
- Remove the installed binaries, and device nodes:
make uninstall
- Remove the config files, if you don't need them anymore:
rm /usr/local/etc/lircd.conf /usr/local/etc/lircmd.conf
~/.lircrc
Module specific information
lirc_gpio
This module receives scan codes from the GPIO register of bt8[47]8
chips using polling or interrupts if the card supports this. It is a
"plugin" for the lirc_dev module. It loads bttv and
lirc_dev modules if they are not loaded yet.
Parameters are:
- debug (0) - value other than 0 (zero) enables printing more log
messages
- card (0) - number of TV card from which receive scan codes
- minor (-1) - minor device number for /dev/lirc device
- gpio_mask (0) - bit mask used for extracting usable bits
from GPIO value
If this parameter is equal to 0 then the module
tries to autodetect the TV card and the remaining parameters are
ignored.
- gpio_lock_mask (0) - if this value "anded" with GPIO
value is non zero than it indicates that scan code is not ready (value
of 0 of this parameter disables checking)
- gpio_xor_mask (0) - bitmask applied (by xor operation) to
GPIO value before lock_mask is checked
- soft_gap (0) - minimal gap (in milliseconds) between two
scan codes (value of 0 disables checking)
- sample_rate (10) - how often (times per second) GPIO will
be polled, set to 0 for interrupt driven input
Supported hardware:
- Prolink - PixelView PlayTV pro - parameters: gpio_mask=0x1f00,
gpio_lock_mask=0x8000, gpio_xor_mask=0, soft_gap=400, sample_rate=12
- AVerMedia - TVCapture98 and TVPhone98 (pre 98 also) - parameters:
gpio_mask=0xf88000, gpio_lock_mask=0x10000, gpio_xor_mask=0x10000,
soft_gap=0, sample_rate=10
- many more...
Autodetection is performed using the API from the bttv module
- this means that if bttv doesn't properly recognize the card
type the remote control won't work.
Updating from lirc-0.5.4
This section only describes changes that break compatibility with older
versions. Please read the NEWS file to learn about all new
features of this release.
The config files of lircd and lircmd are now located
in /usr/local/etc/ instead of /etc/ per default. Most
people prefer to make /usr/local/etc/ a link to /etc/.
The modules no longer are uniformly installed as lirc.o but
are called lirc_driver.o depending on the driver you
are using. Therefore you might have to edit your
/etc/conf.modules and change the line
alias char-major-61 lirc
to whatever you need.
LIRC now supports the Irman directly. lirmand is no longer
necessary. Before installing this version you should call rm
/dev/lirc to remove the FIFO that was used in
lirc-0.5.4. /dev/lirc now should be a link to the device
the Irman is connected to (e.g. /dev/ttyS1).
Updating from lirc-0.6.2
The lirc_gpio_p has been renamed to lirc_gpio. I now also contains
support for TV cards that are able to generate interrupts if infra-red
commands are received. The lirc_gpio_i driver that implemented this
has been removed. The lirc_fly98 also has been removed as it is now
supported by the lirc_gpio driver.
The lirc_haup module has been renamed to lirc_i2c.
The transmit code in lirc_serial has been modified
slightly. If you have problems transmitting decrease the frequency
value in the lircd config file by approximately 2000.
There have been major changes to the SIR driver. If you used this
driver before you may have to generate new config files for your
remotes. Transmitting is now more likely to work.
The config file for the old AVerMedia TVCapture and TVPhone cards (pre
98) has changed. Please use the new config file that you can find in
remotes/avermedia/lircd.conf.avermedia.
[LIRC homepage]
The LIRC Manual, last update: 10-Sep-2000
|