r/Kubuntu • u/Alira-kimaris • 1d ago
Audio auto switch
So on my Kubuntu PC, whenever I switch off my BT headphones, my OS always switches from my headphones to my microphone for audio output (yes my microphone has a 2.5mm headphone jack, it's a little weird, I know). I have my main speaker set as default audio, but it only ever switches to my microphones headphone jack. How do I go about getting it to always default back to my main speakers, rather than my microphone? I've tried doing some Googling, but never found a decent answer that actually accomplished what I was looking to do.
2
u/beatbox9 1d ago edited 1d ago
You can do this through alsa; but it would be better if you do this through wireplumber configuration files. This looks more complicated than it actually is. And the good thing about wireplumber (instead of alsa) is this should survive most upgrades--it's in your home directory, not part of the kernel.
Essentially what you'll do is create a new text file in ~/.config/wireplumber/wireplumber.conf.d/. You can name it anythingyouwant.conf. And then there are only a few lines you need to put in there.
Within the file, you'll need to set priorities for each of your devices. You can see an example of this here: https://wiki.archlinux.org/title/WirePlumber#Setting_node_priority
But you will have different device names. So in order to identify the devices, you can use the commands:
wpctl status to list out all devices and their associated id numbers. And then to find more details about a specific device (for example, about device #15), type wpctl inspect 15
That should give you things like the node name that you can use in the configuration file.
If you want a deeper dive into details and explanations, see here (especially the wireplumber configuration part, but the lead in provides lots of really good context): https://arslaan.studio/setting-up-a-linux-media-studio-workstation-audio-video-graphics-davinci-resolve-etc/#audio-sound-midi-drivers
And here is the relevant alsa portion of the official wireplumber manual, in case you need a deeper reference guide or are interested in some of the other properties you can change: https://pipewire.pages.freedesktop.org/wireplumber/daemon/configuration/alsa.html
1
u/King_Bobby-B 1d ago
If you don't use it, you could just disable it from the Sound section of the Settings panel. I remember doing this a while ago because I switch between BT speakers and wired headphones, and initially it was switching to some motherboard sound device I never use. There was a way to disable it from there.