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?

There is pulseaudio module-switch-on-connect that enables automatic switching of an audio device on connection. To test if this works we may issue the following commmand in a terminal:

pacmd load-module module-switch-on-connect

On success we can add the following line to our /etc/pulse/default.pa

load-module module-switch-on-connect

to always load this module on every login, resp. restart of the pulseaudio daemon.

  • I just re-found this answer and wish I could upvote it again. This solves the issue on Ubuntu 14.04. – Lars Nyström Oct 8 '15 at 10:02
  • 1
    such a long time it is out there, and still not set to be loaded automatically in 16.04 :| – Ivan Temchenko Jul 16 '16 at 9:54
  • @LarsNyström I upvoted for you – Nabil Kadimi Jul 8 '17 at 0:57
  • just applied this to 17.04 - perfect solution and really should be default – fishears Aug 4 '17 at 7:06
  • Tested and working on Mint 18 (Sarah) – Lucio Mollinedo Aug 22 '17 at 15:33

create ~/.config/pulse/default.pa if it doesn't exist and append

.include /etc/pulse/default.pa
load-module module-switch-on-connect

This is better than editing /etc/pulse/default.pa.

Afterwards you should run pulseaudio -k && pulseaudio --start to have the changes take effect. Thanks for pointing that out lreeder

  • 4
    Works for me on 16.04 LTS. You also need to restart pulseaudio after creating this config. 'pulseaudio -k' from the command line will do it. – lreeder Jan 7 '17 at 16:16
  • 1
    Why is it "better than editing /etc/pulse/default.pa"? – Rodrigo Apr 1 at 13:07

Your Answer

 

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.