Hi, sorry, but was not able to make it work on rpi4 and 19.4 matrix.
Have beamer with low res and 1280 res TV.
When I have plugged both devices to connectors on rpi4, every time Kodi detects HDMI0 = TV, it switches from beamer on HDMI1 to TV.
The only thing your solution makes for me is the start up.
From the start of rpi when switched to HDMI1, it sends splash screen with LIBREELEC logo to beamer but..
When initial theme should appear, Kodi detects TV and send the screen again to HDMI0. Beamer has nothing.
I have ignored CEC for both 0 and 1 in config.txx but was not succesful.
The only solution working for me is to unplug HDMI0 from rpi (manually) and Kodi auto switches to beamer on HDMI1.
It seems like Kodi detects both HDMIs and when there is nothing on 0, it uses 1. That would be enough.. but.. switching TV off does not solve detection of TV, it still "is there"..
Really frustrating to disconnect it all the time. I have spend 3 days playing with it using different distros, but every one has some issue (no DVB support, no source codes, no repo for this, not working CEC and so and so.. On the other hand, what every other distro compared to Libre can do and Libre not is to mirror HDMI outputs.. mission impossible..)
If duplicating output is nightmare, I thought switching them might be a solution.. Well.. might Plugin for this would be VERY WELCOME
Roman