[regression][snd_hda_codec_realtek] repeating crackling noise after 19.04 upgrade

Bug #1821663 reported by venturia on 2019-03-26
22
This bug affects 2 people
Affects Status Importance Assigned to Milestone
linux (Ubuntu)
High
Hui Wang
Bionic
High
Unassigned
Cosmic
High
Unassigned
Disco
High
Hui Wang

Bug Description

[Impact]
After CONFIG_SND_HDA_POWER_SAVE_DEFAULT is changed to 1, the codec runtime PM is
enabled, on some codecs or for some hw design, there is noise with the codec
runtime PM enabled.

[Fix]
put the machine in the power_save_black_list, this will set the power_save=0

[Test Case]
just boot up and do some audio operations, there is no noise anymore

[Regression Risk]
Low. this patch ony applies to the specific machines.

I'm experiencing a repeating crackling noise after 19.04 upgrade that start just after the boot and before the login.

I tried a bunch of fixes for pulseaudio I found googling, including this one https://wiki.archlinux.org/index.php/PulseAudio/Troubleshooting#Glitches.2C_skips_or_crackling
 and this one https://askubuntu.com/questions/864608/audio-crackle-through-headphones. Neither of which helped.

The command "killall pulseaudio" usually stop the noise for 10 seconds, then the noise restart.

The system was running smoothly on 18.10

Alessandro-

ProblemType: Bug
DistroRelease: Ubuntu 19.04
Package: pulseaudio 1:12.2-2ubuntu1
ProcVersionSignature: Ubuntu 5.0.0-8.9-generic 5.0.1
Uname: Linux 5.0.0-8-generic x86_64
ApportVersion: 2.20.10-0ubuntu23
Architecture: amd64
AudioDevicesInUse:
 USER PID ACCESS COMMAND
 /dev/snd/controlC1: alessandro 3310 F.... pulseaudio
 /dev/snd/controlC0: alessandro 3310 F.... pulseaudio
CurrentDesktop: ubuntu:GNOME
Date: Tue Mar 26 03:29:00 2019
InstallationDate: Installed on 2016-07-09 (989 days ago)
InstallationMedia: Ubuntu 16.04 LTS "Xenial Xerus" - Release amd64 (20160420.1)
ProcEnviron:
 TERM=xterm-256color
 PATH=(custom, no user)
 XDG_RUNTIME_DIR=<set>
 LANG=it_IT.UTF-8
 SHELL=/bin/bash
SourcePackage: pulseaudio
UpgradeStatus: Upgraded to disco on 2019-03-25 (0 days ago)
dmi.bios.date: 02/14/2006
dmi.bios.vendor: Phoenix Technologies, LTD
dmi.bios.version: 6.00 PG
dmi.board.name: GA-8TRC410M-NF
dmi.board.vendor: NEC COMPUTERS INTERNATIONAL
dmi.chassis.type: 3
dmi.chassis.vendor: NEC COMPUTERS INTERNATIONAL
dmi.modalias: dmi:bvnPhoenixTechnologies,LTD:bvr6.00PG:bd02/14/2006:svnPackardBellNEC:pnIMEDIA5204:pvrPB34310106:rvnNECCOMPUTERSINTERNATIONAL:rnGA-8TRC410M-NF:rvr:cvnNECCOMPUTERSINTERNATIONAL:ct3:cvr:
dmi.product.name: IMEDIA 5204
dmi.product.version: PB34310106
dmi.sys.vendor: Packard Bell NEC

venturia (alessandro-venturini) wrote :
description: updated
Daniel van Vugt (vanvugt) wrote :

Thanks for the bug report. Since pulseaudio is unchanged (the same version) in 19.04 from 18.10 I think we can exclude that as a possible cause.

1. The first idea I have about possible causes is a kernel change (and the kernel has changed a lot). Please try some older kernels from here:

  https://kernel.ubuntu.com/~kernel-ppa/mainline/?C=N;O=D

(for reference, Ubuntu 18.10 uses kernel 4.18).

2. Also, is the crackling from internal speakers or headphones?

3. Finally, please check that something hasn't accidentally enabled:

  Settings > Sound > Over-Amplification

  as that could cause crackling.

