Bug 104788

Summary: Touchpad hysteresis doesn't work
Product: Wayland Reporter: Hi-Angel <Hi-Angel>
Component: libinputAssignee: Wayland bug list <wayland-bugs>
Status: RESOLVED DUPLICATE QA Contact:
Severity: normal    
Priority: medium CC: peter.hutterer
Version: unspecified   
Hardware: x86-64 (AMD64)   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:
Bug Depends on: 98839    
Bug Blocks:    
Attachments: selecting a text
libinput debug-events --verbose > 1

Description Hi-Angel 2018-01-25 14:02:44 UTC
Created attachment 136960 [details]
selecting a text

Today I learned libinput have "touchpad hysteresis" to prevent pointer wobbling. Unfortunately I don't remember it ever working for me. Selecting a text or clicking small icons is very hard because the pointer restlessly wobbles.

The evemu-record is done for trying to select a text. I tried to focus a margin between letters, then double-tapped to start selection, then moved the finger to select a text span, then again tried to focus a margin between letters.

laptop: SAMSUNG NP305V5A
touchpad: x=103mm, y=53mm. (I'm traveling, measures are done with a checkered notebook)
libinput versions tested: 1.9.1 (git), 1.9.901.r0.g0ac4a148 (git)

	$ udevadm info /dev/input/event11
	P: /devices/platform/i8042/serio1/input/input9/event11
	N: input/event11
	S: input/by-path/platform-i8042-serio-1-event-mouse
	E: DEVLINKS=/dev/input/by-path/platform-i8042-serio-1-event-mouse
	E: DEVNAME=/dev/input/event11
	E: DEVPATH=/devices/platform/i8042/serio1/input/input9/event11
	E: ID_BUS=i8042
	E: ID_INPUT=1
	E: ID_INPUT_HEIGHT_MM=48
	E: ID_INPUT_TOUCHPAD=1
	E: ID_INPUT_TOUCHPAD_INTEGRATION=internal
	E: ID_INPUT_WIDTH_MM=94
	E: ID_PATH=platform-i8042-serio-1
	E: ID_PATH_TAG=platform-i8042-serio-1
	E: ID_SERIAL=noserial
	E: LIBINPUT_DEVICE_GROUP=11/2/7:isa0060/serio1
	E: LIBINPUT_MODEL_JUMPING_SEMI_MT=1
	E: LIBINPUT_MODEL_SYNAPTICS_SERIAL_TOUCHPAD=1
	E: MAJOR=13
	E: MINOR=75
	E: SUBSYSTEM=input
	E: USEC_INITIALIZED=19413965
	$ cat /sys/class/dmi/id/modalias
	dmi:bvnAmericanMegatrendsInc.:bvr07PW.ME06.20120112.SKK:bd01/12/2012:svnSAMSUNGELECTRONICSCO.,LTD.:pn305V4A/305V5A/3415VA:pvr07PW:rvnSAMSUNGELECTRONICSCO.,LTD.:rn305V4A/305V4A:rvr07PW:cvnSAMSUNGELECTRONICSCO.,LTD.:ct9:cvrN/A:
Comment 1 Hi-Angel 2018-01-26 07:03:00 UTC
Weird, it seems to have worked for a minute-two, just after I just started the system. I could select the text without wobbling. But then cursor started wobbling again.
Comment 2 Peter Hutterer 2018-02-01 04:53:50 UTC
libinput looks at the touchpad motion and if the finger is down for some time without motion events (i.e. without wobbles) the motion hysteresis is disabled. See bug 98839.

This would explain why it works after login and then starts wobbling later - likely after the hysteresis was disabled. Once disabled, it stays disabled until you log out/restart.

You can easily verify this with sudo libinput debug-events --verbose, pipe it into a file and check for a hysteresis disabled message once it starts wobbling.

To debug this further though I'll need an evemu record that triggers this because the one you attached doesn't seem to disable the hysteresis.
Comment 3 Hi-Angel 2018-02-01 05:35:07 UTC
(In reply to Peter Hutterer from comment #2)
> libinput looks at the touchpad motion and if the finger is down for some
> time without motion events (i.e. without wobbles) the motion hysteresis is
> disabled. See bug 98839.
> 
> This would explain why it works after login and then starts wobbling later -
> likely after the hysteresis was disabled. Once disabled, it stays disabled
> until you log out/restart.
> 
> You can easily verify this with sudo libinput debug-events --verbose, pipe
> it into a file and check for a hysteresis disabled message once it starts
> wobbling.
> 
> To debug this further though I'll need an evemu record that triggers this
> because the one you attached doesn't seem to disable the hysteresis.

Thanks for your response. Any way to enable motion hysteresis in running system? I'm asking because it's a bit problematic to catch the moment it's is still working. For example when I installed latest git version for testing, I restarted sddm, and upon logging into system hysteresis have already been disabled. That's the reason I was surprised when the next day after reboot it was working for some time.

But if there's no way, of course I'll try to catch the moment manually.
Comment 4 Peter Hutterer 2018-02-01 05:48:01 UTC
No, there's no toggle short of adding code and recompiling, sorry. But it disables after 80ms of no movement with the finger on the touchpad, so the easiest way to get around the initial disabling is to just use the keyboard + a mouse to log in. Or start evemu from a vt, it doesn't care about the session anyway since it sits below everything.
Comment 5 Hi-Angel 2018-02-01 10:47:57 UTC
Created attachment 137110 [details]
libinput debug-events --verbose > 1

Gotcha!
Comment 6 Peter Hutterer 2018-02-06 01:39:47 UTC
doh. looks like this is the same as Bug 104828

 event7   POINTER_MOTION   +14.11s	  4.47/  0.00
 event7   POINTER_MOTION   +14.12s	  0.29/  0.00
 event7   POINTER_MOTION   +14.15s	  5.65/  0.00
 event7   POINTER_MOTION   +14.18s	  0.56/  0.00
 event7   POINTER_MOTION   +14.19s	  1.07/  0.00
event7  - hysteresis disabled
 event7   POINTER_MOTION   +14.29s	  0.00/ -0.93
 event7   POINTER_MOTION   +14.31s	  7.11/ -0.16
 event7   POINTER_MOTION   +14.35s	  0.00/  0.66


Judging by the timestamps you get regular jitter/wobble but then there's a pause of ~100ms, just above the timeout that causes libinput to disable the hysteresis on this device.

We need some smarter approach, i.e. something that analyses the motion for wobbles and then disables/enables it based on that.

*** This bug has been marked as a duplicate of bug 104828 ***

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.