Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Kailang <kailang@realtek.com>
To: Takashi Iwai <tiwai@suse.de>
Cc: "Joseph C. Sible" <josephcsible@gmail.com>,
	Bagas Sanjaya <bagasdotme@gmail.com>,
	"regressions@lists.linux.dev" <regressions@lists.linux.dev>,
	"perex@perex.cz" <perex@perex.cz>,
	"tiwai@suse.com" <tiwai@suse.com>,
	"alsa-devel@alsa-project.org" <alsa-devel@alsa-project.org>
Subject: RE: Fwd: [Bug 217440] New: ALC236 audio disappears from HP 15z-fc000 on warm boot
Date: Thu, 13 Jul 2023 08:25:22 +0000	[thread overview]
Message-ID: <4678992299664babac4403d9978e7ba7@realtek.com> (raw)
In-Reply-To: <87cz182hfk.wl-tiwai@suse.de>

[-- Attachment #1: Type: text/plain, Size: 2566 bytes --]

Hi Joseph,

Could you test attach patch?

BR,
Kailang

> -----Original Message-----
> From: Takashi Iwai <tiwai@suse.de>
> Sent: Tuesday, July 4, 2023 4:46 PM
> To: Kailang <kailang@realtek.com>
> Cc: Joseph C. Sible <josephcsible@gmail.com>; Bagas Sanjaya
> <bagasdotme@gmail.com>; regressions@lists.linux.dev; perex@perex.cz;
> tiwai@suse.com; alsa-devel@alsa-project.org
> Subject: Re: Fwd: [Bug 217440] New: ALC236 audio disappears from HP
> 15z-fc000 on warm boot
> 
> 
> External mail.
> 
> 
> 
> On Tue, 04 Jul 2023 10:38:43 +0200,
> Kailang wrote:
> >
> >
> > Below was the relation patches.
> > https://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound.git/commit
> > /?id=5aec98913095ed3b4424ed6c5fdeb6964e9734da
> > https://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound.git/commit
> > /?id=f30741cded62f87bb4b1cc58bc627f076abcaba8
> >
> > It shows ALC236 codec not need to run pull low 3k setting.
> >
> > I trace windows code, find it add delay for read MIC jack detected at booting
> time.
> 
> I expected something like that ;)
> If you have a test patch, let us know.
> 
> 
> thanks,
> 
> Takashi
> 
> >
> >
> > > -----Original Message-----
> > > From: Takashi Iwai <tiwai@suse.de>
> > > Sent: Sunday, June 25, 2023 5:43 PM
> > > To: Joseph C. Sible <josephcsible@gmail.com>
> > > Cc: Kailang <kailang@realtek.com>; Bagas Sanjaya
> > > <bagasdotme@gmail.com>; regressions@lists.linux.dev; perex@perex.cz;
> > > tiwai@suse.com; alsa-devel@alsa-project.org
> > > Subject: Re: Fwd: [Bug 217440] New: ALC236 audio disappears from HP
> > > 15z-fc000 on warm boot
> > >
> > >
> > > External mail.
> > >
> > >
> > >
> > > On Sat, 24 Jun 2023 03:36:11 +0200,
> > > Joseph C. Sible wrote:
> > > >
> > > > On Sun, Jun 11, 2023 at 3:36 AM Takashi Iwai <tiwai@suse.de> wrote:
> > > > >
> > > > > Thanks for checking.  So the additional delay didn't help at
> > > > > all, i.e. it's no timing issue.  We need to figure out which
> > > > > verb actually breaks things.  Oh well.
> > > >
> > > > Was there something else specific you wanted me to try for this?
> > > > If not, what do you think the next steps to get this fixed are? Do
> > > > you think it might be good to just cook the partial revert I
> > > > posted a while back after all?
> > >
> > > It's rather a call to Kailang, after all.
> > > I'm fine with any way as long as it avoids further regressions.
> > >
> > >
> > > Takashi
> > >
> > > ------Please consider the environment before printing this e-mail.

