noise suppression with librespeaker in RespeakerCorev2

Hello,



I have some issues with with the noise reduction example using aloop.

When I record after an “aplay” command, I have a big initial pop in my recording.

For example:

aplay phrase.wav

sox -d -t wavpcm -c 1 -b 16 -r 16000 -e signed-integer --endian little record.wav trim 0 1

Then in my file record.wav, there is a big pop at the beginning that you can hear with aplay.



If I record twice in a row, then the second file is good, meaning:

aplay phrase.wav

sox -d -t wavpcm -c 1 -b 16 -r 16000 -e signed-integer --endian little record.wav trim 0 1

sox -d -t wavpcm -c 1 -b 16 -r 16000 -e signed-integer --endian little record2.wav trim 0 1

The file record.was has the pop but the file record2.wav is good (no initial pop in it).



I hope that you can reproduce and let me know how to fix this because it is causing problem when submitted next to the ASR.



Moreover, I noticed big variation in the volume of my recording. It varies from one recording to another but sometimes within the recording itself (e.g. starting loud and finishing low). I played with the agc parameter and even disable it but without any luck.



Thanks for your help