Switching on Samsung TV via CEC but audio comes out via TV speakers and not ARC/receiver

Hi all,

Just been setting up HA on a Hass.io install on a RPi3.

My TV model is Samsung 40F6500, a 2013 model (I think) so before Samsung enabled WOL.
Initially I had no way to turn the TV on via HA. If I manually turned it on with remote, HA would detect it and allow me to turn it off, but not back on.

I then realised hass.io / RPi3 can utilise CEC if it is physically connected to the TV so I moved my Pi into the front room and connected via HDMI to the TV.

Now, on HA dashboard I have a switch for the TV which works. I can turn it on and off.

Now the problem is, when I turn on the TV via CEC from the Pi/HA, the TV reverts to using the TV speaker and not using ARC to my AV Receiver (Yamaha RXV481D). I have to go into the TV settings and switch it to use the receiver.
This happens if I turn the TV on before or after the AV receiver is on.
Ok, so maybe if I connect the Pi to the receiver, then the CEC ON command will be routed via receiver to the TV and hopefully the TV will be aware of the receiver? Nope, same problem, uses TV speakers, even though, for example, the PS4 is hooked up to the AV receiver it routes the sound to the TV speakers.

This has never been an issue when using the TV/receiver remotes to switch them on in any order - it always results in sound coming from my speaker system, not the TV. But for some reason if the TV is switched on via CEC then it uses it’s own speakers.

Any ideas how I can make sure my TV always uses the ARC/receiver? I don’t think CEC has the ability to change the TV’s settings… or is there a CEC command to force ARC? Anything I can do to the Rpi CEC settings in boot/config.txt?

Thanks

I would say your raspberry should be connected to one entry of the AV Receiver, and turn ON the AV receiver which should automatically turn ON the TV.
Problem is that the output of your raspberry will be used as input on your AV receiver, but you might be able to change channel/source with a second action.

Thanks.
Unfortunately turning on AVR first doesn’t switch on the TV too.
I think it may have done in the past (before using HA, using the remote) but it’s always been hit or miss so I cant remember exactly.
e.g sometimes turning off TV also turns off AVR, but sometimes not and I have to do it manually.

I have now realised that the CEC toggle switch for the AVR is what causes this audio issue.
If I turn on the AVR via the power button on media player panel (I assume this uses the built in Yamaha Network Standby function) then the AVR turns on and plays the sound. But if I power on via CEC then thats when the TV hijacks the sound.

Strange behaviour, but now I know this I think I can work around it.

I have a similar problem. I have a Yamaha hooked up to a (audio-less) projector. There is a headless Raspberry connected by HDMI to the Yamaha, with the sole purpose of doing CEC things. There is an Android TV connected to another Yamaha input.

When I turn on the Yamaha from Home Assistant (throught the CEC on the Raspberry Pi) I can select the appropriate input (i.e. call hdmi_cec.select_device) but Yamaha reacts strangely without sound (AFAICT, it’s trying to use the audio from another input source, which is not what I want).

From the Yamaha configuration I see that I can disable the HDMI CEC control, but that’s not what I want. Maybe there is a CEC command that can solve my issue? Have you succeeded on tuning this behaviour? Do you have any advice on how to proceed?