[Nexus 5 Q&A, Help & Troubleshooting] :
Is this issue related to camera recording audios too? It's frustrating that I can't make a decent phone call :(

I've found fixes but particularly I think that is related to google camera audio supression.

Quote:

Originally Posted by chdloc

I have spent a lot of time trying to fix the in-call recording distortion issue (incoming audio) that seems to plague many devices with Qualcomm chipsets that are trying to use call recording software that records from the line, like the excellent CallRecorder by skvalex. (Actually I found a way, which may not fit the broad population, but it works for me. PM me if you are interested). My time spent on this endeavor gave me quite some insight into the audio subsystem.

Anyway, up until now I have not really used the camcorder feature, but recently I have and lo and behold, the quality is god-awful. So I played around with one of the system libraries, i.e. /system/lib/hw/audio.primary.msm8974.so

The problem seems to be that the audio path chosen within the Qualcomm chipset by the camcorder is enabling a noise suppression algorithm that is way too aggressive. The way I found around this problem is to find (by trial and error) a signal path that seems to bypass noise suppression when the camcorder is used.

Give the attached library a try and report back whether it works for you. Unpack the library, make a backup of the existing /system/lib/hw/audio.primary.msm8974.so, copy the new one in its place, and reboot. Make sure to not rename (or misspell) the modified library before the reboot, otherwise you will get into a boot loop. In short, don't try this if you don't know what you are doing...

Of course, root is required to write to the system partition.

Edit: The attached library was built from 4.4.4 AOSP (branch: android-4.4.4_r1, build: KTU84P). It may or may not work with an older version of stock KitKat. It will probably not work with any other version of Android, but I'd be happy to share the mod so it can be built for other ROMs, if the modified library seems to work for people (it does for me).

Edit2: Make sure you give the library the correct permissions (644, i.e. rw-r-r) after it has been copied to the /system/lib/hw folder. Also, this mod currently does not seem to work for CM as that ROM has modified the files which are necessary to build the library.

Edit3: The microphone path used by this mod is "voice-rec-mic", see /system/etc/mixer_paths.xml

The default microphone gain is set to 88 ("DEC6 Volume"). If one feels that microphone "sensitivity" is insufficient, this gain can be increased significantly. According to ALSA mixer data, the maximum level can be set 124 (not sure about the actual gain difference in dB, but it is very audible). Of course, there is a tradeoff between microphone gain and background noise, i.e. higher gain results in louder microphone/preamp self-noise. It is important to understand, however, that changing this gain in the mixer_paths.xml file will also affect all other applications that choose to use the "voice-rec-mic" path, e.g. Google Now ("OK Google") and possibly others. There may be undesired side effects. Hence, I would suggest to use an app like Tasker to only modify the gain when the Camera app is being used.

Edit4: The microphone gain can quite easily be modified with the help of the attached tinymix binary, which can be built from the AOSP tree. The syntax (after it has been uncompressed, copied to, e.g., /system/bin, and made executable is:

> tinymix "DEC6 Volume" X

where X=[0,124]. Again, there will be a tradeoff between microphone gain and noise amplification.