Speaker Cancellation

This is what I did, as I mentioned in my first post when I said that I tried linking my asoundrc.conf into the container. The container uses the host’s config successfully.

ALSA does take a bit to get your head wrapped around it all, but I feel like I’ve got a good grasp on it at this point - at least on the host directly. It’s the Docker game I’m still trying to figure out :slight_smile:

Thanks for the ideas! I’ll keep poking around.

Yeah as apols as same, thought that would just work.
Maybe its just a matter of https://rhasspy.readthedocs.io/en/latest/installation/#virtual-environment as really don’t know.
aplay --verbose see if it gives a clue, someone on here will know as sure this must be a common thing.

I’m sure if I ran Rhasspy through venv, I wouldn’t be having the issue… It’s something with Docker for sure.

No difference in the output with aplay -v in the container or out of it. I just get the error message inside the container whenever something is already playing out of it.

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