Avoid redundant set_rumble_state(0, 0) calls when idle#292
Open
cashcon57 wants to merge 3 commits into
Open
Conversation
The frequent "check failed" notifications drive me nuts, especially since all the other ones work fine
- To work around a policy issue involving `yamc` - I'll need to fix this properly later
RumbleTask runs every frame (ASAP scheduling), and when _rumbleTimeout has already reached zero, the task still calls retro::set_rumble_state(0, 0) on every frame. On Linux, this goes through the evdev/haptic driver and may carry per-call syscall overhead. This adds a check so that set_rumble_state(0, 0) is only called once on the frame where the timeout actually expires, rather than on every subsequent idle frame. I haven't been able to test this on hardware, but the change is conservative — it just skips redundant calls when rumble is already inactive. Either this helps with the performance regression in JesseTG#282, or it has no observable effect. It shouldn't be possible for this to make things worse. Relates to JesseTG#282.
Owner
|
Thank you for your contribution! Soon I plan on going balls-to-the-wall in updating melonDS, and I will test and review this PR when I do. (I had some reason for doing it this way, but I forget off-hand.) |
Author
|
@JesseTG definitely let me know if you find it doesn't work, I haven't had a moment to really test myself either, but I'll report back too if i do! |
Contributor
|
Please see also #278 , pretty sure that's not quite the same issue but related and I think the two fixes go together |
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.
RumbleTask runs every frame (ASAP scheduling), and when _rumbleTimeout has already reached zero, the task still calls retro::set_rumble_state(0, 0) on every frame. On Linux, this goes through the evdev/haptic driver and may carry per-call syscall overhead.
This adds a check so that set_rumble_state(0, 0) is only called once on the frame where the timeout actually expires, rather than on every subsequent idle frame.
I haven't been able to test this on hardware, but the change is conservative — it just skips redundant calls when rumble is already inactive. Either this helps with the performance regression in #282, or it has no observable effect. It shouldn't be possible for this to make things worse.
Relates to #282.