Fixing Static Noise In Microphone Recording In Linux using PulseAudio modules
Author: Subroto Banerjee
Linux is a family of open-source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991, by Linus Torvalds. It is typically packaged as a Linux Distribution (distro), which includes the kernel and supporting system software and libraries. Popular Linux distros are Debian, Fedora Linux, and Ubuntu.
PulseAudio is a general-purpose sound server intended to run as a middleware between your applications and your hardware devices. It also offers easy network streaming across local devices using Avahi if enabled. While its main purpose is to ease audio configuration, its modular design allows more advanced users to configure the daemon precisely to best suit their needs.
If you are also sick of all the static noise your teammates complain about when you are speaking in an online meeting with them and you are tired of testing your mic again and again on Discord and want a permanent solution. Then you have come to the right place. In this article, I will discuss and lay a step-by-step process as to how to fix that with an already existing module within the PulseAudio that you have in your Linux and without installing any unnecessary packages you can allow your teammates to hear your soothing voice without unnecessary static noise. Let's dive into it...
Where does this static noise come from?
You would ask why in the world my mic makes static noise when I am on Linux but works perfectly fine on Windows. The reason behind your audio device emitting static or high-pitched noise lies in the power-saving settings of your Linux distro. In some distros, power-saving modes on all peripherals are enabled by default to conserve battery on laptops and other battery-dependent systems which makes you sound like you are stuck in a hurricane or something in your online meetings.
How do I fix it?
There are multiple ways available to solve this, but installing many packages and then writing dozens of commands while you are new to Linux could be awful. Using an existing noise suppression module in PulseAudio is a wiser and time-saving choice.
Your PulseAudio has an existing noise suppression module named Echo Cancel, which is waiting for you to activate it -
Step 1: Open the default.pa file
The default.pa file is used to define how PulseAudio handles audio input and output, as well as various audio processing settings. It specifies which PulseAudio modules should be loaded and how they should be configured.
Open it using a text editor in your terminal :
# if you use nano text editor
sudo nano /etc/pulse/default.pa
# if you use nvim/vim text editor
sudo nvim /etc/pulse/default.pa
sudo vim /etc/pulse/default.pa
# you can use any text editor you want
the file looks something like this :
Step 2: Add echo cancel module at the end of default.pa
add the following :
load-module module-echo-cancel aec_method=webrtc source_name=echoCancel_source sink_name=echoCancel_sink
Save the file.
Step 3: Restart PulseAudio
pulseaudio --kill
pulseaudio --start
After this, check once if you can still hear the static noise, your mic is fixed.
But I can still hear the static noises, what do I do?
In case it didn't work, which is a very uncommon case, you check the following articles/packages :
You can download Noisetorch
Noisetorch is a real-time microphone noise suppressor on Linux
Step 1
git clone https://aur.archlinux.org/noisetorch.git
Step 2
cd noisetorch makepkg -si
Then simply open the application
Adjust stuff as per your needs.
Time to go...
I hope one of the above solutions works out for you and you can make your existence known in your online meetings again xD. Nonetheless, if you find some other way of fixing the static noise, do drop it in the comments. Thanks for reading.
Do like and comment if it helped you, share with those who might be facing this issue and follow me for more such articles.
Subscribe to my newsletter
Read articles from Subroto Banerjee directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by
Subroto Banerjee
Subroto Banerjee
Hi , I am a Sophomore Engineering Undergraduate from Indian Institute of Information Technology , Kalyani . I am pursuing B.Tech in Electronics and Communication Engineering. I have a keen interest in Web and App development, open source , and writing. I also like to explore different technologies like blockchain, GameDev, Google Cloud, Web/App Development etc. I am also very active on different social media platforms and like to share my learnings on those platforms, I also am active in various tech communities. I have worked on various websites for hackathons organised by my college. I also have done PR work for them, managing the social handles of the tech club of my college. I like writing blogs , which I post on medium and hashnode. Apart from this, I am a die hard hip-hop fan, and sometimes produce my own music and post it on youtube. I have worked as a DevRel and Dev Evangelist Intern at a startup. I am learning Angular and Flutter development frameworks. I also am honing my DSA problem solving skills on LeetCode and trying to participate more in Competitive Programming. I'm currently focussed on improving my skills in technology.