Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is it possible to do realtime noise-removal with PulseAudio, so the sound output that's coming out is smoother?

share|improve this question
it probably is possible, though it would be intensive, and would require someone write a filter for it. – RolandiXor Dec 27 '10 at 12:36
@Vadi - I have added an answer that might help you if you are still using Ubuntu or any other PulseAudio based Distro. Hope it works for you buddy. – Luis Alvarado Apr 29 at 21:23
This post seems to be doing something similar – akhmed May 10 at 22:24
up vote 4 down vote accepted

I started reading a lot about PulseAudio and "hidden" options it had so I could find one that was similar to this question. The one I found was the noise-cancellation module, which is one that dramatically lowers any static noise on the microphone and even A LOT of the background noise, basically giving you the benefit of only recording your own voice with excellent quality (For audio recording for example). To do this follow this steps:

  1. sudo nano /etc/pulse/

  2. Add the following line anywhere on the file, but I recommend almost at the end where you will find a comment about Echo Cancellation stuff:

    load-module module-echo-cancel  
  3. Reload PulseAudio or simply restart the computer. You should be able to select the new Noise Cancellation option from the Input Device Section:

enter image description here

You can find more information about it on the Echo Cancel Module Page

If you wish to set as default the echo cancel device simply turn the above line into:

  load-module module-echo-cancel source_name=logitechsource

and then at the bottom of the file add

  set-default-source logitechsource

In this case I named the source logitechsource, but you can name it whatever you want and simply either restart pulseaudio like pulseaudio -k or restart the computer.

Lastly, if you do not want a super long name on the Sound Settings (When you want to select an input/output device). My suggestion is renaming the input device like this:

load-module module-echo-cancel source_name=logitechsource source_properties=device.description=LogitechHD

And again, restarting pulseaudio with pulseaudio -k or rebooting the computer. The end result looks like this:

enter image description here

share|improve this answer
Easy to do and doesn't seem to break things - thanks! – Vadi Apr 30 at 21:37
it isnt working module-echo-cancel.c is not found says the error i get @luis – nikoss Jul 1 at 19:52
@nikoss Hi I can give a hand with that on the askubuntu chat or via google hangouts. – Luis Alvarado Jul 1 at 21:00
@LuisAlvarado how do we start chat here ? – nikoss Jul 1 at 21:40
@nikoss Please contact me via email at luisalvarado at ubuntu dot com – Luis Alvarado Jul 2 at 21:46

This is an old question, but I had the same problem and after some Googling (where I mostly found people who agreed it wasn't possible) and reading some man pages, I have now developed a solution based on user2330377's idea.

First you need to create a noise profile for SoX. Just use any audio recording program to record a few seconds of noise, then cd into the directory you saved it to and do sox noise.wav -n noiseprof

Then you need to create an ALSA loopback device:

sudo modprobe snd_aloop

This is required because pulseaudio, unlike Jack, cannot directly connect audio software together; we will hence use the loopback device as a proxy.

Now you need to start paman and find the names of both your microphone (or other recording device) and of the loopback device we just created. Once those are found, you can execute the following command to start recording sound from your microphone, piping it through SoX and then playing it on the loopback device:

pacat -r -d alsa_input.pci-0000_00_14.2.analog-stereo --latency=1msec|sox -b 16 -e signed -c 2 -r 44100 -t raw - -b 16 -e signed -c 2 -r 44100 -t raw - noisered 0.2|pacat -p -d alsa_output.2.analog-stereo --latency=1msec

(Where you need to substitute the correct device names for the -d parameters -- the input device for the first pacat invocation and the loopback device output for the second.)

There you go, almost done! As a last step, start recording sound with the application of your choice, then start up pavucontrol, change to the "Recording" tab and set the audio device used for recording (displayed as the grey button to the right) to "Monitor of Loopback Audio Device". You should now have a clear and noise-free recording!

share|improve this answer

Investigation shows that there is no known way of doing real time noise reduction filtering with any Linux sub system. Some websites point to hardware you can buy which should do the trick much better than doing a software filter.

Alternatively if this is for a recording, you could pass the sound through Audacity and use the noise filter there.

share|improve this answer
Pity, I wonder why not. Thanks for investigating. – Vadi Jan 8 '11 at 12:16

Here's at leas tone way, implement webrtc-aec in the

webrtc-aec Yes Uses the AudioProcessing library for enhancing VoIP calls greatly in applications that support it by performing acoustic echo cancellation, analog gain control, noise suppression and other processing.

Here's a paper dated 2013 on the subject (noise removal with pulseaudio not webrtc-aec specifically)

"We have presented rst results of a multi-channel noise/echo reduction solution built on top of PulseAudio and motivated the design decisions. The work has resulted in a number of improvements in the PulseAudio echo cancellation and signal-processing framework, which have been contributed during the version 3.0/4.0 development cycle and should facilitate future embedded Linux audio solutions. Further work includes optimizing code for audio stream mixing, more ecient resampling methods, and the implementation of an efficient AEC in the multi-channel processing pipeline."

share|improve this answer
What I had in mind for a quick had was to takle a noise profile and do real time noise removal using sox and then play back the audio output which I can then use as an input stream in pulse. I believe that pulse is able to create and redirect input and output streams in this manner. That is the playback stream can get redirected as an input stream to another application and the playback stream is per application not per device, so it need not be routed to device hardware. – user2330377 Jun 22 '13 at 15:53
I'm giving this a go using pacmd to list pulseaudio devices, pacat to record and playback from them and sox to do the real time effects on the stream. – user2330377 Jun 22 '13 at 16:18
Would you be interested in posting the scripts for it? – Vadi Jun 23 '13 at 20:51

Your Answer


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.