I have headphones (Razer Kraken X with virtual 7.1 surround sound) plugged in to my desktop, I also have a monitor (MSI Optix) connected via HDMI. I have regular stereo speakers plugged into my monitor.
The issue is that when the monitor wakes up or is turned on, Windows switches between the playback devices for about 5 mins before settling on one - usually the headphones.
I have a video of this happening: https://i.sstatic.net/a0auo.jpg
Audio will play through my headphones while it's doing this, but it's got static on it. Once it settles, everything is fine.
Until I can figure out what the issue is, I've disabled the monitor device as per the answer here: How do I get rid of monitor audio devices from Windows 10. But I do use my speakers, so would like to get to the bottom of this.