All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ALSA: hda/realtek - Fix headset mic problem for a HP machine with alc671
@ 2022-03-10 13:03 ` huangwenhui
  0 siblings, 0 replies; 19+ messages in thread
From: huangwenhui @ 2022-03-10 13:03 UTC (permalink / raw)
  To: perex, tiwai
  Cc: jeremy.szu, hui.wang, wse, cam, kailang, tanureal, sami,
	alsa-devel, linux-kernel, huangwenhui

On a HP 288 Pro G8, the front Mic could not be detected.

Signed-off-by: huangwenhui <huangwenhuia@uniontech.com>
---
 sound/pci/hda/patch_realtek.c | 37 +++++++++++++++++++++++++++++++++++
 1 file changed, 37 insertions(+)

diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index 3a42457984e9..bcd56cdc07af 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -10519,6 +10519,37 @@ static void alc671_fixup_hp_headset_mic2(struct hda_codec *codec,
 	}
 }
 
+static void alc671_fixup_hp288_headset_mic2(struct hda_codec *codec,
+					     const struct hda_fixup *fix, int action)
+{
+	struct alc_spec *spec = codec->spec;
+	hda_nid_t hp_pin = alc_get_hp_pin(spec);
+
+	static const struct hda_pintbl pincfgs[] = {
+		{ 0x19, 0x02a11040 }, /* use as headset mic, with its own jack detect */
+		{ 0x1b, 0x0181304f },
+		{ }
+	};
+
+	if (!hp_pin)
+		hp_pin = 0x21;
+
+	switch (action) {
+	case HDA_FIXUP_ACT_PRE_PROBE:
+		spec->gen.mixer_nid = 0;
+		spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
+		snd_hda_apply_pincfgs(codec, pincfgs);
+		break;
+	case HDA_FIXUP_ACT_INIT:
+		alc_write_coef_idx(codec, 0x19, 0xa054);
+		msleep(80);
+		snd_hda_codec_write(codec, hp_pin, 0,
+			    AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE);
+		msleep(100);
+		break;
+	}
+}
+
 static void alc897_hp_automute_hook(struct hda_codec *codec,
 					 struct hda_jack_callback *jack)
 {
@@ -10615,6 +10646,7 @@ enum {
 	ALC669_FIXUP_ACER_ASPIRE_ETHOS,
 	ALC669_FIXUP_ACER_ASPIRE_ETHOS_HEADSET,
 	ALC671_FIXUP_HP_HEADSET_MIC2,
+	ALC671_FIXUP_HP288_HEADSET_MIC2,
 	ALC662_FIXUP_ACER_X2660G_HEADSET_MODE,
 	ALC662_FIXUP_ACER_NITRO_HEADSET_MODE,
 	ALC668_FIXUP_ASUS_NO_HEADSET_MIC,
@@ -10986,6 +11018,10 @@ static const struct hda_fixup alc662_fixups[] = {
 		.type = HDA_FIXUP_FUNC,
 		.v.func = alc671_fixup_hp_headset_mic2,
 	},
+	[ALC671_FIXUP_HP288_HEADSET_MIC2] = {
+		.type = HDA_FIXUP_FUNC,
+		.v.func = alc671_fixup_hp288_headset_mic2,
+	},
 	[ALC662_FIXUP_ACER_X2660G_HEADSET_MODE] = {
 		.type = HDA_FIXUP_PINS,
 		.v.pins = (const struct hda_pintbl[]) {
@@ -11067,6 +11103,7 @@ static const struct snd_pci_quirk alc662_fixup_tbl[] = {
 	SND_PCI_QUIRK(0x1028, 0x069f, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
 	SND_PCI_QUIRK(0x103c, 0x1632, "HP RP5800", ALC662_FIXUP_HP_RP5800),
 	SND_PCI_QUIRK(0x103c, 0x873e, "HP", ALC671_FIXUP_HP_HEADSET_MIC2),
+	SND_PCI_QUIRK(0x103c, 0x885f, "HP 288 Pro G8", ALC671_FIXUP_HP288_HEADSET_MIC2),
 	SND_PCI_QUIRK(0x1043, 0x1080, "Asus UX501VW", ALC668_FIXUP_HEADSET_MODE),
 	SND_PCI_QUIRK(0x1043, 0x11cd, "Asus N550", ALC662_FIXUP_ASUS_Nx50),
 	SND_PCI_QUIRK(0x1043, 0x129d, "Asus N750", ALC662_FIXUP_ASUS_Nx50),
-- 
2.20.1




^ permalink raw reply related	[flat|nested] 19+ messages in thread
* Re: [PATCH] ALSA: hda/realtek - Fix headset mic problem for a HP machine with alc671
@ 2022-03-11  1:20 huangwenhui
  2022-03-11  8:30   ` Takashi Iwai
  0 siblings, 1 reply; 19+ messages in thread
