Skip to content

Fix: Improve poll rate for source devices - #641

Merged
pastaq merged 1 commit into
mainfrom
pastaq/lego_polling
Aug 21, 2026
Merged

Fix: Improve poll rate for source devices#641
pastaq merged 1 commit into
mainfrom
pastaq/lego_polling

Conversation

@pastaq

@pastaq pastaq commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Adds a fix for source device run loop that prevents halving the poll rate. Previously it would unconditionally sleep for the duration of the poll interval. Now it calculates the time spent draining the source device and creating events and sleeps for the remainder.

@pastaq
pastaq force-pushed the pastaq/lego_polling branch from 9867be2 to 4888fec Compare August 18, 2026 19:33
- Calculates the total poll time for each source device and sleeps for only the remainder of the devices poll rate. With the previous implementation a source device could effectively halve its poll rate by waiting the full duration. If a device took 8ms to fill its event buffer and produce events, and its poll rate needed an 8ms sleep, that would effectively make the delay 16ms.
@pastaq
pastaq force-pushed the pastaq/lego_polling branch from 4888fec to f17425e Compare August 21, 2026 04:56
@pastaq pastaq changed the title Fix: Improve poll rate source devices, Legion Go Touchpad Fix: Improve poll rate for source devices Aug 21, 2026
@pastaq
pastaq marked this pull request as ready for review August 21, 2026 04:57
@pastaq
pastaq merged commit 3a6e069 into main Aug 21, 2026
6 checks passed
@pastaq
pastaq deleted the pastaq/lego_polling branch August 21, 2026 05:35
@github-actions

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 0.78.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant