HDMI CEC keeps AVR on

Hello there

I’ve installed OSMC on a raspberry PI 1 so I can leave it on all day and can control it with the TV remote control.
Works great.

I’ve connected it to my AVR (Marantz SR5007) and from there to my TV (LG). The AVR normally switches off when nothing is played for a while. But since I’ve connected the Raspberry PI, it doesn’t anymore.

I’ve tried to configure Kodi in the HDMI-CEC settings but to no avail.
I’ve switched on the screensaver to black after some minutes.

How can I achieve the AVR goes off when no music or video is playing?

Hope someone can help.

This is very specific and the answer might be that you can’t…
The raspberry is always on and the avr detects that as an active signal. The standby function of the avr might not be related to cec but just monitoring active hdmi sources.

The only way I can think of is to shut down the pi.

There is a function “Keep audio device alive”. I’ve disabled that so the device should switch off I expect…

This is just for the audio part. The video signal will still be there on hdmi.

Black screensaver doesn’t shut down the hdmi video. It just paints the screen black.

Edit: you could run a script when the screensaver kicks in with xbmc callbacks or something and use tvservice to really turn off the hdmi.

thanks! I was focused on the audio part most of the time. I will give this a try.

Maybe someone else already has a ready solution? I found some people have been working on it already.

Now that I’m typing this I wonder… What if I’m playing music and the screensaver comes in? It shouldn’t switch off the hdmi then. Perhaps the callbacks should take that into account.

edit: Just checked the documentation from kodi callbacks, there are some functions already available for CEC (like CECStandby, CECActivateSource). This should be the way to go. I’ll report back when I have news!

Hi @rikki78

Your set-up seems close to mine - OSMC on Raspi connected to a Yamaha receiver connected to an LG TV. This is how I found out that HDMI CEC is a bit fiddly and really depends on the particular set-up. For instance, I couldn’t get the TV remote control to pass commands through HDMI all the way to OSMC; my receiver captures everything. I have to use the receiver’s remote to control the OSMC, that works fine. My receiver also goes in stand-by after some time of not having any user interaction (no buttons pressed), even if there is a video or audio signal playing through.

Maybe you need to work out a combination of HDMI CEC parameters for OSMC and settings in your receiver. Do share the outcome, I’d be interested to learn from your example.

I’ve now installed kodi callbacks and that works well. The builtin functions CECStandby don’t do the job as they will switch off the AVR when it is in use by some other device (when I’m watching TV for example).

What does do the job is to switch video off with

vcgencmd display_power 0

At first I tried tvservice but that kept the TV black when switching back on.

To have everything switched on and off I’ve made this script. That should be called from kodi callbacks for various events (play, resume, stop, ended, screensaver active, screensaver inactive) and the video will be switched off.
With the video switched off the AVR also goes into standby (after a while).

The script can be downloaded here:

This issue seems to be different than yours. I didn’t have problems with the keys being passed through. Your issue seems more related to the parameters of your receiver I think.

1 Like