Ubuntu – How to automatically switch to USB headset when plugged in

10.10automationheadsetpulseaudiosound

Whenever I plugged in my old audio jack headset, sound was immediately diverted from my speakers to the headset speakers, and the microphone was immediately available.

When I plug in my new USB headset, I have to open Sound Preferences and switch both input and output to the headset.

Is there any way to make this happen automatically?

I'm using a Fujitsu-Siemens Amilo Pi laptop, Maverick and a Logitech H330 USB headset.

Best Answer

This is actually a bug in Pulseaudio.

Here is a recent bug report on the situation, but it might be a dupe of this older (but reportedly fixed) one.

Here's a workaround that you could possibly use. Create a text file and paste this in:

#! /bin/bash

amixer cset iface=MIXER,name='Input Source' 1
amixer cset iface=MIXER,name='Output Source' 1
exit

If it is fact your third one then you should replace the end numbers on the commands with the number '2'. If fourth, then '3'. And so on.

You can then make a launcher on the panel and click on it every time you plug in the headset. It's an ugly workaround for now but until it is fixed (i.e. Pulseaudio remembers preferred devices) I don't see much else you can do.

You could do some extreme crazy workaround involving writing udev rules.... but is it worth it? ;)

Related Question