Microphone - static background noise suppression [duplicate]
My soundcard is Realtek ALC 892. On Windows 7 I use official Realtek drivers, on Linux I use PulseAudio (on Ubuntu 13.10). On both Windows and Linux, when I enable microphone boost +30db (required because my microphone is quiet), I get very annoying and loud background noise (I also confirmed the background noise with Audacity on both systems).
However, Windows Realtek drivers have noise suppression option which works (after enabling it, Audacity shows no background noise and my ears also confirm that there is no background noise).
My question is how can I enable background noise suppression in ALSA/PulseAudio? Is there any module I can install or maybe there is a setting for it that can be enabled in config file?
I can't find solution for it and this is the only thing that prevents me from switching to Linux completely - as I talk using microphone a lot and on Windows the Realtek software removes the background noise completely and PulseAudio doesn't remove it, which means the recorded voice on Linux is very bad.
I know I could buy better soundcard and microphone, but as I said, Windows Realtek drivers remove the noise on software level in real time (ie no noise when talking on TeamSpeak3/Steam/whatever voip programme) so I hope that there is such option on Linux as well.
This is also crossposted on Unix StackExchange
I use lubuntu and have installed pulseaudio and pavucontrol already.
I have managed to fix the problem with my microphone noise by launching skype from terminal:
PULSE_PROP="filter.want=echo-cancel" skype
A bit late in the day but I recently got similar static background noise issue with my laptop's internal microphone (same Realtek chipset I believe but solution should work for all soundcards). After looking around, there is indeed a way to reduce noise in realtime in pulseaudio using webrtc echo-cancel plugin (the default speex echo-cancel in Ubuntu/Mint did not work well for me). I saw mention of that on PulseAudio Gentoo wiki, but took a while to figure out how to enable in Ubuntu. It made quite some difference for me and the background noise in Skype is now almost all gone.
Luckily Ubuntu already packages the webrtc library required for this. We can compile from the official source applying minimal change to enable the plugin and then install the updated package:
Enable source code repos in software sources, then:
sudo apt install build-essential
# do this if like me you have libjack-jackd2-0 installed and not libjack0
sudo apt install libjack-jackd2-dev
# for jack dependency problem accept the second solution of not installing libjack-dev, libjack0 since we already have installed required dev package above
sudo apt build-dep pulseaudio
# also install webrtc
sudo apt install libwebrtc-audio-processing-dev
# get the pulse source package
apt source pulseaudio
cd pulseaudio-4.0
After this edit the debian/rules file, go to ~line 57 and add "--enable-webrtc-aec
" to DEB_CONFIGURE_EXTRA_FLAGS
(say after the --disable-hal-compat
option)
Next edit debian/pulseaudio.install file and add: usr/lib/pulse-*/modules/libwebrtc-util.so
If you also want the pulse PulseaAudio System-Wide Equalizer, then edit debian/pulseaudio-utils.install
and add: /usr/bin/qpaeq
.
Then build the package to get the new debs: dpkg-buildpackage -d -us -uc -nc
You should install pulseaudio, pulseaudio-utils and libpulse packages among the generated debs (e.g. for Trusty 64bit release, or Mint 17 64bit: sudo dpkg -i pulseaudio_4.0-0ubuntu11_amd64.deb pulseaudio-utils_4.0-0ubuntu11_amd64.deb libpulse0_4.0-0ubuntu11_amd64.deb libpulsedsp_4.0-0ubuntu11_amd64.deb libpulse-mainloop-glib0_4.0-0ubuntu11_amd64.deb
)
Lastly enable webrtc plugin in /etc/pulse/default.pa: sudo gedit /etc/pulse/default.pa
Add the following at the end of the file:
### Load echo cancellation module
load-module module-echo-cancel source_name=echosource aec_method=webrtc
set-default-source echosource
You can also enable equalizer if you desire as mentioned in the webupd8 link above.
After this restarting pulseaudio (pulseaudio -k && pulseaudio --start
), or logoff+relogin, or reboot should enable the noise/echo cancellation plugin in pulseaudio. Somehow I found it working well after a full reboot but not so much after just a relogin.