CEC breaks after switching source on TV

Hi all,
after my old SD card died, I decided to set up OSMC in place of my previous RaspberryPi OS with a manual Kodi installation. I’m very happy with it so far, but there is one thing I cannot get to work properly:

When I switch input sources on my TV to “TV” and back to “AV/HDMI”, I cannot control Kodi with my TV remote control anymore. I have to restart the mediacenter.service or navigate to the CEC adapter settings with a USB controller and apply the settings there again, that fixes it without a reboot.

i’ve already tried setting hdmi_force_hotplug=1 and hdmi_ignore_cec=1 but that didn’t help.
Also tried different settings in the CEC adapter settings but to no avail.

The Rasbperry PI (4) is attached to a Pioneer AVR and that to a Panasonic TV. On my old installation with Kodi 18 or so, this hasn’t been an issue and it worked properly, so it isn’t a hardware issue, nor a problem in the TV/AVR configuration.

Can someone point me in the right direction on how to debug this further, or can give me any hints what setting I should change so this works after switching input sources on the TV?

Thank you kindly in advance.

The first thing I would do is unplug from the wall the TV and AVR for a few seconds and then plug them back in. This should reset the CEC assignments which can oftentimes cure off behavior. If that doesn’t fix the issue try navigating to…
Settings>system>input>peripherals>CEC adapter>
and try playing with those settings.