Page MenuHomePureOS Tracker

Enable acoustic noise (and echo) cancelling feature by default (for Librem microphones)
Open, WishlistPublic

Description

So far, the built-in analogic microphones on most librems have a fair amount of unpleasant background noise, like most laptop microphones.

PulseAudio not only has an excellent/true acoustic echo canceller (not just a concealer), it also has a denoiser. Normally, this is used only when the right module is loaded, and only by native VoIP applications. Therefore, it is not used for WebRTC (ex: PureBrowser) and normal sound recording applications.

There is a way to force it for all applications. I have successfully done so by adding some lines to my ~/.config/pulse/default.pa, but this can be done systemwide, like what we see there.

I think enabling it by default (as part of our packages/patchset) would be a great way to improve user experience. Users are always in control as this only creates a second (virtual) device in the sound control center (or pavucontrol) that they can set as the default recording device.

Event Timeline

jeff created this task.Jan 1 2018, 11:32

Mak, once you finish other high-priority tasks please implement this into our defaults. In meantime I would like others to try this patch and report here.

hansolo added a subscriber: hansolo.Dec 29 2018, 12:23
mladen reassigned this task from mak to jeremiah.foster.May 31 2019, 14:50
mladen added a subscriber: mak.
mladen added a subscriber: mladen.EditedMay 31 2019, 15:46

Another solution is to add:

### 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" source_name=echoCancel_source sink_name=echoCancel_sink
set-default-source echoCancel_source
set-default-sink echoCancel_sink

# automatically switch to newly-connected devices
load-module module-switch-on-connect ignore_virtual=no

to ~/.config/pulse/default.pa or to the bottom of the /etc/pulse/default.pa file.

NOTE: You need to logout and login again or to restart pulseaudio with pulseaudio -k command for the changes to come into effect.

I have this snippet you pasted here at the bottom of my /etc/pulse/default.pa file. It came in via the regular update process on June 4th (I didn't add it manually.)

mladen added a comment.Jul 5 2019, 10:41

Awesome, can we close this now?

shoshin added a subscriber: shoshin.EditedMon, Oct 21, 14:21

Just came across this thread after consistently having issues in video conferences at work with Librem15 v4.

I do not see that snippet from mladen in my /etc/pulse/default.pa file, and when I try to add it to my ~/.config/pulse/default.pa, it seems to break pulse audio completely when i try to restart it.

I am using KDE, so perhaps Phonon could be interfering?


*edit*

i tried adding simply load-module module-echo-cancel to /etc/pulse/default.pa, and it does give me an option to use the echo cancelled device in sound settings now.

hansolo added a comment.Tue, Oct 22, 00:28
In T285#14573, @mladen wrote:

Another solution is to add:

### 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" source_name=echoCancel_source sink_name=echoCancel_sink
set-default-source echoCancel_source
set-default-sink echoCancel_sink
# automatically switch to newly-connected devices
load-module module-switch-on-connect ignore_virtual=no

to ~/.config/pulse/default.pa or to the bottom of the /etc/pulse/default.pa file.

NOTE: You need to logout and login again or to restart pulseaudio with pulseaudio -k command for the changes to come into effect.

I don't have this snippet (or any sign of echo-cancelling) in my default.pa, running a fully updated PureOS.

In T285#16002, @hansolo wrote:
In T285#14573, @mladen wrote:

Another solution is to add:

### 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" source_name=echoCancel_source sink_name=echoCancel_sink
set-default-source echoCancel_source
set-default-sink echoCancel_sink
# automatically switch to newly-connected devices
load-module module-switch-on-connect ignore_virtual=no

to ~/.config/pulse/default.pa or to the bottom of the /etc/pulse/default.pa file.

NOTE: You need to logout and login again or to restart pulseaudio with pulseaudio -k command for the changes to come into effect.

I don't have this snippet (or any sign of echo-cancelling) in my default.pa, running a fully updated PureOS.

If you follow those instructions you should have echo-cancelling.

hansolo added a comment.Tue, Oct 22, 07:19

I just wanted to point out, that it doesn't seem to be added via an update (but it should - in my opinion, if that's not an option it should be probably added in the wiki?)
I'm fine with the manual edit. :)

Good point - I will add it to the wiki. I will also dig into why it is not coming via an update, although I suspect it may be because it is not available in the upstream configuration.