Wednesday, April 29, 2020

Set a default audio output device in Ubuntu 18.04


First: List the audio output devices using:

pactl list short sources  

Example of the output:

0 alsa_output.usb-Dell_Dell_AC511_USB_SoundBar-00.analog-stereo.monitor module-alsa-card.c s16le 2ch 44100Hz SUSPENDED
1 alsa_input.usb-Dell_Dell_AC511_USB_SoundBar-00.analog-stereo module-alsa-card.c s16le 2ch 44100Hz SUSPENDED
2 alsa_output.pci-0000_00_1b.0.analog-stereo.monitor module-alsa-card.c s16le 2ch 44100Hz IDLE
3 alsa_input.pci-0000_00_1b.0.analog-stereo module-alsa-card.c s16le 2ch 44100Hz SUSPENDED
4 alsa_input.usb-046d_HD_Pro_Webcam_C920_627B04DF-02.analog-stereo module-alsa-card.c s16le 2ch 32000Hz SUSPENDED

Now, to make this work at every restart, follow this :

sudo -H gedit /etc/pulse/default.pa

Example of the edit:

### Make some devices default ###  sink(for output) / source(for input)
#set-default-sink output 
#set-default-source input
set-default-sink alsa_output.pci-0000_00_1b.0.analog-stereo.monitor
#set-default-source input

----
Sources:
AskUbuntu
Rastating.