[FIX] Galaxy Nexus GSM low latency audio playback

Search This thread

vonVideo

Senior Member
May 23, 2012
115
135
In my opinion one of the main flaws of the Android ICS OS the big audio playback latency - about 88 ms. This impacts negatively many applications that emulate musical instruments and the ones that do VOIP like Skype or Google Talk. For VOIP apps the audio lag also has a negative impact on acoustic echo cancellation - probably the most difficult feature to implement on an Android phone. In spite of many user protests and requests apparently Google has chosen not to do anything about it.

This is a similar thread to the one started by "Windows X":
http://forum.xda-developers.com/showthread.php?t=1621914
but the solution is applicable to the Google Galaxy Nexus GSM phone ( or with custom ROMs based on ICS 4.0.4 GSM (maguro))

The attached package should be used only by experienced users that can eventually restore their system to the original state. I tested it only on ICS 4.0.4 GSM phone build IMM76I (maguro). In this configuration it worked flawlessly as far as I could test it. Other successful testing reports coming for CM9 Nightly Builds, AOKP and rascream maguro ROMs.
The latency after aplying it should be about 20 ms - as reported by the "Caustic 2" app.

Change log:
Original package replaced by "lowlatsnd_inst.zip"
To restore to original state you may use "lowlatsnd_rest.zip" or other restore methods if necessary.

Status: stable
Note: applying this might reverse changes made in other mods.
 

Attachments

  • lowlatsnd_inst.zip
    168.7 KB · Views: 1,789
  • lowlatsnd_rest.zip
    122.8 KB · Views: 856
Last edited:

vonVideo

Senior Member
May 23, 2012
115
135
Actually I think it is pretty stable, but I tested it only on my ICS 4.0.4 GSM phone build IMM76I.
 

Serious_Beans

Senior Member
Feb 17, 2011
2,316
332
In my opinion one of the main flaws of the Android ICS OS the big audio playback latency - about 88 ms. This impacts negatively many applications that emulate musical instruments and the ones that do VOIP like Skype or Google Talk. For VOIP apps the audio lag also has a negative impact on acoustic echo cancellation - probably the most difficult feature to implement on an Android phone. In spite of many user protests and requests apparently Google has chosen not to do anything about it.

This is a similar thread to the one started by "Windows X":
http://forum.xda-developers.com/showthread.php?t=1621914
but the solution is applicable to the Google Galaxy Nexus GSM phone.

The attached package is in an experimental stage and should be used only by experienced programmers that can eventually restore their system to the original state. I tested it only on ICS 4.0.4 GSM phone build IMM76I.
The latency after aplying it should be about 20 ms - as reported by the "Caustic 2" app.

So that's why I have an echo on almost all of my phone calls and voip apps?
Is this a flashable zip or something you have to include before compiling?
 

vonVideo

Senior Member
May 23, 2012
115
135
It is a flashable zip.
The big audio playback latency is one of the reasons for echo cancellation poor performance.
 
Last edited:
  • Like
Reactions: Serious_Beans

aeoveu

Senior Member
Nov 8, 2010
635
144
I'm guessing it's possible to manually paste these files into the phone via some form of root explorer, right?

Since I'm new to the GN (had a Desire before), is it possible for you to create a flashable version of the stock files which will get replaced, as a precaution, please? :) Backing up and restoring takes quite a while (some minutes vs. a few seconds compared to a patch ;) )

