How to disable pulseaudio automatic device switch?

Solution 1:

Let me know if this doesn't work for you and I'll delete my answer. I don't have your speaker system but this should work.

Disable automatic device switching

When signal is lost to during sleep, Pulse Audio is automatically configured to activate the default source (your HDMI). Upon resume the sound device is still on HDMI. To override this setting, tell Pulse Audio to never switch sound devices automatically:

  • edit the file /etc/pulse/default.pa
  • find the line load-module module-switch-on-port-available
  • insert a # at the beginning of the line to disable automatic port switching
  • save file and exit editor
  • type pulseaudio -k to reload configuration

Solution 2:

WinEunuuchs2Unix's post is correct, but I had to adjust module-switch-on-connect instead of module-switch-on-port-available. Here's an easy one-liner:

sudo sed -i 's/^load-module module-switch-on-connect$/# load-module module-switch-on-connect/g' /etc/pulse/default.pa && pulseaudio -k