TV/AVR turns back on right after turning them off

  • Hi again,


    RasPi4 LE10.0.1 <--> AVR Sony <--> TV LG


    LibreELEC is always on. Running LE9 I would turn on the TV and the AVR would turn on simultaneously (I've always experienced the bug that if I switched sources on the TV shortly after powering up the TV/AVR LibreELEC would steal focus and switch the source back to itself, but that just on the side). Now after the upgrade to LE10 (same RasPi4) whenever I turn the TV off (and with it the AVR), it takes anywhere from 5 to 20 seconds until the TV and AVR are turned back on.


    If I turn off Auto-Power-Sync in the CEC options of the TV nothing is turned back on, but I would manually have to turn on the AVR and need a second remote for that, which I do not want. Obvoiusly if I turn CEC off on the TV or in Kodi no unwanted-power-on occurs, but all CEC-function is lost. In the CEClib settings everything that looks remotely like a command to turn anything on is switched off. I determined the HDMI Port to be 3 by changing it and accepting that value only when it switched to the right input after saving the CEC options, but besides that I'm not sure of this setting. The physical address seems to be changed to 2300 by the system. I entered that the REasPi is connected to the AVR (as shown above) but it keeps being reverted to TV, which is not physically correct.


    I've attached a log-2021-11-04-08.13.18.zip with CEClib verbose logging turned on.


    Can anybody help? Please? My wife is going to be so mad if I tell her something about workarounds.... ;)

  • Ok, so now I'm able to reproduce this behavior on a second TV, albeit also from LG.


    I found I can also circumvent this by switching the TV to another source (ie conventional television, etc) and then turning off the TV, but this is kind of messy. I've always felt that CEC was rather buggy (across all vendors and implementations) but this would need to be something that changed from LI 9.3 to 10.0 within libCEC, but I don't even remember if the version was a different one.


    Anybody have any ideas?

  • In past I tried to use HDMI CEC as well but also found it was pretty unusable due to incompatibility across HDMI devices & unique implementations. Some features were working but some most important (like power off request through HDMI CEC) did not work on my old LG TV. So I stopped using CEC completely and started using GPIO pins on my RPI 4B instead to control relays and IR LED so I can easily take a full control of any attached (or even unattached) devices which are connected to power outlets (controlled by relays) or have an IR remote sensors. I can recommend this solution and I can provide you with technical details if you are interested in.


    BTW. on LE 11 Nightly my RPi 4B now turns on attached TV (through HDMI) after power on, even though the HDMI CEC is disabled in LE (I don't remember what the behavior was on LE 10 / LE 9 but I think TV stayed off in this case). But this is OK for my use case. I can use a power outlet (with relay) to turn the TV on/off and IR sensor to control any TV function (through a script, which can be run by pushing button on my remote control).

    Edited once, last by ghtester ().

  • I have the exact same problem. It appeared when I upgraded from LE 10.0.0 to 10.0.1.
    I have an r-pi4 which connects to a Pioneer receiver (VSX-1131) which again connects to a Sony TV (KDL-52W4500).

    It is quite annoying, but if I turn off the receiver first, I can turn off the TV after, and it stays off.

  • I have the exact same problem. It appeared when I upgraded from LE 10.0.0 to 10.0.1.
    I have an r-pi4 which connects to a Pioneer receiver (VSX-1131) which again connects to a Sony TV (KDL-52W4500).

    It is quite annoying, but if I turn off the receiver first, I can turn off the TV after, and it stays off.

    If you revert back to 10.0.0 can you confirm the problem goes away?


    I can't think of anything that might have changed in 10.0.1 to cause that, so I want to rule out some other environmental change

    (e.g. a new cec device that's interfering, or TV getting into a bad state).

    If you can confirm problem is always present on 10.0.1 and never present on 10.0.0 we can try to narrow it down.

  • If you revert back to 10.0.0 can you confirm the problem goes away?


    I can't think of anything that might have changed in 10.0.1 to cause that, so I want to rule out some other environmental change

    (e.g. a new cec device that's interfering, or TV getting into a bad state).

    If you can confirm problem is always present on 10.0.1 and never present on 10.0.0 we can try to narrow it down.

    I will try to do that the next days. There are no new CEC devices attached, but I will do a proper power cycle of my TV and receiver in case they do something funny, and then try to roll back to 10.0.0 and see if the issue is still present or not.

  • Ok, so why wait. I power of my TV and receiver for a minute, but it didn't making any differnce.

    Then I rolled back to LE 10.0.0 (by using the LE update menu in Kodi).

    Now I can turn off my TV normally, and it stays off.

    Before I go back to 10.0.1, is there any perticular logs you would be interested in now while its working?

  • I upgraded back to LE 10.0.1 this morning, and the problem is immediately back. If I turn off my TV, it powers off, my receiver powers off, and then about a seconds later they both turn on again.

    I enabled debug log for CEC, rebooted the pi, and turned off the TV shortly after LE had started up, and then went to upload the log afterwards. Hopefully the below log can be useful.

    CEC debug log

  • Did you try power cycling the TV ? - pull the power cord from the wall for 1 hour and then plug it back in again ? I know it sounds silly but for some reason it has fixed a lot of CEC related issues. I think some TV's have a CEC "memory" and when there is any change (like changing versions of LE), it may remember the last setting.


    Just a thought

  • I did unplug the power cord for both the TV and receiver, but for one minute, and I tried turning both on after the power cord was unplugged to speed up the capacitor drain. So it should be good enough. But I can try it again leaving them unplugged longer if that is desired.

  • Did you try power cycling the TV ? - pull the power cord from the wall for 1 hour and then plug it back in again ? I know it sounds silly but for some reason it has fixed a lot of CEC related issues. I think some TV's have a CEC "memory" and when there is any change (like changing versions of LE), it may remember the last setting.


    Just a thought

    As stated in my second post, I can reproduce this behavior on LE 10.0.1 with two different TVs, one of them has never seen any other hardware than the attached AVR, BD-Player, and Pi, deef-freeze-booted (first time turned on) into that setup. I havn't had the time to downgrade to 10.0.0, I skipped that version coming from 9.3.x

  • Just for the fun of it, I unplugged my TV and receiver for more than one hour (I even timed it).

    Unfortunately it didn't help.

  • Are any more logs with CEClib-logging or anything else necessary to analyze this problem? Am happy to provide whatever is helpful. Thanks for looking into this!

  • I can confirm this behavior. Upgraded my two RPI4s to 10.0.1 and both attached TV/AVR systems began turning back on right after I shut them off. I had no issues with 10.0. I am rolling back both systems to 10.0.

  • Hi all!

    I have the same issue. After upgrade LE RPi4 from 10.0.0 to 10.0.1 LE constantly turning on TV Panasonic after TV is manually turned off.

    I am attaching CEC log and CEC settings. Should be CEC settings changed in 10.0.1 to achieve the same behavior as in 10.0.0?

    Thank you.
    cec_debug_log.txt

  • Does anyone have this issue without an AVR connected?

    Might be useful if users affected can report make of AVR/TV.


    Unfortunately, while I have identified the commit that provokes this behaviour, the commit it correct and is necessary for 4kp60.

    The bug looks to be in libcec which is a bit of a mysterious black box.


    We have found this behaviour also occurs on a Fire TV stick, so isn't Pi specific.

  • I provided my log with cec logging with AVR in the first post of this thread. I can, if it helps, attach the LE-Pi directly to the TV and take the AVR out of the equation and provide logs again, but I'm quite busy at the moment so I'm not going to do if you see no point in it trying to help debug this thing in this way.


    Greetings and thanks for taking this on, popcornmix