Bug 62040

Summary: Echo canclled sink is mono
Product: PulseAudio Reporter: cloakable
Component: modulesAssignee: pulseaudio-bugs
Status: RESOLVED FIXED QA Contact: pulseaudio-bugs
Severity: normal    
Priority: medium CC: lennart
Version: unspecified   
Hardware: x86-64 (AMD64)   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:

Description cloakable 2013-03-08 22:04:22 UTC
Running: "pacmd load-module module-echo-cancel" creates the source/sink, but in mono only, despite running on a stereo source/sink. Testing reveals that anything played through that sink (and therefore echo cancelled) is playing in mono...

Running "pacmd load-module module-echo-cancel channels=2" silently fails.

This is a major problem for me; I plan on eventually running 5.1 speakers + mic, but if the echo-cancel module is just going to squash that into mono the entire setup will be useless.
Comment 1 Tanu Kaskinen 2013-03-11 10:38:06 UTC
I tried this, and indeed at least the speex canceller doesn't support anything but mono:

E: [pulseaudio] speex.c: AGC, denoising and echo suppression only work with channels=1

I presume that it's a limitation of the speex algorithm. I'm not a DSP engineer, so at least I will probably not do anything about this.

Out of curiosity, what use case requires proper (not downmixed to mono and then duplicated to 6 channels) 5.1 output and echo cancellation at the same time?
Comment 2 cloakable 2013-03-11 13:21:37 UTC
Gaming! :)

Being able to get accurate position information from sound is pretty huge, and voice comms in a co-operative game is pretty important; so echo cancellation is important there. Can't have the game feeding back through the microphone, after all.

(Possibly a growing use case too, now we have Steam on Linux.)
Comment 3 Tanu Kaskinen 2013-03-12 09:13:07 UTC
OK, multichannel certainly makes sense for gaming. It looks like the webrtc canceller should already support multichannel operation. The webrtc canceller is the default if PulseAudio has been compiled with support for it. I suspect that your PulseAudio version doesn't have support for webrtc. Does this command fail: "pactl load-module module-echo-cancel aec_method=webrtc"?

The code of the speex canceller looks like it might support multichannel operation too, if you disable all extra processing:

    pactl load-module module-echo-cancel channels=6 aec_method=speex aec_args="\"agc=false denoise=false echo_suppress=false\""

("echo_suppress" is not the same thing as echo cancellation)

I tried this myself, and the module at least loads. I don't know about the quality. From what I have heard, the webrtc canceller is significantly higher quality than the speex canceller, even with all the extra processing enabled.
Comment 4 cloakable 2013-03-12 12:58:49 UTC
Yeah, I'm using Kubuntu 12.10, and for some reason Pulseaudio isn't compiled with the webrtc canceller. Lets hope it gets put in for 13.04!

And thank you, it seems to be working! A little less efficient from the looks of it without all the options, but better than nothing. (I used channels=2 for the moment, but I'm getting stereo sound, so 5.1 should hopefully work when I get the speaker set!)

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.