Attached to my Ubuntu 20.04 desktop, are two audio recording devices: a nice condenser microphone, and a shoddy webcam microphone. Every time I power cycle my desktop, Ubuntu defaults to the webcam microphone. Is there a way to change this behavior?
Attached to my Ubuntu 20.04 desktop, are two audio recording devices: a nice condenser microphone, and a shoddy webcam microphone. Every time I power cycle my desktop, Ubuntu defaults to the webcam microphone. Is there a way to change this behavior?
You can do that using the
pactl
command.First: List the audio devices using
Second: To set a default output device run the command
Example:
pactl set-default-sink 'alsa_output.pci-0000_00_1f.3.analog-stereo'
Now that the device names are known, and they have been verified to work by using the pactl application. They can be used in conjunction with the default Pulse configuration file.
First, open the file
/etc/pulse/default.pa
using :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.
OR You can also put the input/output name in /etc/pulse/default.pa instead of the input/output number.
After doing this, delete the
~/.config/pulse
directory, and then reboot the system. Once the system comes back up, the appropriate devices should now be set as the defaults.The downside to this approach, will be that if the device list changes, the indexes of the devices may also change, meaning this process may need to be repeated; but it resolves the immediate issue, when there are multiple audio devices connected on a permanent basis.