diff --git a/sources/tech/20221126.1 ⭐️ How I Fixed Buzzing Noise Coming from Speakers in Linux.md b/sources/tech/20221126.1 ⭐️ How I Fixed Buzzing Noise Coming from Speakers in Linux.md new file mode 100644 index 0000000000..a6e34a26fe --- /dev/null +++ b/sources/tech/20221126.1 ⭐️ How I Fixed Buzzing Noise Coming from Speakers in Linux.md @@ -0,0 +1,130 @@ +[#]: subject: "How I Fixed Buzzing Noise Coming from Speakers in Linux" +[#]: via: "https://itsfoss.com/buzzing-noise-speaker-linux" +[#]: author: "Sagar Sharma https://itsfoss.com/author/sagar/" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +How I Fixed Buzzing Noise Coming from Speakers in Linux +====== + +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 +``` + +![power saving setting in sound card making buzzing sound in linux][1] + +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 +``` + +![fix buzzing sound in linux][2] + +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][3] 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. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/buzzing-noise-speaker-linux + +作者:[Sagar Sharma][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/sagar/ +[b]: https://github.com/lkxed +[1]: https://itsfoss.com/wp-content/uploads/2022/11/power-saving-setting-in-sound-card-making-buzzing-sound-in-linux.png +[2]: https://itsfoss.com/wp-content/uploads/2022/11/fix-buzzing-sound-in-linux.png +[3]: https://linuxhandbook.com/nano-save-exit/