Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents

Feature Summary

The HDMI_CEC API defines the ability to get connected HDMI devices, send messages to those devices, and to be notified when messages are received from HDMI devices.

HDMI-CEC is a protocol that provides high-level control functions between audio-visual devices connected over HDMI. CEC is a one-wire bidirectional serial bus based on industry-standard AV.Link protocol to perform control functions. All audio-visual sources are connected directly or indirectly to a display device as the ‘root’ in a tree-like structure.

...

  • Hardware support for HDMI-CEC as specified in HDMI 1.4a

    • CEC 4 – Electrical Specification
    • CEC 5 – Signaling and Bit Timings
    • CEC 6 – Frame Description
    • CEC 7 – Reliable Communication Mechanisms
    • CEC 8 – Protocol Extensions
    • CEC 9 – CEC Arbitration
    • CEC 10.1 – Physical Address Discovery
    • CEC 11 – Switch Requirements

...

This feature applies to the following devices:

  • Hybrid
  • IP

Architecture Overview

...

draw.io Diagram
diagramNameArchitecture overview.drawio
revision1

HDMI-CEC Profiles supported in RDK

Profiles

Capabilities

Capabilities

Description

Discovery

Discover HDMI devices that support CEC and provide settop information to those devices

Power

Synchronize settop power state with HDMI device power state

Switching

Switch settop HDMI inputs to settop HDMI outputs

Channel Change

Change channel on settop from HDMI device

Audio

Control audio mute/volume on HDMI device from settop and vice versa

User Input

Accept user input commands from HDMI device

Component Impacts

CEC Protocol Library

  • Translate application commands to CEC commands
  • Receive CEC commands and provide to application listeners
  • Autonomously respond to a subset of CEC messages

HDMI-CEC HAL

  • Abstract Abstracts SoC HDMI-CEC driver from higher level components that means it will abstract SoC CEC library from CEC Protocol Library
  • it allow transmits/receives HDMI-CEC messages

SoC CEC Driver

  • Serialize and send CEC commands
  • Receive CEC commands and provide to CEC Protocol Library
  • Send EDID to HDMI source

  • Provide HDMI input connect notification

Service Manager

  • Provide HDMI input connect notification via State Observer API.

  • Select select video source

Device Settings HAL

Device Settings APIs that SoC vendors implement.  It provides primitive and hardware specific implementation for each controllable aspect of the SoC.  This level API is considered single-app mode only, even though its SoC implementation may potentially support multiple-app mode.

  • Initialize and terminate device inputs and outputs.
  • Determine device settings capabilities (e.g. supported video resolutions, audio modes, etc).
  • Modify device settings (e.g. audio encoding).
  • Modify front panel LEDs.
  • Provide HDMI event notification

  • Read/Modify/Write EDID

  • Add dsRegisterHdmiListener

  • Add dsSelectVideoSource

  • Add dsScaleVideoSource

SoC Video Pipeline

  • Source video from HDMI input

How HDMI-CEC Works in RDK

draw.io Diagram
diagramNameHDMI.drawio
revision1
Image Removed

Application API Specification

...

  • The Library APIs allows application to contrl how the CEC stack operates, such as adding logical address to the stack.

draw.io Diagram
diagramNameComponents of CEC Library.drawio
revision1
Image Removed

The Host interface allows libCEC implementation to interact with the host environment. Such interaction includes monitoring of the Power State change, the HDMI HotPlug events, or API to change the Host State. The Host Interface is delivered as a run-time plugin to the libCEC stack. This allows the CEC stack to run in any devices that implements the Host Interface.

...

The relation between Application, Connection and CEC-Bus is described in the figure.

draw.io Diagram
diagramNameApplication-1.drawio
revision1
Image Removed

CEC Daemon

  • This daemon receives Raw Bytes from the SoC Driver and dispatches them into IARM Bus via CecIARMMgr, it also receives Raw Bytes from IARM Bus and send to the SoC Driver. It controls the only access point to the physical HDMI CEC Bus.

...

In essence, there is only one physical CEC bus on a system. However, with the help of Connection, Logical CEC-Bus, and IARM-Bus, the CEC library can converge the CEC traffic from different Connections and Logical Buses before forwarding them to the single physical bus. This is illustrated by the diagram below.

draw.io Diagram
diagramNamemulti-Application.drawio
revision1
Image Removed

In this diagram there are two applications (Receiver and CECDevMgr). Since both applications can only access the underlying physical CEC Bus via Connection API, they have no knowledge how the message are eventually delivered to the Physical Bus.

...

The message flow on Connections and Logical Buses are full duplex.

Methods & Events

Following methods are used for DMI CEC module.

NameParametersDescription
setEnabledenabled : booleanEnables or disables CEC
getEnablednoneReturns true if CEC is enabled
setNamename : stringSets the name of the STB device.  The default name is "STB".  It is recommended that the name of the device is set prior to enabling CEC.
getNamenoneReturns the name of the STB device
sendMessage

message : String

The message is a base64 encoded byte array of the raw CEC bytes.  The CEC message includes the device ID for the intended destination.

getCECAddressesnone

return the JSON object <CECAddresses> that is assigned to the local device. It does not contain the <CECAddresses> of other devices on the connected CEC network.

"CECAddresses" : {
"physicalAddress": Array of 4 bytes [byte0, byte1, byte2, byte3],
"logicalAddresses" : Array of <CECLogicalAddress>
}
"CECLogicalAddress" : {
"deviceType" : <string>
"logicalAddress": <integer>
}

The deviceType returned is part or all of devices types optionally set by XRE.

A CEC device can have multiple deviceTypes, if so an array of <CECLogicalAddress> with size more than one is returned.

Default deviceType is Tuner, and its logical Address is either 3, 6, 7, or 10.

In messages sent by XRE, XRE can only use the logicalAddress returned from CECAddresses.

Accepted deviceType are: "Tuner", "Record", "Playback", "AudioSystem", "VideoProcessor", "Switch"

Events notification:

Name

Content

Description

onMessage

message : String

Fired when a message is sent from an HDMI device.  Message is a base64 encoded byte array of the raw CEC bytes.

cecAddressesChangedJSON object <CECAddresses>Notify that address of the host CEC device has changed


API Documentation 

 To know more about SoC/Application level APIs details use in RDK, refer the link  RDK HDMI-CEC API Documentation