View previous topic :: View next topic |
Author |
Message |
spica Guru
Joined: 04 Jun 2021 Posts: 333
|
Posted: Wed Jan 08, 2025 7:48 pm Post subject: Microphone onboard - headset automatic switch |
|
|
Hi All,
I recently got new hardware, and I’m encountering an issue where, when I plug my headset into the laptop, two separate microphones are detected.
This causes confusion, as I’m unsure which microphone is being used by applications.
I need a way to configure the system to automatically disable the onboard microphone when the headset is connected, ensuring the correct microphone is used.
A little bit about the setup:
Code: | 00:1f.3 Audio device [0403]: Intel Corporation Meteor Lake-P HD Audio Controller [8086:7e28] (rev 20)
Subsystem: Lenovo Device [17aa:50e9]
Kernel driver in use: sof-audio-pci-intel-mtl
Kernel modules: snd_hda_intel, snd_sof_pci_intel_mtl |
Code: | $ emerge -pv pipewire
[ebuild R ] media-video/pipewire-1.2.6:0/0.4::gentoo USE="X bluetooth dbus gstreamer jack-sdk readline sound-server ssl systemd -doc -echo-cancel (-elogind) -extra -ffmpeg -flatpak -gsettings -ieee1394 -jack-client -liblc3 -lv2 -man -modemmanager -pipewire-alsa -roc (-selinux) (-system-service) -test -v4l -zeroconf" 0 KiB |
|
|
Back to top |
|
|
spica Guru
Joined: 04 Jun 2021 Posts: 333
|
Posted: Fri Jan 10, 2025 1:52 pm Post subject: |
|
|
According to https://danielpower.ca/blog/wireplumber-device-priority, the default device is selected according to priority.
This is what I observe when headset is not connected: Code: | # wpctl status:
Audio
├─ Sources:
│ * 53. Board Microphone [vol: 0.75]
│ 158. Headphones Microphone [vol: 0.36]
Settings
└─ Default Configured Devices:
1. Audio/Source alsa_input.pci-0000_00_1f.3-platform-skl_hda_dsp_generic.HiFi__Mic1__source
# wpctl inspect 53:
node.name = "alsa_input.pci-0000_00_1f.3-platform-skl_hda_dsp_generic.HiFi__Mic1__source"
priority.driver = "1648"
priority.session = "1648"
# wpctl inspect 158:
node.name = "alsa_input.pci-0000_00_1f.3-platform-skl_hda_dsp_generic.HiFi__Mic2__source"
priority.driver = "2000"
priority.session = "2000" |
When headset is connected: Code: | # wpctl status:
Audio
├─ Sources:
│ 72. Headphones Microphone [vol: 0.36]
│ * 143. Board Microphone [vol: 0.75]
Settings
└─ Default Configured Devices:
1. Audio/Source alsa_input.pci-0000_00_1f.3-platform-skl_hda_dsp_generic.HiFi__Mic1__source
# wpctl inspect 143:
node.name = "alsa_input.pci-0000_00_1f.3-platform-skl_hda_dsp_generic.HiFi__Mic1__source"
priority.driver = "1648"
priority.session = "1648"
# wpctl inspect 72:
node.name = "alsa_input.pci-0000_00_1f.3-platform-skl_hda_dsp_generic.HiFi__Mic2__source"
priority.driver = "2000"
priority.session = "2000" |
As we can see, priorities do not work, Mic1 is default source in both observations, however it has lower priority |
|
Back to top |
|
|
Ralphred l33t
Joined: 31 Dec 2013 Posts: 694
|
Posted: Fri Jan 10, 2025 5:31 pm Post subject: |
|
|
Have you tried reversing the priorities? I don't expect it to work but it's worth a try.
If/when it doesn't work run 'udevadm monitor' and see if pluging-in/removing the headphones generates a udev event, then you can "workaround" the wireplumber issue with some udev rules/scripting. |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|