Nexus 4 mic gain too high / distorted input

Search This thread

andy o

Senior Member
May 6, 2012
908
194
Please vote here to bring the issue more attention.

Hey guys, something I noticed. While testing several VoIP options, I found out that my voice with the Speex low bitrate codec was coming out on the other end significantly distorted. I thought at first it was the compression (the codec may apply dynamic compression). But as it turns out, it's the mic gain itself on the phone. The codec simply exacerbates the problem. I don't know if this is a hardware or an OS problem, but it's OS-wide.

If you're holding the phone like a handset on your face, then something a bit louder than a whisper will distort a bit. If you're talking loudly, for sure. This is not as noticeable with regular calls, cause the frequency range is limited, but for higher-quality streams it is a problem. If you don't have another smartphone at hand, you can test how high you can go with e.g. Skype's call testing service, or this number someone in another thread mentioned, where you can hear yourself in real time: (909)390-0003 (I'm in the US with T-mobile).

This is not only a problem with calls, which is my main concern, but also, if you're going for example to a concert, you better get something else to record your clips. There are some of the samples I could find with loud enough audio (which is not very loud) that it distorts.

First the most egregious one: http://www.symbiantweet.com/nokia-lumia-920-vs-google-nexus-4-audio-and-video-recording-comparison

Since that comes from a WP forum, some of you may be rolling your eyes (although, faking that would be pretty childish even for the most staunch fanboy).

Here are a couple other videos I found that show the problem:

http://youtu.be/iF4MBGQUJYY:
attachment.php



http://youtu.be/1UJZYWqGNMQ:
attachment.php



The several VoIP apps that have a "mic gain" control (Groove IP, Talkatone, Sipdroid, CSipSimple) don't actually change the mic gain, but the app's gain which means the already distorted audio will go out with a lower volume, but the damage has already been done.

From searching, it seems that the only way to set actual gain lower in Android is if the kernel permits it, which means a custom kernel. Hopefully the CM guys or someone else can address this. Since the phone is not in the hands of too many people right now and it hasn't been long, the problem is not very widely known, but once people start going to concerts and trying to record clips, there's gonna be some complaints.
 

Attachments

  • Nexus_4_1080P_video_Sample.PNG
    Nexus_4_1080P_video_Sample.PNG
    29.4 KB · Views: 19,683
  • LG_Nexus_4_Indoor_Video_Audio_Sample.PNG
    LG_Nexus_4_Indoor_Video_Audio_Sample.PNG
    23.9 KB · Views: 19,789
Last edited:

rr5678

Senior Member
Dec 25, 2009
1,836
231
It seems that LG messed up a lot that's microphone related. But this problem actually needs attention paid to it.
 

andy o

Senior Member
May 6, 2012
908
194
The Nexus 4 doesn't seem to have auto gain at all (e. g. for videos and audio recording). I'm not sure if this is an Android problem or one particular to this phone.

Also the gain on handset mode is pretty much the same (even seems a bit louder) than in speakerphone mode. I assumed it was a given that it should be significantly lower.
 
Last edited:

frigidazzi

Senior Member
Apr 21, 2011
1,533
265
Nexus Player
OnePlus 5
Are there any kernels or ROMs or anything that fixes this yet that anyone knows of? I am using AOKP with Franco Kernel and it is really bad in the app Voxer that I use several times a day. My recordings sound terrible.
 

rr5678

Senior Member
Dec 25, 2009
1,836
231
Right now all we can do is hope that LG fixes it in an update or a developer fixes the issue with a patch.
 

yahyoh

Senior Member
Nov 7, 2011
4,867
1,929
Amman
The Nexus 4 doesn't seem to have auto gain at all (e. g. for videos and audio recording). I'm not sure if this is an Android problem or one particular to this phone.

its android problem ( no auto Gain ) which sucks if u r recording in loud environment u will get **** sound :(

(but in wolfson audio chips u can control mic gain with voodoo sound like GS1 or Nexus S )
 

andy o

Senior Member
May 6, 2012
908
194
And here I was thinking that latency was the worst problem for recording apps on Android. They even supposedly improved latency on 4.1 and 4.2, but this is way worse. For recording, Android is even farther behind iOS than I thought, and if this has always been a problem and nobody cares, probably everybody will keep not caring for the N4. Ideally the CM guys would take notice, I wonder how difficult it would be to implement it for them.
 

rr5678

Senior Member
Dec 25, 2009
1,836
231
And here I was thinking that latency was the worst problem for recording apps on Android. They even supposedly improved latency on 4.1 and 4.2, but this is way worse. For recording, Android is even farther behind iOS than I thought, and if this has always been a problem and nobody cares, probably everybody will keep not caring for the N4. Ideally the CM guys would take notice, I wonder how difficult it would be to implement it for them.

Remember, this phone hit a little over a month old a few days ago.
 

andy o

Senior Member
May 6, 2012
908
194
The problem with this phone in particular is that the gain is set too high, but since I first posted the OP I've learned that this was also a problem with the galaxy nexus, at least on a lesser magnitude. And the fact that there is no way for apps to adjust gain is an Android problem in general (and news to me as well).
 

jamez243

Senior Member
Jul 7, 2008
370
16
The problem with this phone in particular is that the gain is set too high, but since I first posted the OP I've learned that this was also a problem with the galaxy nexus, at least on a lesser magnitude. And the fact that there is no way for apps to adjust gain is an Android problem in general (and news to me as well).

I am also having this issue most apparent in the voxer app when you play back the message you send ... you can tell it's way too over driven.

My nexus 7 doesn't do this :(
 

andy o

Senior Member
May 6, 2012
908
194
this explains why when i lower the volume during a call it doesnt appear to actually lower the volume of the call
I'm not sure that this is the same problem. Do you mean the volume you're hearing on the phone? Cause we're talking about the input gain on the mic, which means that the app will get the sound very high, many times distorted as in the examples above, and then it can lower it, but the already distorted sound cannot be fixed and it will be sent that way. Lowering the sound does work here for incoming audio in calls.
 

volkswagner

New member
Jan 10, 2013
3
0
Nexus 4 mic very sensitive

I'm surprised that this is not all over the web. I guess there are not many users with VOIP accounts on their Nexus 4.

This problem makes it unusable as a VOIP phone.

It seems during a VIOP call, the second mic is not used to surpress background noise... it actually amplifies it.

I think at least two things are happening here. The second mic amplifies background noise and also pics up noise from the earpiece since they are so close.

I have put a small piece of scotch tape over the second mic and with the earpiece at 50% volume, the issue is almost gone. This solution/work around would only be suitable if a. you don't mind tape on your $350 handset and b. calls are only made in a quiet environment. This is because at 50% earpiece volume it is very difficult to hear the caller.

Again this does not happen during cellular voice calls.

I have not fully tested, but I believe using a bluetooth headset will also eliminate the problem.

Symptom: during voip calls background noise is amplified including introduced echo from earpiece causing major distortion on the receiving callers earpiece.
 
Last edited:

jackierobinson

Senior Member
May 29, 2011
333
94
I have modified my kernel to fix the mic issues (I believe) but since I don't use VOIP and I don't have account either. I can't test this myself.

http://faux.androidro.ms/mako/beta/mako-jb-kernel-004b06.zip

check for me to see if my kernel fixes made any difference.
I initially thought it wasnt much better, but after using it a bit I think it is actually quite an improvement over how it was before. It's not on the same level as my One X, but it is at least audible in most situations now, where before it was often just fuzz.

Thanks mate. What did you change in the kernel? In layman's terms.
 
Last edited:

clubtech

Senior Member
Jun 26, 2007
1,908
353
USA
I have modified my kernel to fix the mic issues (I believe) but since I don't use VOIP and I don't have account either. I can't test this myself.

http://faux.androidro.ms/mako/beta/mako-jb-kernel-004b06.zip

check for me to see if my kernel fixes made any difference.

Thanks for the Kernel. I think there is a slight improvement but gain on VOIP calls is still way too high...not sure what the change in the Kernel is but maybe you can try and reduce the gain even more?

Thanks,
 

-Mindroid-

Senior Member
Dec 3, 2012
162
53
New York
Thanks mate. What did you change in the kernel? In layman's terms.

Faux is using the method that I describe over here:
http://xdaforums.com/showthread.php?t=2092625

It's more of a trick than a permanent fix. The kernel exposes a few audio streams to Android apps such as
MIC, CAMCORDER, VOICE CALL, VOICE RECOGNITION and others. I discovered that CAMCORDER sounds
a bit better than the rest but most apps use the MIC stream. I proposed that kernel devs hardwire MIC and DEFAULT
audio streams to always output the content of CAMCORDER.

We can try tracing the kernel code and figure out what is CAMCORDER doing differently. I would guess it's simply
a noise suppression because the physical signal always seems to be coming from the bottom mic.

The problem with a high mic gain remains.
The best solution will be to find where the driver sets the mic gain and expose these values to the user. Depending on how
the driver code was written that could be obvious or impossible to figure out.
 
  • Like
Reactions: natzy85 and Bexton

Top Liked Posts

  • There are no posts matching your filters.
  • 7
    Please vote here to bring the issue more attention.

    Hey guys, something I noticed. While testing several VoIP options, I found out that my voice with the Speex low bitrate codec was coming out on the other end significantly distorted. I thought at first it was the compression (the codec may apply dynamic compression). But as it turns out, it's the mic gain itself on the phone. The codec simply exacerbates the problem. I don't know if this is a hardware or an OS problem, but it's OS-wide.

    If you're holding the phone like a handset on your face, then something a bit louder than a whisper will distort a bit. If you're talking loudly, for sure. This is not as noticeable with regular calls, cause the frequency range is limited, but for higher-quality streams it is a problem. If you don't have another smartphone at hand, you can test how high you can go with e.g. Skype's call testing service, or this number someone in another thread mentioned, where you can hear yourself in real time: (909)390-0003 (I'm in the US with T-mobile).

    This is not only a problem with calls, which is my main concern, but also, if you're going for example to a concert, you better get something else to record your clips. There are some of the samples I could find with loud enough audio (which is not very loud) that it distorts.

    First the most egregious one: http://www.symbiantweet.com/nokia-lumia-920-vs-google-nexus-4-audio-and-video-recording-comparison

    Since that comes from a WP forum, some of you may be rolling your eyes (although, faking that would be pretty childish even for the most staunch fanboy).

    Here are a couple other videos I found that show the problem:

    http://youtu.be/iF4MBGQUJYY:
    attachment.php



    http://youtu.be/1UJZYWqGNMQ:
    attachment.php



    The several VoIP apps that have a "mic gain" control (Groove IP, Talkatone, Sipdroid, CSipSimple) don't actually change the mic gain, but the app's gain which means the already distorted audio will go out with a lower volume, but the damage has already been done.

    From searching, it seems that the only way to set actual gain lower in Android is if the kernel permits it, which means a custom kernel. Hopefully the CM guys or someone else can address this. Since the phone is not in the hands of too many people right now and it hasn't been long, the problem is not very widely known, but once people start going to concerts and trying to record clips, there's gonna be some complaints.
    2
    According to posts in this thread the problem is caused by the microphone gain set too high.
    That's one hypothesis that we are working with but there could be something else wrong.
    I don't have enough recording experience to tell what's wrong just by the sound of it.

    But if a recording engineer hears it he/she should be able to pinpoint the problem.
    A microphone gain problem is the very likely cause but it will help to have an expert opinion.

    I'm not a sound engineer but a simple musician. I often record myself with my phone but never achieved to obtain the quality of my old galaxy s (voodoo sound really did magic) or of an iPhone with the nexus 4.
    The only solution to get a listenable record is to use an app like recforge which allows to disable the mic's automatic gain control (AGC). Even with that the sound is decent but far from great.

    In conclusion I'd say the easiest solution is to disable AGC and create an easy way to adjust the gain tunable on the fly, eg. in notification bar. My educated guess is that it's controlled at kernel level as voodoo sound was injecting a module in the kernel. But there must be some userspace access as I don't think recforge has root permission. Maybe a way to follow... :confused:

    A more complete approach would involve digging in the dsp driver as I suspect some strong audio filters to be applied. Disabling them would probably help with the clarity of the record.

    Unfortunately I can't help for the coding stuff but of you need me to test things I'll do my best.

    Sent from my Nexus 4 using xda app-developers app
    2
    Thanks mate. What did you change in the kernel? In layman's terms.

    Faux is using the method that I describe over here:
    http://xdaforums.com/showthread.php?t=2092625

    It's more of a trick than a permanent fix. The kernel exposes a few audio streams to Android apps such as
    MIC, CAMCORDER, VOICE CALL, VOICE RECOGNITION and others. I discovered that CAMCORDER sounds
    a bit better than the rest but most apps use the MIC stream. I proposed that kernel devs hardwire MIC and DEFAULT
    audio streams to always output the content of CAMCORDER.

    We can try tracing the kernel code and figure out what is CAMCORDER doing differently. I would guess it's simply
    a noise suppression because the physical signal always seems to be coming from the bottom mic.

    The problem with a high mic gain remains.
    The best solution will be to find where the driver sets the mic gain and expose these values to the user. Depending on how
    the driver code was written that could be obvious or impossible to figure out.
    2
    I'm surprised this hasn't been mentioned yet, but Faux123's kernel has a sound mod with an accompanying app that allows you to adjust microphone gain. I can personally vouch for Faux's kernel because my phone is running ridiculously well, so help out a dev and buy a few of his apps.

    https://play.google.com/store/apps/details?id=com.teamkang.fauxsound
    (NOTE: There MUST be kernel support for this app to work!)
    2
    Turns out our device uses the 8064 not the 8690. So the correct file can be found here:

    kernel/arch/arm/mach-msm/8064.c

    I have compiled an updated version of franco's kernel but haven't tried it yet.