This post requires no answers, I’m mostly just documenting my notes on fixing flaky audio device issues with hdmi audio out with nvidia drivers.
issue 1: After a restart your audio output device is not what you expect
For example, in my case the “Digital Output (S/PDIF)…” audio output device was selected as the audio output device after running/closing certain programs, after restarts, or after upgrading video drivers. I expected audio output to be HDMI/2
- open ‘Sound’ settings from Gnome Settings
- select your HDMI output device
- click ‘Test’ and verify audio is working or
issue 2: Selecting your correct audio device in Gnome Settings still has no audio
for example, if
aplay /usr/share/sounds/alsa/Front_Center.wav does not produce any sound
(As all things linux this is not a one size fits all solution, however here’s the steps that work for my setup)
- list all devices from aplay,
- identify the card/device numer from the list of devices that your device should be, for me:
card 1: NVidia [HDA NVidia], device 7: HDMI 1 [HDMI 1] Subdevices: 0/1 Subdevice #0: subdevice #0
- verify this is the correct device with aplay,
aplay -D plughw:1,7 /usr/share/sounds/alsa/Front_Center.wav
4.1. under “### Load audio drivers statically” add line:
load-module module-alsa-sink device=hw:1,7
4.2. disable udev detection, comment out this section:
#.ifexists module-udev-detect.so #load-module module-udev-detect #.else ### Use the static hardware detection module (for systems that lack udev support) #load-module module-detect #.endif
- restart pulseaudio:
pulseaudio -k pulseaudio --start
Note, this will now make your sound setup static. Disabling udev detection will make it so that plugging in new HDMI devices, bluetooth audio, etc… will not only not switch to a new audio device, it likely won’t even be detected.
This setup is very inflexible!