If you have a laptop with typical feeble speakers, and a usb audio, then you might like to hear sound through the USB sound device when you have your external sound device connected.
Simply right-click the panel’s loudspeaker icon > Sound Preferences > Output and click on the radio button for your external device. Every time!
You can automate this by editing /etc/pulse/default.da but there is a better way:
In your home directory, create - if necessary - ~/.config/pulse/default.pa containing:
Ahh … It - auto selecting the usb device - is now the default action in 17.10
So this extra file is not need in 17.10, but worse … including the above will cause your pulseaudio code to not load at all ! Immediately after an install or upgrade there appears to be no file /etc/pulse/default.da, until pulseaduio runs first time, so the hack fails and pulseaudio is not able to load.
Hack should probably be something like:
if [ -f /etc/pulse/default.pa ]; then
.include /etc/pulse/default.pa
load-module module-switch-on-connect
fi
But probably best to just delete it and upgrade to 17.10!