No sound when switching audio from line-out to s/pdif

I have two audio outputs connected to my PC. One is headphones over an aux cord plugged into the mobo. The other is a toslink cable connected to a DAC and my speakers. Audio works fine on both devices through Windows, so I can rule out hardware issues.

When I switch my audio device from “Line Out” to “Digital Output (S/PDIF)” there is no audio from the speakers. It’s fixed if I restart pipewire or wireplumber, but reoccurs if I swap audio outputs again. Oddly, it’s also fixed if I mute and un-mute while on spdif.

Issue does not happen if I switch from spdif to hdmi output then back to spdif. Issue does happen if the order is spdif → hdmi → line-out → spdif or spdif → line-out → hdmi → spdif. So seems caused by switching to line-out.

This issue was previously reported in Fedora 34 Beta, but was fixed by an update. I have all updates installed.