Skip to content

Avoid redundant set_rumble_state(0, 0) calls when idle#292

Open
cashcon57 wants to merge 3 commits into
JesseTG:devfrom
cashcon57:patch-1
Open

Avoid redundant set_rumble_state(0, 0) calls when idle#292
cashcon57 wants to merge 3 commits into
JesseTG:devfrom
cashcon57:patch-1

Conversation

@cashcon57

Copy link
Copy Markdown

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.

JesseTG and others added 3 commits September 26, 2025 17:33
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.
@cashcon57 cashcon57 changed the base branch from main to dev February 18, 2026 06:58
@JesseTG

JesseTG commented Feb 18, 2026

Copy link
Copy Markdown
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.)

@cashcon57

Copy link
Copy Markdown
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!

@warmenhoven

Copy link
Copy Markdown
Contributor

Please see also #278 , pretty sure that's not quite the same issue but related and I think the two fixes go together

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.

3 participants