module-echo-cancel: pw-native module seems to perform significantly poorer compared to pulseaudio-module-echo-cancel with default settings?
-
PipeWire version (
pipewire --version
):
pipewire
Compiled with libpipewire 0.3.57
Linked with libpipewire 0.3.57 -
Distribution and distribution version (
PRETTY_NAME
from/etc/os-release
):
Arch Linux -
Desktop Environment:
Gnome -
Kernel version (
uname -r
):
Linux 5.19.7-arch1-1 #1 SMP PREEMPT_DYNAMIC Mon, 05 Sep 2022 18:09:09 +0000 x86_64 GNU/Linux
Description of Problem:
I recently switched over from PulseAudio to Pipewire and am aiming to use this box as a Software-DSP, as I already did with PulseAudio previously in a very similar setup (older PC, same peripheral hardware).
Among other things, it should act as a speakerphone for my mobile telephone connected via bluetooth.
Goal/Rationale:
- Turn this setup into a Speakerphone which is convenient to use for me and sounds significantly better than just using your phone on speaker mode, and that is good enough for doing business calls
(Read: the person paying you for participating in these calls shall have no grounds to request you stop using it) - for reasons beyond the scope of this report I need my general audio graph to run at 96KHz. module-echo-cancel may use different settings if required, when trying this I found giving it a different rate/quantum in the stream properties had no effect on the problem described
Problem:
While the quality of error cancellation and noise suppression has always been exceptionally good with PulseAudio, when using PipeWire in a similar configuration with module-echo-cancel the performance of acoustic echo cancellation is too poor to be usable for business calls.
Assumption:
since I don't see very many people complaining about this I suspect this might be related to my individual setup rather than the module itself, but have no way to verify or investigate further.
What I am hoping for:
- from the documentation available here I gather that both PulseAudio and PipeWire are basically wrapping their modules around the same webRTC library, so I would expect performance/behavior to be similar in general?
- might there be additional parameters/setting/not-so-obvious tweaks I can try that will positively affect AEC performance with the PipeWire module?
Relevant components available:
- very new computer based on Intel Core i5 12600T / 64GB DDR5 RAM / SSD storage (dedicated to doing audio)
- 0bda:8771 Realtek Semiconductor Corp. Bluetooth Radio via USB
- 1235:8201 Focusrite-Novation Scarlett 18i20 USB Studio audio device
- two identical professional XLR microphones sitting on the desk, directly connected to the Scarlett
- two identical professional Studio speakers sitting on same desk, directly connected to the same Scarlett
- Samsung Galaxy S21 5G mobile phone (stock firmware, no funny stuff, your basic generic bluetooth phone)
- Archlinux in stock configuration (if there is such a thing)
How Reproducible:
always (test repeat count: 2)
Steps to Reproduce:
- install pipewire
- configure server to use 96KHz / 256 for the graph
- use module-loopback to create a virtual stereo source (the two microphones) and a virtual stereo sink (the two speakers) from the audio board
- include native pipewire module-echo-cancel as per documentation
- change audio.channels to 2 in both the source and the sink configuration for module-echo-cancel because we want this to be stereo for applications supporting it, and we really have two physical microphones available (irrelevant for Bluetooth, relevant for other applications)
- in pavucontrol / helvum, make sure the audio is routed correctly through the echo-cancel node for both inbound and outbound.
- connect telephone to pipewire via Bluetooth and initiate a phone call with trusted far end
- compare performance with that of a similar setup using native Pulseaudio and Pulseaudio's module-echo-cancel on an older PC but the same audio/bluetooth hardware.
Actual Results:
- performance of echo cancellation is much inferior to the original PulseAudio setup (which was near-perfect). While still being better than having no echo cancellation at all, using the pipewire setup the echo is clearly audible for the far end, and hence using this setup is very irritating for the far end. Performance of echo-cancellation is therefore not good enough for business calls. (Or any other production calls to non-IT-nerds for that matter).
Expected Results:
- performance of echo cancellation should be at least on par with older native PulseAudio module, preferably better (echo barely or not at all audible on the far end, experience for the far-end participant should be similar to when we are using good headphones).