alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
* [BUG]3.14-rc2 [PATCH] Revert "ALSA: hda/realtek - Avoid invalid COEFs for ALC271X"
@ 2014-02-12 16:09 Martin Kepplinger
  2014-02-12 16:20 ` Takashi Iwai
  0 siblings, 1 reply; 5+ messages in thread
From: Martin Kepplinger @ 2014-02-12 16:09 UTC (permalink / raw)
  To: perex
  Cc: tiwai, david.henningsson, hui.wang, alsa-devel, linux-kernel,
	Martin Kepplinger

This reverts commit d3c56568f43807135f2c2a09582a69f809f0d8b7.

The reverted commit breaks audio through headphone line out on
the Acer TravelMate B113 (Type1Sku0) Notebook, my main work
machine. I don't know much about it but this fixes my problem.
Bisected and tested.

Tested-by: Martin Kepplinger <martink@posteo.de>
Signed-off-by: Martin Kepplinger <martink@posteo.de>
---
 sound/pci/hda/patch_realtek.c |    3 ---
 1 file changed, 3 deletions(-)

diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index d9693ca..0f5af34 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -4434,9 +4434,6 @@ static void alc269_fill_coef(struct hda_codec *codec)
 
 	if (spec->codec_variant != ALC269_TYPE_ALC269VB)
 		return;
-	/* ALC271X doesn't seem to support these COEFs (bko#52181) */
-	if (!strcmp(codec->chip_name, "ALC271X"))
-		return;
 
 	if ((alc_get_coef0(codec) & 0x00ff) < 0x015) {
 		alc_write_coef_idx(codec, 0xf, 0x960b);
-- 
1.7.10.4

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

* Re: [BUG]3.14-rc2 [PATCH] Revert "ALSA: hda/realtek - Avoid invalid COEFs for ALC271X"
  2014-02-12 16:09 [BUG]3.14-rc2 [PATCH] Revert "ALSA: hda/realtek - Avoid invalid COEFs for ALC271X" Martin Kepplinger
@ 2014-02-12 16:20 ` Takashi Iwai
  2014-02-12 16:45   ` Takashi Iwai
  0 siblings, 1 reply; 5+ messages in thread
From: Takashi Iwai @ 2014-02-12 16:20 UTC (permalink / raw)
  To: Martin Kepplinger
  Cc: perex, david.henningsson, hui.wang, alsa-devel, linux-kernel

At Wed, 12 Feb 2014 17:09:23 +0100,
Martin Kepplinger wrote:
> 
> This reverts commit d3c56568f43807135f2c2a09582a69f809f0d8b7.
> 
> The reverted commit breaks audio through headphone line out on
> the Acer TravelMate B113 (Type1Sku0) Notebook, my main work
> machine. I don't know much about it but this fixes my problem.
> Bisected and tested.
> 
> Tested-by: Martin Kepplinger <martink@posteo.de>
> Signed-off-by: Martin Kepplinger <martink@posteo.de>

Too bad, we need COEF for some machine but it breaks for some.
Since reverting breaks obviously another machine, we need a different
approach, e.g. checking the machine ID.  Please give alsa-info.sh
output of your machine.


thanks,

Takashi

> ---
>  sound/pci/hda/patch_realtek.c |    3 ---
>  1 file changed, 3 deletions(-)
> 
> diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
> index d9693ca..0f5af34 100644
> --- a/sound/pci/hda/patch_realtek.c
> +++ b/sound/pci/hda/patch_realtek.c
> @@ -4434,9 +4434,6 @@ static void alc269_fill_coef(struct hda_codec *codec)
>  
>  	if (spec->codec_variant != ALC269_TYPE_ALC269VB)
>  		return;
> -	/* ALC271X doesn't seem to support these COEFs (bko#52181) */
> -	if (!strcmp(codec->chip_name, "ALC271X"))
> -		return;
>  
>  	if ((alc_get_coef0(codec) & 0x00ff) < 0x015) {
>  		alc_write_coef_idx(codec, 0xf, 0x960b);
> -- 
> 1.7.10.4
> 

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

* Re: [BUG]3.14-rc2 [PATCH] Revert "ALSA: hda/realtek - Avoid invalid COEFs for ALC271X"
  2014-02-12 16:20 ` Takashi Iwai
@ 2014-02-12 16:45   ` Takashi Iwai
  2014-02-12 18:31     ` Martin Kepplinger
  0 siblings, 1 reply; 5+ messages in thread
