Lowering the rate on the 2 mic hat / Gate

After a long session, I finally have the mic hat working with pulseaudio and the webrtc module-echo-cancel, on a Pi zero W.



Lowering rate

This is a hassle, since the default pulseaudio and webrtc are compiled for ARM7 with NEON. So you have to recompile them for ARM6 (=zero W) and no NEON.



However, the input of the mic hat seems locked on 48khz, and now the AEC gets a 1,5Mb/s bitstream. The Zero W can handle this, and the audio difference is day and night, but it loads the CPU up to 80%.



If I look in the driver .c files, the device also supports other samplerates, like ie. 16000hz. So far I haven’t found out how to get it to do this.



I have tried adding a rate setting in asound.conf, to no avail. I don’t think alsa is the one setting this high rate, but the driver.



So how do I change the samplerate of the inputs?



gate



The used chip has a gate built in. The settings for this gate show up in alsamixer. However, I can’t get this gate to work. As I understand the concept, this could work as oldschool ‘squelch’, ie you get silence until the volume reaches a certain preset value, and then you get the sound.



However, Whatever settings I make, I cannot get the gate to engage. How does this work?