I used a laptop for a long time but only recently switched to a desktop setup for my remote work at Itβs FOSS.
I noticed a constant buzzing sound coming from the speakers. It was annoying and gave me headaches. I started out to fix the issue. It was quite interesting to know the root cause of the issue.
I will share my experience of fixing the buzzing noise from speakers in Linux. I found it working with Ubuntu, Debian and Pop OS on the same hardware.
One thing to consider is that you may have a serious hardware issue if this guide does not work for you. For most users, the given solution should get the job done.
Before you try the fix β¦
I have tried to make things easy to follow safely. You try the temporary fix and if it works, you make the changes permanent. However, it would be a good idea to make system snapshots with Timeshift. If you are easily panicked when things do not work, you can restore the system to the earlier state.
Also, check your sound card. In my case, it was snd_hda_intel. For USB card, it could be snd_usb_audio. You have to change the commands according to your sound card.
cat /proc/asound/modules
The reason behind the buzzing noise from speakers in Linux
After combing through numerous forum posts and websites, I learned the root cause of the issue. It is because of capacitor discharge in the speakers. And it can be solved by turning off the power-saving setting of a sound card.
By turning off power saving, you are allowing the system to charge those capacitors when they get discharged. It is similar to using a phone while charging constantly.
And you can check whether the power-saving setting for the sound card is enabled on your system by using the given command:
cat /sys/module/snd_hda_intel/parameters/power_save
And if you get 1 in output like mine, the power saving is turned on. So letβs have a look at the solution.
Donβt worry. This will not affect your battery percentage drastically, as the shown method is only applied to the sound card.
Try fixing the buzzing noise issue (temporary)
The reason why I included the temporary way is to identify whether the humming sound is being caused due to capacitor discharge or if there is any serious hardware problem going on.
If this temporary solution works, you can go ahead with the permanent solution.
The first step is to switch to the root user:
sudo su
And then, execute the given command, and it should stop the buzzing sound until the next boot:
echo 0 > /sys/module/snd_hda_intel/parameters/power_save
If you are using a USB sound card, you have to interchange snd_hda_intel
with snd_usb_audio
as given:
echo 0 > /sys/module/snd_usb_audio/parameters/power_save
If the above trick fixed the issue, you have to make things permanent. Otherwise, the changes will be lost when you next reboot your system.
Fixing the buzzing noise issue (permanently)
Here, Iβm going to make changes in kernel parameters.
Change your working directory to /etc/modprobe.d:
cd /etc/modprobe.d
And now, create a new file named audio_disable_powersave.conf
and open with the nano text editor using the given command:
sudo nano audio_disable_powersave.conf
And put the following lines in that file to turn off the power-saving setting in the sound card permanently:
options snd_hda_intel power_save=0
For a USB sound card, you can use snd_usb_audio
:
options snd_usb_audio power_save=0
Now, save changes and exit the Nano text editor by pressing Ctrl+X keys. Reboot your system, and you can enjoy a noise-free workspace.
Wrapping Up
This guide explains the cause of the buzzing noise and how you can straightforwardly solve that issue.
Again, you may have some other issue rather than discharging capacitors, so you should always try the temporary method.
Let me know if you were able to fix the buzzing noise from speakers in Linux this way or not.