0

When I switch my output device to speakers, everything works as expected. Until I reboot the machine. Then I have to go back into settings and select my speaker output again because Ubuntu reverts to using my headphones for output.

While I use the headset infrequently, I leave it plugged in all the time. Unplugging the headset is a bit of a chore due to the design on my PC.

How can I force pulseaudio to always use speaker output except for when I explicitly select the headphones for audio output? Right now it's the other way around.

3 Answers3

1

Pulseaudio is configurable. To find out, which sources you have you could issue:

pactl list short sinks

Then you might get something like:

alsa_output.pci-0000_00_1b.0.analog-stereo  module-alsa-card.c  s16le 2ch 44100Hz   SUSPENDED s16le 2ch 44100Hz SUSPENDED

To set a certain output as default (your choice from the list above):

pacmd set-default-sink alsa_output.pci-0000_00_1b.0.analog-stereo

To persist it put that line into /etc/pulse/default.pato have it across reboots

kanehekili
  • 6,402
  • This solution did not work for me. After adding the suggested line (edited to match my device), I lost all sound output devices. Removing the line from the configuration file restored expected functionality. – Nathan W. Olney Jun 22 '20 at 22:07
  • The reason your solution did not work was because I copied and pasted the last bit of code and put my sink name in there. I did not even notice that the line started with `pacmd'. Removing that first bit from the configuration line fixed the issue. Pulseaudio is behaving exactly as I wanted now. Thank you. – Nathan W. Olney Jun 22 '20 at 23:02
0

After trying various searches, I was able to solve my issue following steps outlined in this post.

After identifying the correct device using pacmd list-sinks, I added the command pacmd set-default-sink "SINKNAME" to Startup Applications.

Since I wanted to explicitly set the headset as the output device only when I was using it, this solution worked for my issue.

Edit: This solution is not perfect as the output device will revert back to headphones if pulseaudio is restarted. But it beats having to change the device every time I reboot the system.

  • Cool, thanks for sharing. I'd be interested in your pactl list .. and which source you entered – kanehekili Jun 22 '20 at 22:13
  • @kanehekili I had two entries: My USB headset, and my onboard audio: alsa_card.usb-Cosair_Corsair_VOID_PRO_Surround_USB_Adapter_00000000-00 and alsa_output.pci-0000_00_1f.3.analog-stereo. I used the latter for the startup command. – Nathan W. Olney Jun 22 '20 at 22:20
  • I've borked it and edited my answer. I was on the "wrong side". You'd needed sinks, not sources. Sorry about that – kanehekili Jun 22 '20 at 22:37
0

List your devices by name

pacmd list-sinks | grep name:

Set default output device in the config file:

echo "set-default-sink alsa_output.pci-000_00_05.0.analog-stereo" >> /etc/pulse/default.pa

Replace <alsa_output.pci-000_00_05.0.analog-stereo> with your device of choice from above device listings

Reboot system.

ThunderBird
  • 1,955