Im having trouble with my Debian 11 install reverting back to 3.5mm analog audio output, though HDMI is plugged in and where I want the audio to come out of. Debian GUI has no stock way to disable a output device. Normally the setting in sound area sticks, but recently not always.
Its even tricky to do it with CLI via alsa or pulse tools, as we are not dealing with different audio cards, as most examples online deal with, but both HDMI output and Analog output are different devices of the one HDA Intel PCH device.
This is the results of aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: PCH [HDA Intel PCH], device 0: ALC662 rev3 Analog [ALC662 rev3 Analog]
Subdevices: 0/1
Subdevice #0: subdevice #0
card 0: PCH [HDA Intel PCH], device 3: HDMI 0 [HDMI 0]
Subdevices: 1/1
Subdevice #0: subdevice #0