easyeffects icon indicating copy to clipboard operation
easyeffects copied to clipboard

Any plans to use webrtc again for echo canceller?

Open danijel1023 opened this issue 11 months ago • 7 comments

As the title says.

I'm experiencing the same issue as this one and my friends tell me my voice "sucks" when I turn on echo canceller. But I need it if I want to listen music because my headphones are really bad when it comes to echo.

danijel1023 avatar Jan 27 '25 21:01 danijel1023

If possible yes. It is just that other things had higher priority. And usually the echo canceller from the speex library isn't so bad. I wonder if maybe the probes it has to put in the soundcard monitors made PipeWire to switch to a latency value that was too low for your device to handle. What is the output of pw-top when you use the echo canceller?

wwmm avatar Jan 27 '25 22:01 wwmm

As a reference for the future I will put here what seems to be a good example for the webrtc library https://gitlab.freedesktop.org/pulseaudio/webrtc-audio-processing/-/blob/master/examples/run-offline.cpp?ref_type=heads

wwmm avatar Jan 27 '25 22:01 wwmm

Image

There is no issue as in crackling or similar, it's just that lower frequencies are cut off so, compared to my normal voice (or when not using the echo canceller), this sounds bad.

Note: I did have issues with crackling sound (not mic) when using discord and/or when opening some games but that's now solved by changing pulse.properties in pipewire-pulse.conf to:

pulse.min.req          = 256/48000
pulse.min.frag         = 256/48000
pulse.min.quantum      = 512/48000

Completely and utterly unrelated to this, but I think it's good to share info like this as finding the fix took me ages.

danijel1023 avatar Jan 27 '25 23:01 danijel1023

There is no issue as in crackling or similar, it's just that lower frequencies are cut off so, compared to my normal voice (or when not using the echo canceller), this sounds bad.

Oh... I see. Unfortunately doing something about this is out of my reach. I wonder if putting the bass enhancer after the speex plugin can somehow "bring your lower frequencies back" 😄

wwmm avatar Jan 28 '25 00:01 wwmm

From the issue I mention in my first comment:

Somewhere on the update road from 6.2.8 to 7.0.5 the "Echo canceller" has changed a lot.

Definitely. You probably were using the version that was based on GStreamer plugins. Unfortunately when I moved to full PipeWire the echo canceller we used before could not be used anymore. The one we use now is based on the speex library.

I thought the problem with lower frequencies being cut off is because of speex and solution would be to use WebRTC (do correct me if I'm wrong). 🤔

I will try the bass enhancer later and see if thats better.

danijel1023 avatar Jan 28 '25 00:01 danijel1023

I thought the problem with lower frequencies being cut off is because of speex and solution would be to use WebRTC (do correct me if I'm wrong).

This is the ideal solution. But while this isn't available it is worth to give the bass enhancer a shot. It is different than using a equalizer to boost low frequencies. The bass enhancer uses a psychoacoustic model to improve bass that takes as input higher frequency harmonics of the lower frequencies. And these might still be there after the speex libraries removes the echo.

wwmm avatar Jan 28 '25 03:01 wwmm

Still not as good as without EC, but its lil' bit better now. It removes some very annoying (imo) high frequencies and makes my voice seem more normal. Thanks for the suggestion. 🙏

If anyone comes across this and is interested, my current setup is (in order):

  • Echo Canceller - Filter length: 60ms, RES: -70dB, NEES: -1dB
  • Noise Reduction - Release: 60ms
  • Bass Enhancer - here I had to crank up values - Blend Harmonics: -10, Amount: 10dB, Scope: 200Hz, and decrease Output to -10dB

danijel1023 avatar Jan 28 '25 09:01 danijel1023

Our master branch now uses webrtc. We can close this issue.

wwmm avatar Oct 17 '25 01:10 wwmm