User avatar
Tiritto
Posts: 3
Joined: Fri Dec 29, 2017 9:49 am
Location: Poland

How can I turn on echo cancellation with multiple devices in Solus?

Fri Dec 29, 2017 9:57 am

Hello everyone, new Solus user here. *waves*


How my current situation looks like...
I have 2 audio devices connected to the computer:
  • Speakers (5.1), connected via aux inputs on my motherboard.
  • Headphones with Microphone, both connected via one USB port.
And those are my audio devices listed in aplay -l
  • card 0: MID [HDA Intel MID], device 0: ALC889 Analog [ALC889 Analog]
  • card 0: MID [HDA Intel MID], device 3: ALC889 Digital [ALC889 Digital]
  • (card 1 is HDMI audio output that I don't use at all so I removed it from the list)
  • card 2: Headset [Logitech USB Headset], device 0: USB Audio [USB Audio]
My current pulseaudio version checked with pulseaudio --version command is: pulseaudio 11.1-rebootstrapped

What I have tried doing so far...
What I want to achieve is to cancel out audio coming out from my speakers so my microphone doesn't capture it. I was already trying to use pactl load-module module-echo-cancel command in my terminal but all it does it display some number that gets higher each time I execute this command (I guess it's some kind of ID of new virtual device created for echo cancellation, but might be wrong) and it adds new output and input device in Sound Settings. I was trying to play around with those settings by changing default input/output devices in there but none of those were effective so I assumed that maybe I need to do something more to get it working with multiple devices.

So the question is...
How can I make my echo cancellation work between my Card 2 (USB Headset) Microphone and Card 0 Speaker (5.1)?

User avatar
KerfufflyKitty
Posts: 40
Joined: Sat Dec 16, 2017 11:56 pm

Re: How can I turn on echo cancellation with multiple devices in Solus?

Sat Dec 30, 2017 7:02 pm

Hey there and welcome! :)

Can you try setting the source device for the echo cancellation module?

Pick the Logitech USB headset input from this list:

Code: Select all

pacmd list-sources | grep -Po '(?<=name: \<).*(?=\>)'

Pick the Intel output from this list:

Code: Select all

pacmd list-sinks | grep -Po '(?<=name: \<).*(?=\>)'

Then put the input in place of <input_goes_here> and output in place of <output_goes_here> here:

Code: Select all

pactl load-module module-echo-cancel source_master=<device_goes_here> sink_master=<output_goes_here>

Does that work?

Edit: Updated to include sink just in case it's different, also put code in code tags.

User avatar
Tiritto
Posts: 3
Joined: Fri Dec 29, 2017 9:49 am
Location: Poland

Re: How can I turn on echo cancellation with multiple devices in Solus?

Sun Dec 31, 2017 4:12 am

Thanks for your reply!

I followed your instructions and got following results...

Code: Select all

$ pacmd list-sources | grep -Po '(?<=name: \<).*(?=\>)'
alsa_output.pci-0000_01_00.1.hdmi-stereo.monitor
alsa_output.usb-Logitech_Logitech_USB_Headset-00.analog-stereo.monitor
alsa_input.usb-Logitech_Logitech_USB_Headset-00.analog-mono
alsa_output.pci-0000_00_1b.0.analog-stereo.monitor
alsa_input.pci-0000_00_1b.0.analog-stereo

$ pacmd list-sinks | grep -Po '(?<=name: \<).*(?=\>)'
alsa_output.pci-0000_01_00.1.hdmi-stereo
alsa_output.usb-Logitech_Logitech_USB_Headset-00.analog-stereo
alsa_output.pci-0000_00_1b.0.analog-stereo

$ pactl load-module module-echo-cancel source_master=alsa_input.usb-Logitech_Logitech_USB_Headset-00.analog-mono sink_master=alsa_output.pci-0000_00_1b.0.analog-stereo
30

At first I was thinking it worked since new devices became available in my Sound Settings:
  • Built-in Analog Stereo (echo cancelled with USB Headset Analog mono) in Output devices
  • USB Headset Analog mono (echo cancelled with Built-in Analog Stereo) in Input devices
I selected normal speaker as my default output and new microphone input (with echo cancelled) as my default input. Unfortunately, it didn't work. In fact, it made my microphone input sound even worse as it became even more likely to "catch" sound from my speakers than before with default settings. I also tried to select newly added "echo cancelled" as my default output device but it just made my sound quality a little bit worse without fixing the problem.

I also disabled echo cancellation module to check if my default settings were in fact better. I did this with following command:

Code: Select all

$ pactl unload-module module-echo-cancel
It removed all previously added "echo cancelled" devices from the list in Sound Settings and my microphone was indeed working better without module loaded and selected as default recording device.

I noticed that a lot of people on the internet are starting echo cancellation module with following command:

