From this blog post:
PulseAudio itself comes with two basic command line tools, called pacmd and pactl. Former offers a set-default-sink command, but that doesn't do what you expect from it. It turns out that, at least on my system, PulseAudio daemon keeps persistent settings for each application that ever connected to it. This means that the default sink only gets used for applications that the daemon hasn't seen yet.
In other words, this blogger had hit the exact same problem as you did:
- switching the default sink only affects programs that haven't been used before
- moving existing input only affects programs actually active with the sound card
- you'll need a tool to walk through the persistent settings and repoint them to the new card.
And so this blogger had written paswitch, a command line tool to do exactly that. You can find its source code in Git format here.
To install:
- Make sure you have a Pulseaudio development library package (
libpulse-dev or similar) installed. You'll also need the gcc compiler and the make utility. - Run
git clone https://www.tablix.org/~avian/git/paswitch.git to download the source code. cd paswitch to enter the directory created by the git clone command, then run make. - If completed without errors, there should now be a
paswitch binary in the directory. Copy it to your /usr/local/bin/ directory. - Read the
README file in the directory for an example on how to use it.
Another option is to tell PulseAudio daemon to not persist the sink settings for applications, by adding the restore_device=false option to the module-stream-restore line in /etc/pulse/default.pa:
load-module module-stream-restore restore_device=false
After doing that and restarting PulseAudio, switching the default sink will cause all new sound applications to default to it.
But your mileage may vary, depending on the desktop environment you use: on my Debian 9, disabling the persistence caused other annoying behavior with KDE, and I ended up returning to the default behavior. If I recall correctly, it caused the KDE System Settings -> Multimedia -> Audio and Video -> Device Preference list to gain a new copy of my audio devices at each login.