Skip to contentSkip to conversation

ALSA: hda/realtek - Fix headset mic problem for a HP machine with alc671

PATCH huangwenhui 2 participants 3 messages Mar 11, 2022 – Mar 14, 2022

lore
Share & tools
lore
#1 lore raw
In reply to huangwenhui
Quoted 7 lines · huangwenhui

Hi 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?

It's the standard behavior for most of ALSA drivers.

The initial mute state is rather controlled via alsactl, restoring the previous state. Also, the sound server like PulseAudio or pipewire does unmute automatically. If this doesn't work as expected, that's a more problem to diagnose.

Takashi

Quoted 69 lines

Thanks.

------------------ Original ------------------

From:  "Takashi Iwai"<[email protected]>;
Date:  Thu, Mar 10, 2022 10:03 PM
To:  "黄文辉"<[email protected]>;

Cc: "perex"<[email protected]>; "tiwai"<[email protected]>; "jeremy.szu" <[email protected]>; "hui.wang"<[email protected]>; "wse" <[email protected]>; "cam"<[email protected]>; "kailang" <[email protected]>; "tanureal"<[email protected]>; "sami" <[email protected]>; "alsa-devel"<[email protected]>; "linux-kernel" <[email protected]>;
Subject: Re: [PATCH] ALSA: hda/realtek - Fix headset mic problem for a HP machine with alc671

Quoted 6 lines · huangwenhui

Hi Takashi,

Thank you for your reply.

When booting with plugged headset, the headphone will be muted.

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

Takashi

Quoted 37 lines

Thanks.

------------------ Original ------------------

From:  "Takashi Iwai"<[email protected]>;
Date:  Thu, Mar 10, 2022 09:29 PM
To:  "huangwenhui"<[email protected]>;

Cc: "perex"<[email protected]>; "tiwai"<[email protected]>; "jeremy.szu" <[email protected]>; "hui.wang"<[email protected]>; "wse" <[email protected]>; "cam"<[email protected]>; "kailang" <[email protected]>; "tanureal"<[email protected]>; "sami" <[email protected]>; "alsa-devel"<[email protected]>; "linux-kernel" <[email protected]>;
Subject: Re: [PATCH] ALSA: hda/realtek - Fix headset mic problem for a HP machine with alc671

Quoted 4 lines · huangwenhui

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

Thanks for the patch. Most of the changes look OK, but one thing I still don't get:

Quoted 5 lines

+ 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);

Why this unconditional unmute is required for fixing the mic problem?

Takashi

#0 lore raw

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"<[email protected]&gt;;
Date: &nbsp;Thu, Mar 10, 2022 10:03 PM
To: &nbsp;"黄文辉"<[email protected]&gt;;
Cc: &nbsp;"perex"<[email protected]&gt;; "tiwai"<[email protected]&gt;; "jeremy.szu"<[email protected]&gt;; "hui.wang"<[email protected]&gt;; "wse"<[email protected]&gt;; "cam"<[email protected]&gt;; "kailang"<[email protected]&gt;; "tanureal"<[email protected]&gt;; "sami"<[email protected]&gt;; "alsa-devel"<[email protected]&gt;; "linux-kernel"<[email protected]&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"<[email protected]&gt;;
&gt; Date:&nbsp; Thu, Mar 10, 2022 09:29 PM
&gt; To:&nbsp; "huangwenhui"<[email protected]&gt;;
&gt; Cc:&nbsp; "perex"<[email protected]&gt;; "tiwai"<[email protected]&gt;; "jeremy.szu" &gt; <[email protected]&gt;; "hui.wang"<[email protected]&gt;; "wse" &gt; <[email protected]&gt;; "cam"<[email protected]&gt;; "kailang" &gt; <[email protected]&gt;; "tanureal"<[email protected]&gt;; "sami" &gt; <[email protected]&gt;; "alsa-devel"<[email protected]&gt;; "linux-kernel" &gt; <[email protected]&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 <[email protected]&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;

#2 lore raw
In reply to Takashi Iwai

I will modify the patch and commit again.

Thanks.
&nbsp;
&nbsp;
------------------&nbsp;Original&nbsp;------------------
From: &nbsp;"Takashi&nbsp;Iwai"<[email protected]&gt;;
Date: &nbsp;Fri, Mar 11, 2022 04:30 PM
To: &nbsp;"huangwenhui"<[email protected]&gt;;
Cc: &nbsp;"perex"<[email protected]&gt;; "tiwai"<[email protected]&gt;; "jeremy.szu"<[email protected]&gt;; "hui.wang"<[email protected]&gt;; "wse"<[email protected]&gt;; "cam"<[email protected]&gt;; "kailang"<[email protected]&gt;; "tanureal"<[email protected]&gt;; "sami"<[email protected]&gt;; "alsa-devel"<[email protected]&gt;; "linux-kernel"<[email protected]&gt;;
Subject: &nbsp;Re: [PATCH] ALSA: hda/realtek - Fix headset mic problem for a HP machine with alc671

