Kodi keeps turning TV back on

  • Turn on the TV, play a video until end, turn off the TV, some minutes later the TV turn on.
  • Turn on the TV, play a video until end, reboot OSMC, turn off the TV, the TV does not turn on.
  • Turn on the TV, play a video until end, disable CEC (Anynet+) in the TV, turn off the TV, the TV does not turn on.

Interesting. Can you post some component specific logs like was pointed out near the top of this thread covering when the TV turns itself back on?

I will try again when have access to the setup.

Please, also activate the debug announcer component, so we can see if any screensaver code is part of the issue even you don’t have specified a screensaver in your logs. Your current CEC settings specifies to wake up other CEC devices in case the screensaver ends.

Hey, everyone. The same thing started happening to me after I installed the November update on my Pi 4 this morning. I already set hdmi_ignore_cec_init=1 in /boot/config-user.txt but that didn’t help.

Everytime I turn off my TV it just turns back on a few seconds later. This has never happened to me before. The only time Kodi would turn my TV on was when I turned it off while there was still a video playing and the video ended.

Any help on this?

1 Like

On May Pi4 and latest update I also experience this issue. Sony TV connected via Yamaha amplifier, with other devices also connected (Fire TV, BDP player), only Kodi presents the issue. Tried different cable and different input. If OSMC is selected when powering off TV, the TV turns back on after 3 seconds, always.

I found this similar thread on librelec forum but I don’t know if or how to apply their solution

https://forum.libreelec.tv › thread
LE Pi keeps turning my TV back on after I’ve turned it off

Which of their solution?

Sorry, also this thread

They edit a file
flash/cmdline.txt
Which I think is not present in OSMC, and add

vc4.inval_delay=0 vc4.cec_debug=0x100

I also add that if in my OSMC the display is in the dim state, the TV stays off.

On OSMC it’s /boot/cmdline.txt

I tried but this does not solve my problem. The only workaround correctly working at the moment in my configuration is to select a different input from the TV or AVR before turning off the TV.

What options are set in Kodi in settings>system>input>peripherals>CEC?

This is the content of .kodi/userdata/peripheral_data/cec_CEC_Adapter.xml

<settings>
    <setting id="activate_source" value="0" />
    <setting id="button_release_delay_ms" value="0" />
    <setting id="button_repeat_rate_ms" value="0" />
    <setting id="cec_hdmi_port" value="1" />
    <setting id="cec_standby_screensaver" value="0" />
    <setting id="cec_wake_screensaver" value="0" />
    <setting id="connected_device" value="36037" />
    <setting id="device_name" value="Kodi" />
    <setting id="device_type" value="1" />
    <setting id="double_tap_timeout_ms" value="300" />
    <setting id="enabled" value="1" />
    <setting id="pause_or_stop_playback_on_deactivate" value="36044" />
    <setting id="pause_playback_on_deactivate" value="0" />
    <setting id="physical_address" value="1100" />
    <setting id="power_avr_on_as" value="0" />
    <setting id="send_inactive_source" value="0" />
    <setting id="standby_devices" value="231" />
    <setting id="standby_devices_advanced" value="" />
    <setting id="standby_pc_on_tv_standby" value="36044" />
    <setting id="standby_tv_on_pc_standby" value="0" />
    <setting id="tv_vendor" value="0" />
    <setting id="use_tv_menu_language" value="0" />
    <setting id="wake_devices" value="231" />
    <setting id="wake_devices_advanced" value="" />
</settings>

The two settings currently set to stop playback, does it make a difference if you set those to ignore? Have you tried clicking the defaults button in the CEC settings screen and then re-selecting your preferred options?

I reset to defaults, restarted and turned off the TV.

I enabled the debug log on CEC and this is what happens after i turn off the TV (and the TV turns back on):

