Difference between revisions of "Protocol decoder:Cec"

From sigrok
Jump to navigation Jump to search
(Created page with "{{Infobox protocol decoder | id = cec | name = cec | description = HDMI Consumer Electronics Control (CEC) protocol. | status = supported...")
 
 
(6 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{Infobox protocol decoder
{{Infobox protocol decoder
| id              = cec
| id              = cec
| name            = cec
| name            = HDMI-CEC
| description    = HDMI Consumer Electronics Control (CEC) protocol.
| description    = HDMI Consumer Electronics Control (CEC) protocol.
| status          = supported
| status          = supported
| license        = GPLv2+
| license        = GPLv2+
| source_code_dir = cec
| source_code_dir = cec
| image          = [[File:|250px]]
| image          = [[File:HDMI Connector Pinout.svg|250px]]
| input          = logic
| input          = logic
| output          = cec
| output          = —
| probes          = cec
| probes          = cec
| optional_probes = —
| options        = —
}}
}}


The '''cec''' protocol decoder decodes the [https://en.wikipedia.org/wiki/Consumer_Electronics_Control Consumer Electronics Control (CEC)] protocol, a feature of HDMI designed to allow users to command and control devices connected through HDMI.


== HDMI CEC protocol decoder ==
== Hardware ==


Sigrok protocol decoder for HDMI CEC (Consumer Electronics Control)
CEC Bus can be found in pin 13 of the [https://en.wikipedia.org/wiki/HDMI HDMI connector]:


Consumer Electronics Control (CEC) is a feature of HDMI designed to allow users to command and control devices connected through HDMI
[[File:HDMI Connector Pinout.svg]]


CEC Bus can be found in PIN 13 of the HDMI connector:
== Protocol ==
 
It is a one-wire, bidirectional, serial bus that is based on the [https://en.wikipedia.org/wiki/European_Committee_for_Electrotechnical_Standardization CENELEC] standard AV.link protocol to perform remote control functions.
 
CEC is a separate electrical signal from the other HDMI signals. This allows a device to disable its high-speed HDMI circuitry in sleep mode, but be woken up by CEC. It is a single shared bus, which is directly connected between all HDMI ports on a device, so it can flow through a device which is completely powered off (not just asleep).
 
The bus is electrically identical to the AV.link protocol, but CEC adds a detailed higher-level message protocol.
 
The bus is an open-collector line, somewhat like I²C, passively pulled up to +3.3 V, and driven low to transmit a bit.
 
== PulseView screenshots ==
 
<gallery widths=800px>
File:Cec_pulseview_ping_frames.png|<small>Ping (poll) frames</small>
File:cec_pulseview_vendor_command_frame.png|<small>Vendor command frame</small>
</gallery>
 
== Usage examples ==
 
'''Print all annotations (very verbose):'''
 
<small>
  $ '''sigrok-cli -i data.sr -P cec:CEC=CEC'''
  cec-1: ST
  cec-1: 0
  cec-1: 0
  cec-1: 1
  cec-1: 1
  cec-1: 0
  cec-1: 0
  cec-1: 0
  cec-1: 0
  cec-1: 0x30
  cec-1: EOM=N
  cec-1: ACK
  cec-1: 0
  cec-1: 0
  cec-1: 0
  cec-1: 0
  cec-1: 0
  cec-1: 1
  cec-1: 0
  cec-1: 0
  cec-1: 0x04
  cec-1: EOM=Y
  cec-1: ACK
  cec-1: 30:04
  cec-1: HDR: Tuner_1, TV | OPC: IMAGE_VIEW_ON | R: ACK
</small>
 
'''Print frames only:'''
 
<small>
  $ '''sigrok-cli -i data.sr -P cec:CEC=CEC -A cec=frames'''
  cec-1: 30:04
  cec-1: 35
  cec-1: 35
  cec-1: 3f:82:10:00
  cec-1: 30:8f
  cec-1: 03:90:01
  cec-1: 30:44:6d
  cec-1: 35
  cec-1: 35
  cec-1: 30:04
  cec-1: 35
  cec-1: 35
  cec-1: 30:0d
  cec-1: 35
  cec-1: 35
  cec-1: 35
  cec-1: 35
  cec-1: 30:04
  cec-1: 35
  cec-1: 35
  cec-1: 30:8f
  cec-1: 03:90:01
  cec-1: 35
  cec-1: 35
  cec-1: 35
  cec-1: 35
  cec-1: 35
  cec-1: 35
  cec-1: 30:04
</small>
 
'''Print sections only:'''
 
<small>
  $ '''sigrok-cli -i data.sr -P cec:CEC=CEC -A cec=sections'''
  cec-1: HDR: Tuner_1, TV | OPC: IMAGE_VIEW_ON | R: ACK
  cec-1: HDR: Tuner_1, AudioSystem | OPC: PING | R: NACK
  cec-1: HDR: Tuner_1, AudioSystem | OPC: PING | R: NACK
  cec-1: HDR: Tuner_1, Broadcast | OPC: ACTIVE_SOURCE | OPS: 0x10, 0x00 | R: ACK
  cec-1: HDR: Tuner_1, TV | OPC: GIVE_DEVICE_POWER_STATUS | R: ACK
  cec-1: HDR: TV, Tuner_1 | OPC: REPORT_POWER_STATUS | OPS: 0x01 | R: ACK
  cec-1: HDR: Tuner_1, TV | OPC: USER_CONTROL_PRESSED | OPS: 0x6d | R: ACK
  cec-1: HDR: Tuner_1, AudioSystem | OPC: PING | R: NACK
  cec-1: HDR: Tuner_1, AudioSystem | OPC: PING | R: NACK
  cec-1: HDR: Tuner_1, TV | OPC: IMAGE_VIEW_ON | R: ACK
  cec-1: HDR: Tuner_1, AudioSystem | OPC: PING | R: NACK
  cec-1: HDR: Tuner_1, AudioSystem | OPC: PING | R: NACK
  cec-1: HDR: Tuner_1, TV | OPC: TEXT_VIEW_ON | R: ACK
  cec-1: HDR: Tuner_1, AudioSystem | OPC: PING | R: NACK
  cec-1: HDR: Tuner_1, AudioSystem | OPC: PING | R: NACK
  cec-1: HDR: Tuner_1, AudioSystem | OPC: PING | R: NACK
  cec-1: HDR: Tuner_1, AudioSystem | OPC: PING | R: NACK
  cec-1: HDR: Tuner_1, TV | OPC: IMAGE_VIEW_ON | R: ACK
  cec-1: HDR: Tuner_1, AudioSystem | OPC: PING | R: NACK
  cec-1: HDR: Tuner_1, AudioSystem | OPC: PING | R: NACK
  cec-1: HDR: Tuner_1, TV | OPC: GIVE_DEVICE_POWER_STATUS | R: ACK
  cec-1: HDR: TV, Tuner_1 | OPC: REPORT_POWER_STATUS | OPS: 0x01 | R: ACK
  cec-1: HDR: Tuner_1, AudioSystem | OPC: PING | R: NACK
  cec-1: HDR: Tuner_1, AudioSystem | OPC: PING | R: NACK
  cec-1: HDR: Tuner_1, AudioSystem | OPC: PING | R: NACK
  cec-1: HDR: Tuner_1, AudioSystem | OPC: PING | R: NACK
  cec-1: HDR: Tuner_1, AudioSystem | OPC: PING | R: NACK
  cec-1: HDR: Tuner_1, AudioSystem | OPC: PING | R: NACK
  cec-1: HDR: Tuner_1, TV | OPC: IMAGE_VIEW_ON | R: ACK
  cec-1: HDR: Tuner_1, AudioSystem | OPC: PING | R: NACK
  cec-1: HDR: Tuner_1, AudioSystem | OPC: PING | R: NACK
  cec-1: HDR: Tuner_1, TV | OPC: GIVE_DEVICE_POWER_STATUS | R: ACK
  cec-1: HDR: TV, Tuner_1 | OPC: REPORT_POWER_STATUS | OPS: 0x01 | R: ACK
</small>
 
== Current status ==
 
The CEC protocol decoder is capable of the following:
 
* Decoding all low level parts: START, BITs, EOM, ACK / NACK
* Resolve names of all logical addresses
* Resolve names of all opcodes
* Detect (and warn) timing errors
* Detect (and warn) misplaced bits, etc.
 
Not implemented:
 
* Operands of the opcodes are not parsed, only printed.
 
[[Category:Protocol decoder]]

Latest revision as of 22:10, 5 November 2019

cec
HDMI Connector Pinout.svg
Name HDMI-CEC
Description HDMI Consumer Electronics Control (CEC) protocol.
Status supported
License GPLv2+
Source code decoders/cec
Input logic
Output
Probes cec
Optional probes
Options

The cec protocol decoder decodes the Consumer Electronics Control (CEC) protocol, a feature of HDMI designed to allow users to command and control devices connected through HDMI.

Hardware

CEC Bus can be found in pin 13 of the HDMI connector:

HDMI Connector Pinout.svg

Protocol

It is a one-wire, bidirectional, serial bus that is based on the CENELEC standard AV.link protocol to perform remote control functions.

CEC is a separate electrical signal from the other HDMI signals. This allows a device to disable its high-speed HDMI circuitry in sleep mode, but be woken up by CEC. It is a single shared bus, which is directly connected between all HDMI ports on a device, so it can flow through a device which is completely powered off (not just asleep).

The bus is electrically identical to the AV.link protocol, but CEC adds a detailed higher-level message protocol.

The bus is an open-collector line, somewhat like I²C, passively pulled up to +3.3 V, and driven low to transmit a bit.

PulseView screenshots

Usage examples

Print all annotations (very verbose):

 $ sigrok-cli -i data.sr -P cec:CEC=CEC
 cec-1: ST
 cec-1: 0
 cec-1: 0
 cec-1: 1
 cec-1: 1
 cec-1: 0
 cec-1: 0
 cec-1: 0
 cec-1: 0
 cec-1: 0x30
 cec-1: EOM=N
 cec-1: ACK
 cec-1: 0
 cec-1: 0
 cec-1: 0
 cec-1: 0
 cec-1: 0
 cec-1: 1
 cec-1: 0
 cec-1: 0
 cec-1: 0x04
 cec-1: EOM=Y
 cec-1: ACK
 cec-1: 30:04
 cec-1: HDR: Tuner_1, TV | OPC: IMAGE_VIEW_ON | R: ACK

Print frames only:

 $ sigrok-cli -i data.sr -P cec:CEC=CEC -A cec=frames
 cec-1: 30:04
 cec-1: 35
 cec-1: 35
 cec-1: 3f:82:10:00
 cec-1: 30:8f
 cec-1: 03:90:01
 cec-1: 30:44:6d
 cec-1: 35
 cec-1: 35
 cec-1: 30:04
 cec-1: 35
 cec-1: 35
 cec-1: 30:0d
 cec-1: 35
 cec-1: 35
 cec-1: 35
 cec-1: 35
 cec-1: 30:04
 cec-1: 35
 cec-1: 35
 cec-1: 30:8f
 cec-1: 03:90:01
 cec-1: 35
 cec-1: 35
 cec-1: 35
 cec-1: 35
 cec-1: 35
 cec-1: 35
 cec-1: 30:04

Print sections only:

 $ sigrok-cli -i data.sr -P cec:CEC=CEC -A cec=sections
 cec-1: HDR: Tuner_1, TV | OPC: IMAGE_VIEW_ON | R: ACK
 cec-1: HDR: Tuner_1, AudioSystem | OPC: PING | R: NACK
 cec-1: HDR: Tuner_1, AudioSystem | OPC: PING | R: NACK
 cec-1: HDR: Tuner_1, Broadcast | OPC: ACTIVE_SOURCE | OPS: 0x10, 0x00 | R: ACK
 cec-1: HDR: Tuner_1, TV | OPC: GIVE_DEVICE_POWER_STATUS | R: ACK
 cec-1: HDR: TV, Tuner_1 | OPC: REPORT_POWER_STATUS | OPS: 0x01 | R: ACK
 cec-1: HDR: Tuner_1, TV | OPC: USER_CONTROL_PRESSED | OPS: 0x6d | R: ACK
 cec-1: HDR: Tuner_1, AudioSystem | OPC: PING | R: NACK
 cec-1: HDR: Tuner_1, AudioSystem | OPC: PING | R: NACK
 cec-1: HDR: Tuner_1, TV | OPC: IMAGE_VIEW_ON | R: ACK
 cec-1: HDR: Tuner_1, AudioSystem | OPC: PING | R: NACK
 cec-1: HDR: Tuner_1, AudioSystem | OPC: PING | R: NACK
 cec-1: HDR: Tuner_1, TV | OPC: TEXT_VIEW_ON | R: ACK
 cec-1: HDR: Tuner_1, AudioSystem | OPC: PING | R: NACK
 cec-1: HDR: Tuner_1, AudioSystem | OPC: PING | R: NACK
 cec-1: HDR: Tuner_1, AudioSystem | OPC: PING | R: NACK
 cec-1: HDR: Tuner_1, AudioSystem | OPC: PING | R: NACK
 cec-1: HDR: Tuner_1, TV | OPC: IMAGE_VIEW_ON | R: ACK
 cec-1: HDR: Tuner_1, AudioSystem | OPC: PING | R: NACK
 cec-1: HDR: Tuner_1, AudioSystem | OPC: PING | R: NACK
 cec-1: HDR: Tuner_1, TV | OPC: GIVE_DEVICE_POWER_STATUS | R: ACK
 cec-1: HDR: TV, Tuner_1 | OPC: REPORT_POWER_STATUS | OPS: 0x01 | R: ACK
 cec-1: HDR: Tuner_1, AudioSystem | OPC: PING | R: NACK
 cec-1: HDR: Tuner_1, AudioSystem | OPC: PING | R: NACK
 cec-1: HDR: Tuner_1, AudioSystem | OPC: PING | R: NACK
 cec-1: HDR: Tuner_1, AudioSystem | OPC: PING | R: NACK
 cec-1: HDR: Tuner_1, AudioSystem | OPC: PING | R: NACK
 cec-1: HDR: Tuner_1, AudioSystem | OPC: PING | R: NACK
 cec-1: HDR: Tuner_1, TV | OPC: IMAGE_VIEW_ON | R: ACK
 cec-1: HDR: Tuner_1, AudioSystem | OPC: PING | R: NACK
 cec-1: HDR: Tuner_1, AudioSystem | OPC: PING | R: NACK
 cec-1: HDR: Tuner_1, TV | OPC: GIVE_DEVICE_POWER_STATUS | R: ACK
 cec-1: HDR: TV, Tuner_1 | OPC: REPORT_POWER_STATUS | OPS: 0x01 | R: ACK

Current status

The CEC protocol decoder is capable of the following:

  • Decoding all low level parts: START, BITs, EOM, ACK / NACK
  • Resolve names of all logical addresses
  • Resolve names of all opcodes
  • Detect (and warn) timing errors
  • Detect (and warn) misplaced bits, etc.

Not implemented:

  • Operands of the opcodes are not parsed, only printed.