Bug 70351

Summary: Soundcard from a X2[23]0 Lenovo thinkpad gets muted on every boot since 3.13
Product: Drivers Reporter: Thomas Mann (rauchwolke)
Component: Sound(ALSA)Assignee: Jaroslav Kysela (perex)
Status: RESOLVED CODE_FIX    
Severity: normal CC: alan, tiwai
Priority: P1    
Hardware: x86-64   
OS: Linux   
Kernel Version: 3.13.* Subsystem:
Regression: Yes Bisected commit-id:
Attachments: 3.12 alsa info
3.13 alsa info
Test fix patch

Description Thomas Mann 2014-02-10 12:13:19 UTC
Since kernel version 3.13 the soundcard on my x230 Lenovo thinkpad gets muted on every boot (i can see it because the mute light lights up - when the kernel is loaded)- see http://thinkwiki.de/Datei:X230-Precision.jpg - the button in the top left corner. As first i thought it's the UEFI stub but the light isn't on before the kernel is loaded.

This isn't a big deal when the machine is booted the first time, as kde will restore the volume on every boot. But when i use hibernation, the sound stays muted and i have to manually unmute the soundcard every time i resume a hibernated session.

Using a kernel <3.13 solves the problem.
Comment 1 Takashi Iwai 2014-02-11 16:54:43 UTC
Please give alsa-info.sh outputs on both 3.12 and 3.13 kernels.  Run it with --no-upload option and attach the outputs to bugzilla.
Comment 2 Thomas Mann 2014-02-12 13:18:54 UTC
as i use luks with lvm the muting isn't triggered by an userland app as the soundcard get muted directly after the UEFI stub hands over to the kernel (the cryptsetup password is asked directly after the muting) and i use my own initramfs code that never touches the soundcard (the same code is used in 3.12.* and 3.13* - just for clarification
Comment 3 Thomas Mann 2014-02-12 13:20:08 UTC
Created attachment 125741 [details]
3.12 alsa info
Comment 4 Thomas Mann 2014-02-12 13:20:45 UTC
Created attachment 125751 [details]
3.13 alsa info
Comment 5 Thomas Mann 2014-02-12 13:21:25 UTC
the error happens also with a x220 thinkpad
Comment 6 Takashi Iwai 2014-02-12 13:34:22 UTC
The diff between 3.12 and 3.13 shows that it's only the mute of mixer switch of thinkpad_acpi driver.  The possible difference is that now it's linked with conexant codec driver.

Could you check whether disabling the mute LED support in sound/pci/hda/patch_conexant.c like below fixes the issue?

--- a/sound/pci/hda/patch_conexant.c
+++ b/sound/pci/hda/patch_conexant.c
@@ -3240,7 +3240,7 @@ enum {
        CXT_FIXUP_THINKPAD_ACPI,
 };
 
-#if IS_ENABLED(CONFIG_THINKPAD_ACPI)
+#if 0 //IS_ENABLED(CONFIG_THINKPAD_ACPI)
 
 #include <linux/thinkpad_acpi.h>
 #include <acpi/acpi.h>
Comment 7 Takashi Iwai 2014-02-12 13:46:19 UTC
Alternatively, try the patch below instead.  This should fix the inconsistent LED after resume.  (When you test this, don't forget to discard the previous change.)

The LED on at boot is rather a feature.  Since 3.13, there is a link between the mute/mic-mute LEDs and the HD-audio driver Master and Capture switches.  At the initial state, the mixer is muted, thus the mute LED bound with the mixer is also turned on.
Comment 8 Takashi Iwai 2014-02-12 13:47:13 UTC
Created attachment 125761 [details]
Test fix patch
Comment 9 Thomas Mann 2014-02-12 15:00:19 UTC
the attachment 125761 [details] fixes the led on resume - but on boot it is still on.

should i try the patch from comment 6 too? and is there a way to tell linux that i don't want a muted soundcard on firstboot? even also restore doesn't set the card to unmuted - this worked in 3.10.
Comment 10 Thomas Mann 2014-02-12 15:01:32 UTC
also restore=alsa-restore - that init script from gentoo that restores the mixer on boot
Comment 11 Takashi Iwai 2014-02-12 15:17:58 UTC
Is the LED still on even when you unmute Master volume?  If so, it's a bug.

As I mentioned, the LED is intentionally on at boot because the volume is really muted initially unless someone unmutes.  Usually a desktop system (either alsatl restore call via systemd or udev, or kmix) or a sound backend (e.g. PulseAudio) unmutes accordingly.
Comment 12 Takashi Iwai 2014-02-12 15:20:36 UTC
And, the Master was already muted at boot on Linux.  It's been over decades.
Now you see it finally since the mute LED is coupled properly with the mixer status.  In the earlier kernels, this wasn't achieved, thus you just didn't see it on LED.
Comment 13 Thomas Mann 2014-02-12 15:22:30 UTC
> Is the LED still on even when you unmute Master volume? 

No, it works as expected.

It would be nice to get the patch from comment 9 into the mainline kernel. Thanks for your help and the explanations.
Comment 14 Takashi Iwai 2014-02-12 15:27:42 UTC
OK, thanks for a quick test.  Of course, the patch should be upstreamed :)
I'm going to submit later.
Comment 15 Thomas Mann 2015-01-08 02:23:50 UTC
fixed in the current version