Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Any plans to use webrtc again for echo canceller? #3653

Open
danijel1023 opened this issue Jan 27, 2025 · 7 comments
Open

Any plans to use webrtc again for echo canceller? #3653

danijel1023 opened this issue Jan 27, 2025 · 7 comments

Comments

@danijel1023
Copy link

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.

@wwmm
Copy link
Owner

wwmm commented Jan 27, 2025

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
Copy link
Owner

wwmm commented Jan 27, 2025

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

@danijel1023
Copy link
Author

danijel1023 commented Jan 27, 2025

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.

@wwmm
Copy link
Owner

wwmm commented Jan 28, 2025

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" 😄

@danijel1023
Copy link
Author

danijel1023 commented Jan 28, 2025

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.

@wwmm
Copy link
Owner

wwmm commented Jan 28, 2025

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.

@danijel1023
Copy link
Author

danijel1023 commented Jan 28, 2025

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants