Summary: | Noisy / Jittery XIDeviceEvent root and event coordinates | ||||||
---|---|---|---|---|---|---|---|
Product: | xorg | Reporter: | Jason Gerecke <killertofu> | ||||
Component: | Server/Input/Core | Assignee: | Xorg Project Team <xorg-team> | ||||
Status: | RESOLVED MOVED | QA Contact: | Xorg Project Team <xorg-team> | ||||
Severity: | normal | ||||||
Priority: | medium | CC: | peter.hutterer | ||||
Version: | unspecified | ||||||
Hardware: | Other | ||||||
OS: | All | ||||||
Whiteboard: | |||||||
i915 platform: | i915 features: | ||||||
Attachments: |
|
Description
Jason Gerecke
2015-09-30 00:07:55 UTC
Created attachment 118555 [details]
Script to check if jitter is present
I've attached a script that may be useful in checking for the existence of the issue. Run with the device ID of a Wacom tablet, it will gather data from `xinput test-xi2` and calculate the expected values as well as the apparent delta.
ok, I think I found the core issue. The data in the events is originally correct, fill_pointer_events() does the right thing. But during ProcessDeviceEvent we call GetSpritePosition() and overwrite the event's root x/y coordinates. And that can be a pixel or so out, though I'm not 100% sure why yet, probably a rounding error elsewhere. ok, it's not a rounding error, it's a bigger problem. The event flow in the server is that the slave device event is processed first, then the master device event. If the SD is attached it doesn't have a separate sprite but instead uses the one from the master device. That's where the discrepancies come from. When the new event comes in, the slave calls GetSpritePosition() to get the current position of the sprite (it may have moved since the last event, either from another slave or through warp pointer requests, confinements, etc.). It uses that position in the event root coordinates, but the position is still the one from the last event. Then the master device is updated, the sprite position changes to the new (correct) position, the data in the master device's event is correct. So the jitter is equivalent to the delta between the last event and the current one, but because of truncating from doubles to ints and back it is amplified a bit. The jitter is always close to an integer, i.e. a full pixel. Or close to zero. Example: * slave device is at to 101.1/200.0, * master updates sprite to 101/200 * slave device moves to 100.5/200.0 ** event root_x/y is 100/200, fractional parts are 0.5/0.0 * GetSpritePosition() in ProcessDeviceEvent() returns 101/200 * fractional parts are added to coordinate again, result is 101.5/200.0, causing a jitter of 1.0 I don't know how to fix this yet. How is it going with that? no-one is currently working on this Well what should we do about it then? It's not acceptable for Qt users if this is really still unfixed for so long. Do we have to process the valuators ourselves? Do you still not know how to fix the X server? I still don't know how to fix the X server and tbh I don't have a lot of time to work on this, sorry. -- GitLab Migration Automatic Message -- This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/xorg/xserver/issues/586. |
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.