[Trying to fix] Display input lag

UltimateByte

Senior Member
Dec 6, 2010
139
56
0
terageek.org
Request to fix Input Lag on Note II

Hi everyone :D
I just made a video so everyone sees what input lag is, and to have an accurate estimation of how much this is on the Note 2.
http://www.youtube.com/watch?v=_MyfkypkNWk&feature=youtu.be
Update 2013/09/23 : Please also have a look at it (pro measurements of input lag comparing samsung to apple devices) : http://appglimpse.com/blog/touchmarks-i-smart-phone-touch-screen-latencies/
Update 2013/10/08 : A test of 21 smartphones' input lag, very interesting
http://www.digitalversus.com/mobile...st-results-21-smartphones-tablets-n29229.html

HUGE NEWS
This is not input lag, it's mainly display lag ! I'll edit the entire post when i got some time.
How do i know that ?
Because if you activate the touch vibration (for the keyboard) and haptic feedback, you feel like the vibration is in sync with your touches (so less than 50ms for sure, maybe less than 20 or 10ms, i will be able to measure it very precisely with a microphone when i got some time); on the other hand, the display is still 90 to 130ms late... So 2 solutions : laggy video software, or laggy screen/digital analog conversion. Maybe something to do with Pentile ? As SGS 1 and 2 were not Pentile, and way way faster than SGS 2 and 3. I don't know if it's fixable, as android seems to be already unbufferized and as fast as it can. By the way, just spam Samsung about it so they fix it at least for their new phones (unlike SGS4 and Note 3)

Introduction for input lag newbies


If you don't know what display lag is, please read this
http://en.wikipedia.org/wiki/Display_lag
It's about the same as input lag, except it counts your human interface device's response delay
http://en.wikipedia.org/wiki/Input_lag



Just to let you know, Input lag concerns every phone, every input device, because nothing in the electronic world is instantaneous.
.

Some of you may have noticed that all the recent phones released have a non negligeable amount of input lag, even more than the previous generations that were already bad. If you didn't, no problem, you will be able to see it thanks to this topic, and i hope, understand why this is very very important to get rid of the maximum amount of input lag.

The Note 2 and Galaxy S 3 have about 100-170ms input lag wich makes many of you feel the response to your fingers' moves feeling late, slow, smoothed, and unnatural. It's painful to say that, but iphones does better, and for example, when a very good player of Ruzzle i know tried to play on my phone after playing every day on her iphone, that was a huge issue for her, and she decided to stop playing on my phone just because it was too slow for her, she was 2 times faster than the phone's reponsiveness. Yes, when you move fast, 100ms is a lot. Even while typing, unconciously, you're not typing as fast if lettering appears lately, almost if you activated "vibrating on touch" that is late too. I've noticed that i'm a bit faster typing with vibration off because of that.

Just to say it can bother anyone, almost if you have used a more responsive device even once only.
My hope is that we can find a fix to improve responsiveness, in case if it's not only a hardware issue, but also a big part of software. We are pretty sure that the capacitive touchscreen detection (+ refresh rate of the screen which is inevitable) is responsible for at least 80-100ms of this input lag.




The main target of this topic is to call amazing devs here to help trying to make the Note 2 experience even better. All input lag haters here would be really really grateful if anything was done to get rid of at least some of it, and other people would be amazed to see their phones being fast as light.


Never heard about input lag ?​

That's normal, there's a pretty bad communication about it, even if it gets better (see links in beginning of the topic). Gamers are mostly concerned about it with computers, but this is happening on any electronic device.

It's the delay between the input and the output of a device.
It's not about being "laggy" or "choppy", as input lag newbies confuse very often : it's about being late !
It's just a hardware and software treatment, due to several things, as any component introduces input lag (even if it's very small). CPU latency (a few nanoseconds) is negligible. A CPU can't cause latency itself. Refresh rate of the screen (the time to display a new frame), screen input lag (time to analyse images and to send it to the screen) touchscreen analysis (the capacitive detection of your fingers), can result in a delayed experience.The consequence is that when you make a move, the action will follow your move with a little delay. That's what you'll see when looking for it.

But if it's not annoying for everyone, anybody could feel the improvement in responsiveness between a big input lag and a low input lag. It just feels better, even if people can't explain it. It's the same difference for most people between SD and HD, or between a bad MP3 and a good FLAC, or a bad headphone and a good headphone : It's better, but most people doesn't have the ability to explain why.

