[RPi5] CEC Turns the TV On

  • Good day everyone.

    I have Rpi5 4GB with LibreElec 12.0.1. A few weeks ago a problem started, where I could not turn my TV off (Sony KD65XF8505), technicaly I could turn it off, but it would turn on by itself in few sesonds. Started troubleshooting and can now confirm that Rpi5 is causing the TV to turn on, via HDMI CEC, I pressume. I switched everything to off in CEC addon settings and now this does not happen anymore, but also CEC does not work. Not a big deal for me, as I have dedicated keyboard, but just letting developers know.

    I have every video/sound source connected to denon AVR via HDMIs and then one, common HDMI goes from AVR to the TV.


    Kind regards

    Marcin

    Edited once, last by Marcin (October 11, 2024 at 12:00 PM).

  • Ok made the entry to the cmdline.txt file. Got me scared for a moment as LE did not boot after reboot command. Had to power cycle and now booted ok. Tried to revert changes to the CEC addon, but CEC no longer works now. I cannot control LE with the TV remote. Like I said, not a big deal, but it does not work.


    EDIT

    Also noticed I have two entries of CEC Adapter. They seem to have separate configs. Is this due to RPi5 having two HDMIs?


    EDIT

    Ok I have an additional entry when going through my TV HDMI sources. When I select HDMI 1 KODI Recorder, CEC works. Beside that I have just a "normal" HDMI 1 entry, and CEC does not work there.

    How do I set it up properly?

    Edited 3 times, last by Marcin (October 11, 2024 at 3:29 PM).

  • The behavior with multiple HDMI 1 entries is known to me with SONY Android TVs. There can some more sub devices displayed if you have additional CEC compatible devices connected to your DENON AVR. On that way you are able to switch between the different CEC sources on your AVR via TV remote. Also I can confirm that not all (but the most) CEC keys are working if the TV is only switched to "HDMI 1" and not to the sub entry "HDMI 1 KODI ...". Maybe you have installed a firmware update for the TV, so that something has been changed?

    The TalkBack feature (if available) is disabled? https://www.sony.com/electronics/support/articles/00269974


    Regarding the irritating double entries for the CEC adapter in the input settings menu, you should switch to a newer version than the official version 12.0.1, as this contains the fix: https://test.libreelec.tv/12.0/RPi/RPi5/…-0803b93.img.gz

    Edited 2 times, last by HarryH (October 11, 2024 at 5:43 PM).

  • HarryH Sony android TV is also in my case. The thing is I have to manually select it (HDMI 1 Player, Recorder etc). My Denon selects just HDMI 1 (without CEC). I have not installed anything else on top of default LE image. Also as mentioned I am running 12.0.1, which I believe is the last one. Either way, after editing cmdline.txt as advised by HiassofT the TV is not switching itself on, which was the main thing.

  • I thought, that you want some help to get a solution for your CEC issue.

    No, 12.0.1 is not the last build, so i linked already a newer version which doesn't have the issue with 2 CEC Adapter entries. It's up to you to try it or not.

    The DENON supports also CEC by itself and reports as active device, so the TV can switch to HDMI 1. After that every single device connected to the DENON can signal as "active source". The last one started, wins.

    Example:

    TV (HDMI 1) <- DENON (HDMI 1) <- FireTV

    .... DENON (HDMI 2) <- LibreELEC (KODI)

    .... DENON (HDMI 3) <- Bluray


    The TV exposes: "HDMI 1", "HDMI 1 Amazon FireTV", "HDMI 1 KODI...", "HDMI 1 Bluray"

    The last 3 entries equals to HDMI 1, HDMI 2 and HDMI 3 of the DENON. So it's usual that you can steering only 1 of that devices with your TV remote control at the same time. It could be that the first entry ‘HDMI 1’ of the TV only passes the remote control buttons via CEC if the device connected there has reported itself as an ‘active’ source.

    To realise this, you only need a properly configured CEC adapter in LibreELEC 12.0.1+ and no other components that cause additional trouble. (such as cheaply made HDMI cables, firmware, etc.), no more and no less. /shrug

    Edited once, last by HarryH (October 11, 2024 at 11:51 PM).

  • Dear all

    I spoke too soon. The problem is back. Seems like adding vc4.force_hotplug=1 to /flash/cmdline.txt did not change anything in this matter. It is difficult to test as the problem occures after some time.

    HarryH I explained my intentions in my first post. It was more to let the community know, that such problem exists. As long as I can deactivate CEC completely (which seems like I can), I am fine, as I do not use CEC too much. It is a nice thing to have, but not on my priority list. If my intentions were not clear, or I used the wrong channels to do that, I appologize.

    As always is the case, the community does not dissapoint, and there are many knowledgable people willing to help, and I do appreciate everybodys input, including yours. Thank you for the explanaition about HDMIs, I am trying to get my head arround this, as I find it difficult to understand.

    Thank's for the link to a new version. I may try it sometime, just do not have the time now to reflash in case something goes horribly wrong.

    If it's not too offtopic, I would definitely need some help with configuration of CEC addon, as many options are not clear for me in terms of what they do. Is there a good source of knowledge about that?

    Is there a way to change the language of the CEC addon only and not the whole system?

    Kind regards

    Marcin

  • Hi Marcin ,

    KODI is using libCEC, so some parts are already documented here (maybe outdated): https://libcec.pulse-eight.com/FAQ
    Some other things I have already tried to explain here:

    HarryH
    June 13, 2024 at 7:54 PM
    HarryH
    May 26, 2024 at 1:20 PM


    As long you use a LibreELEC version where you got advertised 2 CEC adapters in the settings menu, please change only one of them. Sometimes one of them exposes more menu entries than the other. Ignore this or use everytime the one with most items listed. Both CEC adapters write to the same settings/properties. Because this is weird and in collision with HDMI device tree, this was fixed/removed within the nightly builds.

  • Hi HarryH. Thank you for the links. I will definitelly read this through. So those two CEC adapter entries are 100% not due to the fact that Rpi5 has two HDMIs? This was my initial though as there's even an option of choosing the HDMI Port Number. Would make sens to have separate configs for each physical port. Thank's for clearing this out.

  • Yes and no. The reason for 2 adapter was that the RPi4/RPi5 have 2 HDMI ports. And I think the original intention was to support HDMI0/HDMI1 (multiple) ports. One adapter entry for HDMI0, and second for HDMI1. The port number property inside of every adapter is a different thing and explained in my provided links.

    But: KODI (maybe libCEC too) currently doesn't support a splitted configuration, so it currently make no sense/different. After think about all stumbling stones also it's possible that there is no working edge case there it make sense to have that feature. AFAIK there is intended only one sink in the HDMI device tree and every other HDMI device should have a unique address. A splitted configuration would conflicts with that, if enabled simultaneously. Perhaps a toggle to use HDMI0 or HDMI1 for CEC could made work without going in conflict with the addressing. Currently you can in 99.x% of the cases reach the same with only one configuration. And this can make trouble enough ... ;)