Understanding HDMI-CEC frame

What is HDMI CEC?

CEC (Consumer Electronics Control) is an HDMI 1.3a feature that allows you to command and control other CEC enabled devices that are connected through HDMI. CEC started appearing as early as 2006 and it is now widely adopted.  In theory, this seemed like a good idea, to be able to control multiple devices with one remote, but in practice, it can be difficult to work with. Why? Well, this is because most manufacturers of TVs have some variant of CEC.

With CEC and this setup, if you press play on your Blue-ray player the Blue-ray player will automatically be the active source and you just play your video on your TV.

Does My TV have HDMI CEC?

If it was created after 2006, then most likely it has this feature. By default, CEC is turned off and a manufacturer may refer to it by different names. Here is a list of what the manufacturers calls CEC:

  • 1-Touch Play (Roku)
  • Anynet+ (Samsung)
  • Aquos Link (Sharp)
  • BRAVIA Link, BRAVIA Sync, Control for HDMI (Sony)
  • CE-Link, Regza Link (Toshiba)
  • E-link (AOC)
  • EasyLink (Philips)
  • Fun-Link (Funai, Sylvania, Emerson, Magnavox, Philips)
  • HDMI-CEC (Hitachi)
  • INlink (Insignia)
  • Kuro Link (Pioneer)
  • NetCommand for HDMI, Realink for HDMI (Mitsubishi)
  • RIHD (Remote Interactive over HDMI) (Onkyo)
  • RuncoLink (Runco International)
  • SimpLink (LG)
  • T-Link (ITT, Thomson)
  • VIERA Link, HDAVI Control, EZ-Sync (Panasonic)
  • CEC (Vizio)


So to enable CEC on your Panasonic TV for example, you would need to look for VIERA Link, HDAVI Control, or EZ-Sync and enable it.

What types of devices can I control with CEC?

These are the 15 types of devices that is recognized with CEC:

  • 0 TV
  • 1 Recording Device 1
  • 2 Recording Device 2
  • 3 Tuner 1
  • 4 Playback Device 1
  • 5 Audio System
  • 6 Tuner 2
  • 7 Tuner 3
  • 8 Playback Device 2
  • 9 Recording Device 3
  • 10 Tuner 4
  • 11 Playback Device 3
  • 12 Reserved
  • 13 Reserved
  • 14 Free Use
  • 15 Unregistered (as initiator address) or Broadcast (as destination address)

How do I understand CEC Messages?

Use this website (http://www.cec-o-matic.com/) to help you understand what is going on. Let’s look at this CEC Message to see if we can understand it:

First, this is our setup:

A TV has a Chromecast connected to HDMI 1 on the TV, and a sound bar on HDMI 2. The soundbar has a Firestick, Tivo and Eddy Bridge. The number below each icon reflect the local address by the CEC i.e. (2.1.0.0 is Fire Stick).

Example #1: Let’s say we want to mute the soundbar, we have this HDMI-CEC frame:

45 : 44 : 43
  • First Byte: 45
    • Consists of the logical source (first character) and destination (second character) addresses of the messages
      • Source is 4, Playback Device 1, which is our Eddy Bridge
      • Destination is 5, Audio System, which is our soundbar
  • Second Byte: 44
    • This means that the user pressed a remote control
  • Third Byte: 43
    • This means they pressed the mute button on the remote control
    •  

So in summary, this is saying that Eddy Bridge (Raspberry Pi device) is asking the Audio System to mute.

Example #2: Let’s say we want to change the HDMI input on the TV to Chromecast, we have this HDMI-CEC frame:

4F : 82 : 10 : 00
  • First Byte: 4F
    • Source is 4, Playback Device 1, which is our Eddy Bridge
    • Destination is F, which is Broadcast  (no device)
  • Second Byte: 82
    • Request Active Source
  • Third Byte: 10 and Fourth Byte:00
    • This is our local address 1.0.0.0, which is the Chromecast – HDMI 1

So in summary, this is saying that Eddy Bridge (Raspberry Pi device) is requesting the Active Source be changed to 1.0.0.0 which is the HDMI port 1 on the TV, which is the chromecast

What commands can I do?

Your mileage will vary because each manufacture implements CEC slightly different. For the most part these commands will most like work all the time:

  • Turning on/off TV
  • Turning on/off your Audio or Soundbar
  • Changing inputs on TV
  • Changing inputs on Audio or Soundbar
  • Mute/unmute Audio or Soundbar
  • Increase/Decrease volume on Audio or Soundbar

In Eddy Voice Remote, the HDMI-CEC frame is auto populated when adding a CEC command.

How do I enable CEC on my device?

Some devices like soundbars have this enabled by default. Most devices have this turned off and you have to go through the menu and find your manufacturer’s version of CEC to enable it. So look for your manual to find out how to enable CEC.

Guide to sending HDMI CEC commands via Eddy Bridge

  1. Setup Eddy Bridge (Go here).
  2. Make sure you plugged in the HDMI cable to your Raspberry pi on boot-up
  3. Add a CEC button on the  buttons page.

What Tool can I use to send CEC Commands?

The most popular tool is the cec-client found here: https://github.com/Pulse-Eight/libcec

You would use this tool in a raspberry pi to send your CEC commands.

On a typical Raspberry Pi , you would install the package using the following command:

sudo apt install cec-utils

then to turn on the TV you would use the following command

echo ‘on 0’ | cec-client -s -d 1

So this is a special command to turn on your tv. In actuality it’s sending 4f:82:10:00 so alternatively, you could also use the following command to turn on your tv:

echo ‘tx 4f:82:00:00’ | cec-client -s -d 1

So there are other commands like standby to turn off your devices, but why us the tx method?  Well, sometimes the default commands doesn’t work on your devices, which is when and where you would have to use the cec website to get the correct command. Example: from our first example, you would mute the sound bar by using the following command:

echo ‘tx 45 : 44 : 43’ | cec-client -s -d 1

Comments are closed.