CEC is too demanding

I’ve opened up about this (or tried to hijack threads if you prefer) few times already, just sharing my feelings, wasn’t expecting support or anything… It plays videos and music, that’s all I need.

The problem is that whenever I switch away from my OSMC on Rbpi3 (or is it Rpi?), the Raspberry switches back over to itself instead of (for example) the BDPlayer. Either I have to turn off OSMC/Raspberry (which I hate doing) or disable CEC. CEC being enabled, it won’t even let me turn off when I’ve decided I’ve had enough. I’ve tried every possible combination, but welcome suggestions. hdmi_safe, everything within CEC disabled but CEC on. It’s not a big deal, but I hate when things aren’t working as they should be on an OCD level.

The Raspberry is connected to the AVR and the AVR is connected to the TV and the TV is connected to the leg bone, and the etc. My AVR is Pioneer VSX-442 if it matters.

I’ve creatively removed most of the boring stuff like my mysql info and frame by frame analyzation of American Dad, but let me know if you absolutely want those too.

No worries, like I said, it plays video and audio. It even tells me the weather because I wouldn’t look outside.

What else is connected to the AVR via HDMI (Chromecast etc)?

Chromecast 2 & My PC and well, the TV. Naturally the OSMC will work on it’s own but that’s not really an option. WOL would have been nice on this new one.

Perhaps I’ll make (or cmake) my own module. The git site for libCEC suggests being unstable, the latest being with a few Rpi specific fixes in between. I’ll see what I can see, when I get to it.

Please disconnect the Chromecast and see if CEC behaves normally without it (leave CEC on in Kodi).
Do you have problems when turning of TV and AVR? Like stuff turning on randomly?
I had my Chromecast and RPi2 connected to my AVR for 6 month or so and suddenly Kodi switches back to his HDMI port etc. weird stuff. It stops when I disconnect the Chromecast. Your problem might be related.

It’s really not an option. I’d rather be without CEC than Saul Goodman.

Just to see if the Chromecast is the cause of this… To see if there is a conflict somewhere. We could draw more attention to the problem since I have a similar issue.

Like I said, on it’s own the OSMC works right, but that’s because it’s the only other CEC device in the mix. The same problem happens if my Bluray is connected since it’s also a CEC device. As my PC isn’t a CEC device, it can be connected at the same time with the OSMC. That’s the gist of it, if you introduce OSMC to the AVR the whole setup becomes unusable if you have CEC on. When you unplug the Rpi, my Bluray player and Chromecast work together in perfect harmony.

To me, it seems the bug is in OSMC… or maybe it’s a feature.

The CEC used in OSMC (version is not up to date, one thing worth a try would be updating the libcec.ko module to the distribution version of Even a downgrade to v2 might help. I will try it myself at some point but apparently I need to play Diablo instead.

I asked because I have the same setup like you. My RPi2 is connected to the AVR in combination with a Chromecast and a Fire TV Stick. All CEC enabled. It all worked without problems and suddenly the RPi2/Kodi goes nuts when I change HDMI ports or turn everything of. In my case it seems to be related to the Chromecast since just removing it and leaving the Fire Stick connected also works as it should. (not 100% sure though)

I posted my issue here: Kodi on RPi2 constantly sending CEC signals · Issue #205 · Pulse-Eight/libcec · GitHub

I still would say our problems are related. What you could do is enabling debug logging in Kodi WITH component-specific logging (Verbose logging for CEC library) More info here: http://kodi.wiki/view/Log_file/Advanced#Component-specific_logging
and add your log to my libCEC Github issue to raise more attention.

You can’t mix and match versions of libcec and Kodi since it is built to use a specific version of libcec and will not work with other versions.

The switch is done on a kernel level and Kodi runs in user space. The only way Kodi would care is if there’s a specific connector from kodi to that specific kernel module or it does signature checking or Kodi is built against that exact module. In my understanding the cec is a peripherial, a plugin, you could run Kodi without it. I’m not a code monkey so I don’t know how Kodi uses the devices the kernel offers it, but I don’t think it cares about the version. I’ve been known to be wrong though, can’t be sure.

Where you do need to be careful though is matching the kernel and architecture, the best way to do that is to compile the module on the raspberry and/or disable any signature checks the kernel might have. Naturally if the kernel gets updated (maybe to properly use armv8) one would have to recompile the module again (if needed).

Pulseaudio can’t do anything for you as you’re not using the up to date version, they even have marked unstable. How it got on to a debian dist is beyond me.

…but I digress, I tend to do that. I’ll post new logs soon.

Due to a BOFH I switched to Arch Linux, CEC works fine on it’s Kodi. It’s the latest libCEC but it also has Kodi Jasper so that might be it too, can’t be sure. Sorry I can’t be of help anymore. :expressionless:

Hope you figure it out and good luck. :slight_smile:

libCEC 2.x is not compatible with Jarvis. Jarvis relies on libCEC 3.x, which is a shared object rather than a kernel object. The kernel exposes a wire, typically as a dev node, but this can vary depending on the platform. libCEC consumes that and handles the interaction from userspace (makes it more configurable).

libCEC 3.1 is available, but it is intended for Kodi v17 (Krypton). The libplatform namespace changed and moving to 3.1 would break compatibility with Jarvis add-ons such as PVR. We are shipping the latest libCEC for Jarvis, and always backport any relevant fixes.

I experienced the same issue. Disconnecting Chromecast solved (sort of) it, but it’d be nice to see this fixed. I just wonder that which is the culprit, Chromecast or Kodi-CEC ?