CEC input switch

I’ve had to make a new SD card for my pi, and some things aren’t working the way they used to. It used to be that if I touched a key on the remote or within Yatse, the tv would turn on and the HDMI input would switch to osmc. Now it only switches the HDMI if I start a program via Yatse but not if I merely scroll, and it doesn’t switch for the keyboard at all. Nothing makes it turn on the tv.

Any help is much appreciated.

The settings your looking for are found in settings>system>input>peripherals>CEC adapter

Thanks for the fast response. I assumed it was in the CEC adapter, but I’m still not certain what I’ve got wrong. My settings are:

Enabled = yes
switch to this source on startup = yes
devices to power on during startup = TV
devices to power down during shutdown = none
send inactive source command on shutdown = off
put devices in standby mode when activating screensaver = off
wake devices when deactivating screensaver = off
when tv is switched off = stop playback
device to also put in standby mode = none
action when switching to another source = stop playback
Physical address = 0
force avr to wake when kodi is activated = on

Thank you for your help!

Try turning this to ON. The screen saver is possibly activating.

That did not work. The behavior is the same. I also tried deactivating the screensaver, but that didn’t work, either.

You have the same settings that I use. The next question would be what remote are you using?

Is it the TV remote using CEC, or an OSMC remote? Do you have the Pi directly connected to the TV, or is there a soundbar/AVR in the chain?

The Pi connects through my Denon receiver. I use Yatse or the keyboard plugged in to the pi for tv control exclusively unless I’m using my firestick, in which case I use the fire remote when it’s not controlled by Alexa.

You seemed to have missed what that option is. That option sends an activate source when the screen saver goes from being on to off. If you disable the screensaver then that setting isn’t going to do anything. AFAIK that option is the only way to get the ‘press any button to wake and switch source’ function you said you wanted on a RPi. I just tested it on my RPi 3B+ with LG TV and Denon AVR and it worked perfect. I previewed the screensaver, switched source on my AVR, hit the down button on my remote, and it came right back to my RPi. I previewed the screensaver again, turned off TV (which turns off my AVR), hit the down button on my remote, and everything powered on and switched to my RPi.

The other way to do it is instead of relying on the screen saver and being able to press any button would be to program a custom keymap to send an CECActivateSource action to make a dedicated on button. You can also make a power off button using the CECStandby action.

I tried it both ways though, with the screensaver engaged, and without.

If you have…

Enabled = yes
switch to this source on startup = yes
devices to power on during startup = TV
wake devices when deactivating screensaver = on

and you have rebooted your RPi after setting those settings, then it should work. You might try unplugging everything from the wall for a few minutes to reset the CEC bus. Otherwise there might be a setting that needs to be changed in your TV or AVR settings. You could also test by SSH’ing into your RPi and issuing the following command…

kodi-send --action=CECActivateSource

FYI the “force avr to wake when kodi is activated” did not seem work when I tested it, but it was not needed in my case as mine turns on/off with the TV.

This did work, so it’s capable of sending the signal.

I did reboot, and tried to power cycle it to reset the CEC bus. No luck. It seems unlikely to be a TV or AVR setting, because it was working on the system with the old SD card, and then the card had Total Existence Failure, followed by a new sd card within the hour that exhibited this problem. No changes were made on the TV/AVR end.

Thank you for your help. This is driving me a little batty.

Perhaps you could reboot the RPi, enable debug logging, enable the screensaver, hit some button to deactivate the screensaver, then upload full logs and post the url in this thread. The settings I posted above should be sending the same CECActivateSource action that you have now tested as working so i’m a bit at a loss as well. Maybe logs will provide some insight.

This lead to an interesting discovery. If I previewed the screensaver, then switched the source to firestick, then clicked a button on the keyboard, it WOULD switch back to the pi! So apparently waking form the screensaver works. So I can set the screensaver to a very short time to act as a workaround if need be, but the previous system did not require a delay for switching between sources.

However, if when I previewed the screensaver and switched the source to the firestick, it immediately switched it back to the pi. Also, if the screensaver is engaged, when I turn the power off on the tv, it immediately turns back on and focuses on the pi.

logs might show what is disabling the screen saver. Perhaps one of your other choices in the CEC settings is causing thing.

I’m not sure how exactly you had you RPi performing this function before without the screen saver unless you used something like use the Kodi Callbacks add-on to do something custom.