Balena Sound: How to force to HDMI audio?

How do I force the sound to HDMI (Pi 3 B+) audio regardless if the Raspberry sees an HDMI plugged in? I have the following settings under device configuration in BalenaCloud.

BALENA_HOST_CONFIG_hdmi_force_hotplug 1

BALENA_HOST_CONFIG_hdmi_drive 2

When I pulled the SD card I see config.txt has the following:
hdmi_drive=2
hdmi_force_hotplug=1
disable_splash=1
dtparam=i2c_arm=on
dtparam=spi=on
dtparam=audio=on
enable_uart=1
gpu_mem=16

Is there something else that needs adding? Audio is being forced out the analog 3.5 port even with these settings.

Hi,

Could you also try setting hdmi_force_edid_audio=1?

That seems to have done the trick, thank you!

So for the record, I’m using this HDMI audio splitter to feed audio via optical link to my stereo system. The audio coming from the analog 3.5mm port was weak and muddled. The digital audio is a much cleaner solution.

The config.txt file now reads as follows:

hdmi_drive=2
hdmi_force_edid_audio=1
hdmi_force_hotplug=1
disable_splash=1
dtparam=i2c_arm=on
dtparam=spi=on
dtparam=audio=on
enable_uart=1
gpu_mem=16

Thanks for coming back and confirming that hdmi_force_edid_audio=1 worked for you!