Re: PROBLEM: Apple external Trackpad event timestamps are jittery (regression)
flat view
From: Yariv <hidden>
Date: 2020-05-12 19:55:10
Thanks for following up!
I took Peter's advice and used 'libinput recrod' to get some logs.
I tested both a 1st gen as well as a 2nd gen Apple external trackpads.
While the 1st gen is Bluetooth-only, the 2nd gen can be connected over
both Bluetooth and USB.
The 2nd gen external trackpad had no jitter, regardless if used over
Bluetooth or USB.
Following is a snippet of a 1st gen touchpad, showing only SYN_REPORT
lines for brevity.
This was taken on a kernel with the regression:
- [ 7, 526745, 0, 0, 0] # ------------ SYN_REPORT (0)
---------- +11ms
- [ 7, 537376, 0, 0, 0] # ------------ SYN_REPORT (0)
---------- +11ms
- [ 7, 540141, 0, 0, 1] # ------------ SYN_REPORT (1)
---------- +3ms
- [ 7, 540141, 0, 0, 0] # ------------ SYN_REPORT (0)
---------- +0ms
- [ 7, 560065, 0, 0, 0] # ------------ SYN_REPORT (0)
---------- +20ms
- [ 7, 571556, 0, 0, 0] # ------------ SYN_REPORT (0)
---------- +11ms
- [ 7, 580125, 0, 0, 1] # ------------ SYN_REPORT (1)
---------- +9ms
- [ 7, 580125, 0, 0, 0] # ------------ SYN_REPORT (0)
---------- +0ms
- [ 7, 594466, 0, 0, 0] # ------------ SYN_REPORT (0)
---------- +14ms
- [ 7, 604987, 0, 0, 0] # ------------ SYN_REPORT (0)
---------- +10ms
- [ 7, 616458, 0, 0, 0] # ------------ SYN_REPORT (0)
---------- +12ms
- [ 7, 624124, 0, 0, 1] # ------------ SYN_REPORT (1)
---------- +8ms
- [ 7, 624124, 0, 0, 0] # ------------ SYN_REPORT (0)
---------- +0ms
- [ 7, 639259, 0, 0, 0] # ------------ SYN_REPORT (0)
---------- +15ms
- [ 7, 650772, 0, 0, 0] # ------------ SYN_REPORT (0)
---------- +11ms
- [ 7, 660130, 0, 0, 1] # ------------ SYN_REPORT (1)
---------- +10ms
- [ 7, 660130, 0, 0, 0] # ------------ SYN_REPORT (0)
---------- +0ms
Now a snippet of the 2nd gen trackpad, over Bluetooth, same kernel:
- [ 9, 584965, 0, 0, 0] # ------------ SYN_REPORT (0)
---------- +11ms
- [ 9, 595860, 0, 0, 0] # ------------ SYN_REPORT (0)
---------- +11ms
- [ 9, 607147, 0, 0, 0] # ------------ SYN_REPORT (0)
---------- +12ms
- [ 9, 618610, 0, 0, 0] # ------------ SYN_REPORT (0)
---------- +11ms
- [ 9, 630279, 0, 0, 0] # ------------ SYN_REPORT (0)
---------- +12ms
- [ 9, 641047, 0, 0, 0] # ------------ SYN_REPORT (0)
---------- +11ms
- [ 9, 652429, 0, 0, 0] # ------------ SYN_REPORT (0)
---------- +11ms
- [ 9, 664148, 0, 0, 0] # ------------ SYN_REPORT (0)
---------- +12ms
- [ 9, 674600, 0, 0, 0] # ------------ SYN_REPORT (0)
---------- +10ms
- [ 9, 686040, 0, 0, 0] # ------------ SYN_REPORT (0)
---------- +12ms
- [ 9, 697808, 0, 0, 0] # ------------ SYN_REPORT (0)
---------- +11ms
- [ 9, 709277, 0, 0, 0] # ------------ SYN_REPORT (0)
---------- +12ms
- [ 9, 719649, 0, 0, 0] # ------------ SYN_REPORT (0)
---------- +10ms
I'm entirely clueless with regard to the input device protocols,
however it is apparent that the 2nd gen trackpad has only SYN_REPORT
(0) in its log, while the 1st gen has both SYN_REPORT (0) and
SYN_REPORT (1).
Last is a snippet of the 1st gen, this time on a kernel with my hack -
so should behave as before the regression:
- [ 6, 243965, 0, 0, 0] # ------------ SYN_REPORT (0)
---------- +11ms
- [ 6, 254576, 0, 0, 0] # ------------ SYN_REPORT (0)
---------- +11ms
- [ 6, 257637, 0, 0, 1] # ------------ SYN_REPORT (1)
---------- +3ms
- [ 6, 265675, 0, 0, 0] # ------------ SYN_REPORT (0)
---------- +8ms
- [ 6, 277512, 0, 0, 0] # ------------ SYN_REPORT (0)
---------- +12ms
- [ 6, 288059, 0, 0, 0] # ------------ SYN_REPORT (0)
---------- +11ms
- [ 6, 297642, 0, 0, 1] # ------------ SYN_REPORT (1)
---------- +9ms
- [ 6, 299646, 0, 0, 0] # ------------ SYN_REPORT (0)
---------- +2ms
- [ 6, 310849, 0, 0, 0] # ------------ SYN_REPORT (0)
---------- +11ms
- [ 6, 322000, 0, 0, 0] # ------------ SYN_REPORT (0)
---------- +12ms
- [ 6, 333265, 0, 0, 0] # ------------ SYN_REPORT (0)
---------- +11ms
- [ 6, 337681, 0, 0, 1] # ------------ SYN_REPORT (1)
---------- +4ms
- [ 6, 344588, 0, 0, 0] # ------------ SYN_REPORT (0)
---------- +7ms
- [ 6, 356921, 0, 0, 0] # ------------ SYN_REPORT (0)
---------- +12ms
- [ 6, 366979, 0, 0, 0] # ------------ SYN_REPORT (0)
---------- +10ms
Here it seems that if we add the delta from each SYN_REPORT (1) to the
delta of the following SYN_REPORT (0) we get sane timestamps.
I also tested a USB mouse, and the timestamps were Ok.
So to summarize my limited finding, only the 1st gen Apple external
touchpad seems to be affected.
Entire logs:
https://drive.google.com/open?id=1nUNf2uOQPvFw_kE8h4mZB0c80kj3hu4F
Gen1, after regression
https://drive.google.com/open?id=1pr508bqeax1Csle2HQuLcuXwinWksdjo
Gen2, after regression
https://drive.google.com/open?id=1W0XekSNyf1i-Um-VqxDJuMmJoWAGXIG5
Gen1, before regression
Please let me know if I there is anything else I can do to help.
Best regards,
Yariv
On Tue, May 12, 2020 at 8:19 AM Peter Hutterer [off-list ref] wrote:On Mon, May 11, 2020 at 01:11:18PM -0700, Dmitry Torokhov wrote:quoted
Hi, On Mon, May 11, 2020 at 09:18:15AM +0300, Yariv wrote:quoted
Using a vanilla installation of Ubuntu 20.04 (kernel v5.4), the timestamps of input events from my Apple "Magic Trackpad" - 1st generation, connected over Bluetooth - are jittery. This is a kernel regression. I bisected the bug.Do you see the same jitter when connected over USB? Can you also see if there is similar jitter when you parse timestamps of SYN_RPEORT events from "evtest"? Could you post a sample of events generated by device (via evtest)?unrelated, but I really recommend using 'libinput record' these days since it can be replayed (libinput replay) or analysed easier (it's YAML). Also, it prints delta times into the recording so you can immediately check those without having to parse them, e.g.: - evdev: - [ 0, 375974, 2, 0, 5] # EV_REL / REL_X 5 - [ 0, 375974, 2, 1, -2] # EV_REL / REL_Y -2 - [ 0, 375974, 0, 0, 0] # ------------ SYN_REPORT (0) ---------- +8ms Cheers, Peter