33

From time to time I get a lot of static noise when playing sound. It stops when no sound is played (e.g. when music playback is stopped).

  • Seems to be independent from output device (same symptons with either my speakers or headphones)
  • When stopping sound, the static noise lingers for just a tiny bit. It doesn’t stop immediately
  • Unplugging my speakers and then plugging them in again amplifies the symptoms.
  • Opening the alsamixer GUI in the terminal and making sure that the levels are not in the red area makes things a bit better, but doesn’t solve this issue

Lastly, for what I can tell, this happens at completely random times. And it goes away just like that. I tried rebooting several times, no luck. At some point in the future it will be just fine.

So I have absolutely no idea what the hell is going on and how to fix it.

1
  • idk but kinda think been using my linux for last 3 years and it gives me tinnitus
    – buncis
    Mar 29, 2023 at 10:24

13 Answers 13

47

For what it’s worth, running the following seems to fix the issue:

pulseaudio -k

As to why, I have no idea.

From pulseaudio man page:

-k | --kill: Kill an already running PulseAudio daemon of the calling user (Equivalent to sending a SIGTERM).

Edit: This works reliably for me. Whenever this issue comes up, I run this command to fix it.

10
  • 1
    Works for me as well. Now we need an explanation why!
    – smirnoffs
    Aug 27, 2020 at 18:48
  • 2
    Has no effect for me at all. Oct 16, 2020 at 16:07
  • No works for me using Ubuntu 20.04
    – Santiago
    Jan 26, 2021 at 1:05
  • 1
    k in this case stands for "kill". The command kills the pulseaudio process, which in turn, will get started again automatically. Basically it restarts pulseaudio.
    – Levente
    Jan 26, 2021 at 19:15
  • It also works for me. Ubuntu 20.04
    – jplandrain
    Feb 18, 2021 at 13:35
21

Asked and answered here.

The solution is to add this to /etc/modprobe.d/alsa-base.conf

options snd-hda-intel power_save=0 power_save_controller=N
6
  • sudo echo -e '\n# Disable snd-hda-intel power saving\noptions snd-hda-intel power_save=0 power_save_controller=N\n' >> /etc/modprobe.d/alsa-base.conf
    – Khalid Ali
    Apr 21, 2019 at 20:23
  • Worked for me, my computer is a ServalWS with Pop!_OS 19.04
    – zeitue
    Apr 26, 2019 at 6:19
  • Tested this on Ubuntu 18.04, Asus UX501VW-DS71t laptop, and I'm amazed it worked! Been suffering through that noise for so long! Sep 23, 2020 at 4:20
  • 3
    It came back for some reason :( Sep 25, 2020 at 4:08
  • Alienware 17R3 (HDA Intel, Creative CA0132 codec). This solution eliminated speakers crackling completely while many other ways did not help! Mar 5, 2021 at 19:28
7

I am not a specialist in this area and don't know why the following worked, but it appears to have fixed the exact same problem on my computer.

In the file /etc/pulse/default.pa change the line:

load-module module-udev-detect

to read:

load-module module-udev-detect tsched=0

I found this on another thread where several others also claimed it solved the same audio problem for them.

3
  • 1
    Doesn't work for me. Oct 16, 2020 at 16:09
  • 1
    No works for me using Ubuntu 20.04
    – Santiago
    Jan 26, 2021 at 1:05
  • It works for me.
    – Lei Zhao
    Aug 24, 2022 at 23:19
5

Not an expert but in my case it was my headphones playing static noise but only when sound was playing.

Turned out it my headphones were over amplified (if that's the correct term). Turning down the headphone output with alsamixer fixed it.

enter image description here

3
  • do you need to reboot or something for the changes to take effect using this program?
    – Bersan
    Oct 6, 2020 at 23:06
  • @bersan No, I did not need to reboot.
    – Cimm
    Oct 8, 2020 at 6:03
  • Simply doesn't work. Oct 16, 2020 at 16:04
2

You can create a systemd (system-daemon) service script that will run at boot.

Open a terminal and run:

sudo nano /etc/systemd/system/powersave.service

authenticate, then add the following to the file:

[Unit]
Description=powersave script

[Service]
ExecStart=/opt/powersave.sh

[Install]
WantedBy=multi-user.target

CTRL+O to save and CTRL+X to exit.

Then run...

sudo nano /opt/powersave.sh

...and add the following:

#!/bin/bash
echo 0 | sudo tee sys/module/snd_hda_intel/parameters/power_save

CTRL+O to save and CTRL+X to exit.

Finally, make the script executable:

sudo chmod+x /opt/powersave.sh

..then, enable the service by typing:

sudo systemctl enable powersave

This script will run on boot as the root user and should result in no more crackling, because it will keep your soundcard ON, instead of allowing it to go into powersaving mode.

This solution worked with my hardware. The output of lspci for my system is:

Audio device: Intel Corporation 82801H (ICH8 Family) HD Audio Controller (rev 02) 
1

I was having the same issue on a dual boot system. Previously pulseaudio -k can temporarily solve the problem once it occurs.

This time it occurs immediately on boot and restarting pulseaudio does not help. Rebooting multiple times into ubuntu does not solve the issue either.

For me, the problem disappear after booting once into windows then boot back to ubuntu...

2
  • So perhaps a firmware-related problem.Do you use Intel HD audio? Oct 16, 2020 at 16:09
  • @ParsaMousavi No, it is an AMD one. And the trick only works some of the time (I am struggling with it again now).
    – hkchengrex
    Nov 29, 2020 at 10:11
1

I have same problem in 16.04 and 18.04. At present I am running 18.04.I have tried all suggestions from web like:

  • Kill Pulse Audio
  • Kill Pulse Audio and change /etc/pulse/default.pa
  • Try Following commands:

    hda-verb /dev/snd/hwC0D0 0x20 SET_COEF_INDEX 0x67
    hda-verb /dev/snd/hwC0D0 0x20 SET_PROC_COEF 0x3000

  • Removing Speech Dispacher
  • Set nice level of pulseaudio to -20 and allowing real-time priority of pulseaudio
  • Try changing power-save options like

    echo 0 > /sys/module/snd_hda_intel/parameters/power_save
    echo N > /sys/module/snd_hda_intel/parameters/power_save_controller

Some of the above options worked for some folks and not worked for most. I tried to some basic level debugging, so started doing strace when audio/video is on. Then the crackling sound was stopped. Here is the sample command I tried:

sudo strace -f -p $(ps -eaf|grep -E "^$USER.*/bin/pulseaudio"|grep -v grep|awk '{print $2}') 2>&1|head -1000

I found 1000 lines of strace output is sufficient to restore the sound. Please keep in mind following:

  • We have strace the pulseaudio process of the user (not the gdm process). So that is the reason we are grep'ing for $USER variable
  • When you are issuing above strace command, audio/video stream should be running
  • most of the 1000 line of strace is sufficient. You may double those lines or rerun the same command
  • Keep in mind that, if audio/video is changed, then same cracking sound will reappear. Once again run same script, the cracking sound will go.
  • Also keep in mind that this also might not solve your issue(until it is confirmed by lot others with various other configurations)
1

I know this question is old but it still seems to be an issue so for those still interested I believe I have a reason for why pulseaudio -k fixes the problem (re @kleinfreund answer and @smirnoffs comment on that answer).

According to the man page for pulseaudio -k is short for --kill and kills the currently running PulseAudio daemon. The system will notice it stopped an start a new instance (hence why the static stops ... until the next time).

I have no idea why the static starts in the first place, maybe a bug or a configuration issue (but that doesn't narrow it down), I'm currently on the hunt for a permanent solution.

2
  • 1
    ...can you recreate the condition? Did you find it explained elseware? Oct 13, 2020 at 13:33
  • I've been seeing the issue frequently, I haven't worked out how to reproduce it consistently yet, just creeps up on me, found this while looking for a permanent solution. Other people across the internet have seen the problem (in fact Arch Linux mentions what I assume is the same issue on their wiki). Though the explanation was just based on the man page my own knowledge.
    – David
    Oct 14, 2020 at 14:16
1

I tried all of the answers in the thread - none of them worked (I was scared it might be a HW problem). The only thing that surprisingly worked for me was turning the PC off, keeping it off for a minute and then turning it back on. Simple restarting the device did not work. After this, the problem disappeared as mysteriously as it appeared.

0
1

This appears to still be a problem years later.

Like others, I don't know the original cause. For me, I can trigger this distinctive static by switching repeatedly between multiple audio sources such as HDMI outputs on multiple displays, digital line-out, and multiple bluetooth audio outputs.

The solution (for me, and perhaps others) is much simpler and less problematic than killing pulse audio in terminal or rebooting the whole machine.

Simply navigate to the "Sound" tab under the default settings app, and toggle the "over-amplification" button.

This is the screen you need, it's under the default settings app

I suspect this is an issue with the pulse-audio code being written in some places to set volume 0-99, but in other places 0-199 (100% over-amplification), and then mixing up those settings when trying to add/subtract/reapply them between outputs.

Regardless of the why, toggling the over-amplification setting on/off appears to get things back on track.

Works on following system:

DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=20.10
DISTRIB_CODENAME=groovy
DISTRIB_DESCRIPTION="Ubuntu 20.10"
NAME="Ubuntu"
VERSION="20.10 (Groovy Gorilla)"
1

This is what I found and it worked perfectly for me. Apparently the push to be "green" and save a penny or two per decade on electricity costs has pushed the kernel devs to implement "power saving" on the audio and since that doesn't work the way it should it causes static in the audio.

Check to see if the power save feature is turned on in your system:

cat /sys/module/snd_hda_intel/parameters/power_save

If you get a "1" as the output, it's on. So turn it off (be root when you do this):

cat /sys/module/snd_hda_intel/parameters/power_save

Hope this works for everyone...

1
  • This works for me. Linux Mint 21.1 Vera Mate with a new Acer Nitro 5 laptop using a Jack audio to a soundbar. However, the problem comes back after a reboot. So I had to sudo crontab -e and add this: @reboot echo 0 > /sys/module/snd_hda_intel/parameters/power_save
    – Zurd
    Mar 6, 2023 at 3:09
0

If you're using VLC Player, just turn its volume under 100%. it worked for me. I hope it works for you.

0
0

I've had this problem off and on for years... (Technically in Linux Mint but sameshing.) The pulseaudio -k type stuff never worked for me.

The actual problem was the audio output port in the back of my desktop computer - or at least that's where the problem occurred...

I first suspected this was the problem when literally nothing I tried fixed it, not even temporarily - no commands, no settings configurations, no driver changes, not even volume reductions (anywhere) - yet my left (and only left) speaker would often crackle. I diagnosed this problem by plugging headphones in and switching out cables until I realized it was the jack itself.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .