alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ALSA: hda/realtek - Couldn't detect Mic if booting with headset plugged
@ 2020-09-14  6:51 Hui Wang
  2020-09-17 15:53 ` Sasha Levin
  2020-09-21  8:25 ` Takashi Iwai
  0 siblings, 2 replies; 3+ messages in thread
From: Hui Wang @ 2020-09-14  6:51 UTC (permalink / raw)
  To: alsa-devel, tiwai, kailang; +Cc: stable

We found a Mic detection issue on many Lenovo laptops, those laptops
belong to differnt models and they have different audio design like
internal mic connects to the codec or PCH, they all have this problem,
the problem is if plugging a headset before powerup/reboot the
machine, after booting up, the headphone could be detected but Mic
couldn't. If we plug out and plug in the headset, both headphone and
Mic could be detected then.

Through debugging we found the codec on those laptops are same, it is
alc257, and if we don't disable the 3k pulldown in alc256_shutup(),
the issue will be fixed. So far there is no pop noise or power
consumption regression on those laptops after this change.

Cc: Kailang Yang <kailang@realtek.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Hui Wang <hui.wang@canonical.com>
---
 sound/pci/hda/patch_realtek.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index 85e207173f5d..b6dc47da1d7b 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -3428,7 +3428,11 @@ static void alc256_shutup(struct hda_codec *codec)
 
 	/* 3k pull low control for Headset jack. */
 	/* NOTE: call this before clearing the pin, otherwise codec stalls */
-	alc_update_coef_idx(codec, 0x46, 0, 3 << 12);
+	/* If disable 3k pulldown control for alc257, the Mic detection will not work correctly
+	 * when booting with headset plugged. So skip setting it for the codec alc257
+	 */
+	if (codec->core.vendor_id != 0x10ec0257)
+		alc_update_coef_idx(codec, 0x46, 0, 3 << 12);
 
 	if (!spec->no_shutup_pins)
 		snd_hda_codec_write(codec, hp_pin, 0,
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] ALSA: hda/realtek - Couldn't detect Mic if booting with headset plugged
  2020-09-14  6:51 [PATCH] ALSA: hda/realtek - Couldn't detect Mic if booting with headset plugged Hui Wang
@ 2020-09-17 15:53 ` Sasha Levin
  2020-09-21  8:25 ` Takashi Iwai
  1 sibling, 0 replies; 3+ messages in thread
From: Sasha Levin @ 2020-09-17 15:53 UTC (permalink / raw)
  To: Sasha Levin, Hui Wang, alsa-devel, tiwai, kailang; +Cc: Kailang Yang, stable

Hi

[This is an automated email]

This commit has been processed because it contains a -stable tag.
The stable tag indicates that it's relevant for the following trees: all

The bot has tested the following trees: v5.8.9, v5.4.65, v4.19.145, v4.14.198, v4.9.236, v4.4.236.

v5.8.9: Build OK!
v5.4.65: Build OK!
v4.19.145: Build OK!
v4.14.198: Build OK!
v4.9.236: Failed to apply! Possible dependencies:
    0a6f0600efc3 ("ALSA: hda/realtek - New codecs support for ALC215/ALC285/ALC289")
    1078bef0cd92 ("ALSA: hda/realtek - Support ALC300")
    1c9609e3a8cf ("ALSA: hda - Reduce the suspend time consumption for ALC256")
    3aabf94c2d95 ("ALSA: hda/realtek - Fix ALC275 no sound issue")
    4a219ef8f370 ("ALSA: hda/realtek - Add ALC256 HP depop function")
    532a7784c376 ("ALSA: hda/realtek - There is no loopback mixer in the ALC234/274/294")
    693abe11aa6b ("ALSA: hda/realtek - Fixed hp_pin no value")
    71683c32dee6 ("ALSA: hda/realtek - Support headset mode for ALC234/ALC274/ALC294")
    bde1a7459623 ("ALSA: hda/realtek - Fixed headphone issue for ALC700")
    c0ca5eced222 ("ALSA: hda/realtek - Reduce click noise on Dell Precision 5820 headphone")
    c2d6af53a43f ("ALSA: hda/realtek - Add default procedure for suspend and resume state")

v4.4.236: Failed to apply! Possible dependencies:
    0a6f0600efc3 ("ALSA: hda/realtek - New codecs support for ALC215/ALC285/ALC289")
    1078bef0cd92 ("ALSA: hda/realtek - Support ALC300")
    1c9609e3a8cf ("ALSA: hda - Reduce the suspend time consumption for ALC256")
    3aabf94c2d95 ("ALSA: hda/realtek - Fix ALC275 no sound issue")
    4a219ef8f370 ("ALSA: hda/realtek - Add ALC256 HP depop function")
    532a7784c376 ("ALSA: hda/realtek - There is no loopback mixer in the ALC234/274/294")
    693abe11aa6b ("ALSA: hda/realtek - Fixed hp_pin no value")
    71683c32dee6 ("ALSA: hda/realtek - Support headset mode for ALC234/ALC274/ALC294")
    bde1a7459623 ("ALSA: hda/realtek - Fixed headphone issue for ALC700")
    c0ca5eced222 ("ALSA: hda/realtek - Reduce click noise on Dell Precision 5820 headphone")
    c2d6af53a43f ("ALSA: hda/realtek - Add default procedure for suspend and resume state")


NOTE: The patch will not be queued to stable trees until it is upstream.

How should we proceed with this patch?

-- 
Thanks
Sasha

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] ALSA: hda/realtek - Couldn't detect Mic if booting with headset plugged
  2020-09-14  6:51 [PATCH] ALSA: hda/realtek - Couldn't detect Mic if booting with headset plugged Hui Wang
  2020-09-17 15:53 ` Sasha Levin
@ 2020-09-21  8:25 ` Takashi Iwai
  1 sibling, 0 replies; 3+ messages in thread
From: Takashi Iwai @ 2020-09-21  8:25 UTC (permalink / raw)
  To: Hui Wang; +Cc: alsa-devel, kailang, stable

On Mon, 14 Sep 2020 08:51:18 +0200,
Hui Wang wrote:
> 
> We found a Mic detection issue on many Lenovo laptops, those laptops
> belong to differnt models and they have different audio design like
> internal mic connects to the codec or PCH, they all have this problem,
> the problem is if plugging a headset before powerup/reboot the
> machine, after booting up, the headphone could be detected but Mic
> couldn't. If we plug out and plug in the headset, both headphone and
> Mic could be detected then.
> 
> Through debugging we found the codec on those laptops are same, it is
> alc257, and if we don't disable the 3k pulldown in alc256_shutup(),
> the issue will be fixed. So far there is no pop noise or power
> consumption regression on those laptops after this change.
> 
> Cc: Kailang Yang <kailang@realtek.com>
> Cc: <stable@vger.kernel.org>
> Signed-off-by: Hui Wang <hui.wang@canonical.com>

Applied now.  Thanks.


Takashi

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-09-21  8:30 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-14  6:51 [PATCH] ALSA: hda/realtek - Couldn't detect Mic if booting with headset plugged Hui Wang
2020-09-17 15:53 ` Sasha Levin
2020-09-21  8:25 ` Takashi Iwai

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).