It allows rudimentary control over HDMI-CEC aware devices - these devices oftern have vendor-specific names for the protocol, such as AnyNet+ for Samsung devices.

It allows rudimentary control over HDMI-CEC aware devices - these devices oftern have vendor-specific names for the protocol, such as AnyNet+ for Samsung devices.

+

+

Therefore, it is possible to either control an HDMI-CEC-aware device (such as a TV) from another (like a computer), e.g. by having the computer turn the TV on, or vice versa, e.g. by using the TV remote to control MythTV on the computer.

+

+

== Background ==

HDMI-CEC devices have two key public properties - a logical address and a physical address.

HDMI-CEC devices have two key public properties - a logical address and a physical address.

Line 10:

Line 16:

If a device with other HDMI ports (referred to as a switch) is plugged in, any devices plugged into that will get a number in the the next "dot range".

If a device with other HDMI ports (referred to as a switch) is plugged in, any devices plugged into that will get a number in the the next "dot range".

−

So if an AV Receiver is plugged into port 1 of the tv, it would have physical address 1.0.0.0

+

So if an AV Receiver is plugged into port 1 of the TV, it would have physical address 1.0.0.0

if the MythTv HDMI out is plugged into port 3 of the AV receiver above, its physical address should be 1.3.0.0

if the MythTv HDMI out is plugged into port 3 of the AV receiver above, its physical address should be 1.3.0.0

Line 22:

Line 28:

- kwikwai http://www.kwikwai.com/ (not tested)

- kwikwai http://www.kwikwai.com/ (not tested)

- pulse-eight http://www.pulse-eight.com/store

- pulse-eight http://www.pulse-eight.com/store

+

+

== Use a TV remote to control MythTV ==

+

+

(Adapted from https://ubuntu-mate.community/t/controlling-raspberry-pi-with-tv-remote-using-hdmi-cec/4250)

+

+

I found that whilst xdotool and libcec4 was available from Raspbian stretch, cec-client was not, so I installed the latter from Debian stretch - for my Pi3, the armhf architecture was compatible.

Contents

Introduction

It allows rudimentary control over HDMI-CEC aware devices - these devices oftern have vendor-specific names for the protocol, such as AnyNet+ for Samsung devices.

Therefore, it is possible to either control an HDMI-CEC-aware device (such as a TV) from another (like a computer), e.g. by having the computer turn the TV on, or vice versa, e.g. by using the TV remote to control MythTV on the computer.

Background

HDMI-CEC devices have two key public properties - a logical address and a physical address.
The physical address is determined by the ports a device is plugged into. HDMI is effectively a tree structure, with the TV/Display defaulting to physical address 0.0.0.0 (I understand there should only be 1 display in a HDMI setup, but exceptions apparently can be sometimes tolerated depending on the equipment)

If a device with other HDMI ports (referred to as a switch) is plugged in, any devices plugged into that will get a number in the the next "dot range".

So if an AV Receiver is plugged into port 1 of the TV, it would have physical address 1.0.0.0

if the MythTv HDMI out is plugged into port 3 of the AV receiver above, its physical address should be 1.3.0.0

Subsequently, any device directly attached to the switch gets a number based on the port it is plugged into. Typically devices determine their physical address via DDC, but as some CEC bridges are not "inline" with the source device they cannot dynamically determine the physical address. (These devices, such as the RainShadowTech one can have their physical address set to allow them to "impersonate" the non-hdmi-cec device - such as a typical HDMI-capable video card.

Secondly, there is a "Logical Address" which largely determines the type of device - and supports negotiation if multiple instances of the same type are on the HDMI tree (ie two bluray players etc). However, the Logical address is used when addressing devices, not the physical address. The Physical address is used when a "source Device" is in playback mode, and alerts all other devices that it is sending a stream to the display device via the path inherent in its physical address.

There are new devices becoming coming available that support a USB-HDMI bridge - some of these are

To allowing MythTv to automatically set the AV receiver to the correct input whenever playback begins (via MythTV System Event),
the following code (saved to a file and marked executable) will turn on the TV, and set the correct AV input when MythTv starts playback

Code to send volume down to AV receiver (save to /home/mythtv/hdmi-cec/voldown, chmod +x)
NOTE - there is a security risk associated with irexec and custom bash files, but if this is your home HTPC, take your chances...

Here are some preliminary observations on libcec and mythtv with a pulse8 device on ubuntu precise:

basically I had to install not only libcec1 but also libcec1-dev. Otherwise mythfrontend shows the error "failed to load libcec" error. (I also made sure both my user and mythtv are member of the "dialout" group although not sure this is necessary.)
Apart from that libcec support works kind of out-of-the box on my 2012 phlilips tv, in the sense that I can use the TV remote to control mythtv.
Most keys from the TV remote work instantly. But I manually made some configuration to myth tv key maps via the frontend config dialogue. The OK key which triggers select I had to manually map to SELECT in "global" and I also chose to map the red button (F2) to MENU.
Another effect is that the name of HDMI 1 in the TV changes to mythtv.