2022-10-11 12:11:43.444 T:601     DEBUG <general>: CecLogMessage - CLinuxCECAdapterCommunication::Process - CEC_DQEVENT - CEC_EVENT_STATE_CHANGE - log_addr_mask=0000 phys_addr=ffff
2022-10-11 12:11:45.459 T:601     DEBUG <general>: CecLogMessage - changing physical address to FFFF
2022-10-11 12:11:45.459 T:601     DEBUG <general>: CecLogMessage - SetDevicePhysicalAddress - not setting invalid physical address ffff
2022-10-11 12:11:45.459 T:601     DEBUG <general>: SetConfigurationFromLibCEC - settings updated by libCEC
2022-10-11 12:11:46.385 T:601     DEBUG <general>: CecLogMessage - CLinuxCECAdapterCommunication::Process - CEC_DQEVENT - CEC_EVENT_STATE_CHANGE - log_addr_mask=0000 phys_addr=1100
2022-10-11 12:11:46.519 T:601     DEBUG <general>: CecLogMessage - CLinuxCECAdapterCommunication::Process - CEC_DQEVENT - CEC_EVENT_STATE_CHANGE - log_addr_mask=0002 phys_addr=1100
2022-10-11 12:11:46.519 T:601     DEBUG <general>: CecLogMessage - changing physical address to 1100
2022-10-11 12:11:46.519 T:601     DEBUG <general>: CecLogMessage - marking Recorder 1 (1) as inactive source
2022-10-11 12:11:46.519 T:601     DEBUG <general>: CecLogMessage - >> source deactivated: Recorder 1 (1)
2022-10-11 12:11:46.524 T:601     DEBUG <general>: CecLogMessage - << Recorder 1 (1) -> broadcast (F): physical address 1100
2022-10-11 12:11:46.524 T:601     DEBUG <general>: CecLogMessage - << 1f:84:11:00:01
2022-10-11 12:11:47.048 T:601     DEBUG <general>: CecLogMessage - CLinuxCECAdapterCommunication::Write - ioctl CEC_TRANSMIT - tx_status=01 len=5 addr=1f opcode=84
2022-10-11 12:11:47.048 T:601     DEBUG <general>: CecLogMessage - making Recorder 1 (1) the active source
2022-10-11 12:11:47.049 T:601     DEBUG <general>: CecLogMessage - >> source activated: Recorder 1 (1)
2022-10-11 12:11:47.049 T:601     DEBUG <general>: CecLogMessage - sending active source message for 'Recorder 1'
2022-10-11 12:11:47.049 T:601     DEBUG <general>: CecLogMessage - << powering on 'TV' (0)
2022-10-11 12:11:47.049 T:601     DEBUG <general>: CecLogMessage - << 10:04
2022-10-11 12:11:47.153 T:601     DEBUG <general>: CecLogMessage - CLinuxCECAdapterCommunication::Write - ioctl CEC_TRANSMIT - tx_status=01 len=2 addr=10 opcode=04
2022-10-11 12:11:47.153 T:601     DEBUG <general>: CecLogMessage - << Recorder 1 (1) -> broadcast (F): active source (1100)
2022-10-11 12:11:47.153 T:601     DEBUG <general>: CecLogMessage - << 1f:82:11:00
2022-10-11 12:11:47.536 T:601     DEBUG <general>: CecLogMessage - CLinuxCECAdapterCommunication::Write - ioctl CEC_TRANSMIT - tx_status=01 len=4 addr=1f opcode=82
2022-10-11 12:11:47.536 T:601     DEBUG <general>: CecLogMessage - << Recorder 1 (1) -> TV (0): menu state 'activated'
2022-10-11 12:11:47.536 T:601     DEBUG <general>: CecLogMessage - 'menu status' is marked as unsupported feature for device 'TV'
2022-10-11 12:11:47.536 T:601     DEBUG <general>: SetConfigurationFromLibCEC - settings updated by libCEC
2022-10-11 12:11:47.796 T:601     DEBUG <general>: CecLogMessage - CLinuxCECAdapterCommunication::Process - ioctl CEC_RECEIVE - rx_status=01 len=2 addr=81 opcode=83
2022-10-11 12:11:47.796 T:601     DEBUG <general>: CecLogMessage - >> 81:83
2022-10-11 12:11:47.796 T:601     DEBUG <general>: CecLogMessage - << Recorder 1 (1) -> broadcast (F): physical address 1100
2022-10-11 12:11:47.796 T:601     DEBUG <general>: CecLogMessage - << 1f:84:11:00:01
2022-10-11 12:11:47.797 T:601     DEBUG <general>: CecLogMessage - >> Playback 2 (8) -> Recorder 1 (1): give physical address (83)
2022-10-11 12:11:47.931 T:601     DEBUG <general>: CecLogMessage - CLinuxCECAdapterCommunication::Write - ioctl CEC_TRANSMIT - tx_status=01 len=5 addr=1f opcode=84
2022-10-11 12:11:47.949 T:601     DEBUG <general>: CecLogMessage - CLinuxCECAdapterCommunication::Process - CEC_DQEVENT - CEC_EVENT_STATE_CHANGE - log_addr_mask=0000 phys_addr=ffff
2022-10-11 12:11:48.821 T:601     DEBUG <general>: CecLogMessage - CLinuxCECAdapterCommunication::Process - CEC_DQEVENT - CEC_EVENT_STATE_CHANGE - log_addr_mask=0000 phys_addr=1100
2022-10-11 12:11:49.142 T:601     DEBUG <general>: CecLogMessage - CLinuxCECAdapterCommunication::Process - CEC_DQEVENT - CEC_EVENT_STATE_CHANGE - log_addr_mask=0002 phys_addr=1100
2022-10-11 12:11:49.412 T:601     DEBUG <general>: CecLogMessage - CLinuxCECAdapterCommunication::Process - CEC_DQEVENT - CEC_EVENT_STATE_CHANGE - log_addr_mask=0000 phys_addr=ffff
2022-10-11 12:11:49.841 T:601     DEBUG <general>: CecLogMessage - CLinuxCECAdapterCommunication::Process - CEC_DQEVENT - CEC_EVENT_STATE_CHANGE - log_addr_mask=0000 phys_addr=1100
2022-10-11 12:11:50.153 T:601     DEBUG <general>: CecLogMessage - CLinuxCECAdapterCommunication::Process - CEC_DQEVENT - CEC_EVENT_STATE_CHANGE - log_addr_mask=0002 phys_addr=1100
2022-10-11 12:11:50.881 T:601     DEBUG <general>: CecLogMessage - CLinuxCECAdapterCommunication::Process - ioctl CEC_RECEIVE - rx_status=01 len=9 addr=0f opcode=a0
2022-10-11 12:11:50.882 T:601     DEBUG <general>: CecLogMessage - >> 0f:a0:08:00:46:00:08:00:00
2022-10-11 12:11:50.883 T:601     DEBUG <general>: CecLogMessage - >> TV (0) -> Broadcast (F): vendor command with id (A0)
2022-10-11 12:11:50.948 T:601     DEBUG <general>: CecLogMessage - CLinuxCECAdapterCommunication::Process - ioctl CEC_RECEIVE - rx_status=01 len=2 addr=81 opcode=9f
2022-10-11 12:11:50.948 T:601     DEBUG <general>: CecLogMessage - >> 81:9f
2022-10-11 12:11:50.949 T:601     DEBUG <general>: CecLogMessage - << Recorder 1 (1) -> Playback 2 (8): cec version 1.4
2022-10-11 12:11:50.949 T:601     DEBUG <general>: CecLogMessage - 'cec version' is marked as unsupported feature for device 'Playback 2'
2022-10-11 12:11:50.949 T:601     DEBUG <general>: CecLogMessage - >> Playback 2 (8) -> Recorder 1 (1): get cec version (9F)
2022-10-11 12:11:51.012 T:601     DEBUG <general>: CecLogMessage - CLinuxCECAdapterCommunication::Process - ioctl CEC_RECEIVE - rx_status=01 len=2 addr=01 opcode=46
2022-10-11 12:11:51.013 T:601     DEBUG <general>: CecLogMessage - >> 01:46
2022-10-11 12:11:51.013 T:601     DEBUG <general>: CecLogMessage - << Recorder 1 (1) -> TV (0): OSD name 'Kodi'
2022-10-11 12:11:51.013 T:601     DEBUG <general>: CecLogMessage - << 10:47:4b:6f:64:69
2022-10-11 12:11:51.013 T:601     DEBUG <general>: CecLogMessage - >> TV (0) -> Recorder 1 (1): give osd name (46)
2022-10-11 12:11:51.171 T:601     DEBUG <general>: CecLogMessage - CLinuxCECAdapterCommunication::Write - ioctl CEC_TRANSMIT - tx_status=01 len=6 addr=10 opcode=47
2022-10-11 12:11:51.234 T:601     DEBUG <general>: CecLogMessage - CLinuxCECAdapterCommunication::Process - ioctl CEC_RECEIVE - rx_status=01 len=2 addr=01 opcode=8c
2022-10-11 12:11:51.235 T:601     DEBUG <general>: CecLogMessage - >> 01:8c
2022-10-11 12:11:51.236 T:601     DEBUG <general>: CecLogMessage - << Recorder 1 (1) -> TV (0): vendor id Pulse Eight (1582)
2022-10-11 12:11:51.236 T:601     DEBUG <general>: CecLogMessage - << 1f:87:00:15:82
2022-10-11 12:11:51.236 T:601     DEBUG <general>: CecLogMessage - >> TV (0) -> Recorder 1 (1): give device vendor id (8C)
2022-10-11 12:11:51.369 T:601     DEBUG <general>: CecLogMessage - CLinuxCECAdapterCommunication::Write - ioctl CEC_TRANSMIT - tx_status=01 len=5 addr=1f opcode=87
2022-10-11 12:11:51.514 T:601     DEBUG <general>: CecLogMessage - CLinuxCECAdapterCommunication::Process - ioctl CEC_RECEIVE - rx_status=01 len=2 addr=01 opcode=46
2022-10-11 12:11:51.514 T:601     DEBUG <general>: CecLogMessage - >> 01:46
2022-10-11 12:11:51.515 T:601     DEBUG <general>: CecLogMessage - << Recorder 1 (1) -> TV (0): OSD name 'Kodi'
2022-10-11 12:11:51.515 T:601     DEBUG <general>: CecLogMessage - << 10:47:4b:6f:64:69
2022-10-11 12:11:51.515 T:601     DEBUG <general>: CecLogMessage - >> TV (0) -> Recorder 1 (1): give osd name (46)
2022-10-11 12:11:51.811 T:601     DEBUG <general>: CecLogMessage - CLinuxCECAdapterCommunication::Write - ioctl CEC_TRANSMIT - tx_status=01 len=6 addr=10 opcode=47
2022-10-11 12:11:51.875 T:601     DEBUG <general>: CecLogMessage - CLinuxCECAdapterCommunication::Process - ioctl CEC_RECEIVE - rx_status=01 len=2 addr=01 opcode=8c
2022-10-11 12:11:51.875 T:601     DEBUG <general>: CecLogMessage - >> 01:8c
2022-10-11 12:11:51.875 T:601     DEBUG <general>: CecLogMessage - << Recorder 1 (1) -> TV (0): vendor id Pulse Eight (1582)
2022-10-11 12:11:51.875 T:601     DEBUG <general>: CecLogMessage - << 1f:87:00:15:82
2022-10-11 12:11:51.875 T:601     DEBUG <general>: CecLogMessage - >> TV (0) -> Recorder 1 (1): give device vendor id (8C)
2022-10-11 12:11:52.010 T:601     DEBUG <general>: CecLogMessage - CLinuxCECAdapterCommunication::Write - ioctl CEC_TRANSMIT - tx_status=01 len=5 addr=1f opcode=87
2022-10-11 12:11:52.304 T:601     DEBUG <general>: CecLogMessage - CLinuxCECAdapterCommunication::Process - ioctl CEC_RECEIVE - rx_status=01 len=5 addr=8f opcode=87
2022-10-11 12:11:52.305 T:601     DEBUG <general>: CecLogMessage - >> 8f:87:00:0c:e7
2022-10-11 12:11:52.305 T:601     DEBUG <general>: CecLogMessage - >> Playback 2 (8) -> Broadcast (F): device vendor id (87)
2022-10-11 12:11:52.912 T:601     DEBUG <general>: CecLogMessage - CLinuxCECAdapterCommunication::Process - ioctl CEC_RECEIVE - rx_status=01 len=2 addr=51 opcode=46
2022-10-11 12:11:52.912 T:601     DEBUG <general>: CecLogMessage - >> 51:46
2022-10-11 12:11:52.914 T:601     DEBUG <general>: CecLogMessage - << Recorder 1 (1) -> Audio (5): OSD name 'Kodi'
2022-10-11 12:11:52.914 T:601     DEBUG <general>: CecLogMessage - << 15:47:4b:6f:64:69
2022-10-11 12:11:52.914 T:601     DEBUG <general>: CecLogMessage - >> Audio (5) -> Recorder 1 (1): give osd name (46)
2022-10-11 12:11:53.106 T:601     DEBUG <general>: CecLogMessage - CLinuxCECAdapterCommunication::Write - ioctl CEC_TRANSMIT - tx_status=01 len=6 addr=15 opcode=47

Are you using profiles (user logins)? If so, note that the CEC settings are per user. I don’t have an explanation on why Kodi would be broadcasting its status or telling a TV to turn on if your settings were set to not do so.