Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Fix system audio leaking into your mic.
#1
A long standing bug on pipewire has plagued me since I've been using Linux, but I recently figured out how to fix it!

Pipewire - Echo-cancel Module

Here's how the module works:
[Image: 2023-07-23-04-30.png]

    A capture stream that captures audio from a microphone.
    A Sink that takes the signal containing the data that should be canceled out from the capture stream. This is where the application (video conference application) send the audio to and it contains the signal from the other participants that are speaking and that needs to be cancelled out.
    A playback stream that just passes the signal from the Sink to the speaker. This is so that you can hear the other participants. It is also the signal that gets picked up by the microphone and that eventually needs to be removed again.
    A Source that exposes the echo-canceled data captured from the capture stream. The data from the sink stream and capture stream are correlated and the signal from the sink stream is removed from the capture stream data. This data then goes into the application (the conference application) and does not contain the echo from the other participants anymore.

To add this Echo-cancel module you must create a text file in /etc/pipewire/pipewire.conf.d/ with this inside:

 context.modules = [
  {  name = libpipewire-module-echo-cancel
      args = {
          # library.name  = aec/libspa-aec-webrtc
          # node.latency = 1024/48000
          # monitor.mode = false
          capture.props = {
            node.name = "Echo Cancellation Capture"
          }
          source.props = {
            node.name = "Echo Cancellation Source"
          }
          sink.props = {
            node.name = "Echo Cancellation Sink"
          }
          playback.props = {
            node.name = "Echo Cancellation Playback"
          }
      }
  }
]

Afterwards you must either Reboot or Restart Pipewire with:
systemctl --user restart pipewire && systemctl --user restart pipewire-pulse

After that you must choose Echo-cancel as your microphone source:

[Image: 2023-07-23-04-46.png]

Also in apps you use the microphone in, unless you have it use what you have selected by default:
[Image: 2023-07-23-04-51.png]

That is all, it fixes, it has fixed my issues of audio leaking.
Thanks for reading my post, have a nice day/night.
- Teddy
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Chrooting to rescue your Linux System DarkXero 0 1,119 08-25-2022, 04:21 PM
Last Post: DarkXero

Forum Jump:


Users browsing this thread: 1 Guest(s)