Echo cancellation with pipewire (for dawn) - need testers

Earlier we had raised $1,893.68 for implementing echo cancellation support with new pipewire audio backend (pureos currently used pulseaudio) via open collective - Echo cancellation with pipewire - Open Collective

This is part of a community initiative to prioritize most user affecting issues with mobile gnu linux and raise funds to implement it Echo cancellation for calls with pipewire on Librem 5

I’m happy to announce that we have found our first developer for this initiative! But to be able to test the changes, we need volunteers who have a Librem 5 device and willing test the changes.

Quoting a message from Franklin, who started working on this issue,

Hi Praveen,

Quick technical update after mapping the current PipeWire pulse-server path against PulseAudio’s filter heuristics/apply behavior: the earlier concern that this necessarily needs a WirePlumber-side architecture change does not hold up. PipeWire already has the primitives to observe the selected peers, load the existing echo-cancel wrapper and request moves after stream creation.

The remaining uncertainty is much narrower and device-specific: whether those automatic target moves are transient or end up contaminating saved route preference, and how they converge if a manual move happens while insertion is pending.

Since you’re recruiting Librem 5 testers, the most useful first evidence would be four read-only snapshots:

  1. Before reproduction: pipewire --version, wireplumber --version, pactl info, wpctl status -n, pw-dump, pactl list sink-inputs, pactl list source-outputs, and pw-metadata -n default.
  2. The same while reproducing the original communication-app echo-cancel case.
  3. If practical, the same immediately after manually moving the active stream once to a Communication/phone-intended device.
  4. After closing and reopening the same stream without echo-cancel filter properties, if the app permits that.

No root access or system changes are needed. The exact app/action used to reproduce the issue should be noted with the captures.

That evidence should tell me whether the narrow implementation can stay entirely inside module-protocol-pulse or whether a different routing contract is needed. I’m continuing the code-path work in parallel rather than waiting idle.

Thanks,
Franklin

Looking forward to volunteers to test this.

Should this be tested on Crimson or Dawn? As far as I know, Dawn is not available on the Librem 5 yet, so I’m wondering which system is currently expected for testing.

Crimson stayed on pulseaudio, so we will have to roll back those changes to test this (need to figure out what should be changed). The easiest would be Mobian Trixie which is using pipewire by default. PostmarketOS is also likely using pipewire, but I have not confirmed it.

It should be something similar in pureos crimson,

Reverse of this,

ie, something like this (untested) - but we need to find out which package does similar changes in pureos first. Possibly librem5-base or librem5-tweaks.

disable wireplumber@.service video-only

enable wireplumber.service

enable pipewire-pulse.service

enable pipewire-pulse.socket

I won’t speak about other distros, but at least in PureOS enabling audio handling in PipeWire will mess things up with your system in a way that may persist after switching back to PulseAudio. Don’t do it unless you know what you’re doing and are ready to pick up the broken pieces, and don’t report any issues with audio or calls that you may have afterwards.

Then it would make sense to post this on forums like Pine64, r/Mobian, Debian, postmarketOS, etc.

For tests like this: take a full partition (or even disc) image as back up. Then, after intentionally breaking the setup, you can just rewrite and revert to the old one.

And this is the right forum: you want to test on L5 hardware and L5 can use other OS’s than just PureOS - testing several combinations may even reveal something unexpected. And then you can return to previous with that image…

Okay, I didn’t realize that this forum also covers operating systems other than PureOS. I still think it would be worthwhile to post this on some of the other forums mentioned above as well.

Those aren’t mutually exclusive. My point was, that L5 should be used for testing and other OS’s can be used on it for that and it’s good to test different combinations. You can and should propose this on other forums as well, as those too should be tested, what combinations/variations they may have / come up with.

This. Full disk image before starting.

Today I managed to switch to pipewire with these steps,

  1. build librem5-base without pulseaudio dependency
  2. install librem5-base and librem5-base-defaults from the built debs
  3. install pipewire-audio pipewire-pulse and wireplumber
  4. disable pulseaudio services

systemctl --user disable --now pulseaudio pulseaudio.socket
systemctl --user mask pulseaudio pulseaudio.socket

  1. Enable pipewire-pulse

systemctl --user enable --now pipewire-pulse pipewire-pulse.socket
systemctl --user status pipewire-pulse pipewire-pulse.socket

  1. Switch to wireplumber from wireplumber@video-only

sudo systemctl disable --now wireplumber@video-only
sudo systemctl enable --now wireplumber

If you are interested to try this, you can get the debs I built from Index of /~praveen/pureos

See Trying Dawn for upgrading to dawn from a clean crimson system.

Next step would be to confirm the echo is still reproducible in calls. If I remember correctly, an external microphone is work around for the missing echo cancelation.

So far the audio itself worked with pipewire and external microphone - tested with youtube in firefox and gnome calls incoming ring works. Not yet tested a real call, that is next.