For some HDMI switches (e.g. ATEN), to make HDMI hot plugging work well with Raspberry Pi, set the following in /boot/config.txt
:
hdmi_force_hotplug=1 # always output HDMI even if not plugged in
hdmi_drive=2 # always output audio to HDMI
hdmi_group=1 # use CET mode (compatible with TV)
hdmi_mode=16 # use 1080p; otherwise it may switch to SD resolution
References:
This helped when nothing else was doing the job. Thanks! 👍