Ubuntu – Automatically change Sound Input Output device

sound

I have to plugin my USB Audio adapter ( 4300054 Gigawire USB Audio Adapter) for audio input because has a combo-input-output port for voice. After I do this, I have go open Sound Settings and manually select the USB Audio adapter for Input and Output, if I do not, the system default remains selected.

Is there anyway, I can make Ubuntu to automatically select the USB Audio Adapter as the default as soon as I plug-in?

Best Answer

There is pulseaudio module-switch-on-connect and module-switch-on-port-available that enable automatic switching of an audio device on connection. See with the following command if any of these modules is already loaded:

pactl list short modules

If not, then test if you can make automatic switching work by issuing one or both of the following commmands in a terminal:

pactl load-module module-switch-on-connect
pactl load-module module-switch-on-port-available

On success add one or both of the following lines to your /etc/pulse/default.pa

load-module module-switch-on-connect
load-module module-switch-on-port-available

This will then always load these modules on every login, resp. restart of the pulseaudio daemon.

Please note that local user settings in ~/.config/pulse/default.pa override system-wide setting. If you have such a local file you will enter the above commands there.

If it still not works you may have conflicting settings in such a local default.pa. It then may worth to (temporarily) rename this file followed by a restart of the Pulseaudio server before trying above again:

mv ~/.config/pulse/default.pa ~/.config/pulse/default.pa.old
pulseaudio -k