From: huangwenhui @ 2022-03-11  1:20 UTC (permalink / raw)
  To: Takashi Iwai
  Cc: alsa-devel, kailang, tanureal, jeremy.szu, linux-kernel, tiwai,
	wse, hui.wang, sami, cam

Hi&nbsp; Takashi,


if adjusting the mixer element or replugging the headset, the headphone would be unmuted.
But most users hope that the default state is unmuted.
Should this unconditional unmute be required?


Thanks.


------------------ Original ------------------
From: &nbsp;"Takashi Iwai"<tiwai@suse.de&gt;;
Date: &nbsp;Thu, Mar 10, 2022 10:03 PM
To: &nbsp;"黄文辉"<huangwenhuia@uniontech.com&gt;; 
Cc: &nbsp;"perex"<perex@perex.cz&gt;; "tiwai"<tiwai@suse.com&gt;; "jeremy.szu"<jeremy.szu@canonical.com&gt;; "hui.wang"<hui.wang@canonical.com&gt;; "wse"<wse@tuxedocomputers.com&gt;; "cam"<cam@neo-zeon.de&gt;; "kailang"<kailang@realtek.com&gt;; "tanureal"<tanureal@opensource.cirrus.com&gt;; "sami"<sami@loone.fi&gt;; "alsa-devel"<alsa-devel@alsa-project.org&gt;; "linux-kernel"<linux-kernel@vger.kernel.org&gt;; 
Subject: &nbsp;Re: [PATCH] ALSA: hda/realtek - Fix headset mic problem for a HP machine with alc671

&nbsp;

On Thu, 10 Mar 2022 14:58:36 +0100,
huangwenhui wrote:
&gt; 
&gt; Hi&nbsp; Takashi,
&gt; 
&gt; Thank you for your reply.
&gt; 
&gt; When booting with plugged headset, the headphone will be muted.

The muted state is the default behavior.&nbsp; Wouldn't it be unmuted if
you adjust the corresponding mixer element?


Takashi

&gt; 
&gt; Thanks.
&gt;&nbsp; 
&gt; ------------------ Original ------------------
&gt; From:&nbsp; "Takashi Iwai"<tiwai@suse.de&gt;;
&gt; Date:&nbsp; Thu, Mar 10, 2022 09:29 PM
&gt; To:&nbsp; "huangwenhui"<huangwenhuia@uniontech.com&gt;;
&gt; Cc:&nbsp; "perex"<perex@perex.cz&gt;; "tiwai"<tiwai@suse.com&gt;; "jeremy.szu"
&gt; <jeremy.szu@canonical.com&gt;; "hui.wang"<hui.wang@canonical.com&gt;; "wse"
&gt; <wse@tuxedocomputers.com&gt;; "cam"<cam@neo-zeon.de&gt;; "kailang"
&gt; <kailang@realtek.com&gt;; "tanureal"<tanureal@opensource.cirrus.com&gt;; "sami"
&gt; <sami@loone.fi&gt;; "alsa-devel"<alsa-devel@alsa-project.org&gt;; "linux-kernel"
&gt; <linux-kernel@vger.kernel.org&gt;;
&gt; Subject:&nbsp; Re: [PATCH] ALSA: hda/realtek - Fix headset mic problem for a HP
&gt; machine with alc671
&gt;&nbsp; 
&gt; On Thu, 10 Mar 2022 14:03:01 +0100,
&gt; huangwenhui wrote:
&gt; &gt;
&gt; &gt; On a HP 288 Pro G8, the front Mic could not be detected.
&gt; &gt;
&gt; &gt; Signed-off-by: huangwenhui <huangwenhuia@uniontech.com&gt;
&gt; 
&gt; Thanks for the patch.&nbsp; Most of the changes look OK, but one thing I
&gt; still don't get:
&gt; 
&gt; &gt; + case HDA_FIXUP_ACT_INIT:
&gt; &gt; + alc_write_coef_idx(codec, 0x19, 0xa054);
&gt; &gt; + msleep(80);
&gt; &gt; + snd_hda_codec_write(codec, hp_pin, 0,
&gt; &gt; + &nbsp; &nbsp; AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE);
&gt; 
&gt; Why this unconditional unmute is required for fixing the mic problem?
&gt; 
&gt; Takashi
&gt; 
&gt;

