• Introducing XDA Computing: Discussion zones for Hardware, Software, and more!    Check it out!

[FIX] Galaxy Nexus GSM low latency audio for Jelly Bean

Search This thread

vonVideo

Senior Member
May 23, 2012
115
135
One of the flaws of the new Android Jelly Bean OS compared to iOS is the big audio playback latency - about 48 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. I have to mention that Google improved from ICS where the playback latency was about 88 ms.

This is a similar thread to:
http://forum.xda-developers.com/showthread.php?t=1674836
but applies to Jelly Bean.

The attached package should be used only by experienced users that can eventually restore their system to the original state. I tested it on Android 4.1.1 GSM phone build JRO03C (maguro) and 4.1.2 build JZ054K.
The latency after aplying it should be 18 ms (no longer 11:( ) with the new version - as reported by the "Caustic 2" app.
It does NOT work on Android 4.2!

Apps like Google Talk, Skype, YouTube, Play Music, Caustic 2, Pandora, TheDrum, My Piano... work very well with this change.
With the newest version all the apps I tested that work well with stock Jelly Bean work well with this patch, with the additional advantage of lower latency.

Status: stable (install and use at own risk)
Notes:
1) applying this might reverse changes made in other mods.
2) The "SCREEN OFF" BUG is FIXED as of July 16th night.

To install use "lowlatsnd41_18_inst.zip"
To restore to original state you may use "lowlatsnd41_rest.zip" or other restore methods if necessary.
Do not run the install twice in a row (run one install then one restore; you have to run restore only if you want to uninstall or before installing a new version when available...).

Since the volume is still a big issue for the Galaxy Nexus users I decided to address this with a Volume Boost patch.
Status: stable ( for 4.1, not tested in 4.2). Install and use at own risk...
The same rules for install/restore apply.

General comment: system updates may delete the backup of the original files; therefore the "restore" should be ran before an update followed by a new install after the update; restoring the original files is also required if the update performs sum checks.
 

Attachments

  • lowlatsnd41_rest.zip
    122.8 KB · Views: 1,702
  • lowlatsnd41_18_inst.zip
    252.2 KB · Views: 2,940
  • volumeboost_inst.zip
    129.4 KB · Views: 523
  • volumeboost_rest.zip
    122.8 KB · Views: 281
Last edited:

Megatr0n.

Senior Member
Sep 22, 2011
127
13
I just installed it and my latency went from 168 ms to 18 ms in caustic 2.

Major ISSUE: When the screen is off audio is incredibly distorted (slowed down an incredible amount) when playing music through headphones. It seems to work fine when the screen is on, though.

I restored using your restore file and caustic 2 now reports my latency as 48 ms and music plays fine when the screen is off, too. Ha, I'm going to test to see if people still complain about horrible echo and delay when making GrooveIP calls over t-mobile 4G.

Thanks!
 
Last edited:
  • Like
Reactions: vonVideo

vonVideo

Senior Member
May 23, 2012
115
135
I just installed it and my latency went from 168 ms to 18 ms in caustic 2.

Major ISSUE: When the screen is off audio is incredibly distorted (slowed down an incredible amount) when playing music through headphones. It seems to work fine when the screen is on, though.

I restored using your restore file and caustic 2 now reports my latency as 48 ms and music plays fine when the screen is off, too. Ha, I'm going to test to see if people still complain about horrible echo and delay when making GrooveIP calls over t-mobile 4G.

Thanks!

Bug confirmed... I'm working on it...
 

leets4uc3

Senior Member
Jun 18, 2010
922
235
Is the distortion due to the limited clock speed?


Sent from my Galaxy Nexus using xda premium
 

Megatr0n.

Senior Member
Sep 22, 2011
127
13
Is the distortion due to the limited clock speed?


Sent from my Galaxy Nexus using xda premium

My GNex is running at 1536 Mhz CPU / 384 Mhz GPU w/ franco's kernel. Could that be causing my issues when the screen's off? Or did you mean that the issue is caused by the SOC clocking down by the scheduler to save power when the screen is off?
 

