Score:1

Setting a persistent default audio output

ph flag

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?

Score:1
ph flag

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.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.