No sound via HDMI

I use a Zotac ZBOX nano that delivers sound via HDMI and a headphone jack. HD Audio is being recognized and driver seems to work: Sound over the headphone jack works fine, but I’d like to have sound via my HDMI cable. If there is no cable plugged into the headphone jack, there’s no sound via HDMI.
Is there a possibility to “manually” switch the sound output to HDMI, maybe by using the terminal or by editing the settings files? I already checked if the HDMI cable is damaged. I also consider, that maybe the headphone jack is damaged and the computer won’t switch the output automatically.

This may not be supported by the intel audio and video drivers. If it is, the setting would be available in preferences -> media (you can pick different output channels there).

Last I checked, switching output channels at runtime breaks everything: https://dev.haiku-os.org/ticket/12776 (and it can’t find new outputs at runtime also: https://dev.haiku-os.org/ticket/12777).

I can confirm that. Restarting the media_server breaks everything. For example the master output doesn’t get connected.
My problem is, that Media pref should show two outputs: HDMI and S/PDIF (=Headphone jack). But it only shows “HDA”. I guess, I set up a new entry in the bug tracker? As far as I can understand that issue is not addressed by the entries you mentioned.

HDA is the name of the driver (Intel’s High Definition Audio)

It would be weird to label headphones S/PDIF, that’s a digital signal, either TOSLINK (optical) or coaxial.

The auto-sense output switching you’re used to from other systems isn’t possible in Haiku, it’s oriented around how desktop PCs worked in the mid-1990s.

Auto-sense (or jack-sense) works nicely on some laptops (x200s and T440s for example), so i wont say it is impossible, but it is hardware dependant.
And technically nothing is impossible, if one can program the required cases.

The headphone jack of the ZBOX Nano is a TOSLINK aka. S/PDIF connection - an unusual case indeed. I installed Debian on the ZBOX to check, if the hardware is alright. It is and Debian shows to outputs: HDMI and S/PDIF (at least in the German version, maybe it’s labeled TOSLINK in English).
I would be glad to select the output manually. But whatever I do, no sound via HDMI.

AFAIK, haiku has no audio support via HDMI, unless someone wrote a driver for it recently…?

Ah yes, I downloaded the manual for this product and I see, the headphone socket also serves as a TOSLINK connector, an adaptor helps a TOSLINK lead to fit into the hole and light from TOSLINK doesn’t interfere with the normal operation of ordinary headphones since those are electrical. It’s possible that if you plugged headphones in (not a TOSLINK connector) the jack-sensing would cause headphones to be displayed as an additional option, but maybe not.

None of this helps you get HDMI audio working. It is possible to buy a device which takes TOSLINK and HDMI inputs and adds the TOSLINK audio onto the HDMI video to output a new HDMI signal with both, but these are often rather expensive since this isn’t a trivial electronics exercise.