Please document how to use echo cancellation
If you are filing this issue with a regular release please try master as it might already be fixed.
Version, Distribution, Desktop Environment: pipewire 1:0.3.30-2 on Arch Linux, with Cinnamon
Description of Problem: There is absolutely no documentation how to use pipewire-module-echo-cancel, and the defaults create issues with e.g. Skype.
How Reproducible: always
Steps to Reproduce: Go to https://gitlab.freedesktop.org/pipewire/pipewire/-/wikis/home or https://docs.pipewire.org/.
Actual Results: there is absolutely nothing about pipewire-module-echo-cancel, in many places this feature is still marked as a TODO item.
Expected Results: some documentation that explains the available module options.
OK, more details.
Now that pipewire supports echo cancellation, I thought, maybe it's time to switch my desktop setup. So, I loaded pipewire-module-echo-cancel
from pipewire.conf
without any arguments, and got two sources and two sinks with the name pipewire
(this double-loading is likely an instance of #1309 (closed)). Eventually I found that loading the module in pipewire-pulse.conf
is a useful workaround. But then, if I select this new source in Skype (well, for no good reason), then next time it tries to record from the monitor of the echo-cancelled sink, and in some other cases there are non-movable streams in pavucontrol.
Eventually I figured out (can't recollect how exactly) that the "Skype wants to record from the monitor" problem stems from the echo-cancelled source and the echo-cancelled sink having the same node name. Then I spent a lot of time trying to set them in pipewire-pulse.conf - could not find any documentation or a working example. Eventually I had to resort to reading the source code, https://gitlab.freedesktop.org/pipewire/pipewire/-/blob/master/src/modules/module-protocol-pulse/modules/module-echo-cancel.c, the module_echo_cancel_load()
function, and trying to mimic the args structure that it creates. And the existing filter examples.
So I ended up with this:
{ name = libpipewire-module-echo-cancel
args = {
source.props = {
node.name = "echo-cancel.source"
node.description = "Echo Cancelled Mic"
}
sink.props = {
node.name = "echo-cancel.sink"
node.description = "Echo Cancelled Output"
}
}
}
This works (after I moved the echo-cancel streams to the correct sound card), but:
- The echo canceler eats the CPU time even if there is no application recording or playing any sound.
- The arguments mentioned in other examples,
node.passive
andnode.pause-on-idle
, do not do anything.
So, please provide a ready-made fully-working example.
Here is what I have now: pipewire-pulse.conf