Skip to content

Conversation

@SilverGozas
Copy link
Contributor

Because of the way DFT packets work, not all of the stylus data gets updated at the same time.

Previously, iptsd would just send out a new event every time a DFT packet arrived. Because of this several events containing the same position, pressure, etc. would be sent out.

This confused the smoothing algorithms in some applications, e.g. Krita, as described here.

This PR implements bundling of these partial updates together into one single event.

Sending an event every time a DFT packet arrives causes issues
with smoothing in some applications (e.g. Krita) due to the
same data being resent several times as though it is a new event.
This workaround bundles all the updates together and sends them
as one event fixing this problem.
@StollD StollD merged commit 1bf28f5 into linux-surface:master Feb 17, 2025
@StollD
Copy link
Member

StollD commented Feb 17, 2025

Thank you!

As a side note, I wonder if an explicit sync after every data frame that iptsd reads from the hardware would work too (here: https://github.com/linux-surface/iptsd/blob/master/src/ipts/parser.hpp#L252), since one frame can contain multiple DFT windows.

@SilverGozas
Copy link
Contributor Author

Thank you!

As a side note, I wonder if an explicit sync after every data frame that iptsd reads from the hardware would work too (here: https://github.com/linux-surface/iptsd/blob/master/src/ipts/parser.hpp#L252), since one frame can contain multiple DFT windows.

Not sure, but I doubt it. From what I've seen, it seems that all of the DFT data comes significantly staggered (and even it didn't, fixing it this way seems more complex as there would be more changes needed further down the line as well). I guess I'll know more whenever I get around to actually analyzing the DFT packets' contents.

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.

2 participants