Every time I boot up I have to switch my audio output device to my "Line Out" headphones because for some reason my microphone defaults as a speaker.
Here is a well explained tutorial to set a default audio input/output.
First: List the audio output devices using
pactl list short sinks
Example of the output:
pactl list short sources 0 alsa_output.pci-0000_02_00.1.hdmi-stereo.monitor module-alsa-card.c s16le 2ch 44100Hz SUSPENDED 1 alsa_input.usb-AVerMedia_Technologies__Inc._Live_Gamer_Portable_2_5202050100060-03.analog-stereo module-alsa-card.c 2 alsa_output.usb-Blue_Microphones_Yeti_Stereo_Microphone_REV8-00.analog-stereo.monitor module-alsa-card.c s16le 2ch 44100Hz SUSPENDED 3 alsa_input.usb-Blue_Microphones_Yeti_Stereo_Microphone_REV8-00.analog-stereo module-alsa-card.c s16le 2ch 44100Hz RUNNING
Second: To set a default output device run the command
pactl set-default-sink <'output device name'>
pactl set-default-sink 'alsa_output.pci-0000_00_1f.3.analog-stereo'
Now, to make this work at every restart, follow this :
First, open the file /etc/pulse/default.pa using :
sudo -H gedit /etc/pulse/default.pa
Then scroll to the bottom of the file, where two lines starting with
set- will be commented out.
Now, uncomment these lines and replace the words input and output with the number of the sink (for output) / source (for input) that you want to be the default.
### Make some devices default set-default-sink 3 set-default-source 3
After doing this, save and exit. Then, delete the ~/.config/pulse directory by running
rm -r ~/.config/pulse, and then reboot the system. Once the system reboots, the appropriate devices should now be set as the defaults.
This can be done with
PulseAudio Volume Control if you prefer to use a GUI.
Once you've opened PulseAudio Volume Control, choose the
configuration (the last tab), then select the output and/or input you want to use from the
profile dropdown menu.
It should look similar to this
PulseAudio Volume Control can also be used to adjust volume levels for each input, output, system sounds and applications that are currently in use.
Here's a post from Linuxhint with more info on PulseAudio.
To make Singrium's answer work, I had to comment out this line from my
/etc/pulse/default.pa by adding the
# load-module module-switch-on-connect
Otherwise, on startup my audio device would be set to my default device, but then would switch to my USB hub once it was detected. This prevents that switch and ensures your chosen audio device is the output.