fix(input): restore RenHDrum controller behavior #2478
No reviewers
Labels
No labels
area/accessibility
area/audio
area/input
area/install
area/menu
area/mods
area/renderer
area/saves
area/tooling
area/upscaling
beanstalk: approved
beanstalk: failed
beanstalk: needs approval
beanstalk: running
beanstalk: tested
ci: approved
good first issue
gpu/amd
gpu/igpu
gpu/intel
gpu/nvidia
help wanted
kind
bug
kind
chore
kind
docs
kind
feature
kind
performance
kind
question
needs measurements
platform/linux
platform/macos
platform/steam-deck
platform/windows
preview
priority
critical
priority
high
priority
low
regression
risk
high
risk
low
risk
medium
status
blocked
status
confirmed
status
duplicate
status
invalid
status
needs-info
status
wontfix
ci: approved
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot!2478
Loading…
Reference in a new issue
No description provided.
Delete branch "HumanBean/Longshot:fix/renhdrum-controller-behavior"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
On main, an original Switch Pro Controller can miss short effects over Bluetooth or lose steady effects over USB. Try sustained rumble and short effects in Ocarina of Time with Vibration set to Auto. A wired DualSense also starts with crisp notes disabled, and its Bluetooth reports use a coarse sleep.
Use RenHDrum's Compatible Bluetooth profile for the original Switch Pro Controller, refresh active USB reports every 40 ms, and apply strength after the core shapes the rumble. Switch pads whose SDL driver refuses raw reports fall back to motors. Wired DualSense enables crisp notes and Bluetooth uses a high-resolution report timer. The shared close path releases controller effects, and the Switch 2 HID layer implements the vibration mount queries and honors the game's vibration permission. Xbox trigger effects use a 200 ms duration with a 100 ms refresh while active.
Start with
host/pad_sdl.candhost/rumble_renhdrum.c. See #2418. RenHDrum integration reportTesting
Tested:
On Linux, the full game-free suite passed on both main and this PR before the vibration permission regression test was added, with 961 passes and 18 skips on each. The new test and full suite are pending. The close-path regression fails on main because the shared close routine skips vibration cleanup. It passes with the fix under GCC and Clang. The fake SDL controller checks passed under both compilers for hardware eligibility, USB refresh, scaled silence, report rejection and motor fallback. The crash-record, pad speaker, rumble mapping, Vibration menu, and RenHDrum export checks passed. All five changed C files passed Linux syntax compilation with the project's host flags.
Still to test:
Measurements
Verdict: The game-free checks confirm the close callback and the 40 ms wired refresh. Hardware HID timing, frame time and memory are pending.
6123c76adcb100c0ac0eRisks
SDL drivers vary in which raw reports they accept. Basic vibration uses motors if a player needs a workaround. If a HID writer stalls during close, its resources stay live until the writer exits or the process terminates.
Checklist
Ready for review
main; the title is a Conventional Commit.mise run testpasses (any failure that also fails onmainis named). A rerun with the vibration permission regression test is pending.main, or Measurements says why there is nothing to measure. Hardware measurements are pending.third_party/untouched; nothing GPL-incompatible.When it applies
mainand passes here.tests/that reads changed source is updated, not weakened.Assisted-by:/Co-Authored-By:trailers.Ready to merge
main, measured again or a comment says why the numbers still hold.Possibly related, for context:
@review
Recommendation: Request changes. The shared close fix has a regression test, but the new vibration-permission behavior does not. The controller fixes also need the hardware runs identified in the pull request before their effect is known.
The change revises Switch Pro, DualSense and Xbox vibration, adds vibration cleanup on close, and implements the game's vibration permission and mount queries. It adds backend selection and shutdown complexity; the reported game-free checks cover part of the behavior, while hardware results are pending.
Blocking (1): must change before merging.
host/nn_hid.c:1902: The new vibration-permission fix has no game-free regression test, contrary to the repository's fix rule. (more on the line) Do: Add a game-free test that sends active values, disables permission, checks both sides and motor output are cleared, verifies sends are ignored while disabled, and verifies they resume after permission is restored.Testing before merging (2) (runs on the systems it can change; it doesn't hold the recommendation)
host/pad_sdl.c:473: The claimed Switch Pro fix and the changed fallback paths have not been exercised on controllers. (more on the line) Do: Compare main and this head in game on Windows and Linux with an original Switch Pro over USB and Bluetooth; check short effects, sustained effects and stops, and exercise rejection and Switch 2/Joy-Con fallback.host/rumble_renhdrum.c:441: The changed HID timing and controller cleanup have not been checked on the other affected hardware. (more on the line) Do: Run the stated DualSense USB and Bluetooth, Xbox trigger, and Steam Controller checks on the applicable Windows and Linux setups, including stopping and closing with effects active.@fixcan do L1.More: does it help, other systems, switches, what was read
Does it help: Unproven for the reported controller problems. The author reports 961 passes and 18 skips on both revisions, plus fake-controller checks for the 40 ms refresh and close cleanup; no before-and-after controller or in-game results are reported.
Other systems: The changes also affect Joy-Cons, Switch 2 controllers, third-party Xbox-type pads, Steam Input and Steam Controller grips, DualSense speaker and triggers, Linux and Windows shutdown, and SDL drivers that reject raw reports. Their hardware behavior has not been reported.
Switches: HOS_RUMBLE_BACKEND=renhdrum no longer forces RenHDrum for a single Joy-Con; Auto remains the default. HOS_HD_RUMBLE=0 now also prevents the original Switch Pro from selecting RenHDrum. The defaults and changed override behavior have not been validated on hardware.
Reviewed:
b100c0ac0eagainst6123c76adc: Read AGENTS.md, CONTRIBUTING.md, the pull request template, standards, the complete diff and commit messages; reviewed the changed input, report scheduling and shutdown sections and their callers. Skimmed the remaining portions of the larger changed files and test fixtures. docs/review-checklist.md and the adjacent Tooling checkout were absent; no recorded runs or translations were included.; nothing run (a code review).Checked and fine:
Testing: Read-only review; no builds, tests or project scripts were run. The author reports Linux game-free checks and syntax compilation; Windows host build and controller runs remain pending.
Overlaps and merge order: Not checked; the network is closed.
Automated code review by BeanBot (gpt-6.1-terra), asked for by HumanBean. Nothing was run; a maintainer decides.
@ -1890,4 +1899,4 @@static void vibration_value_idle(uint64_t v) { /* VibrationValue {f32 amp_low, freq_low, amp_high, freq_high} */float idle[4] = {0.0f, 160.0f, 0.0f, 320.0f};memcpy(GP(v), idle, sizeof idle);}L1 (blocking): The new vibration-permission fix has no game-free regression test, contrary to the repository's fix rule.
When: If PermitVibration is restored to the previous no-op, the changed close and fake SDL tests still pass even though disabling permission no longer stops vibration or suppresses subsequent sends.
Do: Add a game-free test that sends active values, disables permission, checks both sides and motor output are cleared, verifies sends are ignored while disabled, and verifies they resume after permission is restored.
@ -452,2 +470,4 @@}/* Stock SDL does not refresh raw wired Switch reports. The core already schedules Bluetooth resends. */static int switch_poll(int i, int64_t now, int strength) {L2 (should fix): The claimed Switch Pro fix and the changed fallback paths have not been exercised on controllers.
When: Fake SDL accepts or rejects prepared reports, but cannot show whether an original Pro Controller plays short and sustained effects or whether supported drivers and other Switch pads handle the fallback correctly.
Do: Compare main and this head in game on Windows and Linux with an original Switch Pro over USB and Bluetooth; check short effects, sustained effects and stops, and exercise rejection and Switch 2/Joy-Con fallback.
@ -439,1 +438,4 @@static volatile LONG bt_run, bt_failed;/* Relative, high-resolution deadlines are shared by the two HID audio threads. */static HANDLE rh_report_timer(void) {return CreateWaitableTimerExW(NULL, NULL, 0x2 /* HIGH_RESOLUTION */, 0x00100002 /* SYNCHRONIZE | TIMER_MODIFY_STATE */);L3 (should fix): The changed HID timing and controller cleanup have not been checked on the other affected hardware.
When: The new timer and close path run for Bluetooth DualSense and Steam grip reports, while the new refresh duration affects Xbox triggers; the fake Switch tests do not exercise those devices or the DualSense speaker.
Do: Run the stated DualSense USB and Bluetooth, Xbox trigger, and Steam Controller checks on the applicable Windows and Linux setups, including stopping and closing with effects active.
@fix
Recommendation: Approve. The code is ready: only testing is left. The controller fix has game-free evidence, but its reported hardware behavior remains unverified. Switch Pro, DualSense, Xbox, Switch 2 and Joy-Con runs are still needed. Recommend approval; not approved on the forge.
What
@fixchangedI changed this pull request: the new head is
a9d5119365. It was already up to date withmain. I edited its description to match the change.Changed
Nothing was built or run: the checks run again on the new head.
The change aims to restore reliable rumble and controller effect cleanup, with motor fallback when raw reports are rejected. It adds controller-specific timing and cleanup logic; the new test covers vibration permission without changing the runtime fix.
Testing before merging (2) (runs on the systems it can change; it doesn't hold the recommendation)
host/pad_sdl.c:473: The claimed Switch Pro fix and the changed fallback paths have not been exercised on controllers. When: Fake SDL accepts or rejects prepared reports, but cannot show whether an original Pro Controller plays short and sustained effects or whether supported drivers and other Switch pads handle the fallback correctly. Do: Compare main and this head in game on Windows and Linux with an original Switch Pro over USB and Bluetooth; check short effects, sustained effects and stops, and exercise rejection and Switch 2/Joy-Con fallback.host/rumble_renhdrum.c:441: The changed HID timing and controller cleanup have not been checked on the other affected hardware. When: The new timer and close path run for Bluetooth DualSense and Steam grip reports, while the new refresh duration affects Xbox triggers; the fake Switch tests do not exercise those devices or the DualSense speaker. Do: Run the stated DualSense USB and Bluetooth, Xbox trigger, and Steam Controller checks on the applicable Windows and Linux setups, including stopping and closing with effects active.Checks: they run again on this head; a failure shows on the pull request.
Also noticed (2; not asked for, not blocking)
More: does it help, other systems, switches, what was read
Does it help: Unproven on hardware. The description reports fake-controller checks for the 40 ms wired refresh and cleanup, but no before-and-after controller runs.
Other systems: The change affects Switch Pro USB and Bluetooth, DualSense playback and cleanup, Xbox triggers, Switch 2 and Joy-Con fallback on Windows and Linux. Hardware checks and a Windows host build remain pending.
Switches: HOS_RUMBLE_BACKEND retains Auto as its default; its forced RenHDrum behavior no longer includes a lone Joy-Con. Hardware fallback still needs verification.
Reviewed:
a9d5119365against6123c76adc: Read the new vibration permission test, the relevant vibration code and fix diff, repository rules, and pull request template. Skimmed the remaining pull request diff and related controller paths; did not read every changed file in full.; nothing run (a code review).Checked and fine:
Testing: No tests or project code were run during this read-only review. CI has not yet run on this head.
Overlaps and merge order: Not established.
Automated code review by BeanBot (gpt-6.1-terra), asked for by BeanBot, after its fix. Nothing was run; a maintainer decides.
WIP: fix(input): restore RenHDrum controller behaviorto fix(input): restore RenHDrum controller behavior