Touchscreen input jitter

Nuutti Kotivuori naked at iki.fi
Mon Aug 6 16:25:32 CEST 2007


Michael Lauer wrote:
> This is a software problem which needs to be fixed. It would be worth
> playing with the oversampling shift and the reporting frequency. It
> also might be wise to look at the tslib dejitter plugin which is
> _supposed_ to cure that, but for some reason it doesn't.
>
> It's on my todo list, but I wouldn't be sad if someone beats me to it
> ;)

I took a look at it.

I used the handy utility "ts_test" - and modified
/usr/share/tslib/ts-2.6.conf to change settings. Modifications to that
file seemed to make a difference.

That file basically contains:

module_raw input grab_events=1                                      
module pthres pmin=1
module variance delta=30
module dejitter delta=100
module linear             

Pthres module seems to be working just fine. Also the variance module
(which is supposed to suppress random errors (not jitter) seems to be
working really great with the included settings. There were no random
data points anywhere.

But the dejitter module isn't doing a very good job. The parameter,
delta, affects only how fast of a movement triggers clearing of the
dejitter history - but that isn't being triggered here so the
parameter cannot be used to tune anything. All the other stuff is
hardcoded into the dejitter module.

Disabling dejitter shows a lot more jitter on the screen, so it does
smooth the jitter out, but not nearly enough.

However, I first wanted to see how the raw data coming from the
touchscreen behaves. I ran "ts_test" and let the pen lie on the
surface at a certain spot. There should be no errors in the results
because of pen movement.

Here is the XY-plot of the data points:

http://www.naked.iki.fi/graph-xy.png

All the data points are nicely in a bunch, so there are no errors
there. The X-data looks rather good - separation of only 4
pixels. Then again the Y-data doesn't look so good - separation of
20-25 pixels!

Let's look at the X-data distribution first:

http://www.naked.iki.fi/graph-x.png

This is indeed looking good - around 80% of the data appears on a
single pixel. A decent dejitterer should be able to cancel this out
completely, or in the worst case, one pixel movement.

Then the Y-data distribution:

http://www.naked.iki.fi/graph-y.png

Now this doesn't look too good. Only less than 25% of the data points
are on a single pixel. This looks like it is going to be hard to
cancel with just simple dejittering - it would need quite a big
history buffer to get enough samples to decide on the correct
pixel. And even then, stabilizing on the pixel is going to take a bit.

So, based on this observation - I don't think jitter reduction on the
tslib level is going to be able to cure the Y-axis jitter.

I will need to toy around with the oversampling shift and reporting
frequency to see if I can improve the data coming from the touchscreen
enough that it is feasible to remove jitter on the tslib level.

Hope this helps,
-- Naked





More information about the device-owners mailing list