We have a few digital I2S microphones connected to the I2S ports on the TX1. We can capture the audio correctly from the microphones, however there is a DC offset. This is apparently common on digital microphones, but it causes popping/clicking noises when muting or adjusting the volume. We are trying to determine the best way to remove the DC offset. Ideally it would be at the ALSA level or lower, so the user does not even notice it.
We have tried various things, but none of them are ideal:
- Use PulseAudio’s module-ladspa-sink with a dc removal plugin. This works as a proof of concept, but it’s pretty ugly. (problems: we really need a source, not a sink, so this requires multiple virtual/loopback modules linked together to create the correct path, and it gets messy with lots of microphones)
- Creating a C program using the PulseAudio libraries to read bytes from stream, modify the buffer and output to module-pipe-source (problems: original mic still exists, adds delay to audio, requires various modules to be connected together, requires the program to be running at all times, possible buffer underrun issues?)
- Creating a custom Pulse module (Requires proper environment for building Pulse and modules from source. I have not been able to properly build a pulse module that is recognized by pulse after trying for a few days. This would still leave the original mic there too.)
Since our LADSPA dc offset removal plugin works, is there a way to add this LADSPA filter/plugin to an ALSA input? A few places indicate this is possible with asound config, but I haven’t been able to find documentation to explicitly do this.
Perhaps it is even possible to edit the bytes at a lower level, such as in the I2S kernel drivers?
I’ve seen some codecs which list DC removal options in amixer, but the TX1 does not seem to have this. Is it possible to add this?
Any thoughts would be appreciated. Thanks in advance.