ReSpeaker USB Mic Array AEC tuning?

I recently received my “ReSpeaker USB Mic Array” and I’ve been trying out the AEC. It seems to work well when the speakers are plugged into the device. In my use case, however, I can’t run the main playback signal through the ReSpeaker due to loss of quality (no surround sound, etc.). I had hoped to duplicate the playback signal in some way and feed it into the ReSpeaker as well to be used for AEC, but all my tests seem to indicate that AEC doesn’t work at all when set up this way. Is there a way to tune the AEC on the ReSpeaker for this case? Is there documentation on what the various AEC* tuning options mean in more depth than in the $ python usb_4_mic_array/ -p output? Any other suggestions?

Here are some more details. My HTPC is a (ugh! …but gaming, ) Windows 10 box. It’s also running a Ubuntu Linux VirtualBox VM guest running Home Assistant and is connected to the Windows host audio playback and capture. I can connect the USB ReSpeaker to either the Windows host or pass it through to the VM guest. On Windows, I’ve enabled the Realtek “Stereo Mix” and I can send that through to the playback of the ReSpeaker, but when I do AEC doesn’t seem to work at all. I confirmed that the ReSpeaker is receiving the “Stereo Mix” signal as it’s playback signal by connecting a portable speaker to the 3.5mm jack on the ReSpeaker. I can hear only some very minor latency in the “Stereo Mix” when both sets of speakers are on at the same time. The AEC works well when turn off the main speakers and play only the portable speaker. When I turn off the portable speaker and turn on the main speakers, however, the voice detection lights are nearly constant and the signal from the ReSpeaker capture is very close to the full playback signal. Maybe the “Stereo Mix” capture channel is enough latency to throw off the AEC? Is there a way to tune how sensitive the AEC is to latency? Might this be something else? Any way to tune for that?

I also tried sending the Windows “Stereo Mix” through to the Linux VM guest as it’s capture signal and then feeding that into the ReSpeaker’s playback signal, but I haven’t been able to wrap my head around how to do that with ALSA yet. Any tips on this are very welcome too.

<LINK_TEXT text=“ … py#L20_L60”></LINK_TEXT> There’s actually a brief explanation behind this. For the detailed introduction, I need to consult the engineer, but I can’t guarantee that this information will be available.

From my OP:

Isn’t what you linked to just the source code that generates “the $ python usb_4_mic_array/ -p output?”?

The solution of ReSpeaker USB Mic Array - XMOS3000 is for mono-playback use only. The acoustic characteristic between stereo and mono is different enough for XMOS3000 to exceed its tolerance, especially when you use powerful speakers. More deeply, the differences lie in:

  1. mix in digital (even in analog signal) != mix in air (stereo sounds interfere each other in air, and then they are captured by the mic)
  2. the clock of the playback circuit of your windows 10 box != the clock of XMOS3000, the synchronism of the clocks of playback and capture is key to the AEC algorithms, a small drift in frequency or delta in phase will kill the performance of AEC

    So, fairly speaking we don’t recommend you dig into this case any deeper, without any means to discourage you. If you can wait, we will produce the XMOS3500 series Mic Array which can do stereo AEC by nature in the first half of this year.

I am curious when is the XMOS3500 due for release.

How can I achieve mono playback? The sound source played over the respeaker are stereo? I tried to use pulseaudio and alsa to create a mono channel, I the results have not been improved. Actually the output from the audio jack seems to be already mono.