Skip to content

contacts/sls2: Add One-Euro position filter, MSC_TIMESTAMP, and SLS2 touchpad tuning - #239

Open
DavidObando wants to merge 3 commits into
linux-surface:masterfrom
DavidObando:sls2-touchpad-improvements
Open

DavidObando wants to merge 3 commits into
linux-surface:masterfrom
DavidObando:sls2-touchpad-improvements

Conversation

@DavidObando

@DavidObando DavidObando commented Nov 22, 2026 •

Copy link
Copy Markdown

Summary

Improves pointer smoothness, velocity accuracy, and palm rejection on the Microsoft Surface Laptop Studio 2 haptic touchpad (045E:0C46, related to #208):

  1. daemon: Emit MSC_TIMESTAMP events on touch frames
    • Enables EV_MSC / MSC_TIMESTAMP on the uinput touch device and emits monotonic microsecond timestamps per frame so libinput does not have to rely solely on userspace wakeup jitter for pointer velocity.
  2. contacts: Add optional One-Euro position smoothing filter
    • Adds opt-in [Contacts] OneEuroFilter (OneEuroMinCutoff, OneEuroBeta, OneEuroDCutoff) in Stabilizer.
    • When enabled, replaces the hard PositionThresholdMin deadzone freeze (which stalls sub-0.4 mm movements and jumps in steps) with an adaptive low-pass filter using physical cm/s contact speed—attenuating Gaussian heatmap jitter when moving slowly while keeping lag near zero during fast swipes.
    • Off by default (OneEuroFilter = false) so existing devices are unaffected unless opted in.
  3. etc: Tune SLS2 touchpad preset and add libinput quirk
    • Updates etc/presets/surface-laptop-studio-2.conf with DisableOnPalm = true, PositionThresholdMax = 5.0 (prevents dropping fast swipes and libinput "Touch jump detected and discarded" errors), and tuned One-Euro parameters (OneEuroMinCutoff = 1.8, OneEuroBeta = 0.45, OneEuroDCutoff = 1.0).
    • Adds etc/libinput/40-iptsd-surface-laptop-studio-2.quirks (installed to ${datadir}/libinput/) providing AttrSizeHint=120x77, AttrInputProp=+INPUT_PROP_PRESSUREPAD, AttrTouchSizeRange=20:10, AttrThumbSizeThreshold=1350, and AttrPalmSizeThreshold=1750 calibrated to iptsd's DIAGONAL=12000. (Note: happy to drop this commit if maintainers prefer shipping the quirk upstream in freedesktop/libinput 30-vendor-microsoft.quirks instead.)

Related Open PRs

This draft complements (and does not duplicate) existing open PRs:

Validation

  • Compiled locally on Ubuntu 26.04 (g++ 15.2.0, meson, ninja, -Werror -Wconversion -Wdouble-promotion) and stage-installed (meson install).
  • Tested extensively on Surface Laptop Studio 2 (045E:0C46, GNOME 50 / Wayland, libinput 1.31.1) as a patchset on top of v3.1.0.

@DavidObando
DavidObando marked this pull request as ready for review November 22, 2026 22:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant