Speaker Cancellation

Yeah not really sure how to get more debug from alsa as its tricky if the logs and verbose output don’t give a clue.
Maybe alsa-info would show something but doubt it.
I would post elsewhere as the title of this thread is prob stopping replies.
Or Venv as presume on a zero being in a container is of little benefit.
Maybe just needs a unique ipc_key to host such as ipc_key 555555 and maybe create a asound.conf in $HOME as a dumb conatiner file or something so they can have different keys.
But dunno that is a straw clutch.

@fastjack

1st card to turn up is the 4 mic linear 4 Pi.

So not using loopback and running ec rather than ec_hw

The ec load seems very low on a Pi4 no OC

Now strangely because I have the 4 mic linear I haven’t been able to run ec_hw yet as not really sure which channel is the loopback.
But will try but the 4 mic linear seems great and actually not bad for £25 but the linear mic strip suits prob a retangle ‘radio’ shape box due to length.

I am pretty sure I can add some extra filters forgot the music term but that will filter out the low volume and that should reduce even further.

Speex & EC doesn’t totally remove echo and really needs the same sound card as clock drift kills its function.
But on a soundcard and presuming the 2mic will be the same its likely effective EC can be used to give a mic signal fit for purpose.

Now what I have to do is figure out how to install the drivers with rt-prempt kernel and see if that gives any improvement.
I ran with default EC settings so should also give that a play and think my pi4 is about 50ms latency so used that.
But I would say that this will run on a Pi3a+ dunno about the zero though.

I am using https://github.com/voice-engine/ec not sure what the speex alsa-plugins actually do?
Still got it set up via alsa with the ec asound.conf
Whats the term for a musical filter that removes the low volume portion of a wav?
But prob a few things I can still do to improve further.

1 Like

Sorry I did not read whole topic, but I can confirm, that Respeaker Mic Array v2 (USB) work very well with AEC (so MIC listen while audio is being played via same card). I reflashed firmware to 48kHz 1 mic channel. The only problem was to get Respeaker card working both output for Respeaker in Docker and Snapcast on host. I did solve it with help of others here on the forum.

Yeah the $70 Respeaker Mic Array v2 damn well ought to have hardware DSP :slight_smile:

You can do it with software with $10 2 mic Pi soundcards, been on a bit of a crusade to get it working.
I found that you have to have playback/capture on the same cards as since I got a 4mic linear for Pi software AEC works quite well.
The idea is satellite speaker/mics with with Pi4/Respeaker V2 USB starts to get a tad expensive.
But you can Pi3A+/2mic4Pi AEC away quite nicely for $35 and as a disclaimer haven’t tried the Pi3A+ but the load is so little on the Pi4 that I am presuming its yes.
I should get my skates on and check that.

There is a Master/Satellite form of Rhasspy that has a number of advantages and is pretty cool, but costs can quickly add up.
There is also the Software AEC of pulseaudio but again pulseaudio can be a docker pain and its adding more bloat to low end satellites that are little more than streaming speakers with mic arrays.

I think its of more interest for those who want to run home cloud AI without big data services.
But localising and distributing voice capture and creating what is essentially a wide array microphone has natural physics on its side rather than technology.

PS if anyone is trying the software.


Is slightly wrong edit ec.c so the frame size is a power of 2 and your FFT filter will be much better (128, 256 or 512) prob.
The line int frame_size = config.rate * 10 / 1000; // 10 ms even for someone like me is easy to change, then make.
The above line is likely to make primes not good for FFT.
[Pi3] with a quick test seems very much like the Pi4

Did you notice audio playback quality issue (like strange « shh ») with the 48Khz firmware?

Isn’t 16khz if you enable AEC, but that is my foggy memory but seem to remember thinking Oh so just wideband audio.

Just to update older thread, there is 48kHz firmware for Respeaker Mic Array v2 available. So AEC is now also available for 48kHz playback/recording.

Thanks. I know of it and tested it a few months back to no avail. AEC is pretty inexistant and audio playback quality suffers from strange saturation issues.

Seed has stated on their forum that the playback quality / AEC issue can not be solved because of the limited capabilities of the XMOS chip.

@litinoveweedle Hi :wave:. Can you confirm that the Respeaker 48KHz 1 channel firmware have a working AEC? Did you notice audio quality issues? Thanks :blush:

@fastjack On the topic of EC and hardware.
Got another Syba USB and again seems to be fake with a c-media mono mic chipset than the stereo via envy.

Also 2x I2S mics and a cheap china hdmi2hdmi+audio seems to work well.

Hello, sorry for late reply. The sound with 48kHz is little bit better than 16kHz, but is is far from perfect, there are some strange artifacts. AEC seems to be working but is far from perfect, especially when playing loud music.

I did checked all available MICs arrays, but all seems to be based on same chip (xmos XVF-3000), with same 16kHz limitation. I can only hope for some new MIC array with xmos XVF-3500 to arrive soon. :-o

@litinoveweedle

Could you try and help this guy out a Mic wise the Anker Anker PowerConf seems to be an amazing piece of kit.

For some reason aplay -Dplughw:1 -r16000 -f S16_LE file_example_WAV_10MG.wav works perfectly but playback from Rhasspby is cutting at the start and I am unsure why.

But might be of interest as they are a pretty new product and if aplay -Dplughw:1 -r16000 -f S16_LE file_example_WAV_10MG.wav works fine from the cli then I can not see it being the hardware.

Only thing I haven’t done is suggest creating an asound.conf defining sample rates and channels maybe summing them.

Sort of hard work remote and blind, I might take the plunge and buy one.

I’m using a ReSpeaker 4 Mic Array with a raspberry pi 3b+ and cannot run ec with “./ec -i plughw:CARD=seeed4micvoicec,DEV=0 -o plughw:CARD=seeed4micvoicec,DEV=0 -d 200”

It just says
cannot open audio device plughw:CARD=seeed4micvoicec,DEV=0 (No such file or directory)

Anyone have a respaeker 4 mic and got this working?

My arecord -L:
null
Discard all samples (playback) or generate zero samples (capture)
jack
JACK Audio Connection Kit
pulse
PulseAudio Sound Server
eci
eco
default
Playback/recording through the PulseAudio sound server
usbstream:CARD=b1
bcm2835 HDMI 1
USB Stream Output
usbstream:CARD=Headphones
bcm2835 Headphones
USB Stream Output
sysdefault:CARD=seeed4micvoicec
seeed-4mic-voicecard, bcm2835-i2s-ac10x-codec0 ac10x-codec.1-003b-0
Default Audio Device
dmix:CARD=seeed4micvoicec,DEV=0
seeed-4mic-voicecard, bcm2835-i2s-ac10x-codec0 ac10x-codec.1-003b-0
Direct sample mixing device
dsnoop:CARD=seeed4micvoicec,DEV=0
seeed-4mic-voicecard, bcm2835-i2s-ac10x-codec0 ac10x-codec.1-003b-0
Direct sample snooping device
hw:CARD=seeed4micvoicec,DEV=0
seeed-4mic-voicecard, bcm2835-i2s-ac10x-codec0 ac10x-codec.1-003b-0
Direct hardware device without any conversions
plughw:CARD=seeed4micvoicec,DEV=0
seeed-4mic-voicecard, bcm2835-i2s-ac10x-codec0 ac10x-codec.1-003b-0
Hardware device with all software conversions
usbstream:CARD=seeed4micvoicec
seeed-4mic-voicecard
USB Stream Output

Dunno try aplay -l and see if you can get it to work with the index number instead plughw:2 or whatever it will be

This is my aplay -l:
Subdevice #0: subdevice #0
Subdevice #1: subdevice #1
Subdevice #2: subdevice #2
Subdevice #3: subdevice #3
Subdevice #4: subdevice #4
Subdevice #5: subdevice #5
Subdevice #6: subdevice #6
Subdevice #7: subdevice #7
card 1: b1 [bcm2835 HDMI 1], device 0: bcm2835 HDMI 1 [bcm2835 HDMI 1]
Subdevices: 4/4
Subdevice #0: subdevice #0
Subdevice #1: subdevice #1
Subdevice #2: subdevice #2
Subdevice #3: subdevice #3
card 2: Headphones [bcm2835 Headphones], device 0: bcm2835 Headphones [bcm2835 H eadphones]
Subdevices: 4/4
Subdevice #0: subdevice #0
Subdevice #1: subdevice #1
Subdevice #2: subdevice #2
Subdevice #3: subdevice #3

I might be wrong, but doesn’t this only list playback devices, not mics? The respaeker isn’t there anyway

You are missing card 0 from your cut and paste but presume thats the loopback.
But that looks like the respeaker is not installed or installed but not found.

PS is this docker or just host install?

If Im not mistaken, you are using the normal 4mic Respeaker Board that doenst have an audio out. So you will not find it in your aplay.
In this case, your sound output is probably routed through the 3.5mm from the PI itself.

1 Like

Yeah, the respeaker is not listed with aplay -l. Does that mean I cannot use the echo cancelling program on my mic?
It’s Raspbian installed with the Rhasspy .deb, so I guess host?

Yeah it uses the clock sync on in and out to match the AEC, AEC works only with cards or USB that both play and record.

I sort of hate that 4 mic I have one in a box and doh it was late at night as always going on about how they are whole load of nothing with a pixel ring.
Nice Pixel ring but otherwise pretty useless.

Have a word with @JGKK as think he now also about a USB dongle or the https://www.raspberrypi.org/products/iqaudio-codec-zero/ looks pretty amazing if it ever gets stocked.

Without high speed DSP beamformingn, algs multiple omnidirectional mics are useless as even when summed they can create 1st order filters and even can be even detrimental than just pointless.
The are just more of the same so you have a mc and a pixel ring and the 4 mic is just one of those products they make cause they can because they sell even if they know they are pretty pointless.

Alright, thank you so much for explaining.
I think I’ll buy a ReSpeaker Mic Array v2.0 instead as it actually has EC and noise suppression built-in. Hopefully it will filter out loud music and background noise well.