
I often see laptop owners complaining about the microphone noise in Linux, while under Windows they are fewer, or they are completely absent. As a rule, the manufacturer is to blame for this, having installed the cheapest microphone and / or codec possible, hoping to smooth out the disgusting quality of iron by software.
Fortunately, Linux has a wonderful PulseAudio audio server, with which you can make audio from your microphone noticeably better.
Method # 1
In order to use the built-in PulseAudio noise and echo suppression module using the webrtc or speex algorithm, for a specific program, it is enough to run it with the environment variable:
PULSE_PROP="filter.want=echo-cancel"
And all your sound will be magically free from noise and echo!
Example:
PULSE_PROP="filter.want=echo-cancel" skype
Before:

After:

Method # 2
Create a permanent source and sink with shock cancellation:
load-module module-echo-cancel source_name=noechosource sink_name=noechosink set-default-source noechosource
You can add these lines to /etc/pulse/default.pa somewhere at the end so that they are executed every time you start pulseaudio.
')
Unfortunately, in the current version of PulseAudio there is a
bug , because of which this module works only when it is not only recording, but also playing. Say, in Skype, Mumble and other voice phones everything will be great at once, and if you enter just to record sound, for example, through audacity, you should turn on some kind of music in it as a background, even with a minimum volume.
If you use the second method, make sure that the program you need plays audio in the sink with noise cancellation, and not directly into the audio card. You can move the sink, for example, through pavucontrol.
Do not play music in the audio player through the sink with noise cancellation, otherwise you will get sound in mono and 32kHz.
At habrahabr there is one of the developers of PulseAudio -
AEP . Thank him for the consultation.