Earlier quoted context omitted.
Pipewire can switch to headset mode automatically whenever a microphone input is needed. And it switches it back to headphone mode afterwards. It works on Linux exactly like on a phone or macOS. Pipewire is backwards compatible with Pulseaudio so there is no reason to not migrate.
I've not heard of pipewire. Need to check this out because I'd love for my truly wireless earphones to be able to seamlessly switch modes on Ubuntu. I use a wired headset for work calls I need to be on quickly because it's pretty flawless, but the tether is more than a little annoying. EDIT: It took me 5 minutes after reading the comment above to replace pulseaudio with pipewire on Ubuntu 20.04, now I have access to…
PS: In the past, I've wrestled with PulseAudio & BT dongles and my JBL headsets on Ubuntu. Banging my head on a brick wall would have been more pleasurable than that.
PPS: and today we have Pipewire on the front page!