TV switches to wrong HDMI input source

Hi all

I’ve been running variations of rapsbian and OSMC for years and was hoping for some help with this.

Previous setup:
RPi 2B (OSMC 2017.03-1) >>> Onkyo HTX-22HDX receiver (HDMI 2) >>> Sony Bravia KDL-42W705B TV (HDMI 1)

The RPi is plugged into my receiver, and the receiver output has previously been plugged into HDMI1 of my TV, without any issues. I’ve been able to control OSMC via CEC with both the TV and receiver remotes.

However I’ve been having audio issues with another device, my Freeview STB, and want to try using another HDMI port on my TV in case it’s that which is causing issues.

New setup:
RPi 2B (OSMC 2017.03-1) >>> Onkyo HTX-22HDX receiver (HDMI 2) >>> Sony Bravia KDL-42W705B TV (HDMI 4)

My issue: The TV continues to switch to HDMI 1, which still picks up the label “Recorder 1(Kodi)” – even though there is nothing plugged into that port.

I can manually change to HDMI 4, where I can see the UI and control the device through my AV receiver’s remote, however the TV remote doesn’t work.

Strangely, if I switch the TV back to HDMI 1, and press navigational buttons on the TV remote, while I can’t see or hear anything, when I switch back to HDMI 4 I can see that the inputs from the TV remote have been received by OSMC!

I’m really not sure what’s happening here. I’ve tried power cycling every component but without any effect…

Did you ever write the edid to a file and enable hdmi_edid_file=1 in config.txt?
Note the file contains the physical address (effectively the hdmi port number), so would need to be regenerated if you change things.

If not, then unplugging the TV (and other CEC capable devices) from the mains for a minute may help.
The display may be remembering some state about how devices are connected and a full power cycle can reset this.