I am using Linux Mint 21, but people using other Ubuntu based systems or systems with PulseAudio might find it helpful.
I found that the internal microphone is essentially unusable. It is extremely loud, noisy and distorted. I am surprised nobody brought up this issue before. Maybe everybody uses mics in their headphones, like I was . But here is how I fixed it.
You can use Sound Recorder to see how your changes affect the recording quality. You can get it using sudo apt install gnome-sound-recorder.
The default gain of 0 dB turned out to be ridiculously loud.
- Install PulseAudio Volume Control using sudo apt install pavucontrol
- Open it up. Go to Input Devices and drop the gain. I reduced it to 30% (-31.07 dB)
Big improvement! But there is more.
You can dig deep on ArchWiki. Here is my TLDR.
- You need to instruct PulseAudio to load the module module-echo-cancel and give it some parameters. Feel free to play with these, but this is what worked best for me.
- Create file /etc/pulse/default.pa.d/noise-cancellation.pa
- Copy paste the following content into that file:
### Enable Echo/Noise-Cancellation load-module module-echo-cancel use_master_format=1 aec_method=webrtc aec_args="analog_gain_control=0\ digital_gain_control=1 beamforming=1 mic_geometry=-0.04,0,0,0.04,0,0 noise_suppression=1 voice_detection=1" source_name=echoCancel_source sink_name=echoCancel_sink set-default-source echoCancel_source set-default-sink echoCancel_sink
- Restart your system.
- Open PulseAudio Volume Control. In Recording select All Streams. You should see Echo-Cancel Source from.
- Make sure this device is selected as the default input device.
- You should now have way better audio!
Let me know if you even faced this issue, and whether this solution worked!