Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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).

Image showing noise suppression option

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.

Thanks in advance!

This is also crossposted on Unix StackExchange

share|improve this question
    
Audacity does have an incredibly annoying/useless noise remover... but that can't be used in real-time... –  Wilf Feb 16 at 14:51
    
@Wilf I know, but I'm looking for real time solution, like the Realtek drivers on Windows. –  user1873947 Feb 16 at 16:24
    
I think that there is nothing as such for linux till now. –  Amith KK Feb 16 at 16:28
2  
@goldilocks added info on both sites that this is crossposted to make sure there won't be duplicate answers –  user1873947 Feb 16 at 16:49

1 Answer 1

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 here: http://wiki.gentoo.org/wiki/PulseAudio, 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 aptitude install build-essential

# do this if like me you have libjack-jackd2-0 installed and not libjack0
sudo aptitude 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 aptitude build-dep pulseaudio

# also install webrtc
sudo aptitude install libwebrtc-audio-processing-dev

# get the pulse source package
apt-get 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 system-wide equalizer utility (http://www.webupd8.org/2013/03/install-pulseaudio-with-built-in-system.html), 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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.