On 15/06/2012 8:30 PM, Oon-Ee Ng wrote:
Still not on my laptop, but I searched around, posted it a while back on the pulseaudio wiki. Here it is http://www.freedesktop.org/wiki/Software/PulseAudio/FAQ#How_do_I_switch_the_default_sound_card.2C_moving_all_applications.3F Again, not sure if by now there's a way to run this script whenever a card is plugged in and out, if you do find that let me know =). Like I said, I just bind the script to a shortcut key using xbindkeys
I'm not sure how 'recommended' it is, but there is a method of running scripts when devices are plugged in using udev rules. There is a guide here http://www.banquise.org/hardware/how-to-automatically-run-a-script-after-inserting-a-usb-device-on-ubuntu/ though it involves being able to identify which device your usb sound device is.
(Rather than blindingly following the example I recommend reading through http://www.reactivated.net/writing_udev_rules.html to understand what you are doing)