Bug 106365 - False positives with wobble detection
Summary: False positives with wobble detection
Status: RESOLVED FIXED
Alias: None
Product: Wayland
Classification: Unclassified
Component: libinput (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: Wayland bug list
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-05-02 22:36 UTC by Peter Hutterer
Modified: 2018-05-03 09:29 UTC (History)
3 users (show)

See Also:
i915 platform:
i915 features:


Attachments
evemu with master (doesn't trigger hysteresis) (181.68 KB, text/plain)
2018-05-03 08:03 UTC, Hi-Angel
Details
revert-9c3a597aa (in case anybody need it, as git-revert gets conflicts) (856 bytes, patch)
2018-05-03 08:09 UTC, Hi-Angel
Details | Splinter Review

Description Peter Hutterer 2018-05-02 22:36:25 UTC
New bug for the wobble detection, hoping to short-cut Nate and Konstantin. Since I don't have a wobbly touchpad anywhere near me, it's a bit frustrating to try something only to have the other side tell me it doesn't work. So now you both are in the same arena and can fight it out :)

So, current status is: 795657a0 (i.e. the original implementation) has false positives. 30a398591ba2 (git master of today) has false negatives. We need to find a middle ground.

Konstantin: reminder that git master auto-enables hysteresis when a fuzz is set, so you always need to comment out this line in tp_init_hysteresis():
      tp->hysteresis.enabled = (ax->fuzz || ay->fuzz);


K mentioned in a private email that 9c3a597aa "touchpad: reset the wobble detection for non-pointer events" is the culprit, please attach an evemu recording of a wobbly sequence that didn't trigger this.
Comment 1 Hi-Angel 2018-05-03 08:03:46 UTC
Created attachment 139294 [details]
evemu with master (doesn't trigger hysteresis)

I did the evemu-record by commenting out the "fuzz-enabling-line", then trying to select a text. Hysteresis haven't been enabled.

I think however, the solution to this have already been indirectly mentioned by Peter on ML — it's to revert the 9c3a597aa "reset the wobble detection for non-pointer events", then to use the last movement time, as opposed to any event.
Comment 2 Hi-Angel 2018-05-03 08:09:02 UTC
Created attachment 139296 [details] [review]
revert-9c3a597aa (in case anybody need it, as git-revert gets conflicts)
Comment 3 Peter Hutterer 2018-05-03 08:52:06 UTC
embarassing... issue is that I had the logic inverted (from an earlier version). This one makes it work:


diff --git a/src/evdev-mt-touchpad.c b/src/evdev-mt-touchpad.c
index 6560ac3e..ce694c28 100644
--- a/src/evdev-mt-touchpad.c
+++ b/src/evdev-mt-touchpad.c
@@ -155,8 +155,8 @@ tp_detect_wobbling(struct tp_dispatch *tp,
        int dx, dy;
        uint64_t dtime;

-       if (tp->nfingers_down == 1 &&
-           tp->nfingers_down == tp->old_nfingers_down)
+       if (tp->nfingers_down != 1 ||
+           tp->nfingers_down != tp->old_nfingers_down)
                return;

        if (tp->hysteresis.enabled)
Comment 4 Hi-Angel 2018-05-03 08:54:33 UTC
(In reply to Peter Hutterer from comment #3)
> embarassing... issue is that I had the logic inverted (from an earlier
> version). This one makes it work:
> 
> 
> diff --git a/src/evdev-mt-touchpad.c b/src/evdev-mt-touchpad.c
> index 6560ac3e..ce694c28 100644
> --- a/src/evdev-mt-touchpad.c
> +++ b/src/evdev-mt-touchpad.c
> @@ -155,8 +155,8 @@ tp_detect_wobbling(struct tp_dispatch *tp,
>         int dx, dy;
>         uint64_t dtime;
> 
> -       if (tp->nfingers_down == 1 &&
> -           tp->nfingers_down == tp->old_nfingers_down)
> +       if (tp->nfingers_down != 1 ||
> +           tp->nfingers_down != tp->old_nfingers_down)
>                 return;
> 
>         if (tp->hysteresis.enabled)

Don't be sad! Thank you, works for me.
Comment 5 Peter Hutterer 2018-05-03 09:29:43 UTC
commit 3d81f1179f007dd555ccf0f183a02494ce22d3a8
Author: Peter Hutterer <>
Date:   Thu May 3 19:14:14 2018 +1000

     touchpad: only try to detect touchpad wobbling with one finger down


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.