PulseAudio
Be sure to configure ALSA first.
PulseAudio configuration
Fix the default PulseAudio/ALSA a52 5.1 profile detection
Setting the default device (to avoid default output pointing to analog headphones)
First you need to find out the device names by running:
And then add it to the default.pa configuration: