I have this issue where I hear a static noise coming from my speakers that goes away when I start playing any audio and comes back after a few seconds when I am not playing any audio.
2 Answers
Following these instructions, I ran pulseaudio in verbose mode:
$ systemctl --user stop pulseaudio.socket
$ systemctl --user stop pulseaudio.service
$ pulseaudio -v
And I found the following output each time the static noise started:
I: [pulseaudio] module-suspend-on-idle.c: Source alsa_input.usb-Logitech_Logitech_Wireless_Headset_88C626977831-00.multichannel-input idle for too long, suspending ...
I: [alsa-source-USB Audio] alsa-source.c: Device suspended...
I: [pulseaudio] module-suspend-on-idle.c: Sink alsa_output.pci-0000_07_00.6.analog-stereo idle for too long, suspending ...
I: [alsa-sink-ALC887-VD Analog] alsa-sink.c: Device suspended...
I: [pulseaudio] module-suspend-on-idle.c: Sink alsa_output.pci-0000_07_00.1.hdmi-stereo idle for too long, suspending ...
I: [alsa-sink-HDMI 0] alsa-sink.c: Device suspended...
I: [pulseaudio] module-suspend-on-idle.c: Sink alsa_output.usb-Logitech_Logitech_Wireless_Headset_88C626977831-00.analog-stereo idle for too long, suspending ...
I: [alsa-sink-USB Audio] alsa-sink.c: Device suspended...
Then, I commented out this line from /etc/pulse/default.pa
:
### load-module module-suspend-on-idle
Finally, I reboot my computer and the static noise was gone :)
-
On behalf of user @BlackThorne: "I didn't have a static noise, I had a pulse-like waveform audio, but same behavior, similar output in verbose, solved using this answer".– LeventeOct 6, 2022 at 13:43
The issue is caused by the audio going into power-save mode. There are two ways that I know of to work around the issue:
- Disable audio power-save for pulseaudio by editing the file
/etc/pulse/default.pa
, and comment out the line
load-module module-suspend-on-idle
You can comment a line by prepending a '#
' to the beginning of the line.
This seems to be the most popular solution, as I found it in many places including Fabian's answer.
- Disable power save for the audio device system-wide by running the command
echo 0 | sudo tee /sys/module/snd_hda_intel/parameters/power_save
This solution I found at https://www.makeuseof.com/fix-static-noise-from-speakers-linux/.
At the end of the day, I don't think it matters how you workaround the issue. Personally, I prefer the second option because it is more general as it does not depend on pulseaudio.
-
snd_hda_intel
- that seems hardware-specific? Is it possible that for some people with different audio hardware, and accordingly, a different driver / module, this measure wouldn't work?– LeventeOct 6, 2022 at 13:35 -
It might be hardware-specific, but I wouldn't know. From the link I shared, there was no indication that it is hardware-specific. In any case, it worked for me, so I figured I would share it.– D BearOct 7, 2022 at 20:54