affects: pulseaudio (Ubuntu) → linux (Ubuntu)
Changed in linux (Ubuntu):
status: New → Incomplete
summary: - repeating crackling noise after 19.04 upgrade
+ [snd_hda_codec_realtek] repeating crackling noise after 19.04 upgrade

Daniel,

your idea was right.

1) Using the kernel 4.18 the noise disappeared
2) crackling was from the headphones
3) Over-Amplification is (and was) disabled

A-

March 26, 2019 4:01 AM, "Daniel van Vugt" <email address hidden> wrote:

> Thanks for the bug report. Since pulseaudio is unchanged (the same
> version) in 19.04 from 18.10 I think we can exclude that as a possible
> cause.
>
> 1. The first idea I have about possible causes is a kernel change (and
> the kernel has changed a lot). Please try some older kernels from here:
>
> https://kernel.ubuntu.com/~kernel-ppa/mainline/?C=N;O=D
>
> (for reference, Ubuntu 18.10 uses kernel 4.18).
>
> 2. Also, is the crackling from internal speakers or headphones?
>
> 3. Finally, please check that something hasn't accidentally enabled:
>
> Settings > Sound > Over-Amplification
>
> as that could cause crackling.
>
> ** Package changed: pulseaudio (Ubuntu) => linux (Ubuntu)
>
> ** Changed in: linux (Ubuntu)
> Status: New => Incomplete
>
> ** Summary changed:
>
> - repeating crackling noise after 19.04 upgrade
> + [snd_hda_codec_realtek] repeating crackling noise after 19.04 upgrade
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1821663
>
> Title:
> [snd_hda_codec_realtek] repeating crackling noise after 19.04 upgrade
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1821663/+subscriptions

Great.

Next, please try to find the closest two kernel versions where one has the bug and the version before it does not...

https://kernel.ubuntu.com/~kernel-ppa/mainline/?C=N;O=D

Changed in linux (Ubuntu):
status: Incomplete → Confirmed
status: Confirmed → Incomplete

Today I'm busy. I will check it tomorrow.
A-

March 26, 2019 7:51 AM, "Daniel van Vugt" <email address hidden> wrote:

> Great.
>
> Next, please try to find the closest two kernel versions where one has
> the bug and the version before it does not...
>
> https://kernel.ubuntu.com/~kernel-ppa/mainline/?C=N;O=D
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1821663
>
> Title:
> [snd_hda_codec_realtek] repeating crackling noise after 19.04 upgrade
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1821663/+subscriptions

I've done many tests. The last working kernel is:

Linux IMEDIA-5204 5.0.0-050000rc3-generic #201901202030 SMP Mon Jan 21 01:33:02 UTC 2019 x86_64
x86_64 x86_64 GNU/Linux

while from the next release on, the system make noise.
The first release with noise is:

Linux IMEDIA-5204 5.0.0-050000rc4-generic #201901272036 SMP Mon Jan 28 01:38:37 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

Alessandro-

March 26, 2019 10:51 PM, "Alessandro" <email address hidden> wrote:

> Today I'm busy. I will check it tomorrow.
> A-
>
> March 26, 2019 7:51 AM, "Daniel van Vugt"
> <email address hidden> wrote:
>
>> Great.
>>
>> Next, please try to find the closest two kernel versions where one has
>> the bug and the version before it does not...
>>
>> https://kernel.ubuntu.com/~kernel-ppa/mainline/?C=N;O=D
>>
>> --
>> You received this bug notification because you are subscribed to the bug
>> report.
>> https://bugs.launchpad.net/bugs/1821663
>>
>> Title:
>> [snd_hda_codec_realtek] repeating crackling noise after 19.04 upgrade
>>
>> To manage notifications about this bug go to:
>> https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1821663/+subscriptions
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1821663
>
> Title:
> [snd_hda_codec_realtek] repeating crackling noise after 19.04 upgrade
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1821663/+subscriptions

I checked the new patches between rc3 and rc4, there are only some minor changes. In theory they will not introduce this problem.

Please test this dkms on the rc4, this dkms contains the same driver as rc3, let us test kernel-rc4+hda sound driver-rc3 and see if the noise still happens or not.

sudo dpkg -i oem-audio-hda-daily-dkms_rc3_all.deb
reboot
check if there is still noise

thx.

Check done without positive results. RC3 works without noise, RC4 has
noise in background.

A-

Il 31/03/19 05:32, Hui Wang ha scritto:
> I checked the new patches between rc3 and rc4, there are only some minor
> changes. In theory they will not introduce this problem.
>
> Please test this dkms on the rc4, this dkms contains the same driver as
> rc3, let us test kernel-rc4+hda sound driver-rc3 and see if the noise
> still happens or not.
>
> sudo dpkg -i oem-audio-hda-daily-dkms_rc3_all.deb
> reboot
> check if there is still noise
>
> thx.
>
> ** Attachment added: "oem-audio-hda-daily-dkms_rc3_all.deb"
> https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1821663/+attachment/5251105/+files/oem-audio-hda-daily-dkms_rc3_all.deb
>

Changed in linux (Ubuntu):
status: Incomplete → Confirmed

Do you mean that you installed the deb of #7 in the kernel-rc3, there is no noise, while installed the deb of #7 in the kernel-rc4, still has noise? So looks like it is not the alsa hda driver's issue, since the deb contains the driver exact same as the rc3.

Please help collect two alsa-info.txt:

1) using rc4 kernel, plug headphone, when there is noise, please enable dump_coef and run alsa-info
$sudo
root@hwang4-Vostro-5390:/# echo 1 > /sys/module/snd_hda_codec/parameters/dump_coef
root@hwang4-Vostro-5390:/# alsa-info
Then upload the /tmp/alsa-info.txt.xxx to launchpad.

2) using rc3 kernel, plug headphone, there is no noise, please also enable dump_coef and run alsa-info, then upload the new /tmp/alsa-info.txt.yyyy to launchpad.

Let us see if there is any difference in the two alsa-info.txt.

thx

"Do you mean that you installed the deb of #7 in the kernel-rc3, there is no noise, while installed the deb of #7 in the kernel-rc4, still has noise?" ===>>>> yes

Attached you can find the two alsa file. I've compared the two files and I sow a difference in power_save setting: this PC is not able to suspend and resume. I saw many ACPI error while the system is booting.

A-

and the alsa for RC4

summary: - [snd_hda_codec_realtek] repeating crackling noise after 19.04 upgrade
+ [regression][snd_hda_codec_realtek] repeating crackling noise after
+ 19.04 upgrade
Changed in linux (Ubuntu):
importance: Undecided → High
Hui Wang (hui.wang) wrote :

It is an issue of power_save setting. It is not a driver's code issue, it is a kconfig issue. From rc4, the CONFIG_SND_HDA_POWER_SAVE_DEFAULT is set to 1 rather 0, then the codec enables the runtime PM, that introduce the noise.

