If your sound output devices are consistent and always present despite the wrong one being selected you may be able to have a startup script set to the correct one via command line like:
pacmd set-default-sink SINK_INDEX_NUMBER_HERE
and this to show what sinks and index numbers they are:
pacmd list-sinks
See here for some more information.
It's what I first tried when I had sound device issues, but didn't help me when my sound device was actually missing (as per my comment above).
If you boot/resume and your monitor sound device is missing the only "fixes" I have found so far are:
- Go to screen display settings, disable the monitor with the sound device, click
Apply
and when it asks if you want to keep the changes click Revert Settings
.
- Run a script which changes the monitor screen to the wrong mode, in my case:
xrandr --output DP-1 --mode 1920x1080
then immediately changes to the right mode: xrandr --output DP-1 --mode 2560x1080
Either approach always gets me my sound device back.