Section: User Commands (1)
Updated: Last change: Oct 2015
irrecord - IR-codes recording tool for usage with LIRC
irrecord [-f] [-n] [-H driver] [-d device] [file]
irrecord -a <file>
irrecord --help | --version
This program will record the signals from your remote control and create a config file for lircd. Although a good deal of effort is put in this program it is often not possible to automatically recognize all features of a remote control. See USAGE NOTES below.
If file is not specified it defaults to "irrecord.lircd.conf"
If file already exists and contains a valid config irrecord will use the protocol description found there and will only try to record the buttons.
The primary options are --driver and usually also --device (some drivers does not need --device). These could be verified using mode2(1) if irrecord runs into trouble.
When driver and device is known it saves some work to update lirc_options.conf with the new values. irrecord uses the [lircd] section as a fallback, so with a proper lirc_options.conf irrecord could be run without command line options.
Using an existing file as a template can sometimes be required for irrecord to work. If using one of the generic templates it can also provide better timing. See PROTOCOL PARAMETERS AND TEMPLATES.
If the program fails to recognize the protocol of the remote control you could use the --force option to at least create a config file in raw mode.
After recording some buttons with irrecord, you should check the repeat masks. These are needed in order to handle repeated button presses, which are very common
Using the config file, start lircd and irw. Keeping a button pressed down, you should see something like:<
0000000000f40bf0 00 KEY_1 ANIMAX 0000000000f40bf0 01 KEY_1 ANIMAX 0000000000f40bf0 02 KEY_1 ANIMAX 0000000000f40bf0 03 KEY_1 ANIMAX 0000000000f40bf0 04 KEY_1 ANIMAX 0000000000f40bf0 05 KEY_1 ANIMAX
Note how the second field gets incremented. This must work for correct operation.
irrecord actually works in two phases. In the first, it tries to identify the protocol used by the remote. Although this often works quite well, there are advantages using an existing file as a template.
One reason to use a template is when irrecord fails to recognize the protocol in the beginning. In such cases, try to find an existing configuration from the same vendor using something like:
$ irdb-get find motorola # lots of remotes listed... $ irdb-get download motorola/VIP_1200.lircd.conf # Pick any $ cp VIP_1200.lircd.conf my_remote.lircd.conf $ irrecord my_remote.lircd.conf
Invoking irrecord this way re-uses the existing protocol which usually works (vendors seldom changes protocol parameters).
Another reason to use an existing file is to get more exact timing, important when planning to also transmit (blast). In such cases, using a generic template found using irdb-get find generic has advantages since the timing values here are hand-crafted from specifications. To use these, you need to know which protocol your remote uses, though.
If decoding of IR commands does not work reliably you can try to modify the eps and aeps values in the lircd config file to adjust the tolerance of signal lengths. aeps is an absolute value while eps is a relative value expressed in percent. See lircd.conf(5)
Some remotes actually emulates two or more remotes. irrecord runs into trouble if buttons from different logical remotes are mixed in the same run, in particular in the initial protocol identification. For such devices, irrecord must be invoked once for every logical device using only buttons from this device during the run.
If there is various non-printable garbage on the screen when running irrecord when using the default driver the rc protocol needs to be set. With a single device the protocol can be set and inspected using
sudo sh -c "echo 'lirc' > /sys/class/rc/rc0/protocol" cat /sys/class/rc/rc0/protocol
As for physical disturbances, the primary source is fluorescent light. You should not have any such light around when using irrecord. It's also important to have a suitable distance between the remote and the capture device, which often is smaller than in typical, normal usage. However, making the distance too small might cause other problems. At a first try use a foot or two.
Drivers are loaded dynamically. This is done from a traditional *ux ':'-separated path where each component in the path is searched (leading part first, trailing last).
The path used for this is determined by (falling priority):
In many cases irrecord needs to run as root to access devices not available to regular users. On the other hand, running as root creates problems such as log files owned by root, security concerns etc.
In order to cope with this, irrecord by default drops root privileges after opening the input device. This support is based on that root permissions are accquired using sudo(1) e. g., using
$ sudo irrecord --device /dev/lirc0 --driver default
If not using sudo, the same behaviour could be accomplished using the SUDO_USER environment variable e. g.,
# SUDO_USER=$LOGNAME irrecord --device /dev/lirc0 --driver default
The --keep-root option will make irrecord to keep root privileges for the complete run.
This document was created by
using the manual pages.
Time: 19:29:43 GMT, August 09, 2016