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

Search This thread

RoadToNever

Senior Member
Jun 14, 2012
591
109
Malmö, Sweden
Did you try it? What is the expected latency?

I can't ATM(USB issues, lack of spare time). The dev claims it reduces audio latency from stock and is simmilar to your fix. That's all the info that's provided.

this rom not install on my maguro nexus !
give me error before flash .

Ok. You could try extracting the following files from Steel Droid 7.1 and copying them into a working 4.2 ROM:

/system/lib/hw/audio.primary.tuna.so
/system/lib/libaudioflinger.so
 
Last edited:

RoadToNever

Senior Member
Jun 14, 2012
591
109
Malmö, Sweden
Bad news. Copied libaudioflinger.so and audio.primary.tuna.so from Steel Droid 7.1 into factory 4.2.2. 'Audio Buffer Size' reports 144, Caustic 2 reports 40ms, same as stock.
 

RoadToNever

Senior Member
Jun 14, 2012
591
109
Malmö, Sweden
After trying some OpenSL enabled apps that I've concluded that you can't trust Caustic2s reported latency anymore. Apps like RD4 Groovebox, Heat Synthesizer, Grand Piano Pro have no perceivable latency with my midi keyboard hooked up via an USB-OTG adapter, no doubt good enough for stage use. Even with this excellent tweak legacy apps give you no less than 85% larger latency. The future is here!
 
Last edited:

vonVideo

Senior Member
May 23, 2012
115
135
After trying some OpenSL enabled apps that I've concluded that you can't trust Caustic2s reported latency anymore. Apps like RD4 Groovebox, Heat Synthesizer, Grand Piano Pro have no perceivable latency with my midi keyboard hooked up via an USB-OTG adapter, no doubt good enough for stage use. Even with this excellent tweak legacy apps give you no less than 85% larger latency. The future is here!

What Android version are you using? This, now old, patch is good up to version 4.1.2. And the "Caustic 2" reporting was accurate. I tried OpenSL at the time but could not get better results than with standard APIs. Maybe OpenSL is better now; I haven't tested it recently, so it would be interesting to see other people's findings. I can't really quantify what you mean by "85% larger latency". What is the exact latency you measured or estimated?
 

RoadToNever

Senior Member
Jun 14, 2012
591
109
Malmö, Sweden
What Android version are you using? This, now old, patch is good up to version 4.1.2. And the "Caustic 2" reporting was accurate. I tried OpenSL at the time but could not get better results than with standard APIs. Maybe OpenSL is better now; I haven't tested it recently, so it would be interesting to see other people's findings. I can't really quantify what you mean by "85% larger latency". What is the exact latency you measured or estimated?

Recently migrated from v4.1.2 to v4.4. I just compared the reported latencies from Caustic2 and Audio Buffer size(OpenSL enabled) and I realize as I'm typing this my maths were wrong, more like 500% larger latency with legacy apps. I deem the numbers reported from both apps as accurate for what they measure on a subjective basis, I have prior experience with working with varying latencies in DAWs. Apologies for the credulity and I hope more users weight in.
 

lozza333

New member
May 26, 2008
2
0
Thank you Vonvideo for developing this patch. I am really eager to try some music making apps on my new Nexus. But I'm having trouble finding a clean version on 4.1.2, all the old download links have expired... no ads, default apps removed, speed mods and the like. Does someone here have a good ROM they would kindly share with me?
 

vonVideo

Senior Member
May 23, 2012
115
135
Recently migrated from v4.1.2 to v4.4. I just compared the reported latencies from Caustic2 and Audio Buffer size(OpenSL enabled) and I realize as I'm typing this my maths were wrong, more like 500% larger latency with legacy apps. I deem the numbers reported from both apps as accurate for what they measure on a subjective basis, I have prior experience with working with varying latencies in DAWs. Apologies for the credulity and I hope more users weight in.

It looks like Google is doing something: http://source.android.com/devices/latency_design.html
with AUDIO_OUTPUT_FLAG_FAST that may work in OpenSL ES ( I didn't try it). But the low latency request may not be accepted. It may be something like the echo cancellation that doesn't work when you really need it - for example during a video chat session when the system load is high...
 

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!