IR-CTL(1)
π IR-CTL(1) β the manual, but make it slay π
okay bestie, welcome to ir-ctl(1), a page from the User Commands section of your friendly neighbourhood manual. it's a whole swiss-knife situation and i'm gonna walk you through every single flag, no skips, no cap. π
β¨ NAME β¨
ir-ctl β a swiss-knife tool to handle raw IR and to set lirc options π§°β¨
β¨ SYNOPSIS β¨
ir-ctl [OPTION]...
ir-ctl [OPTION]... --features
ir-ctl [OPTION]... --send [file to send]
ir-ctl [OPTION]... --scancode [protocol and scancode to send]
ir-ctl [OPTION]... --keycode [keycode to send]
ir-ctl [OPTION]... --receive
β¨ DESCRIPTION β¨
so ir-ctl is the tool that lets you do four little main-character things: list the features of a lirc device, set its options, receive raw IR, and send IR. periodt. π
IR can be sent as the keycode of a keymap, or using a scancode, or using raw IR. three lanes, all iconic. π
β οΈ heads up bestie: you need to have read or write permissions on the /dev/lirc device for options to work. no perms, no vibes. π
β¨ OPTIONS β¨
-d,--device=DEVβ the lirc device you wanna control. defaults to/dev/lirc0π«Ά-f,--featuresβ list the features of the lirc device. the little "what can u even do" check. π-r,--receiveβ receive IR and print it to standard output. incoming!! π₯β¨-s,--send=FILEβ send IR in a text file. it's gotta be in the format described below, ok? if you pass this option multiple times, it sends all the files in order with a 125ms gap between them. that gap length can be modified with--gap. π-S,--scancode=PROTOCOL:SCANCODEβ send the IR scancode in the protocol you specify. the protocol has to be one of the protocols listed below, followed by a colon and the scancode number. if you specify this option multiple times, it sends all the scancodes in order with a 125ms gap between them. gap length can be modified with--gap. π«-K,--keycode=KEYCODEβ send theKEYCODEfrom the keymap, which you must specify with--keymap. if you specify this option multiple times, it sends all the keycodes in order with a 125ms gap between them. gap length can be modified with--gap. π-k,--keymap=KEYMAPβ the rc keymap file, in toml format. the format is described in therc_keymap(5)man page. this file is what theKEYCODEgets selected from. π-1,--oneshotβ when receiving, stop receiving after the first message, i.e. after a space or timeout of more than 19ms is received. one and done, no notes. β--mode2β when receiving, output IR in mode2 format. one line per space or pulse. π-w,--widebandβ use the wideband receiver if it's available on the hardware. this is also known as learning mode. the measurements should be more precise and any carrier frequency should be accepted. π¦-n,--narrowbandβ switches back to the normal, narrowband receiver if the wideband receiver was enabled. back to default, bestie. β©οΈ-R,--carrier-range=RANGEβ set the accepted carrier range for the narrowband receiver. it should be specified in the form30000-50000. πΆ-m,--measure-carrierβ if the hardware supports it, report what the carrier frequency is on receiving. you'll get the keywordcarrierfollowed by the frequency. this might use the wideband receiver, although this is hardware specific. π-M,--no-measure-carrierβ disable reporting of the carrier frequency. this should make it possible to use the narrowband receiver. this is the default. π-t,--timeout=TIMEOUTβ set the length of a space at which the receiver goes idle, specified in microseconds. π΄-c,--carrier=CARRIERβ sets the send carrier frequency. π‘-D,--duty-cycle=DUTYβ set the duty cycle for sending, in percent, if the hardware supports it. βοΈ-e,--emitters=EMITTERSβ comma separated list of emitters to use for sending. the first emitter is number 1. some devices only support enabling one emitter (thewinbond-cirdriver). π’-g,--gap=GAPβ set the gap between scancodes, or the gap between files when multiple files are specified on the command line. the default is 125000 microseconds. β³-?,--helpβ prints the help message. π--usageβ give a short usage message. βοΈ-v,--verboseβ verbose output; this prints the IR before sending. π£οΈ-V,--versionβ print the v4l2-utils version. π·οΈ
π Format of file π
when sending or receiving raw IR, two formats can be used. π
the first is a list of integers representing pulse and space values. a pulse value can be prefixed with + and a space with -, but this is optional. the rc-5 scancode 0x1e01 is encoded so:
+889 -889 +1778 -1778 +889 -889 +889 -889 +889 -889 +1778 -889 +889 -889
+889 -889 +889 -889 +889 -889 +889 -1778 +889
the other format mimics the mode2 tool. this produces one line per space or pulse. for receiving it can be selected by specifying --mode2. here's the same message as above, now encoded in mode2:
carrier 36000
pulse 940
space 860
pulse 1790
space 1750
pulse 880
space 880
pulse 900
space 890
pulse 870
space 900
pulse 1750
space 900
pulse 890
space 910
pulse 840
space 920
pulse 870
space 920
pulse 840
space 920
pulse 870
space 1810
pulse 840
note that in this format, the carrier can also be specified. this can only be done with a separate --carrier=38000 command line option with the first format. πΈ
rather than specifying just the raw IR, in this format you can also specify the scancode and protocol you want to send. this will also automatically set the correct carrier. the above can be written as:
scancode rc5:0x1e01
if multiple scancodes are specified in a file, a gap is inserted between scancodes if there is no space between them (see --gap). one file can only have one carrier frequency, so this might cause problems if different protocols are specified in one file and they use different carrier frequencies. π
also note: there are device-specific limits of how much IR can be sent at a time. this can be both the length of the IR and the number of different lengths of space and pulse. so likeβ¦ don't go wild. π
π Supported Protocols π
a scancode with protocol can be specified on the command line or in the pulse and space file. the following protocols are supported:
rc5, rc5x_20, rc5_sz, jvc, sony12, sony15, sony20, nec, necx, nec32, sanyo, rc6_0, rc6_6a_20, rc6_6a_24, rc6_6a_32, rc6_mce, sharp, imon, rc_mm_12, rc_mm_24, rc_mm_32.
if the scancode starts with 0x it will be interpreted as a hexadecimal number, and if it starts with 0 it will be interpreted as an octal number. π’
π¦ Wideband and narrowband receiver π¦
most IR receivers have a narrowband and wideband receiver. the narrowband receiver can receive over longer distances (usually around 10 metres without interference) and is limited to certain carrier frequencies. β¨
the wideband receiver is for higher precision measurements and for when the carrier frequency is unknown; however it only works over very short distances (about 5 centimetres). this is also known as learning mode. π¬
for most drivers, enabling carrier reports using -m also enables the wideband receiver. π«Ά
πΎ Global state πΎ
all the options which can be set for lirc devices are maintained until the device is powered down or a new option is set. so it remembers, bestie. π§
β¨ EXIT STATUS β¨
on success, it returns 0. otherwise, it will return the error code. π
β¨ EXAMPLES β¨
to list all capabilities of /dev/lirc2:
ir-ctl -f -d /dev/lirc2
to show the IR of the first button press on a remote in learning mode:
ir-ctl -r -m -w
to restore the normal (longer distance) receiver:
ir-ctl -n -M
to send the pulse and space file play on emitter 3:
ir-ctl -e 3 --send=play
to send the rc-5 hauppauge '1' scancode:
ir-ctl -S rc5:0x1e01
to send the rc-5 hauppauage '1' key from the hauppauge keymap:
ir-ctl -k hauppauge.toml -K KEY_NUMERIC_1
β¨ BUGS β¨
report bugs to Linux Media Mailing List <linux-media@vger.kernel.org> π
β¨ COPYRIGHT β¨
copyright (c) 2016 by Sean Young. π
license GPLv2: GNU GPL version 2 <http://gnu.org/licenses/gpl.html>. this is free software: you are free to change and redistribute it. there is NO WARRANTY, to the extent permitted by law. π«Ά
β¨ SEE ALSO β¨
to display decoded IR, or set IR decoding options, see ir-keytable(1). π
the keymap format is described in rc_keymap(5). π
and that's the whole page bestie!! π this little manual came from v4l-utils 1.32.0, dated Tue Jul 5 2016 β go forth and send some IR, u absolute icon πβ¨π
π¦ where this page comes from
- alpine 3.24: v4l-utils-doc 1.32.0-r1 Β· LGPL-2.0-or-later
- arch rolling: v4l-utils 1.32.0-2 Β· LGPL
- fedora 43: rc-tools 1.32.0-1.fc43 Β· GPL-2.0-or-later AND GPL-2.0-only
- fedora 44: rc-tools 1.32.0-3.fc44 Β· GPL-2.0-or-later AND GPL-2.0-only
- nixos 26.05: v4l-utils 1.32.0
- nixpkgs unstable: v4l-utils 1.32.0
- ubuntu resolute: ir-keytable 1.32.0-2ubuntu1 Β· GPL-2.0-only
- ubuntu stonking: ir-keytable 1.32.0-5ubuntu1 Β· GPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms