FORUMS
Remove All Ads from XDA
Honor 7x
Win an Honor 7X!

[MOD][TWEAK][03/05] Nexus S: Fidelity 2.0 - Ultimate Low latency audio playback

742 posts
Thanks Meter: 1,304
 
By Windows X, Senior Member on 27th April 2012, 06:47 AM
Post Reply Email Thread
4th May 2012, 03:51 AM |#101  
kong's Avatar
Senior Member
Thanks Meter: 959
 
More
Quote:
Originally Posted by Windows X

https://github.com/peteralfonso/plat...467cd8f48cb4a3

Here he changed output buffer period size from 1024 to 448 because in early implementation didn't work fine at 1024.

https://github.com/peteralfonso/plat...246a1c785a6d3c

Now he changed back from 448 to 1024 again saying it's not necessary anymore and higher buffer size will save up more battery.

What we know here? Reducing period size to 40-50% still works fine without trouble except consuming little more battery and smaller period means smaller buffer size leading to lower latency too.

Same goes for Galaxy Nexus. Let me explain here

https://github.com/peteralfonso/plat.../ics/device.mk

Galaxy Nexus uses audio library code from tuna base. so let's see tuna code changes that has comment about latency value.

https://github.com/peteralfonso/plat...a5756264620234

This ones is pretty obvious. The goal is to have lower latency and optimizing audio performance to perform well at lower latency is the most important of all. Not to mention that early period size of Nexus S having 448 which is less than 50% of 24x44 = 1056 in Galaxy Nexus's low latency mode right now. Specs in Galaxy Nexus should be like 2-3 times better but Nexus S can handle latency at half fine until increase buffer patch? Sound quality regarding latency size is subjective and I already said that I'm not giving any promise to sound quality improvements though some may perceive noticeable changes in what they hear. I want to have lower latency playback and and I feel snappier having it.

I still don't get the idea of this "low latency" thing. I suppose any audio player would play the song from a "buffer", which is used to hold the data processed by CPU and the "latency" would come from the time CPU used to process that data (maybe plus the time to fill the buffer?)

Then no matter what size of this "buffer" is, it always contains the same data for the player to fetch and play... so I don't see how "low latency" can improve "sound quality" or improve "sonic fidelity" unless there is a degradation of data in the buffer over time, which sounds strange to me in terms of computing

If anyone could come up with some explanations I would be really appreciated.
The Following User Says Thank You to kong For This Useful Post: [ View ] Gift kong Ad-Free
 
 
4th May 2012, 07:37 AM |#102  
OP Senior Member
Thanks Meter: 1,304
 
More
Some good sites from quick search regarding latency

http://www.rossbencina.com/code/dave...google-io-2011 <--- Google talking about latency problems. ICS in Galaxy Nexus seems to improve to 20ms. Still miles behind iOS API lower latency from good low CPU usage and power consumption. I hope Google will implement PulseAudio in newer Android build.

http://www.synthtopia.com/content/20...android-phone/ <--- Some good sites explaining with data and examples. Try listenig audio clip from 0ms latency to over 300ms and ask yourself if they're all sound the same.

Hmmm. I just know iOS having 5.4ms latency playback. It's such shame that iPad/iPhone didn't use good Wolfson DACs. Sonic quality from lower latency is having more responsive audio output, more continuity of bit-stream, more linear of the sound closer to ideal from quantization.

Btw, it seems supercurio noted something interesting in https://docs.google.com/document/d/1...cv8/edit?pli=1

"Cpu frequency transition latency: 100000 ns"

This is called "/proc/sys/kernel/sched_latency_ns" in Android and I changed it to 100000ns for supported kernel. I doubt he ever looked into my work before giving comments.
4th May 2012, 08:10 AM |#103  
PhaedraCorruption's Avatar
Senior Member
Thanks Meter: 11
 
More
Quote:
Originally Posted by Windows X

Some good sites from quick search regarding latency

http://www.rossbencina.com/code/dave...google-io-2011 <--- Google talking about latency problems. ICS in Galaxy Nexus seems to improve to 20ms. Still miles behind iOS API lower latency from good low CPU usage and power consumption. I hope Google will implement PulseAudio in newer Android build.

