I had this problem - pulseaudio was defaulting to my USB headset, but I want sound to come to my speakers by default and I'll switch to the headset using video conferencing software if I'm on a call.
I ran pactl list short sinks
to find out which 'sinks' (i.e. audio output devices) are available. The output looked like this:
$ pactl list short sinks
1 alsa_output.usb-C-Media_Electronics_Inc._USB_Audio_Device-00.analog-stereo module-alsa-card.c s16le 2ch 44100Hz RUNNING
2 alsa_output.pci-0000_09_00.4.analog-stereo module-alsa-card.c s16le 2ch 44100Hz IDLE
7 alsa_output.pci-0000_07_00.1.hdmi-stereo module-alsa-card.c s16le 2ch 44100Hz SUSPENDED
The first of these, which the list has as RUNNING
, is my USB headset. The one I want is the second. If I run pactl set-default-sink alsa_output.pci-0000_09_00.4.analog-stereo
this makes the right device active, but this is just like changing the option in the 'Sound' settings menu.
To make the change persistent through rebooting, I edited /etc/pulse/default.pa
and added set-default-sink alsa_output.pci-0000_09_00.4.analog-stereo
to the bottom of the file (i.e. the same as the command above but missing off the pactl
from the front).
So work out which device you want to switch to, run pactl set-default-sink device
to check you have this right, then add set-default-sink device
to the bottom of /etc/pulse/default.pa
.
For input devices, the equivalent commands are pactl list short sources
and pactl set-default-source
.