If you go back few pages on this thread, i have mentioned this same issue and its not fixed until now. Apparently no one cares much about this issue so no fix. I have even posted this on the official telegram channel. I have gone back to LoS 17.1 and i can record clean audio. There is no issue of auto gain on Gcam which i was facing while using this ROM. I think its related to kernel coz if it was about few changes in mixerpath or some other files, it could have been easily fixed. Its present on all A11 roms.Yes, I already tried adjust the microphone gain through the Audio Amplification setting, it didn't fix it. I also tried the Mic Fix Magisk Module you suggested but the problem persists.
The problem I encounter doesn't occur with the internal microphone but only happens when I use external microphone connected to the 3.5mm jack. My assumption is that the Automatic Gain Control is mafluctioning or something like that, cause these gain fluctuations. Is it possible that the custom ROM is at fault or perhaps Android 11? Unfortunately, I have no experience with the previous LineageOS 17.1 (Android 10).