From: Takashi Iwai @ 2014-02-12 16:45 UTC (permalink / raw)
  To: Martin Kepplinger
  Cc: perex, david.henningsson, hui.wang, alsa-devel, linux-kernel

At Wed, 12 Feb 2014 17:20:21 +0100,
Takashi Iwai wrote:
> 
> At Wed, 12 Feb 2014 17:09:23 +0100,
> Martin Kepplinger wrote:
> > 
> > This reverts commit d3c56568f43807135f2c2a09582a69f809f0d8b7.
> > 
> > The reverted commit breaks audio through headphone line out on
> > the Acer TravelMate B113 (Type1Sku0) Notebook, my main work
> > machine. I don't know much about it but this fixes my problem.
> > Bisected and tested.
> > 
> > Tested-by: Martin Kepplinger <martink@posteo.de>
> > Signed-off-by: Martin Kepplinger <martink@posteo.de>
> 
> Too bad, we need COEF for some machine but it breaks for some.
> Since reverting breaks obviously another machine, we need a different
> approach, e.g. checking the machine ID.  Please give alsa-info.sh
> output of your machine.

Thinking it again, I'll take your patch as is, and put an additional
fix for AO725 as below.  Could you try it to see whether it brings any
regressions?  It's to be applied after your revert patch.


thanks,

Takashi

-- 8< --
From: Takashi Iwai <tiwai@suse.de>
Subject: [PATCH] ALSA: hda - Better fix for invalid COEF setup on Acer AO725

Instead of disabling the COEF setup for all ALC271X codec (like commit
d3c56568), do it only if needed.  Currently, Acer AO725 is known to
show the problem, so clear the bad init_hook in the fixup.

The explicit call of alc269_fill_coef() in patch_alc269() is also
removed, since the function will be called anyway at init callback.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=52181
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
 sound/pci/hda/patch_realtek.c | 18 ++++++++++++++++--
 1 file changed, 16 insertions(+), 2 deletions(-)

diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index a9a83b85517a..eaff10598f67 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -3817,6 +3817,14 @@ static void alc290_fixup_mono_speakers(struct hda_codec *codec,
 	}
 }
 
+static void alc_fixup_clear_init_hook(struct hda_codec *codec,
+				      const struct hda_fixup *fix, int action)
+{
+	struct alc_spec *spec = codec->spec;
+	if (action == HDA_FIXUP_ACT_PROBE)
+		spec->init_hook = NULL;
+}
+
 /* for hda_fixup_thinkpad_acpi() */
 #include "thinkpad_helper.c"
 