leets4uc3

Senior Member
Jun 18, 2010
922
235
I was thinking it may have happened because I'm max screen off speed was 384 it was to low. But I changed it to always hold 12Xx and it bug still persisted

Sent from my Galaxy Nexus using xda premium
 

vonVideo

Senior Member
May 23, 2012
115
135
Major ISSUE: When the screen is off audio is incredibly distorted (slowed down an incredible amount) when playing music through headphones. It seems to work fine when the screen is on, though.
Thanks!
It is fixed now (as of 07/16/12 night - edited post). You may rename it after the download. Just make sure you don't run the install twice in a row...
 
Last edited:

Megatr0n.

Senior Member
Sep 22, 2011
127
13
No. The sound is just configured differently when the screen is off. It should be OK with the new packages.

Could you rename the fixed version, please? I just downloaded what I think is the new version but I'm still having the same issue when the screen is off and since it has the same name as the original file, I can't be sure that the new version doesn't work.
 

klobkelosh

Senior Member
Jan 25, 2011
1,323
415
Phx, AZ
Confirmed, audio on screen off working properly. Subjectively, voip tests are promising with little delay. I'll have to put it through some phone calls to really know. Thanks Von!
 
  • Like
Reactions: vonVideo

Top Liked Posts

  • There are no posts matching your filters.
  • 60
    One of the flaws of the new Android Jelly Bean OS compared to iOS is the big audio playback latency - about 48 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. I have to mention that Google improved from ICS where the playback latency was about 88 ms.

    This is a similar thread to:
    http://forum.xda-developers.com/showthread.php?t=1674836
    but applies to Jelly Bean.

    The attached package should be used only by experienced users that can eventually restore their system to the original state. I tested it on Android 4.1.1 GSM phone build JRO03C (maguro) and 4.1.2 build JZ054K.
    The latency after aplying it should be 18 ms (no longer 11:( ) with the new version - as reported by the "Caustic 2" app.
    It does NOT work on Android 4.2!

    Apps like Google Talk, Skype, YouTube, Play Music, Caustic 2, Pandora, TheDrum, My Piano... work very well with this change.
    With the newest version all the apps I tested that work well with stock Jelly Bean work well with this patch, with the additional advantage of lower latency.

    Status: stable (install and use at own risk)
    Notes:
    1) applying this might reverse changes made in other mods.
    2) The "SCREEN OFF" BUG is FIXED as of July 16th night.

    To install use "lowlatsnd41_18_inst.zip"
    To restore to original state you may use "lowlatsnd41_rest.zip" or other restore methods if necessary.
    Do not run the install twice in a row (run one install then one restore; you have to run restore only if you want to uninstall or before installing a new version when available...).

    Since the volume is still a big issue for the Galaxy Nexus users I decided to address this with a Volume Boost patch.
    Status: stable ( for 4.1, not tested in 4.2). Install and use at own risk...
    The same rules for install/restore apply.

    General comment: system updates may delete the backup of the original files; therefore the "restore" should be ran before an update followed by a new install after the update; restoring the original files is also required if the update performs sum checks.
    3
    I'm already waiting for a specific 4.2 ROM to come out so I can wait for your great work as well. :good:

    I restored my system to 4.1.2 and plan to keep it like this. It looks like Google is doing an update every couple of months now. I wrote so much custom code that is not worth entering a rat race just to keep up ( no real quality gain)... I know this will dissapoint some of you, but it is fair to let you know.
    3
    Anyone got a link to the 11ms file? Need it for VoIP calls.

    Sent from my Galaxy Nexus using xda app-developers app
    Here ya go.
    3
    I can confirm still an issue listening to mlb app with screen off. On the plus side, voip delay noticeably lessened.

    Pls check out the new version (use the restore first, don't run the install twice in a row)
    3
    I did not make any sacrifices :)
    I based my mod on AOSP, but it may work on other roms; give it a try!