[-- Attachment #2: 0000-HP-reboot-issue.patch --]
[-- Type: application/octet-stream, Size: 2077 bytes --]

From c8eb2230e1a9e197b22de69318eb1678da6e7b04 Mon Sep 17 00:00:00 2001
From: Kailang Yang <kailang@realtek.com>
Date: Thu, 13 Jul 2023 15:57:13 +0800
Subject: [PATCH] ALSA: hda/realtek - remove 3k pull low procedure

This was the ALC283 depop procedure.
Maybe this procedure wasn't suitable with new codec.
So, let us remove it. But HP 15z-fc000 must do 3k pull low. If it reboot with plugged headset,
it will have errors show don't find codec error messages. Run 3k pull low will solve issues.
So, let AMD chipset will run this for workarround.

Signed-off-by: Kailang Yang <kailang@realtek.com>

diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index e2f8b608de82..afb4d82475b4 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -122,6 +122,7 @@ struct alc_spec {
 	unsigned int ultra_low_power:1;
 	unsigned int has_hs_key:1;
 	unsigned int no_internal_mic_pin:1;
+	unsigned int en_3kpull_low:1;
 
 	/* for PLL fix */
 	hda_nid_t pll_nid;
@@ -3622,6 +3623,7 @@ static void alc256_shutup(struct hda_codec *codec)
 	if (!hp_pin)
 		hp_pin = 0x21;
 
+	alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x1); /* Low power */
 	hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
 
 	if (hp_pin_sense)
@@ -3638,8 +3640,7 @@ static void alc256_shutup(struct hda_codec *codec)
 	/* 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 != 0x10ec0236 &&
-	    codec->core.vendor_id != 0x10ec0257)
+	if (spec->en_3kpull_low)
 		alc_update_coef_idx(codec, 0x46, 0, 3 << 12);
 
 	if (!spec->no_shutup_pins)
@@ -10682,6 +10683,8 @@ static int patch_alc269(struct hda_codec *codec)
 		spec->shutup = alc256_shutup;
 		spec->init_hook = alc256_init;
 		spec->gen.mixer_nid = 0; /* ALC256 does not have any loopback mixer path */
+		if (codec->bus->pci->vendor == PCI_VENDOR_ID_AMD)
+			spec->en_3kpull_low = true;
 		break;
 	case 0x10ec0257:
 		spec->codec_variant = ALC269_TYPE_ALC257;

  reply	other threads:[~2023-07-13  8:26 UTC|newest]

Thread overview: 49+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <bug-217440-225600@https.bugzilla.kernel.org/>
2023-05-13 19:52 ` Fwd: [Bug 217440] New: ALC236 audio disappears from HP 15z-fc000 on warm boot Joseph C. Sible
2023-05-14  5:41   ` Bagas Sanjaya
2023-05-14  6:46     ` Joseph C. Sible
2023-05-14  7:35       ` Takashi Iwai
2023-05-14 21:48         ` Joseph C. Sible
2023-05-15  2:23           ` Bagas Sanjaya
2023-05-15  3:03             ` Joseph C. Sible
2023-05-15 13:39           ` Takashi Iwai
2023-05-18  5:44             ` Kailang
2023-05-24 10:16               ` Takashi Iwai
2023-05-25  9:21                 ` Kailang
2023-05-25 10:17                   ` Takashi Iwai
2023-05-26  8:09                     ` Kailang
2023-05-26 14:58                       ` Joseph C. Sible
2023-06-05  7:14                         ` Takashi Iwai
2023-06-06  6:02                           ` Joseph C. Sible
2023-06-06  6:54                             ` Kailang
2023-06-07  5:47                               ` Joseph C. Sible
2023-06-07  7:05                                 ` Kailang
2023-06-07 18:36                                   ` Joseph C. Sible
2023-06-08  2:48                                     ` Kailang
2023-06-08  4:08                                       ` Joseph C. Sible
2023-06-08  6:28                                         ` Kailang
2023-06-08  6:32                                         ` Kailang
2023-06-08 14:43                                           ` Joseph C. Sible
2023-06-09  3:04                                             ` Kailang
2023-06-09  6:56                                               ` Takashi Iwai
2023-06-09  7:04                                                 ` Kailang
2023-06-09  7:34                                                   ` Joseph C. Sible
2023-06-09  8:12                                                     ` Takashi Iwai
2023-06-09  8:34                                                       ` Takashi Iwai
2023-06-09 16:47                                                         ` Joseph C. Sible
2023-06-10  7:09                                                           ` Takashi Iwai
2023-06-10 17:41                                                             ` Joseph C. Sible
2023-06-11  7:36                                                               ` Takashi Iwai
2023-06-24  1:36                                                                 ` Joseph C. Sible
2023-06-25  9:42                                                                   ` Takashi Iwai
2023-07-04  8:38                                                                     ` Kailang
2023-07-04  8:45                                                                       ` Takashi Iwai
2023-07-13  8:25                                                                         ` Kailang [this message]
2023-07-14  1:11                                                                           ` Joseph C. Sible
2023-07-14  2:46                                                                             ` Kailang
2023-07-14  5:58                                                                               ` Takashi Iwai
2023-07-31 16:14                                                                                 ` Takashi Iwai
2023-08-04 14:34                                                                                   ` Joseph C. Sible
2023-08-15  8:08                                                                                     ` Kailang
2023-08-15  9:08                                                                                       ` Takashi Iwai
2023-08-16 12:22                                                                                         ` Takashi Iwai
2023-08-02 10:49   ` Linux regression tracking #update (Thorsten Leemhuis)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4678992299664babac4403d9978e7ba7@realtek.com \
    --to=kailang@realtek.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=bagasdotme@gmail.com \
    --cc=josephcsible@gmail.com \
    --cc=perex@perex.cz \
    --cc=regressions@lists.linux.dev \
    --cc=tiwai@suse.com \
    --cc=tiwai@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox