noise suppression with librespeaker in RespeakerCorev2

Dear Service,

I am testing the librespeaker c++ library with a RespeakerCoreV2.

All the algorithms are working just fine exept for Noise Suppression.

I’ve tried to use the HybridNode::CreateNsOnly in many ways as showed in your documentation:

1- Before VepAecBeamformingNode (with various values for ns_level);

2- After Collector (with various values for ns_level);

3- After Selector (with various values for ns_level);

In any case the output of the block is highly distorced. My voice is not only metallic and unrecognizable but also speeded up.

Hence if I put a Hot Word recognition block after the noise suppression, the recognition performance drops.

Do you have any guidance on how to use this Noise Suppression block except those examples in

Thanks for your help

Hi Cinettoa,

I am Jerry from Seeed. Could you post your code here? And which versions of librespeaker you are using?

And also a test audio, please.

You can find the result of NS in the following 2 audios: one of them is the origin audio and another is the processed(ns_level=3) audio. (1.68 MB) (1.41 MB)

Hi Jerry,

According to dpkg I am using the librespeaker 2.0.0-build1.

here in attached you can find the two scripts and two recordings made with them. One with noise suppression ( and one without ( (375 KB) (152 KB)

Hi Cinettoa,

Thanks for your post, which helps us to find a bug in HybridNode. We have already fixed it and feel free to update the lib: </s>sudo dpkg -i librespeaker_2.0.1-build181017_armhf.deb <e>

We will also merge the fix into our dev branch and release ASAP. (1.03 MB)

Hi Jerry,

I’ve removed the old librespeaker using “dpkg -r librespeaker” and then install the package you provided with “dpkg -i”.

the package is correctly installed according to dpkg -l librespeaker.

I’ve a new issue.

The file /usr/local/include/ is not present anymore I couldn’t compile my cc script using g++.

So, I’ve copied the file to and I was eventually able to compile.

However after compiling the same cc script I’ve sent you yesterday, it returns an error right after launching it:

terminate called after throwing an instance of ‘std::bad_array_new_length’

what(): std::bad_array_new_length.

Any support about this?

Thanks for your help

I attach a little output for troubleshooting.

(393ms)DEBUG – record stream state: 1 []

(404ms)DEBUG – record stream state: 1 []

(414ms)DEBUG – record stream state: 1 []

(424ms)DEBUG – record stream state: 1 []

(434ms)DEBUG – record stream state: 2 []

(434ms)INFO – Connected to PulseAudio server. []

(435ms)DEBUG – PulseCollectorNode input: channels 8 rate 48000, output: channels 8 rate 16000 []

(435ms)INFO – PulseCollectorNode thread started. []

(437ms)INFO – HybridNode is accepting interleaved data. []

terminate called after throwing an instance of ‘std::bad_array_new_length’

what(): std::bad_array_new_length


Have you added parameter “–std=c++11”? Please try this:
</s>g++ -o main_vep_nr_test -L/usr/local/lib -I/usr/local/include/respeaker -lrespeaker -lsndfile -fPIC -std=c++11 -fpermissive<e>


just tried but still the same error.

Just to double check, I’ve also tried to reinstall the librespeaker v2.0.0 and re-compile the same cc file. In this way it is working.

Any other suggestion or any additional info I can provide?

Could you check the md5sum of the deb package? It should be </s>b98d4bc263215f28162ff2c9a2df182b<e> .

Is it possible to run out of memory? It seems like the most probable cause bad_array_new_length.

<LINK_TEXT text=“ … new_length”></LINK_TEXT>


I confirm the checksum

md5sum librespeaker_2.0.1-build181017_armhf.deb

b98d4bc263215f28162ff2c9a2df182b librespeaker_2.0.1-build181017_armhf.deb

It seems to me strange that this is a memory problem.

This same examples war running properly with the previous bugged version.

I will double check also this by the way.

Is it working in your respeakerCore?

Yes, it is working on my core v2.

You can try the following main_vep_nr_test built on my Respeaker Core V2.

</s>respeaker@v2:~/test_nr/src$ uname -a Linux v2 4.4.138-respeaker-r0 #2 SMP Wed Jul 25 11:29:18 CST 2018 armv7l GNU/Linux<e> (8.75 KB)

uname -a returns the same output of yours.

the file you attached is returning the same error.

I’ve tried to reflash the SD card, reinstall only librespeaker and its dependencies and then run again but I still get the same error.

Any other idea?

Hi Cinettoa,

I have also tried to reflash the SD card. I installed librespeaker-2.0.0 and pulseaudio, copy common.res and alexa.umdl and “main_vep_nr_test” I built before, then reboot. After reboot, of course main_vep_nr_test was able to run, but it just could not wake up because I were using librespeaker-2.0.0. Then I installed librespeaker-2.0.1 and made a symbolic link to “”. After this, my “main_vep_nr_test” worked well.

If these steps don’t help, I suggest you use another faster SD card(eg. class10).


I’ve tried step by step you procedura but I still get the same error.

I will buy a faster SD and try again.

It is possible that my feedback will be a little delayed this time.

I have another question related to this library. If you prefer I can open a new issue.

Do you have any guidance or example on how to return the output of the librespeaker audio processing pipeline to a linux device instead of a file?

Thanks for your help!

HI Cinettoa,

Any feedback is welcome!

And please open a new issue of your question;). Can you explain more about your question? Do you mean that you need to process audio stream on ReSpeaker and then send that stream to another Linux device?


I’m going to open a new issue so you can reply me there!

The same problem with “out of the box” example. I’m using new librespeaker_2.0.1 library version

You mean the “bad_array_new_length” problem when using librespeaker_2.0.1 ? Or the “Noise Suppression doesn’t work” problem? Can you provide more information? Thanks!