How to disable FIR filter in MATRIX Voice by default?

Last week we had the below question for MATRIX Labs:
We have a MATRIX Voice Development Board for our audio DSP algorithm job.
After installing matrixio-creator-init and matrixio-kernel-modules, we can use PortAudio to capture 8 channels data from MATRIX Voice Development Board.
But we don’t need the audio processing and advanced algorithms (Beamforming, AEC, de-reverberation and noise cancellation) in 8 channels data.
How can we disable these audio processing and advanced algorithms in MATRIX Voice Development Board?

Then we got the answer from MATRIX Labs as follows:
By default the only audio processing that is being done to the microphones is a FIR filter in order to clean up the audio.
You can turn off this filter by changing the function "bool MicrophoneCore::SetCustomFIRCoeff” here to set the FIR coeff as [1 0 0 0 … ].

But, after following the above MATRIX Labs’ suggestion, we got two problems:

(1) No any code in matrix-creator-hal/ will call this function MicrophoneCore::SetCustomFIRCoeff().
If we modify code in MicrophoneCore::SetCustomFIRCoeff(), how can this modification work?

(2) We must use PortAudio and ALSA driver to capture MATRIX Voice channels data,
but ALSA driver does not use any code in matrix-creator-hal/.
ALSA driver looks like to use code only in matrixio-kernel-modules!

How can we disable FIR filter in MATRIX Voice by modify code in MicrophoneCore::SetCustomFIRCoeff()?

Hope MATRIX Labs or someone can give us solution,
Thanks very much for your great help.

Hi @kychao,

Sorry about the delayed response.

I was testing the first solution and is not working as intended. We will be working on a better way of turn off the filter on the PFGA.

In the meantime, my advice is to use the previous release of the kernel modules (v0.1.3). I just tried and i could get audio unfiltered.

I did this from a fresh Raspbian lite installation:

curl https://apt.matrix.one/doc/apt-key.gpg | sudo apt-key add -
echo "deb https://apt.matrix.one/raspbian $(lsb_release -sc) main" | sudo tee /etc/apt/sources.list.d/matrixlabs.list
sudo apt-get update
sudo apt-get upgrade 
sudo apt install matrixio-creator-init
sudo apt-get -y install raspberrypi-kernel-headers raspberrypi-kernel git 
git clone https://github.com/matrix-io/matrixio-kernel-modules
sudo reboot 
cd matrixio-kernel-modules/
git checkout v0.1.3
cd src/
make
make install
sudo nano /boot/config.txt  #added dtoverlay=matrixio 
sudo reboot 

Let us know if it works for you

Hi. yoelrc88,

After running the command: git checkout v0.1.3,
the matrixio-kernel-modules indeed has not any FIR filter code,
We use portaudio to get 8 channels data from MATRIX Voice,
and it is OK to check these recorded voices!

Thanks very much for your great help!

Hi. yoelrc88,

After running the command: git checkout v0.1.3,

the matrixio-kernel-modules indeed has not any FIR filter code,

We use portaudio to get 8 channels data from MATRIX Voice,

and it is OK to check these recorded voices!

Thanks very much for your great help!

Best Regards

Great, thats good news. I will post here when a better way of doing this is released. It is in the kernel modules roadmap.