Bug 276709 - hms(4): two finger scroll stops half way unless dev.hms.0.drift_thresh=0
Summary: hms(4): two finger scroll stops half way unless dev.hms.0.drift_thresh=0
Status: New
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: 15.0-CURRENT
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-01-29 12:57 UTC by Edward Tomasz Napierala
Modified: 2024-11-16 19:42 UTC (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Edward Tomasz Napierala freebsd_committer freebsd_triage 2024-01-29 12:57:19 UTC
When two-finger scrolling through a web page in a Firefox, the scroll stops at random moments, requiring fingers to be lifted from the touchpad before it can continue.  This can be fixed by setting the (undocumented) sysctl dev.hms.0.drift_thresh to 0.
Comment 1 Vladimir Kondratyev freebsd_committer freebsd_triage 2024-02-09 19:01:18 UTC
Could you try to increase sysctl dev.hms.0.drift_thresh rather than set it to 0?
Comment 2 Edward Tomasz Napierala freebsd_committer freebsd_triage 2024-02-12 16:05:18 UTC
It is better with it set to eg 10, but it still occasionally gets stuck.

I wonder... From what I understand it tries to detect and filter out repeating inputs.  What if the problem happens because, differently from cursor movement which is kind of random:

 event6   POINTER_MOTION          +0.536s	  7.86/  5.24 ( +6.00/ +4.00)
 event6   POINTER_MOTION          +0.546s	  7.76/  1.29 ( +6.00/ +1.00)
 event6   POINTER_MOTION          +0.556s	  4.49/  1.12 ( +4.00/ +1.00)
 event6   POINTER_MOTION          +0.566s	  2.00/  0.00 ( +2.00/ +0.00)
 event6   POINTER_MOTION          +0.576s	  3.00/ -2.00 ( +3.00/ -2.00)
 event6   POINTER_MOTION          +0.586s	  2.00/ -3.00 ( +2.00/ -3.00)
 event6   POINTER_MOTION          +0.596s	  2.03/ -4.05 ( +2.00/ -4.00)
 event6   POINTER_MOTION          +0.606s	  0.00/ -6.82 ( +0.00/ -6.00)
 event6   POINTER_MOTION          +0.616s	  0.00/ -7.32 ( +0.00/ -6.00)
 event6   POINTER_MOTION          +0.626s	 -5.32/ -9.31 ( -4.00/ -7.00)
 event6   POINTER_MOTION          +0.636s	 -7.37/-10.32 ( -5.00/ -7.00)
 event6   POINTER_MOTION          +0.646s	 -2.48/ -3.72 ( -2.00/ -3.00)
 event6   POINTER_MOTION          +0.656s	 -3.01/ -3.01 ( -3.00/ -3.00)
 event6   POINTER_MOTION          +0.666s	 -3.01/ -1.00 ( -3.00/ -1.00)
 event6   POINTER_MOTION          +0.676s	 -2.00/  0.00 ( -2.00/ +0.00)
 event6   POINTER_MOTION          +0.686s	 -1.00/  0.00 ( -1.00/ +0.00)
 event6   POINTER_MOTION          +0.696s	 -2.00/  0.00 ( -2.00/ +0.00)

The scroll events in all direction look mostly the same:

 event6   POINTER_SCROLL_WHEEL    +0.784s	vert 15.00/120.0* horiz 0.00/0.0 (wheel)
 event6   POINTER_SCROLL_WHEEL    +0.814s	vert 15.00/120.0* horiz 0.00/0.0 (wheel)
 event6   POINTER_SCROLL_WHEEL    +1.164s	vert 15.00/120.0* horiz 0.00/0.0 (wheel)
 event6   POINTER_SCROLL_WHEEL    +1.184s	vert 15.00/120.0* horiz 0.00/0.0 (wheel)
 event6   POINTER_SCROLL_WHEEL    +1.204s	vert 15.00/120.0* horiz 0.00/0.0 (wheel)
 event6   POINTER_SCROLL_WHEEL    +1.234s	vert 15.00/120.0* horiz 0.00/0.0 (wheel)
 event6   POINTER_SCROLL_WHEEL    +1.544s	vert 15.00/120.0* horiz 0.00/0.0 (wheel)
 event6   POINTER_SCROLL_WHEEL    +1.564s	vert 15.00/120.0* horiz 0.00/0.0 (wheel)
 event6   POINTER_SCROLL_WHEEL    +1.584s	vert 15.00/120.0* horiz 0.00/0.0 (wheel)

So perhaps the threshold logic is mistaking them for duplicates?
Comment 3 Edward Tomasz Napierala freebsd_committer freebsd_triage 2024-11-16 19:42:07 UTC
Here's a prototype patch: https://reviews.freebsd.org/D47640.  I still need some advice on how to proceed: whether that's the right approach, and how to figure out which of the report variables is the wheel.