feat(libSceVideoOut): add ANYPS5_RUMBLE to scale or turn off host controller vibration #12686
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/12686"
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?
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-29T02:09:00Z.
What
Adds
ANYPS5_RUMBLE=<0..100>, a host-side comfort setting for how strongly a title's vibration reaches a physical controller. There was no way to reduce or disable it. Unset or100is a bypass that builds exactly the command built before;0never hands the host a nonzero amplitude and stops a running rumble; values in between scale the 16-bit motor amplitudes with exact integer arithmetic (round half up, never amplifying). It applies to every connected controller. An invalid value (empty, signed, fractional, above 100) throws when the pad input starts, with an error namingANYPS5_RUMBLE. This is not console behaviour and is documented as such; there is no overlay entry or hotkey.Paths considered:
SDL_GameControllerRumble): scaled.SDL_GameControllerRumbleTriggers): scaled, since it is vibration to the user.0would still shake a DualSense on USB.SDL_GameControllerSendEffect). They are resistance and force profiles, not only vibration, and scaling them means decoding the effect formats, which is unmeasured here. Documented in USAGE.md.Commits:
feat(libScePad)header-onlyPadRumbleIntensity.hpp: scale, command builder, sink helper, parser, cached env read.test(libScePad)its test.feat(libSceVideoOut)PadInput.cpp builds both rumble commands through the helper (about 10 changed lines).feat(libSceAudioOut)trailing percentage parameter (default 100) onAudioOut2WritePadFrames; 5. its test; 6-7. one commit per caller (AudioOut.cpp,AudioOut2Context.cpp).8-10. docs: ENVIRONMENT.md row, USAGE.md section, INPUT_MAPPING.md pointer.
Overlaps with open PRs (no code reused): #12569 edits
PadInput.cpp,AudioOut.cpp,AudioOut2Context.cpp,libSceAudioOut/CMakeLists.txt, ENVIRONMENT.md, USAGE.md and INPUT_MAPPING.md, so a mechanical conflict is possible in those files; my edits there are small and separate. #9154 (Bluetooth DualSense haptics reports) and #10112 (adaptive triggers) add host output paths that this setting does not cover until they adoptPad::RumblePercent().Tested
Debian 12, g++ 12, Ninja, base
3a2b919816after rebase (tests were built before a clean rebase onto it; the upstream commits in between touch none of the files changed here).pad_rumble_intensity: scale checked against an independent exact reference for every amplitude 0..65535 at every percentage 0..100 (bounds, monotonic in both), the 100 percent command byte for byte (memcmp) against the old formula for all 256x256 motor pairs, 0 percent with a recording sink for all 65536 pairs (exactly one call, always0,0,0), stop after a full-strength rumble, intermediate values, parser accept (0 1 50 99 100 007 000) and refuse ("" 101 999 1000 -1 +5 " 5" "5 " 1.5 abc 0x10 50% 5a 1e1), env read once, invalid value keeps failing. Passed.audio_out2_pad_haptic_intensity: quad and pulse layouts, 100 and above byte-identical to the call without the parameter, 0 silences exactly the actuator channels (also non-finite samples), 50 and 99 scale, speaker and unmapped channels untouched. Passed.upstream/mainin a second tree, same targets: 44 passed on baseline, 47 on branch; per-test diff is only the 3 new tests (plusaudio_out2_pad_mix, which I had not built on the baseline and ran there separately: passed on both). Allaudio_out_vibration_*,guest_pad,guest_pad_vibration_mode,pad_output_pacing,pad_input_mapping,pad_keyboard_mouse,pad_sdlpass on both. Targets I did not build areNot Runon both sides.ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation xvfb-run -a ctest -R 'video_out|pad_' -Vwith-DANYPS5_VIDEO_OUT_TEST_DRIVER=x11: layer-not-found lines 0 on both,VUID-lines 0 on branch and 0 on baseline, 0 failures on both (the same 14 unbuilt tests areNot Runon both).*256, no bypass above 100, 0 percent skipping the sink or leaving a nonzero duration, duration not zeroed, parser accepting empty / 101 / a sign, error not naming the variable, env not cached; audio: speaker channels scaled, wrong gain, scaling at 100 and above, 99 not scaled, 0 not silencing a NaN sample. Each fails at its intended assertion. Not negative-controllable: removing the 100 percent branch (the scaled formula is exactly the identity at 100, so behaviour is equal by construction; the byte-for-byte test catches any non-identity bypass).check_conventions.py --base upstream/main,git diff --check, header audit,env_reference.py --check.NOT RUN: Windows, macOS, a real controller or DualSense (the wiring in
PadInput::applyOutputand the sound-card gain are covered by the helper tests and compile, not by a device; the haptic gain being linear is not felt-tested), a hardware GPU, a console.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)