Enable Noise cancellation in Ubuntu

There is a hidden feature in Ubuntu which will allow you to enable noise cancellation and enhance quality of your online conversations. Here is a short tutorial on how to do it.

Here are quick few commands to enable it. This is tested with Ubuntu 19.10

First, backup of the important stuff.

sudo cp /etc/pulse/default.pa /etc/pulse/default.pa.bak

Now, following part you can do two ways.

First method

First method is to just enter following command and execute it

sudo cat <<EOT >> /etc/pulse/default.pa
load-module module-echo-cancel source_name=noechosource sink_name=noechosink
set-default-source noechosource
set-default-sink noechosink
EOT

It will look like this

And that is it, you are done. If you for some reason get error “Permission denied”, try executing sudo -s before this command.

Second method

If for some reason you like to do things manully, here is the second method. Second one is to edit default.pa file manually by enetring following

sudo vi /etc/pulse/default.pa

At the bottom of the file, in the ###Make some devices default section, add following

load-module module-echo-cancel source_name=noechosource sink_name=noechosink
set-default-source noechosource
set-default-sink noechosink

So, your file will look like this

If you enter last two commands –

set-default-source noechosource
set-default-sink noechosink

You will also get noise cancellation on your output device, and sometimes your audio won’t work and you will not hear sound. You will have to manually switch to output device which has no noise cancellation enabled. This is just a heads up, it is up to you to choose. I removed these two lines in my working environment

Save the file and exit.

“Must do” step, whichever method you select

If you done this by following first or second method, you still in the end have to restart your audio, you will do that by typing following

sudo pulseaudio -k

if you prefer, you can also reboot pc instead.

After you are done, next time you start using your microphone (skype call, youtube session…) head to Settings | Sound | Input and change your input device to the one that has (echo cancelled) at the end of it.

That is it, you have echo cancellation enabled in Ubuntu.

To be honest, this doesn’t always work for me as it should, but few reboots, and reconnecting of peripherals usually helps.

Disclaimer