Code: Select all

$ pactl load-module module-echo-cancel aec_method=webrtc
Unfortunately it seems that using "aec_method=webrtc" makes module initialization fail.


Edit: It might be useless, but I decided to post list of my Sinks and Sources with echo cancellation module enabled:

Code: Select all

$ pactl list sinks short
0	alsa_output.pci-0000_01_00.1.hdmi-stereo	module-alsa-card.c	s16le 2 k 44100 Hz	SUSPENDED
1	alsa_output.usb-Logitech_Logitech_USB_Headset-00.analog-stereo	module-alsa-card.c	s16le 2 k 44100 Hz	SUSPENDED
2	alsa_output.pci-0000_00_1b.0.analog-stereo	module-alsa-card.c	s16le 2 k 44100 Hz	RUNNING
4	alsa_output.pci-0000_00_1b.0.analog-stereo.echo-cancel	module-echo-cancel.c	s16le 1 k 32000 Hz	SUSPENDED

$ pactl list sources short
0	alsa_output.pci-0000_01_00.1.hdmi-stereo.monitor	module-alsa-card.c	s16le 2 k 44100 Hz	SUSPENDED
1	alsa_output.usb-Logitech_Logitech_USB_Headset-00.analog-stereo.monitor	module-alsa-card.c	s16le 2 k 44100 Hz	SUSPENDED
2	alsa_input.usb-Logitech_Logitech_USB_Headset-00.analog-mono	module-alsa-card.c	s16le 1 k 44100 Hz	RUNNING
3	alsa_output.pci-0000_00_1b.0.analog-stereo.monitor	module-alsa-card.c	s16le 2 k 44100 Hz	IDLE
4	alsa_input.pci-0000_00_1b.0.analog-stereo	module-alsa-card.c	s16le 2 k 44100 Hz	SUSPENDED
7	alsa_input.usb-Logitech_Logitech_USB_Headset-00.analog-mono.echo-cancel	module-echo-cancel.c	s16le 1 k 32000 Hz	RUNNING
8	alsa_output.pci-0000_00_1b.0.analog-stereo.echo-cancel.monitor	module-echo-cancel.c	s16le 1 k 32000 Hz	SUSPENDED
And with echo cancellation module disabled:

Code: Select all

$ pactl list sinks short
0	alsa_output.pci-0000_01_00.1.hdmi-stereo	module-alsa-card.c	s16le 2 k 44100 Hz	SUSPENDED
1	alsa_output.usb-Logitech_Logitech_USB_Headset-00.analog-stereo	module-alsa-card.c	s16le 2 k 44100 Hz	SUSPENDED
2	alsa_output.pci-0000_00_1b.0.analog-stereo	module-alsa-card.c	s16le 2 k 44100 Hz	RUNNING

$ pactl list sources short
0	alsa_output.pci-0000_01_00.1.hdmi-stereo.monitor	module-alsa-card.c	s16le 2 k 44100 Hz	SUSPENDED
1	alsa_output.usb-Logitech_Logitech_USB_Headset-00.analog-stereo.monitor	module-alsa-card.c	s16le 2 k 44100 Hz	SUSPENDED
2	alsa_input.usb-Logitech_Logitech_USB_Headset-00.analog-mono	module-alsa-card.c	s16le 1 k 44100 Hz	RUNNING
3	alsa_output.pci-0000_00_1b.0.analog-stereo.monitor	module-alsa-card.c	s16le 2 k 44100 Hz	IDLE
4	alsa_input.pci-0000_00_1b.0.analog-stereo	module-alsa-card.c	s16le 2 k 44100 Hz	SUSPENDED

User avatar
KerfufflyKitty
Posts: 40
Joined: Sat Dec 16, 2017 11:56 pm

Re: How can I turn on echo cancellation with multiple devices in Solus?

Sun Dec 31, 2017 11:58 am

Dang, I don't have a secondary audio device so I can't test for myself to figure out what's going on. Sorry! :( Hope someone else can help you out here, PulseAudio can be such a pain sometimes...

Edit: I found an old USB sound card lying around. I can confirm it's not working that well, probably in large part due to the fact that the Solus PulseAudio package does not ship with the WebRTC canceller. It's a real shame, since it seems to be the only really good one, especially when using USB devices. Perhaps you could request including it?

User avatar
Tiritto
Posts: 3
Joined: Fri Dec 29, 2017 9:49 am
Location: Poland

Re: How can I turn on echo cancellation with multiple devices in Solus?

Sun Dec 31, 2017 8:22 pm

Sure, but Im bit of clueless where I should post such request? In "Ideas" board on this forum, or there is some special website for making requests?
Also, thanks a lot for your help, at last now I know it wasn't me who messed up something :D


Return to “Multimedia”