&nbsp;

On Fri, 11 Mar 2022 02:20:42 +0100,
huangwenhui wrote:
&gt;
&gt; Hi&nbsp; Takashi,
&gt;
&gt; if adjusting the mixer element or replugging the headset, the headphone would &gt; be unmuted.
&gt; But most users hope that the default state is unmuted.
&gt; Should this unconditional unmute be required?

It's the standard behavior for most of ALSA drivers.

The initial mute state is rather controlled via alsactl, restoring the previous state.&nbsp; Also, the sound server like PulseAudio or pipewire does unmute automatically.&nbsp; If this doesn't work as expected, that's a more problem to diagnose.

Takashi

&gt;
&gt; Thanks.
&gt;
&gt; ------------------ Original ------------------
&gt; From:&nbsp; "Takashi Iwai"<[email protected]&gt;;
&gt; Date:&nbsp; Thu, Mar 10, 2022 10:03 PM
&gt; To:&nbsp; "huangwenhui"<[email protected]&gt;;
&gt; Cc:&nbsp; "perex"<[email protected]&gt;; "tiwai"<[email protected]&gt;; "jeremy.szu" &gt; <[email protected]&gt;; "hui.wang"<[email protected]&gt;; "wse" &gt; <[email protected]&gt;; "cam"<[email protected]&gt;; "kailang" &gt; <[email protected]&gt;; "tanureal"<[email protected]&gt;; "sami" &gt; <[email protected]&gt;; "alsa-devel"<[email protected]&gt;; "linux-kernel" &gt; <[email protected]&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:58:36 +0100,
&gt; huangwenhui wrote:
&gt; &gt;
&gt; &gt; Hi&nbsp; Takashi,
&gt; &gt;
&gt; &gt; Thank you for your reply.
&gt; &gt;
&gt; &gt; When booting with plugged headset, the headphone will be muted. &gt;
&gt; The muted state is the default behavior.&nbsp; Wouldn't it be unmuted if &gt; you adjust the corresponding mixer element?
&gt;
&gt; Takashi
&gt;
&gt; &gt;
&gt; &gt; Thanks.
&gt; &gt;
&gt; &gt; ------------------ Original ------------------
&gt; &gt; From:&nbsp; "Takashi Iwai"<[email protected]&gt;;
&gt; &gt; Date:&nbsp; Thu, Mar 10, 2022 09:29 PM
&gt; &gt; To:&nbsp; "huangwenhui"<[email protected]&gt;;
&gt; &gt; Cc:&nbsp; "perex"<[email protected]&gt;; "tiwai"<[email protected]&gt;; "jeremy.szu" &gt; &gt; <[email protected]&gt;; "hui.wang"<[email protected]&gt;; "wse" &gt; &gt; <[email protected]&gt;; "cam"<[email protected]&gt;; "kailang" &gt; &gt; <[email protected]&gt;; "tanureal"<[email protected]&gt;; "sami" &gt; &gt; <[email protected]&gt;; "alsa-devel"<[email protected]&gt;; "linux-kernel" &gt; &gt; <[email protected]&gt;;
&gt; &gt; Subject:&nbsp; Re: [PATCH] ALSA: hda/realtek - Fix headset mic problem for a HP &gt; &gt; machine with alc671
&gt; &gt;
&gt; &gt; On Thu, 10 Mar 2022 14:03:01 +0100,
&gt; &gt; huangwenhui wrote:
&gt; &gt; &gt;
&gt; &gt; &gt; On a HP 288 Pro G8, the front Mic could not be detected. &gt; &gt; &gt;
&gt; &gt; &gt; Signed-off-by: huangwenhui <[email protected]&gt; &gt; &gt;
&gt; &gt; Thanks for the patch.&nbsp; Most of the changes look OK, but one thing I &gt; &gt; still don't get:
&gt; &gt;
&gt; &gt; &gt; + case HDA_FIXUP_ACT_INIT:
&gt; &gt; &gt; + alc_write_coef_idx(codec, 0x19, 0xa054);
&gt; &gt; &gt; + msleep(80);
&gt; &gt; &gt; + snd_hda_codec_write(codec, hp_pin, 0,
&gt; &gt; &gt; +&nbsp;&nbsp;&nbsp;&nbsp; AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE); &gt; &gt;
&gt; &gt; Why this unconditional unmute is required for fixing the mic problem? &gt; &gt;
&gt; &gt; Takashi
&gt; &gt;
&gt; &gt;
&gt;
&gt;