Bug#1009628: linux-image-5.16.0-6-amd64: Wrong initial state of microphone muted LED on Thinkpad E14 (Gen 2)

2022-04-16 Thread Stefano
I hacked together a dirty workaround, which I'm sharing just in case
somebody else with the same problem ends up on this bug report.
Since I'm using systemd and pulseaudio, and the microphone state
changes are correctly being sent to the kernel (I'm not exactly sure
who's responsible for this), I've created a small systemd service unit
that depends on pulseaudio and simply toggles the microphone muted
status twice. The pulseaudio unit is a user service, so this unit
needs to be a user service as well.
A temporary file is used to avoid toggling the microphone more than
once per boot.

$ cat /usr/local/lib/systemd/user/micropohe_led.service
[Unit]
Requires=pulseaudio.service
Description=Make sure that the microphone-muted LED on the F4 key
matches the actual microphone status

[Service]
Type=oneshot
ExecStart=/bin/sh -c "[ ! -f /temp/micmute-led-toggled ] && touch
/tmp/micmute-led-toggled && pactl set-source-mute @DEFAULT_SOURCE@
toggle && pactl set-source-mute @DEFAULT_SOURCE@ toggle"

[Install]
WantedBy=default.target


This service can be enabled for all users with "sudo systemctl
--global enable micropohe_led.service".


On Wed, 13 Apr 2022 10:36:14 +0200 Steven  wrote:
> Package: src:linux
> Version: 5.16.18-1
> Severity: normal
> X-Debbugs-Cc: steven3k+deb...@gmail.com
>
> Dear Maintainer,
> I'd like to report that the initial status of the "microphone muted" LED on 
> the
> F4 key of a Thinkpad E14 (Gen 2) laptop is incorrectly set to on on boot, even
> though the microphone is indeed not muted.
> Pressing the key leaves the LED on but mutes the microphone. Pressing the key
> again unmutes the microphone and turns off the LED.
> All subsequent presses behave as expected (i.e., the LED matches the mute
> status).
>
> It look like the information that the mic is unmuted never gets to the module
> that is handling the LEDs.
>
> Manually turning the LED off via 
> "/sys/class/leds/platform::micmute/brightness"
> disables the LED trigger. Re-enabling the led trigger with "echo micmute >
> /sys/class/leds/platform::micmute/trigger" re-lights the LED.
>
> This seems somewhat related:
> https://lore.kernel.org/alsa-devel/20210221115208.105203-1-hdego...@redhat.com/
>
> Please let me know if I can help troubleshoot the problem. So far I was not
> able to find any workaround.
>
> Thank you!
>
> *** Reporter, please consider answering these questions, where appropriate ***
>
>* What led up to the situation?
>* What exactly did you do (or not do) that was effective (or
>  ineffective)?
>* What was the outcome of this action?
>* What outcome did you expect instead?
>
> *** End of the template - remove these template lines ***
>
>
> -- Package-specific info:
> ** Version:
> Linux version 5.16.0-6-amd64 (debian-ker...@lists.debian.org) (gcc-11 (Debian 
> 11.2.0-19) 11.2.0, GNU ld (GNU Binutils for Debian) 2.38) #1 SMP PREEMPT 
> Debian 5.16.18-1 (2022-03-29)
>
> ** Command line:
> BOOT_IMAGE=/vmlinuz-5.16.0-6-amd64 root=/dev/mapper/ghoul--vg-root ro quiet
>
> ** Tainted: POE (12289)
>  * proprietary module was loaded
>  * externally-built ("out-of-tree") module was loaded
>  * unsigned module was loaded
>
> ** Kernel log:
> [   15.625143] audit: type=1400 audit(1649836987.684:5): apparmor="STATUS" 
> operation="profile_load" profile="unconfined" name="nvidia_modprobe//kmod" 
> pid=829 comm="apparmor_parser"
> [   15.625191] audit: type=1400 audit(1649836987.684:6): apparmor="STATUS" 
> operation="profile_load" profile="unconfined" name="/usr/bin/man" pid=831 
> comm="apparmor_parser"
> [   15.625196] audit: type=1400 audit(1649836987.684:7): apparmor="STATUS" 
> operation="profile_load" profile="unconfined" name="man_filter" pid=831 
> comm="apparmor_parser"
> [   15.625198] audit: type=1400 audit(1649836987.684:8): apparmor="STATUS" 
> operation="profile_load" profile="unconfined" name="man_groff" pid=831 
> comm="apparmor_parser"
> [   15.625521] audit: type=1400 audit(1649836987.684:9): apparmor="STATUS" 
> operation="profile_load" profile="unconfined" name="lsb_release" pid=828 
> comm="apparmor_parser"
> [   15.627366] audit: type=1400 audit(1649836987.684:10): apparmor="STATUS" 
> operation="profile_load" profile="unconfined" name="ioq3ded" pid=832 
> comm="apparmor_parser"
> [   15.627902] audit: type=1400 audit(1649836987.688:11): apparmor="STATUS" 
> operation="profile_load" profile="unconfined" name="libreoffice-xpdfimport" 
> pid=840 comm="apparmor_parser"



Bug#1009628: linux-image-5.16.0-6-amd64: Wrong initial state of microphone muted LED on Thinkpad E14 (Gen 2)

2022-04-13 Thread Steven
Package: src:linux
Version: 5.16.18-1
Severity: normal
X-Debbugs-Cc: steven3k+deb...@gmail.com

Dear Maintainer,
I'd like to report that the initial status of the "microphone muted" LED on the
F4 key of a Thinkpad E14 (Gen 2) laptop is incorrectly set to on on boot, even
though the microphone is indeed not muted.
Pressing the key leaves the LED on but mutes the microphone. Pressing the key
again unmutes the microphone and turns off the LED.
All subsequent presses behave as expected (i.e., the LED matches the mute
status).

It look like the information that the mic is unmuted never gets to the module
that is handling the LEDs.

Manually turning the LED off via "/sys/class/leds/platform::micmute/brightness"
disables the LED trigger. Re-enabling the led trigger with "echo micmute >
/sys/class/leds/platform::micmute/trigger" re-lights the LED.

This seems somewhat related:
https://lore.kernel.org/alsa-devel/20210221115208.105203-1-hdego...@redhat.com/

Please let me know if I can help troubleshoot the problem. So far I was not
able to find any workaround.

Thank you!

*** Reporter, please consider answering these questions, where appropriate ***

   * What led up to the situation?
   * What exactly did you do (or not do) that was effective (or
 ineffective)?
   * What was the outcome of this action?
   * What outcome did you expect instead?

*** End of the template - remove these template lines ***


-- Package-specific info:
** Version:
Linux version 5.16.0-6-amd64 (debian-ker...@lists.debian.org) (gcc-11 (Debian 
11.2.0-19) 11.2.0, GNU ld (GNU Binutils for Debian) 2.38) #1 SMP PREEMPT Debian 
5.16.18-1 (2022-03-29)

** Command line:
BOOT_IMAGE=/vmlinuz-5.16.0-6-amd64 root=/dev/mapper/ghoul--vg-root ro quiet

** Tainted: POE (12289)
 * proprietary module was loaded
 * externally-built ("out-of-tree") module was loaded
 * unsigned module was loaded

** Kernel log:
[   15.625143] audit: type=1400 audit(1649836987.684:5): apparmor="STATUS" 
operation="profile_load" profile="unconfined" name="nvidia_modprobe//kmod" 
pid=829 comm="apparmor_parser"
[   15.625191] audit: type=1400 audit(1649836987.684:6): apparmor="STATUS" 
operation="profile_load" profile="unconfined" name="/usr/bin/man" pid=831 
comm="apparmor_parser"
[   15.625196] audit: type=1400 audit(1649836987.684:7): apparmor="STATUS" 
operation="profile_load" profile="unconfined" name="man_filter" pid=831 
comm="apparmor_parser"
[   15.625198] audit: type=1400 audit(1649836987.684:8): apparmor="STATUS" 
operation="profile_load" profile="unconfined" name="man_groff" pid=831 
comm="apparmor_parser"
[   15.625521] audit: type=1400 audit(1649836987.684:9): apparmor="STATUS" 
operation="profile_load" profile="unconfined" name="lsb_release" pid=828 
comm="apparmor_parser"
[   15.627366] audit: type=1400 audit(1649836987.684:10): apparmor="STATUS" 
operation="profile_load" profile="unconfined" name="ioq3ded" pid=832 
comm="apparmor_parser"
[   15.627902] audit: type=1400 audit(1649836987.688:11): apparmor="STATUS" 
operation="profile_load" profile="unconfined" name="libreoffice-xpdfimport" 
pid=840 comm="apparmor_parser"
[   15.734768] ACPI Warning: \_SB.PC00.RP05.PXSX._DSM: Argument #4 type 
mismatch - Found [Buffer], ACPI requires [Package] (20210930/nsarguments-61)
[   15.761175] snd_hda_codec_realtek ehdaudio0D0: ASoC: sink widget AIF1TX 
overwritten
[   15.761180] snd_hda_codec_realtek ehdaudio0D0: ASoC: source widget AIF1RX 
overwritten
[   15.761276] skl_hda_dsp_generic skl_hda_dsp_generic: ASoC: sink widget hifi3 
overwritten
[   15.761280] skl_hda_dsp_generic skl_hda_dsp_generic: ASoC: sink widget hifi2 
overwritten
[   15.761282] skl_hda_dsp_generic skl_hda_dsp_generic: ASoC: sink widget hifi1 
overwritten
[   15.761285] skl_hda_dsp_generic skl_hda_dsp_generic: ASoC: source widget 
Codec Output Pin1 overwritten
[   15.761287] skl_hda_dsp_generic skl_hda_dsp_generic: ASoC: sink widget Codec 
Input Pin1 overwritten
[   15.761291] skl_hda_dsp_generic skl_hda_dsp_generic: ASoC: sink widget 
Analog Codec Playback overwritten
[   15.761294] skl_hda_dsp_generic skl_hda_dsp_generic: ASoC: sink widget 
Digital Codec Playback overwritten
[   15.761297] skl_hda_dsp_generic skl_hda_dsp_generic: ASoC: sink widget Alt 
Analog Codec Playback overwritten
[   15.761302] skl_hda_dsp_generic skl_hda_dsp_generic: ASoC: source widget 
Analog Codec Capture overwritten
[   15.761305] skl_hda_dsp_generic skl_hda_dsp_generic: ASoC: source widget 
Digital Codec Capture overwritten
[   15.761309] skl_hda_dsp_generic skl_hda_dsp_generic: ASoC: source widget Alt 
Analog Codec Capture overwritten
[   15.761315] skl_hda_dsp_generic skl_hda_dsp_generic: 
hda_dsp_hdmi_build_controls: no PCM in topology for HDMI converter 3

[   15.761317] skl_hda_dsp_generic skl_hda_dsp_generic: 
hda_dsp_hdmi_build_controls: no PCM in topology for HDMI converter 4

[   15.761318] skl_hda_dsp_generic skl_hda_dsp_generic: 
hda_dsp_hdmi_build_controls: no PCM in topology for HDMI converter 5

[