^ permalink raw reply	[flat|nested] 19+ messages in thread
* [PATCH] ALSA: hda/realtek - Fix headset mic problem for a HP machine with alc671
@ 2022-03-11  9:38 ` huangwenhui
  0 siblings, 0 replies; 19+ messages in thread
From: huangwenhui @ 2022-03-11  9:38 UTC (permalink / raw)
  To: perex, tiwai
  Cc: jeremy.szu, hui.wang, wse, cam, kailang, tanureal, sami,
	alsa-devel, linux-kernel, huangwenhui

On a HP 288 Pro G8, the front mic could not be detected.In order to
get it working, the pin configuration needs to be set correctly, and
the ALC671_FIXUP_HP_HEADSET_MIC2 fixup needs to be applied.

Signed-off-by: huangwenhui <huangwenhuia@uniontech.com>
---
 sound/pci/hda/patch_realtek.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index 3a42457984e9..e9c9b1d1bf0d 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -11067,6 +11067,7 @@ static const struct snd_pci_quirk alc662_fixup_tbl[] = {
 	SND_PCI_QUIRK(0x1028, 0x069f, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
 	SND_PCI_QUIRK(0x103c, 0x1632, "HP RP5800", ALC662_FIXUP_HP_RP5800),
 	SND_PCI_QUIRK(0x103c, 0x873e, "HP", ALC671_FIXUP_HP_HEADSET_MIC2),
+	SND_PCI_QUIRK(0x103c, 0x885f, "HP 288 Pro G8", ALC671_FIXUP_HP_HEADSET_MIC2),
 	SND_PCI_QUIRK(0x1043, 0x1080, "Asus UX501VW", ALC668_FIXUP_HEADSET_MODE),
 	SND_PCI_QUIRK(0x1043, 0x11cd, "Asus N550", ALC662_FIXUP_ASUS_Nx50),
 	SND_PCI_QUIRK(0x1043, 0x129d, "Asus N750", ALC662_FIXUP_ASUS_Nx50),
-- 
2.20.1




^ permalink raw reply related	[flat|nested] 19+ messages in thread
* [PATCH] ALSA: hda/realtek - Fix headset mic problem for a HP machine with alc671
@ 2022-07-12  9:22 ` Meng Tang
  0 siblings, 0 replies; 19+ messages in thread
From: Meng Tang @ 2022-07-12  9:22 UTC (permalink / raw)
  To: perex, tiwai, tcrawford, kai.heng.feng, tanureal, cam, kailang,
	sbinding, andy.chi, yong.wu
  Cc: alsa-devel, linux-kernel, Meng Tang

On a HP 288 Pro G6, the front mic could not be detected.In order to
get it working, the pin configuration needs to be set correctly, and
the ALC671_FIXUP_HP_HEADSET_MIC2 fixup needs to be applied.

Signed-off-by: Meng Tang <tangmeng@uniontech.com>
---
 sound/pci/hda/patch_realtek.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index ecc737342fcc..34139c26795f 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -11219,6 +11219,7 @@ static const struct snd_pci_quirk alc662_fixup_tbl[] = {
 	SND_PCI_QUIRK(0x103c, 0x1632, "HP RP5800", ALC662_FIXUP_HP_RP5800),
 	SND_PCI_QUIRK(0x103c, 0x8719, "HP", ALC897_FIXUP_HP_HSMIC_VERB),
 	SND_PCI_QUIRK(0x103c, 0x873e, "HP", ALC671_FIXUP_HP_HEADSET_MIC2),
+	SND_PCI_QUIRK(0x103c, 0x877e, "HP 288 Pro G6", ALC671_FIXUP_HP_HEADSET_MIC2),
 	SND_PCI_QUIRK(0x103c, 0x885f, "HP 288 Pro G8", ALC671_FIXUP_HP_HEADSET_MIC2),
 	SND_PCI_QUIRK(0x1043, 0x1080, "Asus UX501VW", ALC668_FIXUP_HEADSET_MODE),
 	SND_PCI_QUIRK(0x1043, 0x11cd, "Asus N550", ALC662_FIXUP_ASUS_Nx50),
-- 
2.20.1




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

end of thread, other threads:[~2022-07-12  9:32 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-10 13:03 [PATCH] ALSA: hda/realtek - Fix headset mic problem for a HP machine with alc671 huangwenhui
2022-03-10 13:03 ` huangwenhui
2022-03-10 13:29 ` Takashi Iwai
2022-03-10 13:29   ` Takashi Iwai
2022-03-10 13:58   ` 黄文辉
2022-03-10 14:02     ` Takashi Iwai
2022-03-10 14:02       ` Takashi Iwai
2022-03-11  1:20 huangwenhui
2022-03-11  8:30 ` Takashi Iwai
2022-03-11  8:30   ` Takashi Iwai
2022-03-11  8:51   ` huangwenhui
2022-03-11  9:38 huangwenhui
2022-03-11  9:38 ` huangwenhui
2022-03-11 16:05 ` Takashi Iwai
2022-03-11 16:05   ` Takashi Iwai
2022-07-12  9:22 Meng Tang
2022-07-12  9:22 ` Meng Tang
2022-07-12  9:31 ` Takashi Iwai
2022-07-12  9:31   ` Takashi Iwai

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.