http://www.synthtopia.com/content/20...android-phone/ <--- Some good sites explaining with data and examples. Try listenig audio clip from 0ms latency to over 300ms and ask yourself if they're all sound the same.

Hmmm. I just know iOS having 5.4ms latency playback. It's such shame that iPad/iPhone didn't use good Wolfson DACs. Sonic quality from lower latency is having more responsive audio output, more continuity of bit-stream, more linear of the sound closer to ideal from quantization.

Btw, it seems supercurio noted something interesting in https://docs.google.com/document/d/1...cv8/edit?pli=1

"Cpu frequency transition latency: 100000 ns"

This is called "/proc/sys/kernel/sched_latency_ns" in Android and I changed it to 100000ns for supported kernel. I doubt he ever looked into my work before giving comments.

I've been following this thread for the last little while and it seems that there is quite a bit of controversy regarding the effects of this mod.

The obvious answer here would be to just "try it" and see if you hear a difference, but the human mind simply does not work this way.

I did a small controlled experiment awhile back regarding the effects that the mind has on what we hear, the results simply proved that we hear what we want to hear. (If you're interested, you can find the experiment here)

The way I see it, once a certain point is reached, hearing a difference does not mean there actually is a genuine difference in sound quality, in order to prove beyond a reasonable doubt that an improvement has been made, I believe it is necessary to introduce completely unobjective tools and measuring devices.

The best bet for anyone to finally put a conclusion once and for all on this mod is simply to do a couple of measurements in the form of electronically recorded sine sweeps with a control (baseline stock measurement) to compare to.

I don't know nearly enough about how phone audio codecs work to add anything of value to the discussion, however I'm certain that with measurements presented, a unanimous decision can be made regarding the true effects.
The Following 5 Users Say Thank You to PhaedraCorruption For This Useful Post: [ View ] Gift PhaedraCorruption Ad-Free
4th May 2012, 08:36 AM |#104  
kong's Avatar
Senior Member
Thanks Meter: 959
 
More
Quote:
Originally Posted by Windows X

http://www.synthtopia.com/content/20...android-phone/ <--- Some good sites explaining with data and examples. Try listenig audio clip from 0ms latency to over 300ms and ask yourself if they're all sound the same.

The "ding's" sound the same to me in all four cases. The only difference is how long until it "ding" after the "tick" in each case. However, I think I have a clearer idea why "high latency" is a problem in Android. But, IMO, this should only be the case for interactive applications that needs to produce sound whenever there is a user interaction e.g. Guitar app. In this case, the high latency may confuse the user whether they're playing it in the wrong rhythm or something like that.

But it shouldn't affect the playback of music at all because the process is just reading the file, decode it, then send the result to audio output. The worst that could happen for "high latency" in music playback is there will be a little bit delay before you can actually hear the music after the data is put in the "buffer" e.g. when changing tracks.

Please correct me if I'm wrong
The Following 3 Users Say Thank You to kong For This Useful Post: [ View ] Gift kong Ad-Free
4th May 2012, 09:05 AM |#105  
OP Senior Member
Thanks Meter: 1,304
 
More
The actual fact of this mod is actually getting lower latency regarding audio and it's proven by google beforehand in AOSP source that Nexus S can actually get down from 20ms to 10ms latency in ICS. One of good advantages in having lower latency for audio playback is application requiring audio pre-processing like DSP sound effects and musician apps can be more responsive to audio stream as it processes audio stream in buffer at lesser size. it helps reducing threshold required giving more space for CPU to take a deep breath for multi-tasking.

Besides actual facts, some people who don't care about low latency audio and try to make claim why he doesn't want it like sound quality is placebo, data is data and streamed the same, etc. I already said this is for people who want low latency playback and won't promise anything for sound quality so if you don't need to have low latency audio, you don't have to force your way into it. But if you want to learn about low latency things, I'm more appreciated to help explaining about it.

To make this mod more believable and trustworthy, I'll remove all my own patches and leave only proved by Google in AOSP in upcoming version according to supercurio's suggestions. This should help avoiding confusion and controversy
4th May 2012, 01:49 PM |#106  
kong's Avatar
Senior Member
Thanks Meter: 959
 
More
Quote:
Originally Posted by Windows X

Besides actual facts, some people who don't care about low latency audio and try to make claim why he doesn't want it like sound quality is placebo, data is data and streamed the same, etc. I already said this is for people who want low latency playback and won't promise anything for sound quality so if you don't need to have low latency audio, you don't have to force your way into it. But if you want to learn about low latency things, I'm more appreciated to help explaining about it.

I'm just trying to understand how "low latency" works or helps improving anything in music playback.

How many people do you think would "want low latency playback" when in fact they haven't even heard of it until you started this thread?

I believe other users may have the same questions as mine so I took time to explain my thoughts and was hoping for some clarifications/corrections/explanations. But it seems my questions never got a direct answer nor an "average Joe" understandable explanation.

Sorry if I was bothering you. Now I have a feeling that I should just stop asking questions in your thread
The Following 2 Users Say Thank You to kong For This Useful Post: [ View ] Gift kong Ad-Free
bedalus
4th May 2012, 03:25 PM |#107  
Guest
Thanks Meter: 0
 
More
Quote:
Originally Posted by PhaedraCorruption

I did a small controlled experiment awhile back regarding the effects that the mind has on what we hear, the results simply proved that we hear what we want to hear. (If you're interested, you can find the experiment here

Bookmarked! Nice study. You should check out Blink by Malcolm Gladwell. Some nice parallels in studies of taste, showing how our brains can improve the flavour of ice cream from the look of the packaging. In one famous study he referenced, hardly anyone can tell the difference between coca-cola and pepsi in a simple triangle test.
Quote:
Originally Posted by kong

I'm just trying to understand how "low latency" works or helps improving anything in music playback.

How many people do you think would "want low latency playback" when in fact they haven't even heard of it until you started this thread?

Each 2048 sample buffer gives roughly an additional 50 millisecond delay between hitting play and the sound hitting your ears (assuming the most common bitrate of 44.1kHz). Here's a little article on latency: http://www.elvenminstrel.com/recordi...002latency.htm

At sea level sound travels at about 1 foot per millisecond. Most people are probably aware of the delay between seeing something happen at a long distance, and hearing it a bit later. An practical experiment anyone can conduct is to go outside and hit anything solid on to the ground. Another person standing far away can confirm there is an obvious delay.

50 milliseconds may not sound like much, but in sound, it is a lot. For example, your ears can begin to pick up pitch information from sounds starting with sounds at least 50 milliseconds long. That's pretty impressive.

Windows X seems to have retracted that this mod improves audio quality. However, he did start out by saying this was an 'Audiophile' improvement, and defended this by stating that low latencies were found to improve sound quality here: http://www.cicsmemoryplayer.com/inde...ay.ASIOLatency

... I read that and have several criticisms of it: http://forum.xda-developers.com/show...7&postcount=21
Quote:
Originally Posted by Windows X

It should give cleaner sound and richer harmonics...

This is from the third post. Cleaner sound means less noise, which is testable, and I intend to test it (to prove that there is no reduction in jitter). Richer harmonics can only mean the amplitude of certain harmonics is increased proportionally to the fundamental frequency, which is a form of distortion. See here: http://www.neumann-kh-line.com/neuma...0%20Distortion

The term 'richer harmonics' has positive connotations, and is a characteristic lauded by the proponents of tube amplifiers, where their non-linear amplification 'warms' the sound, or in more scientific terms, increases the proportional amplitude of the consonant harmonics (the even numbered ones). However, this is not possible with this mod, as it is a digital amplifier, and we are talking about latencies, not signal modulation.

Anyway. I don't think Windows X intended to mislead anyone, but claims of better sound may have been a bit over-hyped and under-substantiated.
The Following 4 Users Say Thank You to For This Useful Post: [ View ] Gift Ad-Free
4th May 2012, 04:07 PM |#108  
OP Senior Member
Thanks Meter: 1,304
 
More
kong, I already answered your questions and wrapped it into one post. In my defense from many unwanted guests trying to make it sounds absurd to try, I have to make my words clear that I'm making low latency audio patch not better sound for voodoophile. I apologize if that sounds offensive to you and I already said I'm more appreciated to help in explaining about low latency thing.

As for bedalus' remarks, low latency is one of the most promising measurements worth chasing in world of pro audio and computer audiophile. I don't see why it's wrong to use scientific pro audio terms that audiophiles can make some sense with. And sonic degradation suffered from lower latency is real thing because random jitter added in latency will be wider. But you have to know how latency jitter can cause problems in quantization. It's pretty deep and easiest way is just try it and decide if you want to keep it or not. I've been in this circle numerous times already in computer audiophile.

I hope to hear your test report soon as I'm also looking forward to see how it'll work in your case too. Personally, I don't see anything wrong in here trying to have lower latency for audio playback regardless of getting better sound quality or not.
4th May 2012, 05:37 PM |#109  
klinker's Avatar
Senior Member
Flag Koper
Thanks Meter: 760
 
Donate to Me
More
Well, i try the diference without and this mod, and i can tell the music have more "balls" with the mod and on my audio setup i can give up more volume. Maybe a normal music user on cheap audio hardware can not hear the diference, but on my Dynaudio BM5A i can hear the diference in more "balls" in music and can incrase the volume a little more, before the monitors gone in clip. Specialy the low frequencies (kick, bass,..) are more "big" and "present".
4th May 2012, 08:09 PM |#110  
cpaixao's Avatar
Senior Member
Flag Sete Lagoas
Thanks Meter: 115
 
Donate to Me
More
Lets say you'll eat a pizza, you can chew each slice 100, one by one, in 30 minutes, or eat it entirely in 10 min, chewing like crazy 100 times each slice.

Question: Whats the tastier pizza?

None. You just eat the same pizza. But perhaps you'll feel more tired after eating the second one. ^_^
4th May 2012, 08:11 PM |#111  
polobunny's Avatar
Senior Member
Flag Montreal
Thanks Meter: 2,496
 
More
Quote:
Originally Posted by Windows X

kong, I already answered your questions and wrapped it into one post. In my defense from many unwanted guests trying to make it sounds absurd to try, I have to make my words clear that I'm making low latency audio patch not better sound for voodoophile. I apologize if that sounds offensive to you and I already said I'm more appreciated to help in explaining about low latency thing.

As for bedalus' remarks, low latency is one of the most promising measurements worth chasing in world of pro audio and computer audiophile. I don't see why it's wrong to use scientific pro audio terms that audiophiles can make some sense with. And sonic degradation suffered from lower latency is real thing because random jitter added in latency will be wider. But you have to know how latency jitter can cause problems in quantization. It's pretty deep and easiest way is just try it and decide if you want to keep it or not. I've been in this circle numerous times already in computer audiophile.

I hope to hear your test report soon as I'm also looking forward to see how it'll work in your case too. Personally, I don't see anything wrong in here trying to have lower latency for audio playback regardless of getting better sound quality or not.

For what it's worth, I don't think anyone here has a problem with reducing the latency, rather with the claims that were made of possible audio improvements while reducing the latency.

I'm interested in what Bedalus can find though. While I am in no way a certified audio engineer, I have done more than a few installations of professional hardware (MOTU & M-Audio mostly) and worked with professional software (AVID) and fully understand the concept of reducing the latency in lag sensitive cases.
I do not however ever remember encountering an instance where the latency proved to cause deterioration of the sound quality using DACs.

Either way, as I said twice before, to each their own. If you can reduce the latency while keeping the overheard to a practical level (not having to use the performance governor) then I see nothing wrong with that. At worst, it'll improve the apparent responsiveness of the device.
The Following User Says Thank You to polobunny For This Useful Post: [ View ] Gift polobunny Ad-Free
Post Reply Subscribe to Thread

Tags
audiophile, head-fi, libaudio, mod, nexus s

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes