Solution for HDMI rescan/handshake issues - sound cutoff in some scenarios

Hi,
I got the time to investigate one annoying problem I have, and by googling I understood its fairly common for people using AVRs (receivers) in their home entertainment system, so thought it might be useful to folks over here.

In this scenario you have devices like kodi machine, PS, xbox, iptv box all connected to AVR input, and only TV to AVR output.

Then you poweroff TV (either by some rule or manually because you dont need it) while playing music from HTPC (lets say running kodi). In that moment sound stutters for few sec, and sometimes gets cut off, no more music.
The solution is to toggle HDMI input of AVR to some other input, then back to HTPC and sound is back (the sound is going from HTPC to AVR via HDMI, and there is no need for a TV to be on.
The issue is it seems with some graphic cards that get confused by lost signal on HDMI port.

I came up with some script that fixes this annoying issue without manual intervention of fiddling with inputs via remote etc…

the script disables/enables hdmi port on linux htpc

#!/bin/sh
export DISPLAY=":0"
xrandr --output HDMI2 --off
sleep 1
xrandr --output HDMI2 --auto

I created an openhab item via exec binding that executes the script via ssh on htpc machine.

and using it in this rule:

rule "TV OFF Update"
when 
   Item Television changed to OFF
then
   HDMIToggle.sendCommand(ON)
   end

As I am relying on kodi in my home automation scenarios, like starting music when someone arrives home, I don’t want random HDMI bugs to cutoff sound because he didnt like how TV was switched off :slight_smile:
hope it helpes someone, cheers

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.