Merge pull request #28366 from geekpi/translating

translated
This commit is contained in:
geekpi 2023-01-04 08:45:12 +08:00 committed by GitHub
commit b882800878
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 130 additions and 130 deletions

View File

@ -1,130 +0,0 @@
[#]: 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: "geekpi"
[#]: 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 Its 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 lets have a look at the solution.
Dont 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, Im 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/

View File

@ -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: "geekpi"
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
我如何修复 Linux 中扬声器发出的嗡嗡声
======
我使用笔记本电脑很长时间了,但最近才切换到桌面设置,以便在 It's FOSS 进行远程工作。
我注意到扬声器不断发出嗡嗡声。这很烦人,让我头疼。我开始着手解决这个问题。了解问题的根本原因非常有趣。
我将分享我在 Linux 中修复扬声器嗡嗡声的经验。我发现它可以在同一硬件上对 Ubuntu、Debian 和 Pop OS 都有效。
需要考虑的一件事是,如果本指南不适合你,你可能遇到了严重的硬件问题。对于大多数用户来说,给定的方案应该可以解决问题。
**在尝试修复之前**
我试图让事情变得容易安全地遵循。你尝试临时修复,如果有效,则将更改永久化。但是,最好使用 Timeshift 制作系统快照。如果你在出现故障时很容易惊慌失措,你可以将系统恢复到之前的状态。
另外,检查你的声卡。在我的例子中,它是 snd_hda_intel。对于 USB 卡,它可以是 snd_usb_audio。你必须根据你的声卡更改命令。
```
cat /proc/asound/modules
```
### Linux 中扬声器发出嗡嗡声的原因
梳理了无数的论坛帖子和网站后,我了解了问题的根本原因。这是因为扬声器中的电容放电。它可以通过关闭声卡的省电设置来解决。
通过关闭省电,你允许系统在这些电容放电时为其充电。这类似于在不断充电时使用电话。
你可以使用给定的命令检查你的系统是否启用了声卡的省电设置:
```
cat /sys/module/snd_hda_intel/parameters/power_save
```
![power saving setting in sound card making buzzing sound in linux][1]
如果你像我一样输出是 1那么省电功能已打开。因此让我们看一下方案。
不用担心。这不会显著影响你的电池百分比,因为所示方法仅适用于声卡。
### 尝试修复嗡嗡声问题(临时)
我之所以包括临时方法是为了确定嗡嗡声是由于电容放电引起的还是是否存在任何严重的硬件问题。
如果此临时方案有效,你可以继续使用永久方案。
第一步是切换到 root 用户:
```
sudo su
```
然后,执行给定的命令,它应该停止嗡嗡声直到下次启动:
```
echo 0 > /sys/module/snd_hda_intel/parameters/power_save
```
如果你使用的是 **USB 声卡**,则必须将 `snd_hda_intel``snd_usb_audio` 互换,如下所示:
```
echo 0 > /sys/module/snd_usb_audio/parameters/power_save
```
如果上述技巧解决了问题,那么你必须使变更永久化。否则,下次重启系统时更改将丢失。
### 修复嗡嗡声问题(永久)
在这里,我将对内核参数进行更改。
将你的工作目录更改为 /etc/modprobe.d
```
cd /etc/modprobe.d
```
现在,创建一个名为 `audio_disable_powersave.conf` 的新文件,并使用给定命令使用 nano 文本编辑器打开:
```
sudo nano audio_disable_powersave.conf
```
并在该文件中放入以下行以永久关闭声卡中的省电设置:
```
options snd_hda_intel power_save=0
```
![fix buzzing sound in linux][2]
对于 **USB 声卡**,你可以使用 `snd_usb_audio`
```
options snd_usb_audio power_save=0
```
现在,[保存更改并退出 Nano 文本编辑器][3]并按 Ctrl+X 键。重启你的系统,你就可以享受无噪音的工作空间。
### 总结
本指南解释了嗡嗡声的原因以及如何直接解决该问题。
同样,除了电容放电之外,你可能还有其他问题,因此你应该始终尝试临时方法。
让我知道你是否能够以这种方式解决 Linux 中扬声器发出的嗡嗡声。
--------------------------------------------------------------------------------
via: https://itsfoss.com/buzzing-noise-speaker-linux
作者:[Sagar Sharma][a]
选题:[lkxed][b]
译者:[geekpi](https://github.com/geekpi)
校对:[校对者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/