Pipewire isn’t as random as PulseAudio was, but it still doesn’t necessarily do the right thing when I’m plugging and unplugging devices from my laptop.
What I want to tell my system is:
If my BT headphones are attached, use them
If no BT headphones, use the HDMI output through my docking station
If no HDMI, use the laptop speakers
never use the digital or analog outputs on my docking station
This seems like something that ought to be easy to do with priority/weighing, right? So, if the heaviest gets selected:
BT Headphones = 100
HDMI = 50
built-in = 10
usb digital = -1
usb analog = -1
but, I don’t see a way to do that in pipewire. I’ve seen a couple things that suggest changing ALSA priority in /usr/share/alsa-card-profile/mixer/paths, but those files come from the OS, and may get stomped on in an upgrade. Is this something I can do?
As you can see above the * sign is on Built in speaker (default). From above example we could change it to HDMI with wpctl set-default 45 where 45 is ID number of HDMI sink (see above).
This unfortunately doesn’t work. If I set the default device using wp set-default <id>, and then I connect my headphones, set the audio device to my headphones, and then disconnect my headphones, the output device does not revert to the default that I had set, it keeps reverting to the digital audio device in my laptop dock.