Comment 51 for bug 1888598

Revision history for this message
Igor V. Kovalenko (i-garrison) wrote :

I believe there is no defined order in which audio devices are resuming, which makes them appear to pulseaudio in random order. This is probably causing pulseaudio module-switch-on-connect to flip user preference to each appearing device in same (random) order. If you do not use this function you can disable module-switch-on-connect or use it's blacklist to prevent your preference flipping between devices.

Pulseaudio itself is not aware of suspend/resume function. I do not know if there is any system callback that confirms that system completed resume sequence and everything is back (including access rights to audio devices) so fixing this issue in full will be not a trivial task.

With pulseaudio-15.0 update you can tell pulseaudio to always select specified profile when device appears. This also is not a complete solution, but you can either make sure your HDMI is always off or is always using the profile with your preferred port:
https://www.freedesktop.org/wiki/Software/PulseAudio/Notes/15.0/#cardprofilescanbesettosticky
Pavucontrol 5.0 has easy button for this, or use pactl send-message as described in release notes.