diff mbox series

[SRU,D] ALSA: hda/realtek: Disable PC beep in passthrough on alc285

Message ID 20190222085413.7298-4-hui.wang@canonical.com
State New
Headers show
Series [SRU,D] ALSA: hda/realtek: Disable PC beep in passthrough on alc285 | expand

Commit Message

Hui Wang Feb. 22, 2019, 8:54 a.m. UTC
BugLink: http://bugs.launchpad.net/bugs/1817263

It is reported that there's a constant background "hum/whitenoise"
in the headset on the Lenovo X1 machines with the codec alc285, and it
is confirmed that if we run the command below, the noise will stop.
 sudo hda-verb /dev/snd/hwC0D0 0x1d SET_PIN_WIDGET_CONTROL 0x0

Then I consulted this issue with Kailang, he told me the pin 0x1d on
this codec is used for PC beep in, the noise probably comes from this
pin and we can also disable the PC beep in passthrough, then the PC
beep in will not affect other sound playback.

Fixes: c4cfcf6f4297 ("ALSA: hda/realtek - fix the pop noise on headphone for lenovo laptops")
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1660581
Cc: <stable@vger.kernel.org>
Signed-off-by: Kailang Yang <kailang@realtek.com>
Signed-off-by: Hui Wang <hui.wang@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
(backported from commit c8c6ee611926685a7d753409e0a6e48b9e1b8748
git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound.git)
Signed-off-by: Hui Wang <hui.wang@canonical.com>
---
 sound/pci/hda/patch_realtek.c | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

Comments

You-Sheng Yang Feb. 22, 2019, 10:12 a.m. UTC | #1
Cannot clean apply on disco master-next HEAD commit
6c2b942599ac3f01a613405caa3befde7fc44367.

