Skip to contentSkip to conversation

Fix for Lenovo B50-70 inverted internal microphone bug.

PATCH In review Michał Wadowski 2 participants 6 messages May 13, 2019 – May 14, 2019 Sound

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix for Lenovo B50-70 inverted internal microphone bug.

Add patch for realtek codec in Lenovo B50-70.
Bugzilla: https://bugs.launchpad.net/ubuntu/+source/alsa-driver/+bug/1524215

---
 sound/pci/hda/patch_realtek.c | 7 +++++++
 1 file changed, 7 insertions(+)
sound/pci/hda/patch_realtek.c +7 -0
index 42cd3945e0de..36c18a5ba288 100644
@@ -5676,6 +5676,7 @@ enum {
 	ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE,
 	ALC233_FIXUP_LENOVO_MULTI_CODECS,
 	ALC233_FIXUP_ACER_HEADSET_MIC,
+	ALC233_FIXUP_INV_DMIC,
 	ALC294_FIXUP_LENOVO_MIC_LOCATION,
 	ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE,
 	ALC700_FIXUP_INTEL_REFERENCE,
@@ -6384,6 +6385,10 @@ static const struct hda_fixup alc269_fixups[] = {
 		.type = HDA_FIXUP_FUNC,
 		.v.func = alc233_fixup_lenovo_line2_mic_hotkey,
 	},
+	[ALC233_FIXUP_INV_DMIC] = {
+		.type = HDA_FIXUP_FUNC,
+		.v.func = alc_fixup_inv_dmic,
+	},
 	[ALC255_FIXUP_DELL_SPK_NOISE] = {
 		.type = HDA_FIXUP_FUNC,
 		.v.func = alc_fixup_disable_aamix,
@@ -6975,6 +6980,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = {
 	SND_PCI_QUIRK(0x17aa, 0x313c, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION),
 	SND_PCI_QUIRK(0x17aa, 0x3902, "Lenovo E50-80", ALC269_FIXUP_DMIC_THINKPAD_ACPI),
 	SND_PCI_QUIRK(0x17aa, 0x3977, "IdeaPad S210", ALC283_FIXUP_INT_MIC),
+	SND_PCI_QUIRK(0x17aa, 0x3978, "Lenovo B50-70", ALC233_FIXUP_INV_DMIC),
 	SND_PCI_QUIRK(0x17aa, 0x3978, "IdeaPad Y410P", ALC269_FIXUP_NO_SHUTUP),
 	SND_PCI_QUIRK(0x17aa, 0x5013, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
 	SND_PCI_QUIRK(0x17aa, 0x501a, "Thinkpad", ALC283_FIXUP_INT_MIC),
@@ -7157,6 +7163,7 @@ static const struct hda_model_fixup alc269_fixup_models[] = {
 	{.id = ALC256_FIXUP_ASUS_AIO_GPIO2, .name = "alc256-asus-aio"},
 	{.id = ALC233_FIXUP_ASUS_MIC_NO_PRESENCE, .name = "alc233-asus"},
 	{.id = ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE, .name = "alc233-eapd"},
+	{.id = ALC233_FIXUP_INV_DMIC, .name = "acl233-inv-dmic"},
 	{.id = ALC294_FIXUP_LENOVO_MIC_LOCATION, .name = "alc294-lenovo-mic"},
 	{.id = ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE, .name = "alc225-wyse"},
 	{.id = ALC274_FIXUP_DELL_AIO_LINEOUT_VERB, .name = "alc274-dell-aio"},
Signature · 6 lines
2.7.4

_______________________________________________
Alsa-devel mailing list
[email protected]
https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
#1 lore raw
Quoted 5 lines · On Mon, 13 May 2019 23:25:36 +0200, MichaX2 Wadowski wrote:

Add patch for realtek codec in Lenovo B50-70.
Bugzilla: https://bugs.launchpad.net/ubuntu/+source/alsa-driver/+bug/1524215

Thanks for the patch.

Actually this seems problematic: the added PCI SSID (17aa:3978) does already exist for Ideapad Y410P. That is, we need to replace the entry, not just adding. The existing quirk is only about the noise fix and it didn't seem help in a later kernel version, in anyway, so it should be OK to replace with the new quirk.

Also, I wonder whether the existing quirk ALC269_FIXUP_DMIC_THINKPAD_ACPI works on your device. Could you check it?

thanks,

Takashi

Quoted 50 lines
---
 sound/pci/hda/patch_realtek.c | 7 +++++++
 1 file changed, 7 insertions(+)
sound/pci/hda/patch_realtek.c +7 -0
index 42cd3945e0de..36c18a5ba288 100644
@@ -5676,6 +5676,7 @@ enum {
 	ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE,
 	ALC233_FIXUP_LENOVO_MULTI_CODECS,
 	ALC233_FIXUP_ACER_HEADSET_MIC,
+	ALC233_FIXUP_INV_DMIC,
 	ALC294_FIXUP_LENOVO_MIC_LOCATION,
 	ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE,
 	ALC700_FIXUP_INTEL_REFERENCE,
@@ -6384,6 +6385,10 @@ static const struct hda_fixup alc269_fixups[] = {
 		.type = HDA_FIXUP_FUNC,
 		.v.func = alc233_fixup_lenovo_line2_mic_hotkey,
 	},
+	[ALC233_FIXUP_INV_DMIC] = {
+		.type = HDA_FIXUP_FUNC,
+		.v.func = alc_fixup_inv_dmic,
+	},
 	[ALC255_FIXUP_DELL_SPK_NOISE] = {
 		.type = HDA_FIXUP_FUNC,
 		.v.func = alc_fixup_disable_aamix,
@@ -6975,6 +6980,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = {
 	SND_PCI_QUIRK(0x17aa, 0x313c, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION),
 	SND_PCI_QUIRK(0x17aa, 0x3902, "Lenovo E50-80", ALC269_FIXUP_DMIC_THINKPAD_ACPI),
 	SND_PCI_QUIRK(0x17aa, 0x3977, "IdeaPad S210", ALC283_FIXUP_INT_MIC),
+	SND_PCI_QUIRK(0x17aa, 0x3978, "Lenovo B50-70", ALC233_FIXUP_INV_DMIC),
 	SND_PCI_QUIRK(0x17aa, 0x3978, "IdeaPad Y410P", ALC269_FIXUP_NO_SHUTUP),
 	SND_PCI_QUIRK(0x17aa, 0x5013, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
 	SND_PCI_QUIRK(0x17aa, 0x501a, "Thinkpad", ALC283_FIXUP_INT_MIC),
@@ -7157,6 +7163,7 @@ static const struct hda_model_fixup alc269_fixup_models[] = {
 	{.id = ALC256_FIXUP_ASUS_AIO_GPIO2, .name = "alc256-asus-aio"},
 	{.id = ALC233_FIXUP_ASUS_MIC_NO_PRESENCE, .name = "alc233-asus"},
 	{.id = ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE, .name = "alc233-eapd"},
+	{.id = ALC233_FIXUP_INV_DMIC, .name = "acl233-inv-dmic"},
 	{.id = ALC294_FIXUP_LENOVO_MIC_LOCATION, .name = "alc294-lenovo-mic"},
 	{.id = ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE, .name = "alc225-wyse"},
 	{.id = ALC274_FIXUP_DELL_AIO_LINEOUT_VERB, .name = "alc274-dell-aio"},
Signature · 6 lines
2.7.4

_______________________________________________
Alsa-devel mailing list
[email protected]
https://mailman.alsa-project.org/mailman/listinfo/alsa-devel

_______________________________________________
Alsa-devel mailing list
[email protected]
https://mailman.alsa-project.org/mailman/listinfo/alsa-devel

#2 lore raw
Quoted 8 lines · Takashi Iwai
Quoted 5 lines · On Mon, 13 May 2019 23:25:36 +0200, MichaX2 Wadowski wrote:

Add patch for realtek codec in Lenovo B50-70.
Bugzilla: https://bugs.launchpad.net/ubuntu/+source/alsa-driver/+bug/1524215

Quoted 7 lines

Thanks for the patch.

Actually this seems problematic: the added PCI SSID (17aa:3978) does already exist for Ideapad Y410P. That is, we need to replace the entry, not just adding. The existing quirk is only about the noise fix and it didn't seem help in a later kernel version, in anyway, so it should be OK to replace with the new quirk.

I also saw this conflict, but I didn't know what should I do with this.
If you say that existing fix for Ideapad Y410P is not necessary now, I replace this with Lenovo B50-70 fix.

Quoted 8 lines

Also, I wonder whether the existing quirk ALC269_FIXUP_DMIC_THINKPAD_ACPI works on your device. Could you check it?

thanks,

Takashi

Yes, quirk ALC269_FIXUP_DMIC_THINKPAD_ACPI works fine on my device.
My laptop uses ALC233, so I created separated quirk, but finally it does the same thing. Should I remove ALC233_FIXUP_INV_DMIC and replace it with ALC269_FIXUP_DMIC_THINKPAD_ACPI?

thanks,
Michał
_______________________________________________
Alsa-devel mailing list
[email protected]
https://mailman.alsa-project.org/mailman/listinfo/alsa-devel

#3 lore raw
Quoted 12 lines · On Tue, 14 May 2019 16:18:38 +0200, MichaX2 Wadowski wrote:
Quoted 10 lines · Takashi Iwai
Quoted 5 lines · On Mon, 13 May 2019 23:25:36 +0200, MichaX2 Wadowski wrote:

Add patch for realtek codec in Lenovo B50-70.
Bugzilla: https://bugs.launchpad.net/ubuntu/+source/alsa-driver/+bug/1524215

Thanks for the patch.

Quoted 8 lines
Quoted 5 lines

Actually this seems problematic: the added PCI SSID (17aa:3978) does already exist for Ideapad Y410P. That is, we need to replace the entry, not just adding. The existing quirk is only about the noise fix and it didn't seem help in a later kernel version, in anyway, so it should be OK to replace with the new quirk.

I also saw this conflict, but I didn't know what should I do with this.
If you say that existing fix for Ideapad Y410P is not necessary now, I replace this with Lenovo B50-70 fix.

I guess that'd be OK, but of course, it'd be good if you mention about the replacement in the patch description.

Quoted 5 lines
Quoted 5 lines

Also, I wonder whether the existing quirk ALC269_FIXUP_DMIC_THINKPAD_ACPI works on your device. Could you check it?

Quoted 7 lines
Quoted 3 lines

thanks,

Takashi

Yes, quirk ALC269_FIXUP_DMIC_THINKPAD_ACPI works fine on my device.
My laptop uses ALC233, so I created separated quirk, but finally it does the same thing. Should I remove ALC233_FIXUP_INV_DMIC and replace it with ALC269_FIXUP_DMIC_THINKPAD_ACPI?

No need for rename. It's compatible with ALC269, after all.

thanks,

Takashi
_______________________________________________
Alsa-devel mailing list
[email protected]
https://mailman.alsa-project.org/mailman/listinfo/alsa-devel

#4 lore raw

Add patch for realtek codec in Lenovo B50-70 that fixes inverted internal microphone channel. Device IdeaPad Y410P has the same PCI SSID as Lenovo B50-70,
but first one is about fix the noise and it didn't seem help in a later kernel version. So I replaced IdeaPad Y410P device description with B50-70 and apply inverted microphone fix.

Bugzilla: https://bugs.launchpad.net/ubuntu/+source/alsa-driver/+bug/1524215

---
 sound/pci/hda/patch_realtek.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
sound/pci/hda/patch_realtek.c +2 -2
index 42cd3945e0de..34bcd711bb55 100644
@@ -4987,7 +4987,7 @@ static void alc_fixup_headset_mode_alc255_no_hp_mic(struct hda_codec *codec,
 		struct alc_spec *spec = codec->spec;
 		spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
 		alc255_set_default_jack_type(codec);
-	} 
+	}
 	else
 		alc_fixup_headset_mode(codec, fix, action);
 }
@@ -6975,7 +6975,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = {
 	SND_PCI_QUIRK(0x17aa, 0x313c, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION),
 	SND_PCI_QUIRK(0x17aa, 0x3902, "Lenovo E50-80", ALC269_FIXUP_DMIC_THINKPAD_ACPI),
 	SND_PCI_QUIRK(0x17aa, 0x3977, "IdeaPad S210", ALC283_FIXUP_INT_MIC),
-	SND_PCI_QUIRK(0x17aa, 0x3978, "IdeaPad Y410P", ALC269_FIXUP_NO_SHUTUP),
+	SND_PCI_QUIRK(0x17aa, 0x3978, "Lenovo B50-70", ALC269_FIXUP_DMIC_THINKPAD_ACPI),
 	SND_PCI_QUIRK(0x17aa, 0x5013, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
 	SND_PCI_QUIRK(0x17aa, 0x501a, "Thinkpad", ALC283_FIXUP_INT_MIC),
 	SND_PCI_QUIRK(0x17aa, 0x501e, "Thinkpad L440", ALC292_FIXUP_TPT440_DOCK),
Signature · 6 lines
2.7.4

_______________________________________________
Alsa-devel mailing list
[email protected]
https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
#5 lore raw
Quoted 9 lines · On Tue, 14 May 2019 16:58:00 +0200, MichaX2 Wadowski wrote:

Add patch for realtek codec in Lenovo B50-70 that fixes inverted internal microphone channel. Device IdeaPad Y410P has the same PCI SSID as Lenovo B50-70,
but first one is about fix the noise and it didn't seem help in a later kernel version. So I replaced IdeaPad Y410P device description with B50-70 and apply inverted microphone fix.

Bugzilla: https://bugs.launchpad.net/ubuntu/+source/alsa-driver/+bug/1524215

Thanks for a quick update.

I applied now but dropped the first chunk as it's an irrelevant change. Also I've put Cc to stable, too.

Takashi
_______________________________________________
Alsa-devel mailing list
[email protected]
https://mailman.alsa-project.org/mailman/listinfo/alsa-devel