This is an issue that has bugged me in Linux generally since I tried most of the Debian based one. Why do the audio output change when I reboot my PC?
I am not interested in changing it to a primary one, but have it so it always is the same as the last one used. Like in any normal OS behavior. And not change it to the one I would like at every login.
It's been 10 years now since I started testing and trying out Linux. And this have been here since then. If anyone have a permanent solution, please send it my way.
From what I have gleaned a few months ago, pipewire is just a modified pulse audio. I prefer ALSA.
You can create a 'pulse off' folder in /etc and drag 'pulse' folder into that so it will never launch at boot. Would advise you install most alsa packages via synaptic, even the pulse plugin so that audio works in browsers. No guarantee this will solve your issue.
Actually, it shows a way of disabling auto-switching, so once you've set a default device, it cannot automatically switch away from that device... Linux doesn't handle device loading very well, different devices come available at different times during boot, so if your speakers, for instance, aren't available, but they're the default device, it'll automatically switch to your headphones as fallback, since there must be a device. Disabling that auto-switching means it must wait for the set default device.
select your speakers as "FallBack"
This seems to help with last state.
Eg: normally i have the speakers running, with FallBack set i can plug-in my TV via HDMI, & the sound changes to the HDMI output, if i turn the pc off, when re-start the pc again it will still have audio via HDMI if it is plugged in, If i unplug the TV, it reverts back to the speakers.
Hope this helps.