Skip to contentSkip to conversation

ALSA: hda - Disable AA-loopback on ALC668

PATCH In review Gabriele Mazzotta 2 participants 6 messages May 14, 2014 – May 21, 2014 1 message not in the archive Sound

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ALSA: hda - Disable AA-loopback on ALC668

Disable the AA-loopback path to get rid of the constant white noise that can be heard when headphones are used.

This patch was tested only on a Dell XPS13 9333.

Fix based on d2e92709e88d ("ALSA: hda - Disable AA-loopback on ALC283 Chromebook").

---
 sound/pci/hda/patch_realtek.c | 7 +++++++
 1 file changed, 7 insertions(+)
sound/pci/hda/patch_realtek.c +7 -0
index 5f7c765..21c94e4 100644
@@ -5690,6 +5690,13 @@ static int patch_alc662(struct hda_codec *codec)
 	if (has_cdefine_beep(codec))
 		spec->gen.beep_nid = 0x01;
 
+	switch (codec->vendor_id) {
+	case 0x10ec0668:
+		/* Disable AA-loopback as it causes white noise */
+		spec->gen.mixer_nid = 0;
+		break;
+	}
+
 	if ((alc_get_coef0(codec) & (1 << 14)) &&
 	    codec->bus->pci && codec->bus->pci->subsystem_vendor == 0x1025 &&
 	    spec->cdefine.platform_type == 1) {
Signature · 1 line
2.0.0.rc2
#1 lore raw
Quoted 22 lines · Gabriele Mazzotta

Disable the AA-loopback path to get rid of the constant white noise that can be heard when headphones are used.

This patch was tested only on a Dell XPS13 9333.

Fix based on d2e92709e88d ("ALSA: hda - Disable AA-loopback on ALC283 Chromebook").

---
 sound/pci/hda/patch_realtek.c | 7 +++++++
 1 file changed, 7 insertions(+)
sound/pci/hda/patch_realtek.c +0 -0
index 5f7c765..21c94e4 100644
@@ -5690,6 +5690,13 @@ static int patch_alc662(struct hda_codec *codec)
 	if (has_cdefine_beep(codec))
 		spec->gen.beep_nid = 0x01;
 

sound/pci/hda/patch_realtek.c static int patch_alc662(struct hda_codec *codec) · line 5702

Quoted 10 lines
sound/pci/hda/patch_realtek.c +7 -0
+	switch (codec->vendor_id) {
+	case 0x10ec0668:
+		/* Disable AA-loopback as it causes white noise */
+		spec->gen.mixer_nid = 0;
+		break;
+	}
+
 	if ((alc_get_coef0(codec) & (1 << 14)) &&
 	    codec->bus->pci && codec->bus->pci->subsystem_vendor == 0x1025 &&
 	    spec->cdefine.platform_type == 1) {

I'm sorry, I was wrong. This patch does not help. I'm still trying to understand what temporarily fixed the problem, I was quite sure this patch did it, but all of the sudden the noise came back. I'm still trying to find the real cause, but I doubt I'll succeed.

Regards,
Gabriele

#2 lore raw
Quoted 1 line · Gabriele Mazzotta

On Wednesday 14 May 2014 16:31:13, Gabriele Mazzotta

Quoted 2 lines · <[email protected]> wrote:

I'm sorry, I was wrong. This patch does not help. I'm still trying to understand what temporarily fixed the problem, I was quite sure this patch

did

Quoted 5 lines

it, but all of the sudden the noise came back. I'm still trying to find the real cause, but I doubt I'll succeed.

Regards,
Gabriele

I have to correct myself again, the first patch I submitted is working, I'm
sorry. However, it seems that disabling the AA-loopback path is not necessary,
muting the input 0x0b in node 0x0c (as it was suggested here:
https://bugs.launchpad.net/ubuntu/+source/alsa-driver/+bug/1252733/comments/26) is enough to get rid of the white noise.

What is the proper way to fix this problem?

Regards,

Gabriele

#3 lore raw

At Tue, 20 May 2014 17:59:30 +0200,

Quoted 11 lines · Gabriele Mazzotta
Quoted 1 line · Gabriele Mazzotta

On Wednesday 14 May 2014 16:31:13, Gabriele Mazzotta

Quoted 2 lines · <[email protected]> wrote:

I'm sorry, I was wrong. This patch does not help. I'm still trying to understand what temporarily fixed the problem, I was quite sure this patch

did

Quoted 3 lines

it, but all of the sudden the noise came back. I'm still trying to find the real cause, but I doubt I'll succeed.

Quoted 6 lines
Quoted 2 lines

Regards,
Gabriele

I have to correct myself again, the first patch I submitted is working, I'm
sorry. However, it seems that disabling the AA-loopback path is not necessary,
muting the input 0x0b in node 0x0c (as it was suggested here:
https://bugs.launchpad.net/ubuntu/+source/alsa-driver/+bug/1252733/comments/26) is enough to get rid of the white noise.

This reminds me of a similar problem reported on Sony VAIO.
https://bugzilla.novell.com/show_bug.cgi?id=873704

The codec is different, it's ALC275, though.

Quoted 1 line

What is the proper way to fix this problem?

Just to be sure: does the mic input itself work correctly?

Maybe the easiest fix would be disabling the aamix, indeed. But you shouldn't apply it generically to ALC668. I'm sure that it's pretty specific to machines, not codec chips. So, create a fixup function that matches with your machine instead.

Takashi

#4 lore raw

At Tue, 20 May 2014 18:06:53 +0200,

Quoted 26 lines · Takashi Iwai

At Tue, 20 May 2014 17:59:30 +0200,

Quoted 11 lines · Gabriele Mazzotta
Quoted 1 line · Gabriele Mazzotta

On Wednesday 14 May 2014 16:31:13, Gabriele Mazzotta

Quoted 2 lines · <[email protected]> wrote:

I'm sorry, I was wrong. This patch does not help. I'm still trying to understand what temporarily fixed the problem, I was quite sure this patch

did

Quoted 3 lines

it, but all of the sudden the noise came back. I'm still trying to find the real cause, but I doubt I'll succeed.

Quoted 6 lines
Quoted 2 lines

Regards,
Gabriele

I have to correct myself again, the first patch I submitted is working, I'm
sorry. However, it seems that disabling the AA-loopback path is not necessary,
muting the input 0x0b in node 0x0c (as it was suggested here:
https://bugs.launchpad.net/ubuntu/+source/alsa-driver/+bug/1252733/comments/26) is enough to get rid of the white noise.

This reminds me of a similar problem reported on Sony VAIO.
https://bugzilla.novell.com/show_bug.cgi?id=873704

The codec is different, it's ALC275, though.

Quoted 8 lines
Quoted 1 line

What is the proper way to fix this problem?

Just to be sure: does the mic input itself work correctly?

Maybe the easiest fix would be disabling the aamix, indeed. But you shouldn't apply it generically to ALC668. I'm sure that it's pretty specific to machines, not codec chips. So, create a fixup function that matches with your machine instead.

Or, another hackish solution is to override the connection list of the mixer widget. Point the item to another (e.g. non-existing) node, so that the parser won't pick it up.

For this (and even with your patch to disable aamix completely), the fixup should have a static init verb to mute this mixer input.

Takashi

A message that is not in the archive (sent off-list or not yet received): 7006803.45xCtKetRW@xps13

#6 lore raw

At Tue, 20 May 2014 18:58:26 +0200,

Quoted 45 lines · Gabriele Mazzotta
Quoted 20 lines · Takashi Iwai

At Tue, 20 May 2014 17:59:30 +0200,

Quoted 11 lines · Gabriele Mazzotta
Quoted 1 line · Gabriele Mazzotta

On Wednesday 14 May 2014 16:31:13, Gabriele Mazzotta

Quoted 2 lines · <[email protected]> wrote:

I'm sorry, I was wrong. This patch does not help. I'm still trying to understand what temporarily fixed the problem, I was quite sure this patch

did

Quoted 3 lines

it, but all of the sudden the noise came back. I'm still trying to find the real cause, but I doubt I'll succeed.

Quoted 6 lines
Quoted 2 lines

Regards,
Gabriele

I have to correct myself again, the first patch I submitted is working, I'm
sorry. However, it seems that disabling the AA-loopback path is not necessary,
muting the input 0x0b in node 0x0c (as it was suggested here:
https://bugs.launchpad.net/ubuntu/+source/alsa-driver/+bug/1252733/comments/26) is enough to get rid of the white noise.

Quoted 8 lines

This reminds me of a similar problem reported on Sony VAIO.
https://bugzilla.novell.com/show_bug.cgi?id=873704

The codec is different, it's ALC275, though.

Quoted 1 line

What is the proper way to fix this problem?

Just to be sure: does the mic input itself work correctly?

Unfortunately, I cannot test it.

Quoted 4 lines

Maybe the easiest fix would be disabling the aamix, indeed. But you shouldn't apply it generically to ALC668. I'm sure that it's pretty specific to machines, not codec chips. So, create a fixup function that matches with your machine instead.

Yes, you are probably right. All I know is that this bug affect the XPS13, XPS12 and XPS15.

Is the following patch OK?
---

Quoted 6 lines

ALSA: hda - White noise fix for XPS13 9333

Disable the AA-loopback path to get rid of the constant white noise that can be heard when headphones are used.

Looks good, so applied now. Thanks.

Takashi

Quoted 59 lines
---
 sound/pci/hda/patch_realtek.c | 19 ++++++++++++++++++-
 1 file changed, 18 insertions(+), 1 deletion(-)
sound/pci/hda/patch_realtek.c +18 -1
index 49e884f..a2c4374 100644
@@ -3894,6 +3894,16 @@ static void alc_fixup_no_shutup(struct hda_codec *codec,
        }
 }
 
+static void alc_fixup_disable_aamix(struct hda_codec *codec,
+                               const struct hda_fixup *fix, int action)
+{
+       if (action == HDA_FIXUP_ACT_PRE_PROBE) {
+               struct alc_spec *spec = codec->spec;
+               /* Disable AA-loopback as it causes white noise */
+               spec->gen.mixer_nid = 0;
+       }
+}
+
 static void alc_fixup_headset_mode_alc668(struct hda_codec *codec,
                                const struct hda_fixup *fix, int action)
 {
@@ -5313,6 +5323,7 @@ enum {
        ALC662_FIXUP_BASS_1A,
        ALC662_FIXUP_BASS_CHMAP,
        ALC668_FIXUP_AUTO_MUTE,
+       ALC668_FIXUP_DELL_DISABLE_AAMIX,
 };
 
 static const struct hda_fixup alc662_fixups[] = {
@@ -5479,6 +5490,12 @@ static const struct hda_fixup alc662_fixups[] = {
                .type = HDA_FIXUP_FUNC,
                .v.func = alc_fixup_inv_dmic_0x12,
        },
+       [ALC668_FIXUP_DELL_DISABLE_AAMIX] = {
+               .type = HDA_FIXUP_FUNC,
+               .v.func = alc_fixup_disable_aamix,
+               .chained = true,
+               .chain_id = ALC668_FIXUP_DELL_MIC_NO_PRESENCE
+       },
        [ALC668_FIXUP_AUTO_MUTE] = {
                .type = HDA_FIXUP_FUNC,
                .v.func = alc_fixup_auto_mute_via_amp,
@@ -5539,7 +5556,7 @@ static const struct snd_pci_quirk alc662_fixup_tbl[] = {
        SND_PCI_QUIRK(0x1025, 0x038b, "Acer Aspire 8943G", ALC662_FIXUP_ASPIRE),
        SND_PCI_QUIRK(0x1028, 0x05d8, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
        SND_PCI_QUIRK(0x1028, 0x05db, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
-       SND_PCI_QUIRK(0x1028, 0x060a, "Dell XPS 13", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
+       SND_PCI_QUIRK(0x1028, 0x060a, "Dell XPS 13", ALC668_FIXUP_DELL_DISABLE_AAMIX),
        SND_PCI_QUIRK(0x1028, 0x0623, "Dell", ALC668_FIXUP_AUTO_MUTE),
        SND_PCI_QUIRK(0x1028, 0x0624, "Dell", ALC668_FIXUP_AUTO_MUTE),
        SND_PCI_QUIRK(0x1028, 0x0625, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
Signature · 1 line
2.0.0.rc2