libpipew...o-cancel(7)

✨ NAME ✨

libpipewire-module-echo-cancel β€” Echo Cancel πŸ’…


πŸŽ€ DESCRIPTION πŸŽ€

okay so bestie, the echo-cancel module performs echo cancellation. that's the whole vibe. πŸ”₯

It creates virtual echo-cancel-capture source and echo-cancel-playback sink nodes, plus all the associated streams that come with them. ✨

You'll mostly see this module hanging out in video or audio conference apps. Here's the tea: when the other participants talk, their audio goes out of your speakers, and then your mic picks it right back up and ships it to everyone else (along with your own gorgeous voice), and suddenly there's an echo. It's giving chaos. 😭 It's annoying because the other participants end up hearing their own echo bouncing back at them from you.

Conceptually, the echo-canceler is composed of 4 streams:

.--------.     .---------.     .--------.     .----------.     .-------.
|  mic   | --> | capture | --> |        | --> |  source  | --> |  app  |
                                 | cancel |
.--------.     .---------.     |        |     .----------.     .---------.
|  app   | --> |  sink   | --> |        | --> | playback | --> | speaker |
  • 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. πŸ¦‹

🌸 MODULE NAME 🌸

libpipewire-module-echo-cancel


πŸ’– MODULE OPTIONS πŸ’–

Options specific to the behavior of this module, bestie. read carefully, no skimming πŸ™ˆ

  • capture.props = {} β€” properties to be passed to the capture stream
  • source.props = {} β€” properties to be passed to the source stream
  • sink.props = {} β€” properties to be passed to the sink stream
  • playback.props = {} β€” properties to be passed to the playback stream
  • library.name = <str> β€” the echo cancellation library. Currently supported: aec/libspa-aec-webrtc. Leave unset to use the default method (aec/libspa-aec-webrtc). ✨
  • aec.args = <str> β€” arguments to pass to the echo cancellation method
  • monitor.mode β€” Instead of making a sink, make a stream that captures from the monitor ports of the default sink. lowkey iconic πŸ‘€

🌈 GENERAL OPTIONS 🌈

Options with well-known behavior:

  • audio.rate
  • audio.channels
  • audio.layout
  • audio.position
  • media.class
  • node.latency
  • node.name
  • node.description
  • node.group
  • node.link.group
  • node.virtual
  • node.latency
  • remote.name

(yes bestie, node.latency is on that list twice. that's exactly how it's written, and we respect it. βœ‹πŸ’€)


🧚 EXAMPLE CONFIGURATION 🧚

 # ~/.config/pipewire/pipewire.conf.d/my-echo-cancel.conf

 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"
          }
      }
  }
]

this is libpipew...o-cancel(7) from the Miscellaneous Information Manual, and it shipped with PipeWire 1.6.11. go forth and cancel those echoes, bestie β€” you ate that. πŸ’…βœ¨πŸŽ€
πŸ“¦ where this page comes from