Edit: maybe I haven't noticed it, but I'm on 4.0.4 update 2 (forgot the exact build number - as I said, I'm new to the GN :D ) so... where exactly (or rather, how) can I spot the differences before and after applying the patches?
 
Last edited:

vonVideo

Senior Member
May 23, 2012
115
135
Actually I have included in the zip the original libraries too with the extension ".orig" for ICS 4.0.4
They may work on 4.0.2 too, but I did not test them. You can copy your original libraries for example in /data/local/tmp/ and restore them later if you need by mounting system rw...
 
Last edited:
  • Like
Reactions: aeoveu

nmesisca

Retired Recognized Developer
Nov 14, 2007
529
62
Dublin
Tested this on the Modaco ROM ..
Seems to break system sounds. Music doesnt play anymore.
Phone calls still work though...
Caustic 2 does say 20ms latency..
going back to stock for now but sure deserves attention..
 

vonVideo

Senior Member
May 23, 2012
115
135
Unfortunately I don't know the Modaco ROM. On ICS 4.0.4 it works flawlessly with any sound source I tested so far.
 

uoY_redruM

Senior Member
May 1, 2010
3,469
1,941
Longwood, FL
So this should work on rascream ROM then? (AOSP from source with very few color changes...basically stock)

Sent from my Galaxy Nexus using xda premium
 

aeoveu

Senior Member
Nov 8, 2010
635
144
Would someone be kind enough to graciously tell us if this made a difference (and what other bugs they've noticed) with their ROMs and device performance? Not that I'm scared or anything, but I'd like to be aware of what I'm trying to spot the difference in.
 

vonVideo

Senior Member
May 23, 2012
115
135
If rascream ROM is AOSP with very few color changes then this should work in the maguro version.
 
Last edited:

sotoskawasaki

Senior Member
Feb 2, 2012
175
21
Limassol, Cyprus
This sure sounds a very interesting project. I hope you get lots of feedback and continue to work on that. Unfortunately, I haven't noticed that lag you are talking about. Most probably my ear isn't trained to spot it. How could I reproduce it, so that I would notice the difference before and after?

Thanks
 

vonVideo

Senior Member
May 23, 2012
115
135
The lag is very easy to notice in a Skype of Google Talk call for example.
Also, you may try apps like "Caustic 2" - hit the keyboard and notice a lag of the generated sound from the moment you tap the screen, or "DroiDrum"... you don't need a trained ear for that...
 
  • Like
Reactions: sarni84

nmesisca

Retired Recognized Developer
Nov 14, 2007
529
62
Dublin
Unfortunately I don't know the Modaco ROM. On ICS 4.0.4 it works flawlessly with any sound source I tested so far.

yeah I wouldnt worry about Modaco..
its not a "full" 4.0.4 rom so thats probably why it didnt work for me..

quick question... would this increase battery usage, or has any of you testing this noticed something like that?
 

Top Liked Posts

  • There are no posts matching your filters.
  • 30
    In my opinion one of the main flaws of the Android ICS OS the big audio playback latency - about 88 ms. This impacts negatively many applications that emulate musical instruments and the ones that do VOIP like Skype or Google Talk. For VOIP apps the audio lag also has a negative impact on acoustic echo cancellation - probably the most difficult feature to implement on an Android phone. In spite of many user protests and requests apparently Google has chosen not to do anything about it.

    This is a similar thread to the one started by "Windows X":
    http://forum.xda-developers.com/showthread.php?t=1621914
    but the solution is applicable to the Google Galaxy Nexus GSM phone ( or with custom ROMs based on ICS 4.0.4 GSM (maguro))

    The attached package should be used only by experienced users that can eventually restore their system to the original state. I tested it only on ICS 4.0.4 GSM phone build IMM76I (maguro). In this configuration it worked flawlessly as far as I could test it. Other successful testing reports coming for CM9 Nightly Builds, AOKP and rascream maguro ROMs.
    The latency after aplying it should be about 20 ms - as reported by the "Caustic 2" app.

    Change log:
    Original package replaced by "lowlatsnd_inst.zip"
    To restore to original state you may use "lowlatsnd_rest.zip" or other restore methods if necessary.

    Status: stable
    Note: applying this might reverse changes made in other mods.
    2
    Any chance of a similar fix for JB to improve latency now that it's out?

    For Jelly Bean I created a new thread:
    http://forum.xda-developers.com/showthread.php?t=1777261
    2
    hi vonVideo, do you think this patch can impact built-in voip client latency too?

    Thanks and great idea
    Yes, this will positively impact the pre-installed Google Talk, as well as Skype and any other VOIP apps.
    The extra 68-69 ms latency at playback is quite annoying at the moment...
    2
    Make a nandroid and find out.

    Works on CM9 :D
    2
    For anybody who has flashed the Jelly Bean update: has this bug been fixed?

    EDIT: We're getting confirmation that it is indeed been fixed to a degree:

    It looks like they've finally addressed the long standing audio latency issue in Android. I was watching the Android Fireside Chat and they mentioned that audio latency on the Galaxy Nexus, running on Jelly bean, has been reduced from 100ms to 12ms. But, they're still not satisfied as they want to reduce it to below 10ms. So it looks like some of those iOS music apps which are heavily reliant on low audio latency targets may finally be coming to Android.

    http://www.theverge.com/2012/6/27/3122302/audio-latency-finally-addressed-in-jelly-bean