On 五, 2019-02-22 at 16:54 +0800, Hui Wang wrote:
> BugLink: http://bugs.launchpad.net/bugs/1817263
> 
> It is reported that there's a constant background "hum/whitenoise"
> in the headset on the Lenovo X1 machines with the codec alc285, and
> it
> is confirmed that if we run the command below, the noise will stop.
>  sudo hda-verb /dev/snd/hwC0D0 0x1d SET_PIN_WIDGET_CONTROL 0x0
> 
> Then I consulted this issue with Kailang, he told me the pin 0x1d on
> this codec is used for PC beep in, the noise probably comes from this
> pin and we can also disable the PC beep in passthrough, then the PC
> beep in will not affect other sound playback.
> 
> Fixes: c4cfcf6f4297 ("ALSA: hda/realtek - fix the pop noise on
> headphone for lenovo laptops")
> Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1660581
> Cc: <stable@vger.kernel.org>
> Signed-off-by: Kailang Yang <kailang@realtek.com>
> Signed-off-by: Hui Wang <hui.wang@canonical.com>
> Signed-off-by: Takashi Iwai <tiwai@suse.de>
> (backported from commit c8c6ee611926685a7d753409e0a6e48b9e1b8748
> git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound.git)
> Signed-off-by: Hui Wang <hui.wang@canonical.com>
> ---
>  sound/pci/hda/patch_realtek.c | 14 +++++++++++++-
>  1 file changed, 13 insertions(+), 1 deletion(-)
> 
> diff --git a/sound/pci/hda/patch_realtek.c
> b/sound/pci/hda/patch_realtek.c
> index cf5d26642bcd..66123abf107c 100644
> --- a/sound/pci/hda/patch_realtek.c
> +++ b/sound/pci/hda/patch_realtek.c
> @@ -5510,6 +5510,7 @@ enum {
>  	ALC221_FIXUP_HP_HEADSET_MIC,
>  	ALC285_FIXUP_LENOVO_HEADPHONE_NOISE,
>  	ALC295_FIXUP_HP_AUTO_MUTE,
> +	ALC285_FIXUP_LENOVO_PC_BEEP_IN_NOISE,
>  };
>  
>  static const struct hda_fixup alc269_fixups[] = {
> @@ -6387,6 +6388,17 @@ static const struct hda_fixup alc269_fixups[]
> = {
>  		.type = HDA_FIXUP_FUNC,
>  		.v.func = alc_fixup_auto_mute_via_amp,
>  	},
> +	[ALC285_FIXUP_LENOVO_PC_BEEP_IN_NOISE] = {
> +		.type = HDA_FIXUP_VERBS,
> +		.v.verbs = (const struct hda_verb[]) {
> +			/* Disable PCBEEP-IN passthrough */
> +			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x36 },
> +			{ 0x20, AC_VERB_SET_PROC_COEF, 0x57d7 },
> +			{ }
> +		},
> +		.chained = true,
> +		.chain_id = ALC285_FIXUP_LENOVO_HEADPHONE_NOISE
> +	},
>  };
>  
>  static const struct snd_pci_quirk alc269_fixup_tbl[] = {
> @@ -7060,7 +7072,7 @@ static const struct snd_hda_pin_quirk
> alc269_pin_fixup_tbl[] = {
>  		{0x12, 0x90a60130},
>  		{0x19, 0x03a11020},
>  		{0x21, 0x0321101f}),
> -	SND_HDA_PIN_QUIRK(0x10ec0285, 0x17aa, "Lenovo",
> ALC285_FIXUP_LENOVO_HEADPHONE_NOISE,
> +	SND_HDA_PIN_QUIRK(0x10ec0285, 0x17aa, "Lenovo",
> ALC285_FIXUP_LENOVO_PC_BEEP_IN_NOISE,
>  		{0x12, 0x90a60130},
>  		{0x14, 0x90170110},
>  		{0x19, 0x04a11040},
> -- 
> 2.17.1
> 
>
Hui Wang Feb. 22, 2019, 10:20 a.m. UTC | #2
Ah, I generated the patch based on the tag Ubuntu-4.19.0-9.10. Will fix
it in the V2.

Thanks,
Hui.
On 2019/2/22 下午6:12, You-Sheng Yang wrote:
> Cannot clean apply on disco master-next HEAD commit
> 6c2b942599ac3f01a613405caa3befde7fc44367.
>
> On 五, 2019-02-22 at 16:54 +0800, Hui Wang wrote:
>> BugLink: http://bugs.launchpad.net/bugs/1817263
>>
>> It is reported that there's a constant background "hum/whitenoise"
>> in the headset on the Lenovo X1 machines with the codec alc285, and
>> it
>> is confirmed that if we run the command below, the noise will stop.
>>  sudo hda-verb /dev/snd/hwC0D0 0x1d SET_PIN_WIDGET_CONTROL 0x0
>>
>> Then I consulted this issue with Kailang, he told me the pin 0x1d on
>> this codec is used for PC beep in, the noise probably comes from this
>> pin and we can also disable the PC beep in passthrough, then the PC
>> beep in will not affect other sound playback.
>>
>> Fixes: c4cfcf6f4297 ("ALSA: hda/realtek - fix the pop noise on
>> headphone for lenovo laptops")
>> Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1660581
>> Cc: <stable@vger.kernel.org>
>> Signed-off-by: Kailang Yang <kailang@realtek.com>
>> Signed-off-by: Hui Wang <hui.wang@canonical.com>
>> Signed-off-by: Takashi Iwai <tiwai@suse.de>
>> (backported from commit c8c6ee611926685a7d753409e0a6e48b9e1b8748
>> git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound.git)
>> Signed-off-by: Hui Wang <hui.wang@canonical.com>
>> ---
>>  sound/pci/hda/patch_realtek.c | 14 +++++++++++++-
>>  1 file changed, 13 insertions(+), 1 deletion(-)
>>
>> diff --git a/sound/pci/hda/patch_realtek.c
>> b/sound/pci/hda/patch_realtek.c
>> index cf5d26642bcd..66123abf107c 100644
>> --- a/sound/pci/hda/patch_realtek.c
>> +++ b/sound/pci/hda/patch_realtek.c
>> @@ -5510,6 +5510,7 @@ enum {
>>  	ALC221_FIXUP_HP_HEADSET_MIC,
>>  	ALC285_FIXUP_LENOVO_HEADPHONE_NOISE,
>>  	ALC295_FIXUP_HP_AUTO_MUTE,
>> +	ALC285_FIXUP_LENOVO_PC_BEEP_IN_NOISE,
>>  };
>>  
>>  static const struct hda_fixup alc269_fixups[] = {
>> @@ -6387,6 +6388,17 @@ static const struct hda_fixup alc269_fixups[]
>> = {
>>  		.type = HDA_FIXUP_FUNC,
>>  		.v.func = alc_fixup_auto_mute_via_amp,
>>  	},
>> +	[ALC285_FIXUP_LENOVO_PC_BEEP_IN_NOISE] = {
>> +		.type = HDA_FIXUP_VERBS,
>> +		.v.verbs = (const struct hda_verb[]) {
>> +			/* Disable PCBEEP-IN passthrough */
>> +			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x36 },
>> +			{ 0x20, AC_VERB_SET_PROC_COEF, 0x57d7 },
>> +			{ }
>> +		},
>> +		.chained = true,
>> +		.chain_id = ALC285_FIXUP_LENOVO_HEADPHONE_NOISE
>> +	},
>>  };
>>  
>>  static const struct snd_pci_quirk alc269_fixup_tbl[] = {
>> @@ -7060,7 +7072,7 @@ static const struct snd_hda_pin_quirk
>> alc269_pin_fixup_tbl[] = {
>>  		{0x12, 0x90a60130},
>>  		{0x19, 0x03a11020},
>>  		{0x21, 0x0321101f}),
>> -	SND_HDA_PIN_QUIRK(0x10ec0285, 0x17aa, "Lenovo",
>> ALC285_FIXUP_LENOVO_HEADPHONE_NOISE,
>> +	SND_HDA_PIN_QUIRK(0x10ec0285, 0x17aa, "Lenovo",
>> ALC285_FIXUP_LENOVO_PC_BEEP_IN_NOISE,
>>  		{0x12, 0x90a60130},
>>  		{0x14, 0x90170110},
>>  		{0x19, 0x04a11040},
>> -- 
>> 2.17.1
>>
>>
>>
diff mbox series

Patch

diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index cf5d26642bcd..66123abf107c 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -5510,6 +5510,7 @@  enum {
 	ALC221_FIXUP_HP_HEADSET_MIC,
 	ALC285_FIXUP_LENOVO_HEADPHONE_NOISE,
 	ALC295_FIXUP_HP_AUTO_MUTE,
+	ALC285_FIXUP_LENOVO_PC_BEEP_IN_NOISE,
 };
 
 static const struct hda_fixup alc269_fixups[] = {
@@ -6387,6 +6388,17 @@  static const struct hda_fixup alc269_fixups[] = {
 		.type = HDA_FIXUP_FUNC,
 		.v.func = alc_fixup_auto_mute_via_amp,
 	},
+	[ALC285_FIXUP_LENOVO_PC_BEEP_IN_NOISE] = {
+		.type = HDA_FIXUP_VERBS,
+		.v.verbs = (const struct hda_verb[]) {
+			/* Disable PCBEEP-IN passthrough */
+			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x36 },
+			{ 0x20, AC_VERB_SET_PROC_COEF, 0x57d7 },
+			{ }
+		},
+		.chained = true,
+		.chain_id = ALC285_FIXUP_LENOVO_HEADPHONE_NOISE
+	},
 };
 
 static const struct snd_pci_quirk alc269_fixup_tbl[] = {
@@ -7060,7 +7072,7 @@  static const struct snd_hda_pin_quirk alc269_pin_fixup_tbl[] = {
 		{0x12, 0x90a60130},
 		{0x19, 0x03a11020},
 		{0x21, 0x0321101f}),
-	SND_HDA_PIN_QUIRK(0x10ec0285, 0x17aa, "Lenovo", ALC285_FIXUP_LENOVO_HEADPHONE_NOISE,
+	SND_HDA_PIN_QUIRK(0x10ec0285, 0x17aa, "Lenovo", ALC285_FIXUP_LENOVO_PC_BEEP_IN_NOISE,
 		{0x12, 0x90a60130},
 		{0x14, 0x90170110},
 		{0x19, 0x04a11040},