2009-03-04 21:56:16

by Arjan Opmeer

[permalink] [raw]
Subject: How to handle Elantech touchpad that occasionally sends bogus coordinates?


Recently a user complained that when using the Elantech driver the mouse
pointer would occasionally jump some distance away, or that when scrolling
the scrolled page would suddenly jump back a bit.

It turns out that when starting a new touch action on this particular model
the touchpad does not reliably emit the new coordinates but can repeat one
or two of the coordinates of the last release point. This misreporting can
last several motion packets depending on the number of fingers that are
touching.

We came up with a workaround that basically discards mouse packets as long
as the number of fingers is increasing. Like so:


if (fingers > old_fingers) {
discard packet
}

With this fix in place the user no longer suffers from the jumpy mouse
cursor or the jumpy scrolling. He reports no impact on the responsiveness of
the touchpad.

My question now is whether this is the right approach to fix this issue? Is
such a workaround acceptable and should it live in the kernel? Can or should
this problem be better solved in the Xorg Synaptics driver?

Comments please! :)


Arjan


2009-03-05 06:32:21

by Dmitry Torokhov

[permalink] [raw]
Subject: Re: How to handle Elantech touchpad that occasionally sends bogus coordinates?

Hi Arjan,

On Wed, Mar 04, 2009 at 10:55:56PM +0100, Arjan Opmeer wrote:
>
> Recently a user complained that when using the Elantech driver the mouse
> pointer would occasionally jump some distance away, or that when scrolling
> the scrolled page would suddenly jump back a bit.
>
> It turns out that when starting a new touch action on this particular model
> the touchpad does not reliably emit the new coordinates but can repeat one
> or two of the coordinates of the last release point. This misreporting can
> last several motion packets depending on the number of fingers that are
> touching.
>
> We came up with a workaround that basically discards mouse packets as long
> as the number of fingers is increasing. Like so:
>
>
> if (fingers > old_fingers) {
> discard packet
> }
>
> With this fix in place the user no longer suffers from the jumpy mouse
> cursor or the jumpy scrolling. He reports no impact on the responsiveness of
> the touchpad.
>
> My question now is whether this is the right approach to fix this issue? Is
> such a workaround acceptable and should it live in the kernel? Can or should
> this problem be better solved in the Xorg Synaptics driver?
>

This is purely hardware problem and I believe it should be fixed in the
kernel; userspace should not be aware that device may emit wrong
coordinates.

Thanks!

--
Dmitry