You can use pulse audio for echo cancelation.
https://wiki.archlinux.org/index.php/PulseAudio/Troubleshooting#Enable_Echo/Noise-Cancellation
sudo nano /etc/pulse/default.pa
### 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
That should now set the default source to echo cancelled
pulseaudio -k
to kill pulseaudio the daemon should restart auto 1-2 secs most
From the Archwiki
Possible âaec_argsâ for âaec_method=webrtcâ
Here is a list of possible âaec_argsâ for âaec_method=webrtcâ with their default values [4][5]:
-
analog_gain_control=1
- Analog AGC - âAutomatic Gain Controlâ done over changing the volume directly - Will most likely lead to distortions.
-
digital_gain_control=0
- Digital AGC - âAutomatic Gain Controlâ done in post processing (higher CPU load).
-
experimental_agc=0
- Allow enabling of the webrtc experimental AGC mechanism.
-
agc_start_volume=85
- Initial volume when using AGC - Possible values 0-255 - A too low initial volume may prevent the AGC algorithm from ever raising the volume high enough [6].
-
high_pass_filter=1
- ?
-
noise_suppression=1
- Noise suppression.
-
voice_detection=1
- VAD - Voice activity detection.
-
extended_filter=0
- The extended filter is more complex and less sensitive to incorrect delay reporting from the hardware than the regular filter. The extended filter mode is disabled by default, because it seemed produce worse results during double-talk [7].
-
intelligibility_enhancer=0
- Some bits for webrtc intelligibility enhancer.
-
drift_compensation=0
- Drift compensation to allow echo cancellation between different devices (such as speakers on your laptop and the microphone on your USB webcam). - only possible with âmobile=0â.
-
beamforming=0
- This can significantly reduce background noise. See [8][9]
-
mic_geometry=x1,y1,z1,x2,y2,z2
- Only with âbeamforming=1â.
-
target_direction=a,e,r
- Only with âbeamforming=1â. Note: If the module does not want to load with this argument, set azimuth (a) to the desired value, but set elevation (e) and radius ÂŽ to 0.
high_pass_filter=1
, voice_detection=1
, extended_filter=0
are questionable if the actual provide benefit.
VAD I thought is a Voice Active Detection filter but with nothing to use that signal prob pointless.
intelligibility_enhancer=0
isnât implemeneted.
drift_compensation=0
Never tried.
I do use the rest and because I have a PS3 eye with a linear 4 mic array approx 20mm apart I have beamforming set. Noticed it seems to like an escape character of \ before the next parameter so my setup.
load-module module-echo-cancel use_master_format=1 aec_method=webrtc aec_args=âanalog_gain_control=0\ digital_gain_control=1\ noise_suppression=1\ beamforming=1\ mic_geometry=-0.03,0,0,-0.01,0,0,0.01,0,0,0.03,0,0â source_name=echoCancel_source sink_name=echoCancel_sink