As electronic and the clocking technique involves input lag, the target is just to make it the lowest possible using good hardware, and avoiding any kind of buffering or averaging that causes delay.

Microsoft made a video about that. They estimate that today, most devices has a around 100ms input lag, and that we would need 1ms input lag to make it feel real, to give you the feeling that you're actualy drawing on your screen, or movig an real object. In practice, as most screens are running at 60fps, 1/60 = 16ms, we could get under 20ms if touchscreen input lag was less than 2ms, with no frame buffering, no averaging on the finger's position while touching the screen, and no screen latency. Of course, it would get to 8ms with 120hz mobile phone screens, but i guess it's a bit too much for now.

Everyone having any doubt about how input lag matters, or wanting to see it in action should watch this video from Microsoft
http://youtu.be/vOvQCPLkPt4 or just simply watch mine (link at the beginning of the topic).

We mostly use to care about input lag :
- On TV or PC Monitors (but it's often heavier on TVs) because of digital/analog conversions, and non real time picture quality improvements. The standard of a TV is between 20 to 300ms (depending on the settings and hardware), some gets lower. Unlike people could think, it doesn't depend of the size of the screen, as electrons are fast enough so you can't notice their latency. The standard of a PC monitor is between 0 to 50ms for the worst ones.
- On keyboard and mices : Most recent mices offers a 1000Hz (1ms) refresh rate, but the normal value is 125Hz (8ms), some keyboards are running at 1000hz too.
- Software delays : Vsync for example, has been created to remove the tearing effect, but it adds delay to sync frames rendering, and screen refresh rate. We can also see "frame buffering" that consist in generating a few frames before displaying it so the overall framerate smoother (less fluctuation), but it adds delay too (we call that input lag too). Frame buffering is usually used to compensate a badly coded game/application.
- For example, in the audio and video recording and broadcasting, converters, buffers, clocks, must be as fast as possible.

The fact is that most people are used to input lag, and think this is the normal response of a device. You just have to watch reviews of recent phones to see that almost nobody talks about it. I'll tell you something : a 1/10s input lag is not a response time you should expect. You should expect a 1/1000s input lag according to Microsoft in the video i just posted, or at least for now, 1/30 to 1/60s. The lower the input lag is, even if you can't quantize it conciously, the most natural it will feel, the most accurate you will be, the fastest you will be, and finally, the more enjoyable will your experience be.


A little comparison, as i'm a sound engineer : As you may know, what you see dominates what you hear. Well, in the music production's world, when you hear the return of your instrument or voice in your headphones while recording it, it HAS to be under a 10ms delay, and you prefer it under 4ms, or if possible, in some systems, you can get it even closer to 0 (about 0,1ms). => The target is always to make it the lowest possible so the feeling or the feedback becomes more natural. So OK, you could record a guitar or drum part while hearing yourself 20ms late, you would just be 20ms less accurate, which is a lot and slightly audible.



The actual input lag on the Note II and SIII​

First of all, how can you see this input lag yourself ?
=> See video in introduction !

You can also
Go to System Settings, Developer Options, and tick "Show touches" (show visual feedback for touches).

=> It will show a dot representing the position of your finger, as the phone senses it.

Now if you make a slow move, the dot will stay under your finger, but if you move faster (for example try to make circles), you will notice that the dot follows actualy follows your finger.

Also see video here http://gigaom.com/2012/01/19/video-android-touch-lag-and-a-possible-solution/


This is what i've tested myself :

- Galaxy S1
- Galaxy S2
- Galaxy S3
- Galaxy Note 2
- Iphone 5

What i can say is the S1 and S2 have about the same input lag, and the S3 and Note 2 have the same at least twice bigger input lag.
Yeah, that's right : the new gen, supposed to be an upgrade, is for sure more powerful, is more expensive but has a lot more input lag. Quite frustrating isn't it ?
In the same time, the iphone 5 is way faster, more like the SGS1 and 2, something around 50ms.

We estimate that the input lag between 100 and 170ms, depending on the situation, and including all sources of input lag (vsync, frames buffering, screen refresh rate, and capacitive detection)

This is 1/10s to 1/6s ! It's just unsuitable for gaming, and comfort.




What To fix & Possible ways to do so

Biggest input lag source : The Capacitive Detection

In the Input Lag thread, Chrissssssss made a test : He plugged a mouse to his phone, and made a reaction test. His result was about 80 to 100ms less while using the mouse than while using the touchscreen
=> We can conclude that the capacitive detection of the touchscreen touchscreen takes already at least 80ms.

KurianOfBorg just said :
I believe on the SGS2 and Note the OS actually uploads the touchscreen firmware to the Amtel controller. These blobs could be hacked in someway to reduced the number of samples (usually 4) per report.

Even Samsung cannot do it. In some other thread the Samsung engineers told someone that even they simply receive just the firmware blobs for the touchscreen from Amtel. The only thing that has been achieved so far on the touchscreen device is changing the Vitalij value via sysfs on the SGS2. You can look through /sys/bus/i2c/devices/3-004a/ or /sys/devices/platform/s3c2440-i2c.3/i2c-3/3-004a/ if they exist on your device.
Maybe a way to tweak ?

We use to see this tweak in ROMs : Disable Scrolling cache. It seems to improve a bit the response time already, but not enough for a real time feeling.
http://forum.xda-developers.com/showthread.php?t=2003062

Here is some work made on the I9003
http://forum.xda-developers.com/showthread.php?t=1587553




About myself / why would you trust me ?

I'm a drummer, gamer, and sound engineer student. As a gamer, i always tried to have low input lag input and display devices. I got a BenQ XL2420T and Steelseries Sensei Mice : Theorical input lag measured by several tests between 1 to 17ms (excluding refresh rate that is 8ms @120hz and with vsync OFF). So i'm used to input lag close to 0, and i know how a responsive device must feel. I've also measured several input lag delays of screen and mices, so i'm now able to estimate input lag between 1 ans 100ms quite accurately (never had to measure more so it's hard to guess how more it is, you just know if it's over 100ms or not).
As a drummer, and a sound engineer, i'm very sensitive to precision and i can notice any little thing that is not synced.




Finally, I don't know if it's fully fixable, or how much it can be improved, i hope it can get under 50ms by combining display tweak (disable vsync, frame buffering) and input tweak (tweaking the tacile driver so it is direct input, very low buffer, and high refresh rate).

I'll say thank you in advance to anyone trying to improve reponse time.


Please let me know if there's anything to correct in my main post. :)


See also
http://forum.xda-developers.com/showthread.php?t=2120867
http://hardforum.com/showthread.php?t=1730089 (nice example of input lag denial from newbies)
 
Last edited:

UltimateByte

Senior Member
Dec 6, 2010
139
56
0
terageek.org

TROLL SPOTTED
And giving a stupid personal judgement without any explaination is very usefull ?
I don't see the point : How could any improvement be useless ? Especially if some of us find this issue very unpleasant, and if it's directly about what you feel (consciously or not) when you're using your smartphone...

The fact is as you can't even write correctly, i guess you can't even use your fingers and eyes properly to enjoy a latency free device.
 
Last edited:

bushako

Senior Member
Mar 16, 2007
1,359
327
0
Dubai
I do notice this input lag more often on a stock based roms then aosp/cm10.1. Ive tried the "show touches" options on both the roms and noticed that the input lag on the aosp rom is significantly less than that present on the stock. As for, whether this is a feature or intended to improve visual quality, i dont know but i do hope its not. This is an issue that does bother me alot and the only reason why i keep going back to custom stock roms is due to the poor batterylife present on the cm10.1 roms, other than that i was quite happy with aosp/cm10.1.
Hopefully, more people will get aware of this issue, enough for Sammy/XDA Developers to try and tackle it. Good Thread:good:
 

mariosraptor

Senior Member
Nov 21, 2006
2,330
681
0
Corfu
Re: [Dev request] Fix touchscreen input lag

I like your investigation but I think it is hardware issue. As MS engineer says "in the next decade".

Sent from my GT-N7100 using xda premium
 

UltimateByte

Senior Member
Dec 6, 2010
139
56
0
terageek.org
Hopefully, more people will get aware of this issue, enough for Sammy/XDA Developers to try and tackle it. Good Thread:good:
Thanks, nice to show how this is bothering you too :highfive:
And yes, even if we don't find a solution, at least poeple will be more aware of this global issue and the lack of efforts from Samsung about it. I'm sad to say that, but Apple is the only one that seems to take care of that, with a really lower input lag. I tried one more iphone 5 this morning, it must be around 50ms input lag, still not perfect, but much better already.

I like your investigation but I think it is hardware issue. As MS engineer says "in the next decade".
Sent from my GT-N7100 using xda premium
Thank you too.
As the SGS2 and even the SGS1 has lower input lag, this just makes no sense, it's supposed to get down and it's getting up ? :confused:
There is almost always a hardware part and a software part in input lag. I know the touchscreen implies at least 80ms, but in those, how much are software due to buffers, or error corrections, or whatever it is ? I hope we can at least get rid of a big part of the software one, and i hope it's the biggest one... :angel: If the hardware is 80% of it, then i'll just wait for any other nice android phone without this bad spec, and change the Note 2, but at least, poeple will know about it, and stop thinking that this latency is a smoothing and is normal... This is latency, and it really sucks !

Smoothing would be a bad thing with touchscreens anyway (and i think it's a bad thing on any input device as well) as you should feel what you're doing, not something different, or your senses are just going mad, and it's the same for a delay. But yeah, just in case if anyone has a doubt : this is not a gentle smoothing, this is just a nasty input lag.



Edited the main topic with a comparison to music production's world.
 
Last edited:
  • Like
Reactions: Diamantes

mariosraptor

Senior Member
Nov 21, 2006
2,330
681
0
Corfu
Re: [Dev request] Fix touchscreen input lag

http://www.overclock.net/t/1351079/guru3d-galaxy-s-iv-confirms-exynos-5-octa-cpu/140

http://gamesfromwithin.com/lag-the-bane-of-touch-screens
Found this seems good.

This is only one page.
But as I said hardwre issue more than software. Yes optimizing software to 110% seems reasonable but because not to many seems bothered by this, then no jardware manufacturer will try to make hardware to have lower input latency.
If we press them and this becomes a common issue among android (and other touch devices users) then some light might show up at the end of the tunnel.
Anyway, good luck and I hope that some more knowledgeable then me responses.
Cheers

Sent from my GT-N7100 using xda premium
 
Last edited:

Kiwito22

Senior Member
Jul 19, 2012
67
22
0
London
Yes, we do understand that all touchscreens have huge input lag... the thing is, the note ii's input lag is way higher than older gen devices.

For example Subway surfers is way more responsive on my Optimus 3D than on the Note II. If you have an older phone to compare, you can easylly see the difference. I dont care much about input lag, smoothing or whatever in UI, browsers and stuff like that. but in games, its very noticible and very annoying. It almost makes me want to throw my phone against a wall.

I prefer tearing, thats why i have vsync off and minimal frame prerendering.... on my PC almost all the time.
 
  • Like
Reactions: UltimateByte

UltimateByte

Senior Member
Dec 6, 2010
139
56
0
terageek.org
http://www.overclock.net/t/1351079/guru3d-galaxy-s-iv-confirms-exynos-5-octa-cpu/140

http://gamesfromwithin.com/lag-the-bane-of-touch-screens
Found this seems good.

This is only one page.
But as I said hardwre issue more than software. Yes optimizing software to 110% seems reasonable but because not to many seems bothered by this, then no jardware manufacturer will try to make hardware to have lower input latency.
If we press them and this becomes a common issue among android (and other touch devices users) then some light might show up at the end of the tunnel.
Anyway, good luck and I hope that some more knowledgeable then me responses.
Cheers

Sent from my GT-N7100 using xda premium
Looks nice, thanks, i'll read it entierely when i got more time, for now i really need to sleep and have a big day waiting for me tomorrow.
From what i've already read, i just can say that my hope is a tweak in the touchscreen driver... There must have a way to override stupid values.

Yes, we do understand that all touchscreens have huge input lag... the thing is, the note ii's input lag is way higher than older gen devices.

For example Subway surfers is way more responsive on my Optimus 3D than on the Note II. If you have an older phone to compare, you can easylly see the difference. I dont care much about input lag, smoothing or whatever in UI, browsers and stuff like that. but in games, its very noticible and very annoying. It almost makes me want to throw my phone against a wall.

I prefer tearing, thats why i have vsync off and minimal frame prerendering.... on my PC almost all the time.
OMG, i thought it was a quote from me, i've written the exact same idea somewhere on the web ! Totally agree, about everything.
 

vRbas_r

Member
Dec 20, 2012
43
20
0
Good Thread:good:

I like your investigation and i dont think the hardware is the issue here at all look at the older sgs2 and iphone both of them have lower input lag
 
  • Like
Reactions: UltimateByte

doclucas

Senior Member
Jan 10, 2009
237
72
48
Great thread!!
This is the thing I hate the most about my Android phones (I had all the flagships - GS1, GS2, GN1, GS3 and now GN2).
My iPhone 4s and iPad 3 have significantly lower input lag (and much better/smoother scrolling, but that's another issue), but they also do have completely different hardware than the Galaxy line.
The thing is, that on CM Roms I also get lower input lags, so this must be fixable or at least significantly improved via software...
 

xartic12

Senior Member
Aug 21, 2012
265
41
0
Re: [Dev request] Fix touchscreen input lag

Since these Gnote II uses a Wacom touchscreen, could there be a possibility that the screen is trying to detect the spen momentarily?
 

D3_

Senior Member
Mar 9, 2010
1,262
419
0
London
Re: [Dev request] Fix touchscreen input lag

Since these Gnote II uses a Wacom touchscreen, could there be a possibility that the screen is trying to detect the spen momentarily?
But the way the s-pen is detected for touches etc is completely different to the way you touching the screen with your finger is. That's why air view works, and you can hold your s-pen above the screen, use something to push the nib in, and the phone will register q touch without even touching the screen, so I highly doubt that's the cause of any input lag.

Sent from my GT-N7100 using xda premium
 

lolmensch

Senior Member
Jul 14, 2009
1,375
304
0
FarFarAway
Did anybody try and compare whether there is any difference regarding the input lag on the touch screen with your finger and the wacom digitizer with the stylus?

The only solution I could think of is reverse engineering of the touchscreen driver and that is such an ungrateful huge work for such a small interested userbase that I'd say it is not going to happen. Unless there is a developer with immense skill and way too much(!) time around :D
 

UltimateByte

Senior Member
Dec 6, 2010
139
56
0
terageek.org
I've just watched the S4 presentation > in the intro video > Exact same input lag. Then i wateched "hands on SGS4" videos > same input lag.
What a waste, I hate them.


=> I read it, it's interesting but gaming lag of a console isn't the same.
Anyway, that's not normal that input lag increased... Maybe touchscreens got more expensive, but physical digital controllers got cheaper.
 
Last edited:

sandulea

Senior Member
Jan 16, 2011
141
36
0
Bucharest
I think software is where the problem lies. I tried an iphone 4 or 4s, couldn't tell which, and it was way more responsive, and the technology is the same as in Android phones. It can't be that big a hardware issue because it would be too easy to solve, just replacing a component, and in a race to sell millions of phones surely Apple couldn't be the only company that afforts an extra dollar or so per unit to purchase a more expensive, but better component. Plus we've all seen articles and teardowns showing that Apple uses plenty of regular components that are found in other phones as well, so there's definitely no magic there. Also, the trackpads in laptops seem to be based on capacitive technology as well, yet the input lag is a lot smaller than it is on the Note 2.

My guess is that there is noise filtering, to eliminate false touches, as well as smoothing and approximation, and the programmers are also generous with the input lag to ensure a smooth approximation. The smoothing, more specifically, is what must be the most lag-inducing feature. It's most obvious when we draw something quickly on the Note 2 with a finger (and even with the pen): small detail gets lost, but all the curves are smooth, and that's because the sampling rate for the finger position is low, and it interpolates points between the sampled positions to ensure a smooth animation. Since it can't approximate all the points between two sampled positions until you actually reach the second position, and it must also run the animation through all these approximated points at the same speed that you moved your finger, that means that a list doesn't start scrolling until the screen has captured at least 2 samples of finger movement, so the animation will always be at least 1 sample behind your finger's actual movement. How many samples is unknown, but the sampling rate can be found out, and together with an accurate measurement of the lag it would be possible to find out how many touch samples it needs before it starts actually performing an animation.

So the obvious solution would be to increase the touch sampling rate, so that animations start faster, and tone down the smoothing because it would be less useful and to compensate for the computing power used by the increased sampling rate (it's not enough to prevent the power usage from rising, that's my guess, and maybe that's why iphones don't last as much as droids with comparable specs in the battery department).

For what it's worth, I'm an amateur sound engineer, bass player with an ear and a passion for drums, so I really know how you feel about input lag OP!
 
  • Like
Reactions: Androssama
Our Apps
Get our official app!
The best way to access XDA on your phone
Nav Gestures
Add swipe gestures to any Android
One Handed Mode
Eases uses one hand with your phone