fix(Hardware Support): Fix Dropped Events From Debounce Method#623
Open
pastaq wants to merge 1 commit into
Open
fix(Hardware Support): Fix Dropped Events From Debounce Method#623pastaq wants to merge 1 commit into
pastaq wants to merge 1 commit into
Conversation
In some rare circumstances the Legion Go S DPad can have some chatter when pressed, emitting a 'down', 'up', and 'down' event in the same event frame. The deck and deck-uhid targets both contain debounce sequences for double events, preventing a "no-op" if a 'down' then 'up' event is hit in the same frame by rescheduling the 'up' event for later, but it doesn't account for what should happen if another 'down' event is hit while the 'up' event is scheduled. In such a case, the second 'down' event becomes a no-op as the state doesn't change, then the deferred 'up' event hits, clearing the state and putting the virtual device out of sync with the physical hardware. Additionally, all of the currently implemented target device scheduled_events() functions fail to check for the elapsed time has passed, instead immediately draining all scheduled events in the next poll. This patch addresses these issues by making the following changes: - Mask the Legion Go S evdev events to reduce the overall processing overhead for duplicated events and lower the chance for chatter. - Dequeue pending 'up' events if a 'down' event is processed before that event's scheduled interval. - Reduce ScheduledNativeEvent timeout on deck and deck-uhid to 8ms (approximately 2 frames) to reduce chatter collision probability. - Check ScheduledNativeEvent.is_ready() for queued events before draining them on all target devices with implemented scheduled_events() functions.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In some rare circumstances the Legion Go S DPad can have some chatter when pressed, emitting a 'down', 'up', and 'down' event in the same event frame. The deck and deck-uhid targets both contain debounce sequences for double events, preventing a "no-op" if a 'down' then 'up' event is hit in the same frame by rescheduling the 'up' event for later, but it doesn't account for what should happen if another 'down' event is hit while the 'up' event is scheduled. In such a case, the second 'down' event becomes a no-op as the state doesn't change, then the deferred 'up' event hits, clearing the state and putting the virtual device out of sync with the physical hardware.
Additionally, all of the currently implemented target device scheduled_events() functions fail to check for the elapsed time has passed, instead immediately draining all scheduled events in the next poll.
This patch addresses these issues by making the following changes:
Fixes ValveSoftware/SteamOS#2539