feat(pad): complete DualSense adaptive trigger support #10112
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/10112"
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 seradavid on 2026-10-23T09:55:31Z.
What
scePadGetTriggerEffectStatewas a silent stub that zeroed its output. It now reads the controller's own trigger effect and status nibbles from the DualSense input report (0x01over USB,0x31over Bluetooth) through a second HID handle and maps them to the SCE states: feedback no-force/pushing, weapon not/almost/fully pressed, vibration not/is firing.The same change completes the trigger output path:
scePadDisableTriggerEffectis implemented. Disabling sends both trigger blocks off; enabling restores the last requested effects.0x00with its enable bit set.scePadInitruns, so a disconnect or failed reopen reports zero until a new report arrives.PadTriggerEffect::Buildholds the 47-byte report construction, and the trigger encoding and retry are covered by tests.libScePad.hppinstead of redeclaring the exports.The branch is rebased onto current
main(151a2cb6) as one linear commit. The per-port trigger state follows #7881, the special-port handle follows #9878, and the Bluetooth haptics stream from #9154 is kept alongside it:closeControllercloses both the status and haptics handles, andapplyOutputruns the haptics/rumble path before the trigger effect path.scePadSetTriggerEffectStrength,scePadGetTriggerEffectInternalStateandscePadSetTriggerEffectExtstill throw because their strength units and payload layouts are unknown. They are recorded indocs/dev/debt/libScePad.md.Tested
Windows 11 26300, WinLibs GCC 15.2.0, Release, rebased onto
151a2cb6.guest_pad_trigger_effects: all seven trigger modes, native report layout, off mode, per-trigger enable bits, disable/restore, trigger-state mapping, clearing and reinitializing the pad.dualsense_status: USB and Bluetooth input-report parsing, short and unknown reports rejected.dualsense_haptics: report/CRC and 3 kHz buffer.guest_pad,guest_pad_vibration_mode,pad_output_pacing: pass.guest_padneedsTEMPon a writable path in this environment; it fails to create its scripted command file under the default Windows temp directory here.tools/check_conventions.py --base upstream/main: pass.tools/pr_overlap.py --branch feat/pad-adaptive-triggers: only #6337 remains, and only in the Pad debt file; it is not a code dependency.Hardware, USB DualSense: a weapon effect was accepted by
SDL_GameControllerSendEffect, and the controller then reported right effect 2/status 0 in input report0x01.Hardware, Bluetooth DualSense: the controller enumerated with
interface_number-1; the second handle read 78-byte report0x31, parsed the same status fields, and non-blocking reads worked. A weapon effect was accepted and the controller reported right effect 2/status 0. A real title was not tested.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)Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-23T10:22:11Z.
Review: CHANGES_REQUESTED
I reviewed exact head 2981977a3d9de02210730b8ef7deba096dedd681. The report parser itself passes a local standalone GCC check (
-std=c++20 -Wall -Wextra -Werror); exact-head diff-check and conventions pass. The reported Windows controller tests and USB/Bluetooth hardware checks are useful. I found a state-lifecycle issue in addition to the need to refresh this branch against current main:liveTriggerStatusValidand the cached effect/status nibbles are never invalidated.PadInput::closeController()closesstatusHidbut does not clear the published trigger state, andPad::Initialize()does not clear it either. On disconnect/reconnect,scePadGetTriggerEffectStatecan therefore return the previous controller’s state before a new status report arrives; if opening the new HID handle fails, the stale state can persist indefinitely despite the debt text saying a host without a readable second handle reports state 0. Please clear/publish an invalid or zero state when the status handle/controller is closed (and define the behavior for failed open), with a regression for disconnect or failed reopen.Also,
check_main_sync.pyreports this head 681 commits behind currentupstream/main. Although the textual merge is clean, current main has substantial changes in the same Pad and VideoOut files. Please rebase onto current main, recheck overlaps with the still-open #9154/#7881/#9878, and rerun the focused tests on the resulting tree before approval. I could not configure the full local tests because SDL2 development files are missing; no broad runtime test was run here.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-23T10:35:55Z.
Review: CHANGES_REQUESTED
I re-reviewed the new exact head
30456cda18. The stale trigger-state issue I reported is fixed:closeController()callscloseStatus()and clears the cached state,openStatus()clears it before the controller/path/HID-open checks, andPad::Initialize()resets it under the state mutex. The new test exercises publish → map → clear → publish again → reinitialize, and the author reports the trigger and DualSense parser tests pass on Windows. Exact-head conventions pass;git diff --checkpasses; sync is 2 ahead/17 behind current main with a clean merge.The remaining blocker is merge coordination. Pairwise merges of this head conflict with #9154 in the VideoOut test registration and
PadInputfiles, with #7881 in Pad state/exports andPadInput, with #9878 inExport.cpp, and with #6337 in the Pad debt file. These are the exact paths the overlap check identifies; several concern the same state or handle code, so please agree an order with those authors, declareDepends onwhere appropriate, then rebase/resolve and rerun the focused pad tests. The repository's overlap rule requires this coordination before approval. I did not run the full updated guest-pad tests locally; this environment's full CMake configure is blocked by the missing SDL2 submodule and XRandR development support.Imported from boykopovar/AnyPS5. Originally posted by jotitadev on 2026-10-27T01:21:02Z.
Review: COMMENTED
Linux run of the current head, since the tested sections cover Windows only.
Machine: Linux x86_64, i7-8700 (6 cores / 12 threads, AVX2), Ubuntu 26.04, GCC 15.2, Release,
BUILD_TESTING=ON. Head013a5a196merged ontomaine2d457be3(clean).guest_pad_trigger_effects,dualsense_status,guest_pad,guest_pad_vibration_mode,pad_output_pacingand the other pad tests pass (14 of 14), pluspatched_libraries.guest_padpasses with the defaultTEMPhere. The two new tests pass 20 of 20 repeated runs.main'slibScePad/Export.cppand keeping the test abortsguest_pad_trigger_effectswithscePadDisableTriggerEffect not implemented.PadState.cppare also caught: not storingtriggerDisabledinSetTriggerEffectsDisabledfails with "the disabled state reaches the output", and mapping effect 2 / status 2 to 0 instead of 5 fails with "pushing and fully pressed statuses are mapped".libScePad.prx,scePadDisableTriggerEffectis exported asOjTEJo7cfREandscePadGetTriggerEffectStateasznaWI0gpuo8.Not tested: a DualSense over hidraw on Linux.
Written with AI assistance (Claude Code). I ran the builds and tests above on my machine.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-29T06:09:58Z.
Review: DISMISSED
Re-checked — changes requested
What I checked
257b3377dd0708bd97fa0ff3efb9a0a06d7bfed8against fetchedmain2960e9a6e7.mainhas not changed the files this PR touches since its reported base319621ba2e. Exact-head hosted Windows, input-mapper, conventions, labels, and report checks pass.Test evidence
The author reports the trigger, DualSense status, pad, vibration-mode, and output-pacing tests passing on this head. The hardware report covers USB and Bluetooth DualSense parsing and effect acceptance; no retail title was tested. I did not run Windows hardware tests locally.
Blocking repository coordination
Open #9154 still conflicts with this PR in VideoOut CMake registration,
PadInputfiles, and the VideoOut debt file. Open #6337 still conflicts in the Pad debt file. The pairwise merge previews confirm these conflicts, and neither PR records an agreed landing order with this one. Please coordinate with both authors and declare the confirmed order in the affected checklists. This is the remaining blocker; the earlier state-lifecycle and current-file refresh findings are resolved.