From 7550d3c3e81c8aa159dc5f6445b1184dcbcdbf2b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Romain=20Gon=C3=A7alves?= Date: Fri, 7 Jan 2022 19:33:14 +0100 Subject: wiki/thinkpad-x220: Add micmute button fix --- src/w/thinkpad-x220.md | 49 +++++++++++++++++++++++++++++++++++++------------ 1 file changed, 37 insertions(+), 12 deletions(-) diff --git a/src/w/thinkpad-x220.md b/src/w/thinkpad-x220.md index 7764308..3b12aa3 100644 --- a/src/w/thinkpad-x220.md +++ b/src/w/thinkpad-x220.md @@ -27,13 +27,13 @@ muting the right microphone fix this issue. With pulseaudio/pipewire-pulse, the `remap-source` module can be loaded: ``` -pactl load-module module-remap-source \ - "source_name=${source_name}" \ - "master=${source_index}" \ - use_master_format=1 \ - master_channel_map=front-left \ - channel_map=mono \ - channels=1 +$ pactl load-module module-remap-source \ + "source_name=${source_name}" \ + "master=${source_index}" \ + use_master_format=1 \ + master_channel_map=front-left \ + channel_map=mono \ + channels=1 ``` However, the fans can still be heard, and not all voip clients handle noise @@ -43,16 +43,41 @@ cancelling. Instead, you can keep the right microphone active and use it for ``` $ pactl load-module module-echo-cancel \ - "source_name=${source_name}" \ - "master=${source_index}" \ - use_master_format=1 \ - aec_method="webrtc" \ - aec_args='"beamforming=1 mic_geometry=-1,0,0,1,0,0"' + "source_name=${source_name}" \ + "master=${source_index}" \ + use_master_format=1 \ + aec_method="webrtc" \ + aec_args='"beamforming=1 mic_geometry=-1,0,0,1,0,0"' ``` See [my dotfiles](https://git.rgoncalves.se/dots/tree/.config/pipewire) for additional information. +## audio led buttons + +On some ThinkPad models, audio led buttons can be broken and desynchronized +on linux `5.15.x`. + +A quick workaround is to catch the key press events (in your dwm configuration, +i3, sway, etc ...) and force the synchronization of the leds. + +For the microphone: + +``` +$ pactl get-source-mute @DEFAULT_SOURCE@ | grep no >/dev/null 2>&1 +$ echo "${?}" > /sys/class/leds/platform::micmute/brightness +``` + +For the audio sink: + +``` +$ pactl get-sink-mute @DEFAULT_SINK@ | grep no >/dev/null 2>&1 +$ echo "${?}" > /sys/class/leds/platform::mute/brightness +``` + +See my [dotfiles](https://git.rgoncalves.se/dots/tree/.bin/ag-audio) and +[the related pipewire issue](https://gitlab.freedesktop.org/pipewire/pipewire/-/issues/1849). + ## usb-c mod // todo -- cgit v1.2.3