| 1 |
.TH "CEC-CTL" "1" "August 2016" "v4l-utils @MAN_PACKAGE_VERSION@" "User Commands" |
| 2 |
.SH NAME |
| 3 |
cec-ctl - An application to control cec devices |
| 4 |
.SH SYNOPSIS |
| 5 |
.B cec-ctl |
| 6 |
[\fI\-h\fR] [\fI\-d <dev>\fR] [many other options] |
| 7 |
.SH DESCRIPTION |
| 8 |
The cec-ctl tool is used to control cec devices. It is able to control almost |
| 9 |
any aspect of such devices covering the full CEC API. |
| 10 |
|
| 11 |
The easiest way to quickly test a CEC adapter of an HDMI output is: |
| 12 |
|
| 13 |
cec-ctl -d/dev/cecX --playback -S |
| 14 |
|
| 15 |
This is what you would use if the HDMI output of your device supports |
| 16 |
CEC: your device will play back video, so it is a CEC Playback device. |
| 17 |
|
| 18 |
And for an HDMI input: |
| 19 |
|
| 20 |
cec-ctl -d/dev/cecX --tv -S |
| 21 |
|
| 22 |
This is what you would use if your device has an HDMI input, i.e. it |
| 23 |
acts like a TV. |
| 24 |
|
| 25 |
Both commands configure the CEC adapter and show the CEC topology. |
| 26 |
The '--playback' and '--tv' options configure \fIyour\fR device, they are |
| 27 |
not about what device you will be talking to. |
| 28 |
|
| 29 |
To put a display to standby use: |
| 30 |
|
| 31 |
cec-ctl -d/dev/cecX --to 0 --standby |
| 32 |
|
| 33 |
To wake up the display: |
| 34 |
|
| 35 |
cec-ctl -d/dev/cecX --to 0 --image-view-on |
| 36 |
|
| 37 |
To switch the TV to our HDMI output (replace the physical address with |
| 38 |
what cec-ctl -d/dev/cecX reported): |
| 39 |
|
| 40 |
cec-ctl -d/dev/cecX --to 0 --active-source phys-addr=1.0.0.0 |
| 41 |
|
| 42 |
Instead of '-d/dev/cecX' you can also write this as '-dX'. |
| 43 |
And instead of '--to 0' you can also write this as '-t0'. |
| 44 |
|
| 45 |
.SH OPTIONS |
| 46 |
.TP |
| 47 |
\fB\-A\fR, \fB\-\-list\-devices\fR |
| 48 |
List all cec devices. |
| 49 |
.TP |
| 50 |
\fB\-d\fR, \fB\-\-device\fR \fI<dev>\fR |
| 51 |
Use device <dev> as the CEC device. If <dev> is a number, then /dev/cec<dev> is used. |
| 52 |
.TP |
| 53 |
\fB\-D\fR, \fB\-\-driver\fR \fI<drv>\fR |
| 54 |
Use a cec device that has driver name \fI<drv>\fR, as returned by the CEC_ADAP_G_CAPS ioctl. |
| 55 |
This option can be combined with \fB\-a\fR to uniquely identify a CEC device without |
| 56 |
having to rely on the device node number. |
| 57 |
.TP |
| 58 |
\fB\-a\fR, \fB\-\-adapter\fR \fI<adap-name>\fR |
| 59 |
Use a cec device that has adapter name \fI<adap-name>\fR, as returned by the CEC_ADAP_G_CAPS ioctl. |
| 60 |
This option can be combined with \fB\-D\fR to uniquely identify a CEC device without |
| 61 |
having to rely on the device node number. |
| 62 |
.TP |
| 63 |
\fB\-v\fR, \fB\-\-verbose\fR |
| 64 |
Turn on verbose reporting. |
| 65 |
.TP |
| 66 |
\fB\-\-version\fR |
| 67 |
Show version information. |
| 68 |
.TP |
| 69 |
\fB\-w\fR, \fB\-\-wall\-clock\fR |
| 70 |
Show timestamps as wall-clock time. This also turns on verbose reporting. |
| 71 |
.TP |
| 72 |
\fB\-h\fR, \fB\-\-help\fR |
| 73 |
Prints the help message. |
| 74 |
.TP |
| 75 |
\fB\-p\fR, \fB\-\-phys\-addr\fR \fI<addr>\fR |
| 76 |
Use this physical address. The address can be a number (e.g. 0 or 0x11b1) |
| 77 |
or formatted as a.b.c.d where each component is a hex value from 0-f |
| 78 |
(e.g. 0.0.0.0 or 1.1.b.1). |
| 79 |
.TP |
| 80 |
\fB\-e\fR, \fB\-\-phys\-addr\-from\-edid\fR \fI<path>\fR |
| 81 |
Parse the given EDID file (in raw binary format) and extract the physical |
| 82 |
address. If the EDID file does not exist or does not contain a physical |
| 83 |
address, then invalidate the physical address. |
| 84 |
.TP |
| 85 |
\fB\-E\fR, \fB\-\-phys\-addr\-from\-edid\-poll\fR \fI<path>\fR |
| 86 |
Parse the given EDID file (in raw binary format) and extract the physical |
| 87 |
address. If the EDID file does not exist or does not contain a physical |
| 88 |
address, then invalidate the physical address. Poll for changes in this |
| 89 |
EDID file every 100 ms and, if changed, update the physical address. |
| 90 |
|
| 91 |
This provides a way for Pulse-Eight (or similar) USB CEC dongles to become |
| 92 |
aware of HDMI disconnect and reconnect events. |
| 93 |
|
| 94 |
Polling happens in the background while cec-ctl processes other requested |
| 95 |
actions (i.e. transmitting messages, waiting for replies, etc.) and when that |
| 96 |
is all done cec-ctl will keep polling until the user kills cec-ctl (Ctrl-C). |
| 97 |
.TP |
| 98 |
\fB\-o\fR, \fB\-\-osd\-name\fR \fI<name>\fR |
| 99 |
Use this OSD name. The maximum length is 14 characters. |
| 100 |
.TP |
| 101 |
\fB\-V\fR, \fB\-\-vendor\-id\fR \fI<id>\fR |
| 102 |
Use this vendor ID. The vendor ID is a number from 0x0 to 0xffffff. |
| 103 |
.TP |
| 104 |
\fB\-x\fR, \fB\-\-physical\-address\fR |
| 105 |
Show the physical address. If invalid, the physical address will be reported |
| 106 |
as f.f.f.f. Useful for scripts, e.g.: la=`cec-ctl -s -x` |
| 107 |
.TP |
| 108 |
\fB\-l\fR, \fB\-\-logical\-address\fR |
| 109 |
Show first configured logical address or nothing if the device is unconfigured. |
| 110 |
Useful for scripts, e.g.: la=`cec-ctl -s -l` |
| 111 |
.TP |
| 112 |
\fB\-L\fR, \fB\-\-logical\-addresses\fR |
| 113 |
Show all configured logical addresses or nothing if the device is unconfigured. |
| 114 |
Useful for scripts, e.g.: las=`cec-ctl -s -L` |
| 115 |
.TP |
| 116 |
\fB\-C\fR, \fB\-\-clear\fR |
| 117 |
Clear all logical addresses, leaving the CEC device unconfigured. |
| 118 |
.TP |
| 119 |
\fB\-n\fR, \fB\-\-no\-reply\fR |
| 120 |
By default when sending a CEC message that expects a reply this utility will |
| 121 |
wait for that reply. With this option it will just send it without waiting |
| 122 |
for the reply. This option applies to the messages following this option. |
| 123 |
It acts as a toggle, so after you specify it a second time then the following |
| 124 |
messages will wait for a reply again. |
| 125 |
.TP |
| 126 |
\fB\-N\fR, \fB\-\-non\-blocking\fR |
| 127 |
Transmit messages in non-blocking mode. |
| 128 |
.TP |
| 129 |
\fB\-t\fR, \fB\-\-to\fR \fI<la>\fR |
| 130 |
Send the message to the given logical address (0-15). |
| 131 |
.TP |
| 132 |
\fB\-f\fR, \fB\-\-from\fR \fI<la>\fR |
| 133 |
Send message from the given logical address. It is only necessary to use this |
| 134 |
option if multiple logical addresses are claimed. By default the first assigned |
| 135 |
logical address will be used. |
| 136 |
.TP |
| 137 |
\fB\-r\fR, \fB\-\-show\-raw\fR |
| 138 |
Show the raw CEC message in hex. |
| 139 |
.TP |
| 140 |
\fB\-s\fR, \fB\-\-skip\-info\fR |
| 141 |
Skip the Driver Info output section. |
| 142 |
.TP |
| 143 |
\fB\-S\fR, \fB\-\-show\-topology\fR |
| 144 |
Show the CEC topology, detecting which other CEC devices are on the CEC bus. |
| 145 |
.TP |
| 146 |
\fB\-P\fR, \fB\-\-poll\fR |
| 147 |
Send a poll message. |
| 148 |
.TP |
| 149 |
\fB\-T\fR, \fB\-\-trace\fR |
| 150 |
Trace all called ioctls. Useful for debugging. |
| 151 |
.TP |
| 152 |
\fB\-\-cec\-version\-1.4\fR |
| 153 |
Use CEC Version 1.4 instead of 2.0 (the default). |
| 154 |
.TP |
| 155 |
\fB\-\-allow\-unreg\-fallback\fR |
| 156 |
Allow fallback to Unregistered if all logical addresses are claimed. |
| 157 |
By default the adapter will remain unconfigured. |
| 158 |
.TP |
| 159 |
\fB\-\-no\-rc\-passthrough\fR |
| 160 |
Disable the RC passthrough. By default remote control CEC messages are |
| 161 |
passed on as input keystrokes (the \fBCEC_LOG_ADDRS_FL_ALLOW_RC_PASSTHRU\fR |
| 162 |
flag is set when calling the \fBCEC_ADAP_S_LOG_ADDRS\fR ioctl), but this |
| 163 |
can be blocked by using this option. |
| 164 |
.TP |
| 165 |
\fB\-\-reply\-to\-followers\fR |
| 166 |
The reply will be sent to followers as well. By default the reply will only |
| 167 |
go to the follower that initiated the CEC message. But if you have other |
| 168 |
followers running as well, then by giving this option they will also receive |
| 169 |
the reply. |
| 170 |
.TP |
| 171 |
\fB\-\-timeout\fR \fI<ms>\fR |
| 172 |
Set the reply timeout in milliseconds (default is 1000 ms). |
| 173 |
.TP |
| 174 |
\fB\-\-tv\fR |
| 175 |
Configure the CEC adapter as a TV. |
| 176 |
.TP |
| 177 |
\fB\-\-record\fR |
| 178 |
Configure the CEC adapter as a recording and playback device. |
| 179 |
.TP |
| 180 |
\fB\-\-tuner\fR |
| 181 |
Configure the CEC adapter as a tuner device. |
| 182 |
.TP |
| 183 |
\fB\-\-playback\fR |
| 184 |
Configure the CEC adapter as a playback device. |
| 185 |
.TP |
| 186 |
\fB\-\-audio\fR |
| 187 |
Configure the CEC adapter as an audio system device. |
| 188 |
.TP |
| 189 |
\fB\-\-processor\fR |
| 190 |
Configure the CEC adapter as a processor device. |
| 191 |
.TP |
| 192 |
\fB\-\-switch\fR |
| 193 |
Configure the CEC adapter as a pure CEC switch. |
| 194 |
.TP |
| 195 |
\fB\-\-cdc\-only\fR |
| 196 |
Configure the CEC adapter as a CDC-only device. |
| 197 |
.TP |
| 198 |
\fB\-\-unregistered\fR |
| 199 |
Configure the CEC adapter as an unregistered device. |
| 200 |
.TP |
| 201 |
\fB\-\-feat\-record\-tv\-screen\fR |
| 202 |
Signal the Record TV Screen feature. |
| 203 |
.TP |
| 204 |
\fB\-\-feat\-set\-osd\-string\fR |
| 205 |
Signal the Set OSD String feature. |
| 206 |
.TP |
| 207 |
\fB\-\-feat\-deck\-control\fR |
| 208 |
Signal the Deck Control feature. |
| 209 |
.TP |
| 210 |
\fB\-\-feat\-set\-audio\-rate\fR |
| 211 |
Signal the Set Audio Rate feature. |
| 212 |
.TP |
| 213 |
\fB\-\-feat\-sink\-has\-arc\-tx\fR |
| 214 |
Signal the sink ARC Tx feature. |
| 215 |
.TP |
| 216 |
\fB\-\-feat\-source\-has\-arc\-rx\fR |
| 217 |
Signal the source ARC Rx feature. |
| 218 |
.TP |
| 219 |
\fB\-\-rc\-tv\-profile\-1\fR |
| 220 |
Signal RC TV Profile 1. |
| 221 |
.TP |
| 222 |
\fB\-\-rc\-tv\-profile\-2\fR |
| 223 |
Signal RC TV Profile 2. |
| 224 |
.TP |
| 225 |
\fB\-\-rc\-tv\-profile\-3\fR |
| 226 |
Signal RC TV Profile 3. |
| 227 |
.TP |
| 228 |
\fB\-\-rc\-tv\-profile\-4\fR |
| 229 |
Signal RC TV Profile 4. |
| 230 |
.TP |
| 231 |
\fB\-\-rc\-src\-dev\-root\fR |
| 232 |
Signal that the RC source has a Dev Root Menu. |
| 233 |
.TP |
| 234 |
\fB\-\-rc\-src\-dev\-setup\fR |
| 235 |
Signal that the RC source has a Dev Setup Menu. |
| 236 |
.TP |
| 237 |
\fB\-\-rc\-src\-contents\fR |
| 238 |
Signal that the RC source has a Contents Menu. |
| 239 |
.TP |
| 240 |
\fB\-\-rc\-src\-media\-top\fR |
| 241 |
Signal that the RC source has a Media Top Menu. |
| 242 |
.TP |
| 243 |
\fB\-\-rc\-src\-media\-context\fR |
| 244 |
Signal that the RC source has a Media Context Menu. |
| 245 |
.TP |
| 246 |
\fB\-m\fR, \fB\-\-monitor\fR |
| 247 |
Start monitoring CEC traffic. This will monitor broadcast messages, |
| 248 |
messages directed to this CEC adapter and messages transmitted by this |
| 249 |
CEC adapter. Directed messages between other CEC devices are not |
| 250 |
monitored. This option requires root. |
| 251 |
.TP |
| 252 |
\fB\-M\fR, \fB\-\-monitor\-all\fR |
| 253 |
Start monitoring all CEC traffic. This will monitor all CEC messages, |
| 254 |
including directed messages between other CEC devices. This option requires root. |
| 255 |
Not all CEC devices support this monitoring mode. It will fallback to regular |
| 256 |
monitoring mode if it is not supported. |
| 257 |
.TP |
| 258 |
\fB\-\-monitor\-pin\fR |
| 259 |
Start monitoring and analyzing the low-level CEC pin transitions. This is only |
| 260 |
possible if the device has the CEC_CAP_MONITOR_PIN capability. This option requires root. |
| 261 |
When in pin monitoring mode all 0->1 and 1->0 CEC pin transitions are monitored and |
| 262 |
analysed. This is effectively a cheap CEC bus analyzer. |
| 263 |
.TP |
| 264 |
\fB\-\-monitor\-time\fR \fI<secs>\fR |
| 265 |
Monitor for the given number of seconds, then exit. The default (0) is to monitor |
| 266 |
forever. |
| 267 |
.TP |
| 268 |
\fB\-\-ignore\fR \fI<la>\fR,\fI<opcode>\fR |
| 269 |
Ignore messages from logical address <la> and opcode <opcode> when monitoring. |
| 270 |
"all" can be used for <la> or <opcode> to match all logical addresses or opcodes. |
| 271 |
To ignore poll messages use "poll" as <opcode>. |
| 272 |
.TP |
| 273 |
\fB\-\-store\-pin\fR \fI<to>\fR |
| 274 |
Store the CEC pin events to the given file. This can be read and analyzed later |
| 275 |
via the \fB\-\-analyze\-pin\fR option. Use \- to write to stdout instead of to a file. |
| 276 |
.TP |
| 277 |
\fB\-\-analyze\-pin\fR \fI<from>\fR |
| 278 |
Read and analyze the CEC pin events from the given file. Use \- to read from stdin |
| 279 |
instead of from a file. |
| 280 |
.TP |
| 281 |
\fB\-\-test\-reliability\fR \fI<secs>\fR |
| 282 |
This option tests the CEC reliability by transmitting <Give Physical Addr> up to |
| 283 |
\fI<secs>\fR seconds (or forever if \fI<secs>\fR is 0) and check if the reply is |
| 284 |
always the same. Since the reply is a broadcast message, it is in practice never |
| 285 |
Nacked and so any bit errors due to poor CEC signal quality will clearly show up. |
| 286 |
The message will be sent to the logical address specified by \fB\-\-to\fR. |
| 287 |
.TP |
| 288 |
\fB\-\-test\-standby\-wakeup\-cycle\fR [\fIpolls\fR=\fI<n>\fR][,\fIsleep\fR=\fI<secs>\fR][,\fIhpd\-may\-be\-low\fR=\fI<0/1>\fR] |
| 289 |
This option tests the standby-wakeup cycle behavior of the display. It polls up to |
| 290 |
\fI<n>\fR times (default 15), waiting for a state change. If that fails then it |
| 291 |
waits \fI<secs>\fR seconds (default 10) before retrying this. |
| 292 |
If \fI<hpd\-may\-be\-low>\fR is 1, then the HPD is allowed to be low when in standby. |
| 293 |
.TP |
| 294 |
\fB\-\-stress\-test\-standby\-wakeup\-cycle\fR \fIcnt\fR=\fI<count>\fR[,\fIpolls\fR=\fI<n>\fR][,\fImax-sleep\fR=\fI<maxsecs>\fR][,\fImin-sleep\fR=\fI<minsecs>\fR][,\fIseed\fR=\fI<seed>\fR][,\fIrepeats\fR=\fI<reps>\fR][,\fIsleep-before-on\fR=\fI<secs1>\fR][,\fIsleep-before-off\fR=\fI<secs2>\fR][,\fIhpd\-may\-be\-low\fR=\fI<0/1>\fR] |
| 295 |
This option performs a stress test for a display: it cycles the display \fI<count>\fR |
| 296 |
times in and out of standby using the CEC Standby and Image View On commands. |
| 297 |
If \fI<count>\fR is 0, then never stop. |
| 298 |
It polls up to \fI<n>\fR times (default 30), waiting for a state change. |
| 299 |
If \fI<maxsecs>\fR is non-zero (0 is the default), then sleep for a random number of seconds |
| 300 |
between \fI<minsecs>\fR (0 is the default) and \fI<maxsecs>\fR before each <Standby> or |
| 301 |
<Image View On> message. |
| 302 |
If \fI<seed>\fR is specified, then set the randomizer seed to that value instead of |
| 303 |
using the current time as seed. |
| 304 |
If \fI<reps>\fR is specified, then repeat the <Image View On> and <Standby> up to |
| 305 |
\fI<reps>\fR times. Note that this test should work without any repeats. If a |
| 306 |
non-zero \fI<reps>\fR value is needed in order to pass this test, then that indicates |
| 307 |
a problem. |
| 308 |
If \fI<secs1>\fR is specified, then sleep for <secs1> seconds before transmitting <Image View On>. |
| 309 |
If \fI<secs2>\fR is specified, then sleep for <secs2> seconds before transmitting <Standby>. |
| 310 |
If \fI<hpd\-may\-be\-low>\fR is 1, then the HPD is allowed to be low when in standby. |
| 311 |
.TP |
| 312 |
\fB\-\-stress\-test\-random\-standby\-wakeup\-cycle\fR \fIcnt\fR=\fI<count>\fR[,\fImax-sleep\fR=\fI<maxsecs>\fR][,\fImin-sleep\fR=\fI<minsecs>\fR][,\fIseed\fR=\fI<seed>\fR][,\fIhpd\-may\-be\-low\fR=\fI<0/1>\fR] |
| 313 |
This option performs a stress test for a display: it cycles the display \fI<count>\fR |
| 314 |
times in and out of standby using the CEC Standby and Image View On commands. |
| 315 |
After each command wait between \fI<minsecs>\fR (default is 0) and \fI<maxsecs>\fR (default is 10) |
| 316 |
seconds. |
| 317 |
This test does not check if the display reached the new state, |
| 318 |
this test is meant to check if the display can handle state change commands |
| 319 |
while still transitioning to a new state. After every 10 cycles it attempts to properly |
| 320 |
wake up the display and check if that works. If not, this test fails. |
| 321 |
If \fI<count>\fR is 0, then never stop. |
| 322 |
If \fI<seed>\fR is specified, then set the randomizer seed to that value instead of |
| 323 |
using the current time as seed. |
| 324 |
If \fI<hpd\-may\-be\-low>\fR is 1, then the HPD is allowed to be low when in standby. |
| 325 |
.TP |
| 326 |
\fB\-\-help\-all\fR |
| 327 |
Prints the help message for all options. |
| 328 |
.TP |
| 329 |
\fB\-\-help\-audio\-rate\-control\fR |
| 330 |
Show help for the Audio Rate Control feature. |
| 331 |
.TP |
| 332 |
\fB\-\-help\-audio\-return\-channel\-control\fR |
| 333 |
Show help for the Audio Return Channel Control feature. |
| 334 |
.TP |
| 335 |
\fB\-\-help\-capability\-discovery\-and\-control\fR |
| 336 |
Show help for the Capability Discovery and Control feature. |
| 337 |
.TP |
| 338 |
\fB\-\-help\-deck\-control\fR |
| 339 |
Show help for the Deck Control feature. |
| 340 |
.TP |
| 341 |
\fB\-\-help\-device\-menu\-control\fR |
| 342 |
Show help for the Device Menu Control feature. |
| 343 |
.TP |
| 344 |
\fB\-\-help\-device\-osd\-transfer\fR |
| 345 |
Show help for the Device OSD Transfer feature. |
| 346 |
.TP |
| 347 |
\fB\-\-help\-dynamic\-audio\-lipsync\fR |
| 348 |
Show help for the Dynamic Audio Lipsync feature. |
| 349 |
.TP |
| 350 |
\fB\-\-help\-htng\fR |
| 351 |
Show help for the Hospitality Profile Next Generation feature. |
| 352 |
This is an optional CEC extension for Hotel displays and is not |
| 353 |
generally available for regular displays. See http://www.htng.org |
| 354 |
for more information. |
| 355 |
.TP |
| 356 |
\fB\-\-help\-osd\-display\fR |
| 357 |
Show help for the OSD Display feature. |
| 358 |
.TP |
| 359 |
\fB\-\-help\-one\-touch\-play\fR |
| 360 |
Show help for the One Touch Play feature. |
| 361 |
.TP |
| 362 |
\fB\-\-help\-one\-touch\-record\fR |
| 363 |
Show help for the One Touch Record feature. |
| 364 |
.TP |
| 365 |
\fB\-\-help\-power\-status\fR |
| 366 |
Show help for the Power Status feature. |
| 367 |
.TP |
| 368 |
\fB\-\-help\-remote\-control\-passthrough\fR |
| 369 |
Show help for the Remote Control Passthrough feature. |
| 370 |
.TP |
| 371 |
\fB\-\-help\-routing\-control\fR |
| 372 |
Show help for the Routing Control feature. |
| 373 |
.TP |
| 374 |
\fB\-\-help\-standby\fR |
| 375 |
Show help for the Standby feature. |
| 376 |
.TP |
| 377 |
\fB\-\-help\-system\-audio\-control\fR |
| 378 |
Show help for the System Audio Control feature. |
| 379 |
.TP |
| 380 |
\fB\-\-help\-system\-information\fR |
| 381 |
Show help for the System Information feature. |
| 382 |
.TP |
| 383 |
\fB\-\-help\-timer\-programming\fR |
| 384 |
Show help for the Timer Programming feature. |
| 385 |
.TP |
| 386 |
\fB\-\-help\-tuner\-control\fR |
| 387 |
Show help for the Tuner Control feature. |
| 388 |
.TP |
| 389 |
\fB\-\-help\-vendor\-specific\-commands\fR |
| 390 |
Show help for the Vendor Specific Commands feature. |
| 391 |
.SH EXIT STATUS |
| 392 |
On success, it returns 0. Otherwise, it will return the error code. |
| 393 |
.SH BUGS |
| 394 |
This manual page is a work in progress. |
| 395 |
|
| 396 |
Bug reports or questions about this utility should be sent to the [email protected] |
| 397 |
mailinglist. |