Pulseaudio over-rides user settings in Ubuntu21, result is incorrect default and no sound
Extreme time and frustration. Extremely poor pulseaudio documentation.
Summary
Pulseaudio will not accept user settings for the default audio device. Result; incorrect device and no audio.
environment
see pa-info.txt
Steps to reproduce
Launch Ubuntu21.10. Open settings. menu:sound Choose HDMI 2. Save and close settings.
What is the expected correct behaviour?
HDMI port 2 will be the default audio device, non-volatile (permanent after boot and resume)
What is the current bug behaviour?
Upon boot, reboot, power resume: Pulseaudio reverts to SPDF and no sound from card.
To resolve, must either:
a/ open settings and choose the correct device b/ give commands: pulseaudio --kill; pulseaudio --start
See below: steps taken to resolve. PROBLEM: The resolution is unstable. Upon boot, Pulseuadio continues to interfere with default settings.
Summary of problem
How to force pulsaudio to default to correct audio device?
System: Ubuntu 21.10; NVidia gtx1050ti.
Configuration:
4k monitor plugged into DP port;
hdmi2av adapter plugged into hdmi port;
analogue stereo plugged into hdmi2av converter.
Desired outcome:
4k video on monitor;
HD sound from stereo.
Actual outcome:
have 4k video;
no sound from hdmi port after boot and resume.
Steps taken to resolve
STEP 1/ Find CORRECT HDMI card, device, port
$ aplay -l
returns...
card 1: NVidia [HDA NVidia], device 7: HDMI 1 [HDMI 1] Subdevices: 1/1 Subdevice #0: subdevice #0
STEP 2/ Testing for the correct card
$ aplay -D plughw:1,7 /usr/share/sounds/alsa/Noise.wav
returns...
audio noise
(correct! so far, so good)
STEP 3/ To find the pulseaudio sinks
$ pactl list sinks
returns...
alsa_output.pci-0000_01_00.1.hdmi-stereo-extra1 module-alsa-card.c s16le 2ch 44100Hz
STEP 4/ Manually configuring PulseAudio to detect the Nvidia HDMI
$ sudo gedit /etc/pulse/default.pa
type these lines at the bottom of default.pa ... "load-module module-alsa-sink device=hw:1,7" "set-sink-port alsa_output.pci-0000_01_00.1.hdmi-stereo-extra1"
save and close gedit
STEP 5/ Restart PulseAudio:
$ pulseaudio --kill
$ pulseaudio --start
open settings, and check the sound settings
is the correct audio device listed?
STEP 6/ switch machine power off, then on to restart
open settings, and check the sound settings
is the correct audio device selected as the default?
if yes, assume resolved.