Bug 106506

Summary: libinput 1.10 trackpoint speed limit is too low
Product: Wayland Reporter: Chow Loong Jin <hyperair>
Component: libinputAssignee: Wayland bug list <wayland-bugs>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: medium CC: peter.hutterer
Version: unspecified   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:
Attachments: Patch to bump TRACKPOINT_DEFAULT_MAX_DELTA to 120
Patch to use accelerated deltas for scrolling

Description Chow Loong Jin 2018-05-14 05:36:26 UTC
Trackpoint movement events are clamped to TRACKPOINT_DEFAULT_MAX_DELTA (60) with no configurable way of increasing it. This results in an intolerably slow top trackpoint movement speed, taking ~5 seconds to traverse my two screens horizontally (3840 + 1200px).

The trackpoint I'm using is the "Lite-On Technology Corp. Thinkpad USB Keyboard with TrackPoint", with usb-id: 17ef:6009.

I've recompiled libinput with TRACKPOINT_DEFAULT_MAX_DELTA=120 and am experiencing a much more favourable pointer speed now.

Here's the output of "libinput debug events" with my recompiled libinput:

 event22  POINTER_MOTION    +1.18s      120.00/ 37.72
 event22  POINTER_MOTION    +1.21s      120.00/ 54.28
 event22  POINTER_MOTION    +1.21s      120.00/ 64.40
 event22  POINTER_MOTION    +1.23s      120.00/ 66.24
 event22  POINTER_MOTION    +1.25s      120.00/ 82.80
 event22  POINTER_MOTION    +1.26s      120.00/ 64.40
 event22  POINTER_MOTION    +1.29s      120.00/ 58.88
 event22  POINTER_MOTION    +1.29s      120.00/ 47.84
 event22  POINTER_MOTION    +1.33s      120.00/ 26.68
 event22  POINTER_MOTION    +1.33s      120.00/ 23.92
 event22  POINTER_MOTION    +1.35s      120.00/ 17.48
 event22  POINTER_MOTION    +1.36s      120.00/ 15.64
 event22  POINTER_MOTION    +1.37s      120.00/ 12.88
 event22  POINTER_MOTION    +1.39s      120.00/  9.20
 event22  POINTER_MOTION    +1.41s      120.00/  5.52
 event22  POINTER_MOTION    +1.42s      109.48/  4.60
 event22  POINTER_MOTION    +1.44s      120.52/  2.76
Comment 1 Peter Hutterer 2018-05-14 06:56:28 UTC
Please run the libinput measure trackpoint-range tool and follow its instructions
Comment 2 Chow Loong Jin 2018-05-14 11:33:27 UTC
> Please run the libinput measure trackpoint-range tool and follow its instructions

I had already done that prior to filing this bug report, and I have also tested various values of LIBINPUT_ATTR_TRACKPOINT_RANGE. I bumped TRACKPOINT_DEFAULT_MAX_DELTA because my pointer wasn't getting any faster no matter how low I set LIBINPUT_ATTR_TRACKPOINT_RANGE to and "libinput debug events" confirmed that (all deltas clamped at 60).

On a single screen, the speed was somewhat acceptable, but once I started trying to move the pointer between screens, it was really annoyingly slow.
Comment 3 Chow Loong Jin 2018-05-14 13:07:55 UTC
I just tried another round of testing with lower values of LIBINPUT_ATTR_TRACKPOINT_RANGE, and my findings are that lowering that attribute's value causes the slow speed movements to become too fast to precisely hit anything, but the top speed is still too slow.

TL;DR: I just want fast movements to be faster. Slow movements are okay in the current implementation.
Comment 4 Peter Hutterer 2018-05-15 05:43:21 UTC
What was the actual value the trackpoint range tool gave you? And did you verify that the range was set on the udev device correctly? The hwdb is a bit fickle.

the max delta is currently at 60 as you noted, so the delta returned from the accel code is (60, 60) maximum. it's not directional, so a diagonal max delta is a longer vector than a horizontal/vertical, but meh.

Given the average trackpoint with ~80Hz this means at full pressure you'd get 60 * 80 pixels per second = 4800 pixels. That's the limit, but that should in your setup allow for a full movement from left to right within a second. The timestamps in your log suggest that the average report rate is around ~10ms, so this isn't an issue with the trackpoint not reporting fast enough.

I have a 3840x1200 setup here and with the right range configured (30 here), I can verify the above and cross from left to right within approx 1 second. That's a far cry off the 5 seconds you mentioned in the first post.

So what's going on here?
Comment 5 Chow Loong Jin 2018-05-15 13:44:10 UTC
> What was the actual value the trackpoint range tool gave you?

With default settings, I think I got something like ~30, but after patching libinput to lift the speed limit, I got something like 15-20, and a lot less muscle strain. A slow pointer makes me press harder.

> And did you verify that the range was set on the udev device correctly? The hwdb is a bit fickle.

Yes, verified with "udevadm info --query=all --name=/dev/input/eventXX". Also, like I mentioned in my previous post, lowering LIBINPUT_ATTR_TRACKPOINT_RANGE makes the slow speed movements way too quick and imprecise, but still doesn't get me to the next screen fast enough.

> I have a 3840x1200 setup here and with the right range configured (30 here), I can verify the above and cross from left to right within approx 1 second. That's a far cry off the 5 seconds you mentioned in the first post.

It's not 3840x1200, it's 3840 + 1200. Two screens side by side. And perhaps you're used to hitting your trackpoint hard? I find that I start feeling pain on the back of my palm if I use the trackpoint without first adjusting the sensitivity.

If it helps, with libinput 1.8, I had a comfortable setup with POINTINGSTICK_CONST_ACCEL=10 and the sysfs sensitivity node set to 255.
Comment 6 Chow Loong Jin 2018-05-15 13:48:30 UTC
Also the report rate doesn't seem to be at 10ms intervals -- it's 16/(1.44-1.18) = 61.5Hz, judging from the log in the description.
Comment 7 Chow Loong Jin 2018-05-16 04:37:43 UTC
I just measured the trackpoint range again with different display setups:

Side-by-side (3840x2160 on the left, 1920x1200 on the right):
Average for abs deltas: x:  45 y:  16                                                                                                                                                                                                                                                                                                                                                    
Median for abs deltas: x:  44 y:  14
95% percentile for abs deltas: x: 103 y:  42

External only (3840x2170):
Average for abs deltas: x:  37 y:  21                                                                                                                                                                                                                                                                                                                                                    
Median for abs deltas: x:  34 y:  17
95% percentile for abs deltas: x:  95 y:  52    

Internal only (1920x1200):
Average for abs deltas: x:  25 y:  14                                                                                                                                                    
Median for abs deltas: x:  21 y:  12
95% percentile for abs deltas: x:  72 y:  38

As you can see, the trackpoint range varies quite significantly depending on display size.
Comment 8 Peter Hutterer 2018-05-16 05:36:20 UTC
urgh, really? that is terrible and would make it virtually impossible for libinput to ever do the right thing... 

Please re-confirm this though, just run the commands again. I find that I get quite different results every time I re-run-this and have to run it a few times in a row to get reliable readings. You also said above:

> A slow pointer makes me press harder.

Please make sure you're not affected by the speed of the pointer motion on the screen. You may be inclined to push harder on the large screen to hit the edges, resulting in higher deltas. This could affect the input data.

The instructions to hit the screen edges are just so users know what to roughly do, the tool isn't affected by the visible pointer movement at all - the trackpoint will keep sending events even when the pointer is at the screen edge.

> And perhaps you're used to hitting your trackpoint hard?

