What Is Consumer Electronics Control (CEC)? Consumer Electronics Control (CEC) is an HDMI® function that allows the command and control of devices (cable box, Blu-ray Disc™ player, etc.) connected to your audio system and TV. An HDMI cable must be used for CEC function to work. What Is HDCP Lockup? Front, rear and side mount cameras, extend your view eliminating blind spots and reducing risk. Quality engineering and materials is vital in cameras, as exposure to weather, dust and other road debris can cause fogging and water to seep inside, ruining the camera view.
There is a certain warmth that seems to emanate from stereo receivers of the 70s, 80s, and 90s. Despite their large footprint and considerable heft, the soft glow of the indicator lights and solid kerthunk of switches provide a sense of coziness. When [Tom] recently swapped his receiver for a 1970s Pioneer SX-950, he found himself getting up from the couch to adjust the volume when watching TV far too often for his liking. Resolving to do something about it, he added some magic in the form of a motorized volume knob. One of the coolest tricks for stereos was to have a small motor attached to the volume knob so that it could turn the volume up or down via a remote.
The first obstacle came when [Tom] had to forgo the center tap on the potentiometer to get a motorized one. This meant the volume compensation feature would be disabled, which is but a small price to pay for convenience. After scouring the internet, he finally had the part in hand only to discover some troublesome capacitors in the way. The new pot had a rather large motor hanging off the back that the previous one didn’t have. Fortunately, there was a good bit of space between the PCB and the bottom of the chassis, so Tom was able to just flip the capacitors to the underside of the board and bend them on their sides.
The next problem to solve was how to change the volume remotely. IR was considered as well as optical cable control signals. What [Tom] did instead was to implement HDMI CEC (consumer electronics control). CEC was well documented and seemed simple to implement on an ATTINY4313 with the help of a half-H driver. The CEC protocol implemented by [Tom’s] TV seemed to be very sensitive to timing, so an external crystal was used to get more precise timing and additional handshaking was implemented to get the TV to accept the microcontroller as valid. A few fail-safes were added to make sure the motor didn’t burn out if something went wrong with the CEC protocol and a nice enclosure wrapped up the build quite nicely.
We’ve seen CEC implemented before on a PIC 18F87J50, but as a sender of CEC commands not a receiver. [Tom’s] code is available on GitHub and might prove useful if you’re looking to implement CEC on an AVR.
Thanks [Tom] for sending this one in!
The Raspberry Pi (Broadcom BCM2835 SoC) hardware has integrated support for CEC (Consumer Electronics Control) over the HDMI port.
CEC (Consumer Electronics Control) is the control protocol found in HDMI. Trade names for CEC are Anynet+ (Samsung); Aquos Link (Sharp); BRAVIA Link and BRAVIA Sync (Sony); HDMI-CEC (Hitachi); E-link (AOC); Kuro Link (Pioneer); CE-Link and Regza Link (Toshiba); RIHD (Remote Interactive over HDMI) (Onkyo); RuncoLink (Runco International); SimpLink (LG); HDAVI Control, EZ-Sync, VIERA Link (Panasonic); EasyLink (Philips); and NetCommand for HDMI (Mitsubishi).
Media center systems XBMC and MythTV already support HDMI-CEC via libCEC;libCEC gained support for the Raspberry Pi in version 1.8.0, allowing you to control them via your television remote control without having a dedicated HTPC / MCE remote for your Raspberry Pi.
Once you have connected your Raspberry Pi to your TV and receiver with HDMI you should be able automatically to turn on and off your TV, receivers, and other home theater equipment, control your amplifier's volume, manage your DVD or Blu-Ray player, and redirect the active source on your TV to other equipment, all from one remote control. No line of sight is required and cables can be hidden neatly out of sight!
- 1What is HDMI CEC?
What is HDMI CEC?
Consumer Electronics Control (CEC) is an HDMI feature designed to allow the user to command and control up to ten CEC-enabled devices connected through HDMI by using just one of their remote controls (for example by controlling a television set, set-top box, PVR/DVR, and DVD player using only the remote control of the TV). CEC also allows for individual CEC-enabled devices to command and control each other without user intervention.
Cc Cameras Connection
HDMI-CEC is a one-wire bidirectional serial bus that uses the industry-standard AV.link protocol to perform remote control functions. CEC wiring is mandatory, although implementation of CEC in a product is optional. It was defined in HDMI Specification 1.0 and updated in HDMI 1.2, HDMI 1.2a and HDMI 1.3a (the last added timer and audio commands to the bus). USB to CEC Adapters exist that allow a computer to control CEC-enabled devices.
Some of the available HDMI-CEC commands
- One Touch Play: the device will become active source when playback starts
- System Standby: switches all connected devices to standby
- Preset Transfer: transfers the tuner channel setup to another TV set
- One Touch Record: start recording immediately
- Timer Programming: allow one device (e.g. a TV set or HTPC) to set the timer programming of another (e.g. a PVR/DVR or DVD-recorder)
- System Information: checks all components for bus addresses and configuration
- Deck Control: playback control
- Tuner Control: control the tuner of another device
- OSD Display: use the OSD of the TV set to display text
- Device Menu Control: use the menus of another device
- Routing Control: control the switching of signal sources
- Remote Control Pass Through: pass through remote control commands
- Device OSD Name Transfer: transfer the preferred device names to the TV set
CEC stands for Consumer Electronics Control. It is implemented as a single wire bus in the HDMI connector (pin 13). It allows various HDMI-enabled products to connect and communicate with each other. It allows various HDMI-enabled products to connect and communicate with each other. The intent is to enable one remote control to interface with all the A/V components. Various message opcodes can be exchanged between the connected systems in order to do device specific actions (like recording on a STB/DVR) or get general information across (like transferring remote control key press details).
In any HDMI setup, the display is considered to be the root, and gets allocated two special tags, a physical address of 0.0.0.0 and a logical address of 0. In any given system, all CEC enabled devices have both physical and logical addresses, while the non-CEC devices have only physical addresses. Physical addresses are taken up based on the position of the device with respect to the root. For example, if an A/V receiver's output is connected to HDMI1 of the TV, it gets the physical address 22.214.171.124. A device connected to the first HDMI input port of the A/V receiver would get the address 126.96.36.199, while one connected to the second HDMI port would get 188.8.131.52. Logical addresses are taken on by the devices depending on their functionality (as mandated by the CEC specifications document). When the HDMI device menu is brought up on the display (On a Sony KDL46EX720, this is achieved by pressing the Sync Menu button), the display sends a broadcast over the CEC wire to all the downstream devices. It then collects the responses arriving over the CEC wire and presents the user with a list of CEC enabled devices. Choosing one of them ensures that future remote key presses are transferred by the TV to that particular address.
If you are interested in learning about the bus protocol and a bit more in-depth overview, I suggest taking a look at QuantumData's excellent CEC whitepaper (PDF). For more details on the various messages which can be exchanged between the devices, the full CEC specifications from the official HDMI documentation may be perused (PDF).
CEC with XBMC Media Center software
CEC allows XBMC to turn your TV, receivers, and other attached equipment on and off (if they support HDMI CEC) adjust the volume or eject the disk from a drive. Start playback, etc. and much more.
Likewise these same devices can tell XBMC what to do, for example, your TV remote can also control XBMC, or vice versa. With this device you can move that step closer to a clutter free living space while maintaining simple remote control for friends and family who may not be familiar with all of the features of a professional remote control.
See CEC in action and read about what it can do with XBMC:
libCEC is an open-source dual licensed library originally designed for communicating with the Pulse-Eight USB - HDMI CEC Adaptor.
libCEC needs the following dependencies in order to work correctly:
- udev v151 or later
- cdc-acm support compiled into the kernel or available as module
- Windows, Mac OS X, and Linux support
- Turns on/off TV and receivers (e.g. when the screensaver becomes active, to save power)
- Switch the TV and receivers to the correct HDMI port when starting your media center software
- Send and receive key presses from your TV's remote
- Control the volume of a CEC capable A/V receiver from your media center software
- Sniff active traffic on CEC bus
- Interfaces for C, C++ and .NET/CLR
- No binary-only or obfuscated code; everything is open and can be modified
- Example implementations in C++ and C#
- And much more...
libCEC supported software
- XBMC v11.0 'Eden' or higher
- MythTV v0.25 or higher
Alternative open source libraries and code for CEC
Alternative, a cross-platform CEC library designed for Realtek SoC, a GPL v3 libraries exists for Arduino board (tmega series chip) and the TI msp430 chip the TI MSP430 chip, that could probably also be modified to work on the Broadcom BCM2835 SoC in the Raspberry Pi.
Realtek 1283 SoC ('MARS') platforms with CEC, a cross CEC library and a CEC daemon/service
Cdc Security Cameras
cec-arduino - Arduino library for communicating with HDMI CEC equipment
TI msp430 linux changes and CEC library repository
External links with more information for developers
- CEC-O-Matic website, helps developers in decoding and creating CEC frames for communication - For the general user, the cec-o-matic.com website also gives an idea as to what can be achieved in a home automation system using CEC with HDMI equipment