@@ -3858,6 +3866,7 @@ enum {
 	ALC271_FIXUP_HP_GATE_MIC_JACK,
 	ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572,
 	ALC269_FIXUP_ACER_AC700,
+	ALC271_FIXUP_ACER_AO725,
 	ALC269_FIXUP_LIMIT_INT_MIC_BOOST,
 	ALC269VB_FIXUP_ASUS_ZENBOOK,
 	ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A,
@@ -4250,13 +4259,19 @@ static const struct hda_fixup alc269_fixups[] = {
 		.type = HDA_FIXUP_FUNC,
 		.v.func = alc_fixup_headset_mode_alc255,
 	},
+	[ALC271_FIXUP_ACER_AO725] = {
+		.type = HDA_FIXUP_FUNC,
+		.v.func = alc_fixup_clear_init_hook,
+		.chained = true,
+		.chain_id = ALC271_FIXUP_HP_GATE_MIC_JACK,
+	},
 };
 
 static const struct snd_pci_quirk alc269_fixup_tbl[] = {
 	SND_PCI_QUIRK(0x1025, 0x029b, "Acer 1810TZ", ALC269_FIXUP_INV_DMIC),
 	SND_PCI_QUIRK(0x1025, 0x0349, "Acer AOD260", ALC269_FIXUP_INV_DMIC),
 	SND_PCI_QUIRK(0x1025, 0x047c, "Acer AC700", ALC269_FIXUP_ACER_AC700),
-	SND_PCI_QUIRK(0x1025, 0x0740, "Acer AO725", ALC271_FIXUP_HP_GATE_MIC_JACK),
+	SND_PCI_QUIRK(0x1025, 0x0740, "Acer AO725", ALC271_FIXUP_ACER_AO725),
 	SND_PCI_QUIRK(0x1025, 0x0742, "Acer AO756", ALC271_FIXUP_HP_GATE_MIC_JACK),
 	SND_PCI_QUIRK_VENDOR(0x1025, "Acer Aspire", ALC271_FIXUP_DMIC),
 	SND_PCI_QUIRK(0x1025, 0x0775, "Acer Aspire E1-572", ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572),
@@ -4523,7 +4538,6 @@ static int patch_alc269(struct hda_codec *codec)
 		if (err < 0)
 			goto error;
 		spec->init_hook = alc269_fill_coef;
-		alc269_fill_coef(codec);
 		break;
 
 	case 0x10ec0280:
-- 
1.8.5.2

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

* Re: [BUG]3.14-rc2 [PATCH] Revert "ALSA: hda/realtek - Avoid invalid COEFs for ALC271X"
  2014-02-12 16:45   ` Takashi Iwai
@ 2014-02-12 18:31     ` Martin Kepplinger
  2014-02-12 18:58       ` Takashi Iwai
  0 siblings, 1 reply; 5+ messages in thread
From: Martin Kepplinger @ 2014-02-12 18:31 UTC (permalink / raw)
  To: Takashi Iwai; +Cc: perex, david.henningsson, hui.wang, alsa-devel, linux-kernel

Am 2014-02-12 17:45, schrieb Takashi Iwai:
> At Wed, 12 Feb 2014 17:20:21 +0100,
> Takashi Iwai wrote:
>>
>> At Wed, 12 Feb 2014 17:09:23 +0100,
>> Martin Kepplinger wrote:
>>>
>>> This reverts commit d3c56568f43807135f2c2a09582a69f809f0d8b7.
>>>
>>> The reverted commit breaks audio through headphone line out on
>>> the Acer TravelMate B113 (Type1Sku0) Notebook, my main work
>>> machine. I don't know much about it but this fixes my problem.
>>> Bisected and tested.
>>>
>>> Tested-by: Martin Kepplinger <martink@posteo.de>
>>> Signed-off-by: Martin Kepplinger <martink@posteo.de>
>>
>> Too bad, we need COEF for some machine but it breaks for some.
>> Since reverting breaks obviously another machine, we need a different
>> approach, e.g. checking the machine ID.  Please give alsa-info.sh
>> output of your machine.
> 
> Thinking it again, I'll take your patch as is, and put an additional
> fix for AO725 as below.  Could you try it to see whether it brings any
> regressions?  It's to be applied after your revert patch.
> 
> 
> thanks,
> 
> Takashi
> 
> -- 8< --
> From: Takashi Iwai <tiwai@suse.de>
> Subject: [PATCH] ALSA: hda - Better fix for invalid COEF setup on Acer AO725
> 
> Instead of disabling the COEF setup for all ALC271X codec (like commit
> d3c56568), do it only if needed.  Currently, Acer AO725 is known to
> show the problem, so clear the bad init_hook in the fixup.
> 
> The explicit call of alc269_fill_coef() in patch_alc269() is also
> removed, since the function will be called anyway at init callback.
> 
> Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=52181
> Cc: <stable@vger.kernel.org>
> Signed-off-by: Takashi Iwai <tiwai@suse.de>
> ---
>  sound/pci/hda/patch_realtek.c | 18 ++++++++++++++++--
>  1 file changed, 16 insertions(+), 2 deletions(-)
> 
> diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
> index a9a83b85517a..eaff10598f67 100644
> --- a/sound/pci/hda/patch_realtek.c
> +++ b/sound/pci/hda/patch_realtek.c
> @@ -3817,6 +3817,14 @@ static void alc290_fixup_mono_speakers(struct hda_codec *codec,
>  	}
>  }
>  
> +static void alc_fixup_clear_init_hook(struct hda_codec *codec,
> +				      const struct hda_fixup *fix, int action)
> +{
> +	struct alc_spec *spec = codec->spec;
> +	if (action == HDA_FIXUP_ACT_PROBE)
> +		spec->init_hook = NULL;
> +}
> +
>  /* for hda_fixup_thinkpad_acpi() */
>  #include "thinkpad_helper.c"
>  
> @@ -3858,6 +3866,7 @@ enum {
>  	ALC271_FIXUP_HP_GATE_MIC_JACK,
>  	ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572,
>  	ALC269_FIXUP_ACER_AC700,
> +	ALC271_FIXUP_ACER_AO725,
>  	ALC269_FIXUP_LIMIT_INT_MIC_BOOST,
>  	ALC269VB_FIXUP_ASUS_ZENBOOK,
>  	ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A,
> @@ -4250,13 +4259,19 @@ static const struct hda_fixup alc269_fixups[] = {
>  		.type = HDA_FIXUP_FUNC,
>  		.v.func = alc_fixup_headset_mode_alc255,
>  	},
> +	[ALC271_FIXUP_ACER_AO725] = {
> +		.type = HDA_FIXUP_FUNC,
> +		.v.func = alc_fixup_clear_init_hook,
> +		.chained = true,
> +		.chain_id = ALC271_FIXUP_HP_GATE_MIC_JACK,
> +	},
>  };
>  
>  static const struct snd_pci_quirk alc269_fixup_tbl[] = {
>  	SND_PCI_QUIRK(0x1025, 0x029b, "Acer 1810TZ", ALC269_FIXUP_INV_DMIC),
>  	SND_PCI_QUIRK(0x1025, 0x0349, "Acer AOD260", ALC269_FIXUP_INV_DMIC),
>  	SND_PCI_QUIRK(0x1025, 0x047c, "Acer AC700", ALC269_FIXUP_ACER_AC700),
> -	SND_PCI_QUIRK(0x1025, 0x0740, "Acer AO725", ALC271_FIXUP_HP_GATE_MIC_JACK),
> +	SND_PCI_QUIRK(0x1025, 0x0740, "Acer AO725", ALC271_FIXUP_ACER_AO725),
>  	SND_PCI_QUIRK(0x1025, 0x0742, "Acer AO756", ALC271_FIXUP_HP_GATE_MIC_JACK),
>  	SND_PCI_QUIRK_VENDOR(0x1025, "Acer Aspire", ALC271_FIXUP_DMIC),
>  	SND_PCI_QUIRK(0x1025, 0x0775, "Acer Aspire E1-572", ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572),
> @@ -4523,7 +4538,6 @@ static int patch_alc269(struct hda_codec *codec)
>  		if (err < 0)
>  			goto error;
>  		spec->init_hook = alc269_fill_coef;
> -		alc269_fill_coef(codec);
>  		break;
>  
>  	case 0x10ec0280:
> 

So my alsa-info.sh is
http://www.alsa-project.org/db/?f=3e9c5d39ff057106d6ae307f9b86c1e562056c1b
and I'm running your patch on top of mine without any problems.

thanks,

            martin

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

* Re: [BUG]3.14-rc2 [PATCH] Revert "ALSA: hda/realtek - Avoid invalid COEFs for ALC271X"
  2014-02-12 18:31     ` Martin Kepplinger
@ 2014-02-12 18:58       ` Takashi Iwai
  0 siblings, 0 replies; 5+ messages in thread
From: Takashi Iwai @ 2014-02-12 18:58 UTC (permalink / raw)
  To: Martin Kepplinger
  Cc: perex, david.henningsson, hui.wang, alsa-devel, linux-kernel

At Wed, 12 Feb 2014 19:31:36 +0100,
Martin Kepplinger wrote:
> 
> Am 2014-02-12 17:45, schrieb Takashi Iwai:
> > At Wed, 12 Feb 2014 17:20:21 +0100,
> > Takashi Iwai wrote:
> >>
> >> At Wed, 12 Feb 2014 17:09:23 +0100,
> >> Martin Kepplinger wrote:
> >>>
> >>> This reverts commit d3c56568f43807135f2c2a09582a69f809f0d8b7.
> >>>
> >>> The reverted commit breaks audio through headphone line out on
> >>> the Acer TravelMate B113 (Type1Sku0) Notebook, my main work
> >>> machine. I don't know much about it but this fixes my problem.
> >>> Bisected and tested.
> >>>
> >>> Tested-by: Martin Kepplinger <martink@posteo.de>
> >>> Signed-off-by: Martin Kepplinger <martink@posteo.de>
> >>
> >> Too bad, we need COEF for some machine but it breaks for some.
> >> Since reverting breaks obviously another machine, we need a different
> >> approach, e.g. checking the machine ID.  Please give alsa-info.sh
> >> output of your machine.
> > 
> > Thinking it again, I'll take your patch as is, and put an additional
> > fix for AO725 as below.  Could you try it to see whether it brings any
> > regressions?  It's to be applied after your revert patch.
> > 
> > 
> > thanks,
> > 
> > Takashi
> > 
> > -- 8< --
> > From: Takashi Iwai <tiwai@suse.de>
> > Subject: [PATCH] ALSA: hda - Better fix for invalid COEF setup on Acer AO725
> > 
> > Instead of disabling the COEF setup for all ALC271X codec (like commit
> > d3c56568), do it only if needed.  Currently, Acer AO725 is known to
> > show the problem, so clear the bad init_hook in the fixup.
> > 
> > The explicit call of alc269_fill_coef() in patch_alc269() is also
> > removed, since the function will be called anyway at init callback.
> > 
> > Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=52181
> > Cc: <stable@vger.kernel.org>
> > Signed-off-by: Takashi Iwai <tiwai@suse.de>
> > ---
> >  sound/pci/hda/patch_realtek.c | 18 ++++++++++++++++--
> >  1 file changed, 16 insertions(+), 2 deletions(-)
> > 
> > diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
> > index a9a83b85517a..eaff10598f67 100644
> > --- a/sound/pci/hda/patch_realtek.c
> > +++ b/sound/pci/hda/patch_realtek.c
> > @@ -3817,6 +3817,14 @@ static void alc290_fixup_mono_speakers(struct hda_codec *codec,
> >  	}
> >  }
> >  
> > +static void alc_fixup_clear_init_hook(struct hda_codec *codec,
> > +				      const struct hda_fixup *fix, int action)
> > +{
> > +	struct alc_spec *spec = codec->spec;
> > +	if (action == HDA_FIXUP_ACT_PROBE)
> > +		spec->init_hook = NULL;
> > +}
> > +
> >  /* for hda_fixup_thinkpad_acpi() */
> >  #include "thinkpad_helper.c"
> >  
> > @@ -3858,6 +3866,7 @@ enum {
> >  	ALC271_FIXUP_HP_GATE_MIC_JACK,
> >  	ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572,
> >  	ALC269_FIXUP_ACER_AC700,
> > +	ALC271_FIXUP_ACER_AO725,
> >  	ALC269_FIXUP_LIMIT_INT_MIC_BOOST,
> >  	ALC269VB_FIXUP_ASUS_ZENBOOK,
> >  	ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A,
> > @@ -4250,13 +4259,19 @@ static const struct hda_fixup alc269_fixups[] = {
> >  		.type = HDA_FIXUP_FUNC,
> >  		.v.func = alc_fixup_headset_mode_alc255,
> >  	},
> > +	[ALC271_FIXUP_ACER_AO725] = {
> > +		.type = HDA_FIXUP_FUNC,
> > +		.v.func = alc_fixup_clear_init_hook,
> > +		.chained = true,
> > +		.chain_id = ALC271_FIXUP_HP_GATE_MIC_JACK,
> > +	},
> >  };
> >  
> >  static const struct snd_pci_quirk alc269_fixup_tbl[] = {
> >  	SND_PCI_QUIRK(0x1025, 0x029b, "Acer 1810TZ", ALC269_FIXUP_INV_DMIC),
> >  	SND_PCI_QUIRK(0x1025, 0x0349, "Acer AOD260", ALC269_FIXUP_INV_DMIC),
> >  	SND_PCI_QUIRK(0x1025, 0x047c, "Acer AC700", ALC269_FIXUP_ACER_AC700),
> > -	SND_PCI_QUIRK(0x1025, 0x0740, "Acer AO725", ALC271_FIXUP_HP_GATE_MIC_JACK),
> > +	SND_PCI_QUIRK(0x1025, 0x0740, "Acer AO725", ALC271_FIXUP_ACER_AO725),
> >  	SND_PCI_QUIRK(0x1025, 0x0742, "Acer AO756", ALC271_FIXUP_HP_GATE_MIC_JACK),
> >  	SND_PCI_QUIRK_VENDOR(0x1025, "Acer Aspire", ALC271_FIXUP_DMIC),
> >  	SND_PCI_QUIRK(0x1025, 0x0775, "Acer Aspire E1-572", ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572),
> > @@ -4523,7 +4538,6 @@ static int patch_alc269(struct hda_codec *codec)
> >  		if (err < 0)
> >  			goto error;
> >  		spec->init_hook = alc269_fill_coef;
> > -		alc269_fill_coef(codec);
> >  		break;
> >  
> >  	case 0x10ec0280:
> > 
> 
> So my alsa-info.sh is
> http://www.alsa-project.org/db/?f=3e9c5d39ff057106d6ae307f9b86c1e562056c1b
> and I'm running your patch on top of mine without any problems.

OK.  I queued the patches now.
Thanks!

Takashi

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

end of thread, other threads:[~2014-02-12 18:58 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-02-12 16:09 [BUG]3.14-rc2 [PATCH] Revert "ALSA: hda/realtek - Avoid invalid COEFs for ALC271X" Martin Kepplinger
2014-02-12 16:20 ` Takashi Iwai
2014-02-12 16:45   ` Takashi Iwai
2014-02-12 18:31     ` Martin Kepplinger
2014-02-12 18:58       ` 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).