I admit I only use the trackpoint to test things, I hardly ever use it directly. So I'm not sure what I'm used to and I definitely can't comment in regards to RSI etc. Which effectively means I'll question everything you tell me for basic sanity, but otherwise you'll have the last word on everything :)
Comment 9 Chow Loong Jin 2018-05-16 07:22:15 UTC
(In reply to Peter Hutterer from comment #8)
> urgh, really? that is terrible and would make it virtually impossible for
> libinput to ever do the right thing... 
> 
> Please re-confirm this though, just run the commands again. I find that I
> get quite different results every time I re-run-this and have to run it a
> few times in a row to get reliable readings.

Yeah the behaviour runs around a bit, but my results seem to be pretty consistent. I just tried moving my pointer around each of my screens without mode-switching, and got the following results:

Just the internal:
Average for abs deltas: x:  22 y:  14
Median for abs deltas: x:  18 y:  12
95% percentile for abs deltas: x:  62 y:  39

Just the external:
Average for abs deltas: x:  32 y:  19
Median for abs deltas: x:  30 y:  17
95% percentile for abs deltas: x:  80 y:  50


> You also said above: 
> > A slow pointer makes me press harder.
> 
> Please make sure you're not affected by the speed of the pointer motion on
> the screen. You may be inclined to push harder on the large screen to hit
> the edges, resulting in higher deltas. This could affect the input data.

I think that this is exactly what's happening, but it's also possible the the firmware is sending larger inputs in response to longer straight movements.

> The instructions to hit the screen edges are just so users know what to
> roughly do, the tool isn't affected by the visible pointer movement at all -
> the trackpoint will keep sending events even when the pointer is at the
> screen edge.

With the test I just did in this post, I was roughly drawing large circles touching the screen edges without bothering to hit the corners.
 
> > And perhaps you're used to hitting your trackpoint hard?
> 
> I admit I only use the trackpoint to test things, I hardly ever use it
> directly. So I'm not sure what I'm used to and I definitely can't comment in
> regards to RSI etc. Which effectively means I'll question everything you
> tell me for basic sanity, but otherwise you'll have the last word on
> everything :)

:)
Comment 10 Chow Loong Jin 2018-05-17 19:17:03 UTC
Created attachment 139617 [details] [review]
Patch to bump TRACKPOINT_DEFAULT_MAX_DELTA to 120
Comment 11 Chow Loong Jin 2018-05-17 19:21:17 UTC
Created attachment 139618 [details] [review]
Patch to use accelerated deltas for scrolling

This patch goes off on a slight tangent to also use accelerated coordinates for scrolling, as it feels more natural for the a scrolled document to move about with the same rate as the pointer would move when not scrolling (e.g. similar to grabbing the document and moving it around, but with axes inverted).
Comment 12 Peter Hutterer 2018-05-22 00:28:12 UTC
First commit is on master now, thank you.

commit 8e30b3069cd11f1a3e4fea6b12d094dc0b203b62
Author: Chow Loong Jin <>
Date:   Fri May 18 03:11:57 2018 +0800

     Bump TRACKPOINT_DEFAULT_MAX_DELTA to 120

So I think we can close this bug as fixed?


As for using accelerated deltas while scrolling - bit of a contested point but we don't use those anywhere for scrolling and instead leave it up to the caller to adjust the scroll speed as necessary. IIRC GTK already does that where long documents have different scroll speed/scroll acceleration than short documents.
Changing this now would result in some applications double-accelerating, which is going to make things worse.
Comment 13 Chow Loong Jin 2018-05-25 11:02:26 UTC
(In reply to Peter Hutterer from comment #12)
> First commit is on master now, thank you.
> 
> commit 8e30b3069cd11f1a3e4fea6b12d094dc0b203b62
> Author: Chow Loong Jin <>
> Date:   Fri May 18 03:11:57 2018 +0800
> 
>      Bump TRACKPOINT_DEFAULT_MAX_DELTA to 120
> 
> So I think we can close this bug as fixed?

Sure, thanks. I've opened another bug to track the accelerated scrolling issue: https://bugs.freedesktop.org/show_bug.cgi?id=106648

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.