Optical audio with no HDMI display

I’m trying to use my Android box for music playback via optical + upnp. It works fine if CoreELEC has an active output to TV but as soon as the TV switches source or switched off audio is gone. I’ve set audio output to optical as well. Is this possible?

X96 Air

It sounds as if you need to turn CEC off.

Settings, Input, Peripherals. CEC adapter.

I have this off already. I disabled it on the TV as well.

Figured it out. It was my AV getting in the way. Disabling HDMI control fixed it but I’m not entirely sure why this was the fix when CoreELEC shouldn’t be listening for the AV’s CEC commands as it’s disabled.