You can workaround it by adding an module parameter (/etc/modprobe.d/alsa-base.conf, add a new line in this file and reboot. "options snd-hda-intel power_save=0".

And I will change the driver's code, and upload a new dkms, if that dkms works, you don't need to add that module parameter anymore.

Hui Wang (hui.wang) wrote :

please install this dkms on rc4 or v5.0 kernel, reboot and test.

If you add the workaround of #12, please remove it first.

thx.

Seth Forshee (sforshee) wrote :

@Hui does the test driver in comment #13 add 1002:437b to power_save_blacklist? From the duped bug seems we also want to add 8086:a170 to the blacklist as well, or else change CONFIG_SND_HDA_POWER_SAVE_DEFAULT back to 0.

Hui Wang (hui.wang) wrote :

@Seth,

It added the subvendor and subdevice, like below:

diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c
index ece256a3b48f..e3ea62acfcce 100644
--- a/sound/pci/hda/hda_intel.c
+++ b/sound/pci/hda/hda_intel.c
@@ -2150,6 +2150,8 @@ static struct snd_pci_quirk power_save_blacklist[] = {
        SND_PCI_QUIRK(0x17aa, 0x367b, "Lenovo IdeaCentre B550", 0),
        /* https://bugzilla.redhat.com/show_bug.cgi?id=1572975 */
        SND_PCI_QUIRK(0x17aa, 0x36a7, "Lenovo C50 All in one", 0),
+ /* https://bugs.launchpad.net/bugs/1821663 */
+ SND_PCI_QUIRK(0x1631, 0xe017, "Packard Bell NEC IMEDIA 5204", 0),
        {}
 };
 #endif /* CONFIG_PM */

If we change the CONFIG_SND_HDA_POWER_SAVE_DEFAULT back to 0, nothing needs to be added in the blacklist.

Seth Forshee (sforshee) wrote :

Ok, I guess I got the wrong id. Can you also add the ids from the duped bug so that can be tested too?

https://launchpadlibrarian.net/417429198/AlsaInfo.txt

Kai-Heng Feng (kaihengfeng) wrote :

CONFIG_SND_HDA_POWER_SAVE_DEFAULT should stay enabled. If it's a driver bug, users will still face the same issue once runtime PM is in use.

Hui Wang (hui.wang) wrote :

Added two machines in the runtime pm blacklist:

diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c
index ece256a3b48f..f62fb8b16c49 100644
--- a/sound/pci/hda/hda_intel.c
+++ b/sound/pci/hda/hda_intel.c
@@ -2150,6 +2150,9 @@ static struct snd_pci_quirk power_save_blacklist[] = {
        SND_PCI_QUIRK(0x17aa, 0x367b, "Lenovo IdeaCentre B550", 0),
        /* https://bugzilla.redhat.com/show_bug.cgi?id=1572975 */
        SND_PCI_QUIRK(0x17aa, 0x36a7, "Lenovo C50 All in one", 0),
+ /* https://bugs.launchpad.net/bugs/1821663 */
+ SND_PCI_QUIRK(0x1631, 0xe017, "Packard Bell NEC IMEDIA 5204", 0),
+ SND_PCI_QUIRK(0x8086, 0x2064, "Intel Laptop 8086:2064", 0),
        {}
 };
 #endif /* CONFIG_PM */

Hui Wang (hui.wang) wrote :

Added two machines in the runtime pm blacklist:

diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c
index ece256a3b48f..f62fb8b16c49 100644
--- a/sound/pci/hda/hda_intel.c
+++ b/sound/pci/hda/hda_intel.c
@@ -2150,6 +2150,9 @@ static struct snd_pci_quirk power_save_blacklist[] = {
        SND_PCI_QUIRK(0x17aa, 0x367b, "Lenovo IdeaCentre B550", 0),
        /* https://bugzilla.redhat.com/show_bug.cgi?id=1572975 */
        SND_PCI_QUIRK(0x17aa, 0x36a7, "Lenovo C50 All in one", 0),
+ /* https://bugs.launchpad.net/bugs/1821663 */
+ SND_PCI_QUIRK(0x1631, 0xe017, "Packard Bell NEC IMEDIA 5204", 0),
+ SND_PCI_QUIRK(0x8086, 0x2064, "Intel Laptop 8086:2064", 0),
        {}
 };
 #endif /* CONFIG_PM */

@Hui: I've installed the package as per comment #18 and this has fixed the problem.
I've skipped the instructions at #12. Do you need additional tests?

A-

@Hui: I've installed the package as per comment #19 (sorry for the typo at #20) and this has fixed the problem.
I've skipped the instructions at #12. Do you need additional tests?

A-

Hui Wang (hui.wang) wrote :

@venturia,

No need to do more tests.

Thanks.

Kai-Heng Feng (kaihengfeng) wrote :

FWIW, I think a better way to do this is to ask Realtek to implement correct de-pop function for this platform.

Of course blacklisting is still a proper compromise.

Hui Wang (hui.wang) on 2019-04-18
description: updated
Hui Wang (hui.wang) on 2019-04-18
Changed in linux (Ubuntu):
assignee: nobody → Hui Wang (hui.wang)
Stefan Bader (smb) on 2019-04-18
Changed in linux (Ubuntu Bionic):
importance: Undecided → High
status: New → Confirmed
Changed in linux (Ubuntu Cosmic):
importance: Undecided → High
status: New → Confirmed
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.