1

I am trying to set my default audio output to be over Display Port. I've already tried following the settings described in this thread.

The main issue is that my preferred audio output doesn't show up when I run pactl list short sinks. I am able to manually add it via the following, however this doesn't work consistently:

pactl load-module module-alsa-sink device=hw:0,8
pactl set-default-sink alsa_output.hw_0_8

I have tried adding the above lines (without pactl at the front) to ~/.config/pulse/defaults.pa which hasn't worked. I have tried removing ~/.config/pulse/defaults.pa and adding those lines to /etc/pulse/defaults.pa which causes the correct speaker to be used after a restart before I am logged in consistently, but as soon as I log in, the computer switches to the wrong speaker. I have tried adding the above lines to my ~/.bashrc file, but the correct speaker only is used after I launch a terminal. I have tried adding them to ~/.profile which caused an error to occur at login forcing me to revert the file in a tty.

Is there some way to make this work consistently on boot every time?

N0rbert
  • 99,918

1 Answers1

1

I got it working by adding the following to my ~/.profile file:

/usr/bin/pactl load-module module-alsa-sink device=hw:0,8 2> /dev/null
/usr/bin/pactl set-default-sink alsa_output.hw_0_8 2> /dev/null

It is important to note that not having the 2> /dev/null on each of those lines is what causes the system to display an error message at login and stop functioning. I believe, with my limited Linux knowledge, this is because an error is raised in the ~/.profile which causes Ubuntu to think the login failed for some reason and refuses to let you login.

(if that does happen, switch to a tty by pressing Ctrl+Alt+F3 or another F-key if F3 doesn't work, which should open a terminal-like session. Log in there, modify your ~/.profile file to not produce errors with your terminal editor of choice, save, and reboot.