Fix SDL DualSense triggers/touchpad and restore native PS5 haptics/effects #543
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/gamingwithhomie--larp!543
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-543"
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?
@wh1te-rgb on GitHub · 2026-12-06 02:19 UTC · original
wh1te-rgb:pr/dualsense-native→main· +1695 −187 · 11 files · 2 commits · openFixes two bugs preventing DualSense features from working when
SDL3.dllis present, and ports Darner's native PS5 DualSense stack (originally derived fromlobomfz/VIctory-xmem#273) for trigger effects, rumble curve, R2 vehicle notch, lightbar sync, and actuator haptics.Fixes (SDL + PlayStation HID)
sdl.rs,playstation.rs):playstation::pads()was only called by the XInput fallback (Host::pad), so whenSDL3.dllhandled input, no Sony HID output handle was ever opened and adaptive triggers never fired. Now callsplaystation::ensure_running()on0x054Cconnect and wheninstall_hookinitializes.sdl.rs,playstation.rs): Sending rumble viaSDL_RumbleGamepadon Sony pads overwrote DualSense HID adaptive-trigger reports.sdl.rsnow detectsVID == 0x054C(is_sony) and forwards rumble throughplaystation::rumble_all()so motors and adaptive triggers share one HID output report. Non-Sony (Xbox) pads are untouched and still useSDL_RumbleGamepad.VIEW(sdl.rs): Adds(20, VIEW)(SDL_GAMEPAD_BUTTON_TOUCHPAD) toBUTTONSalongside(4, VIEW)(back), matching native HID (playstation.rs) so pressing the DualSense touchpad opens the map without affecting Xboxback/View.Native PS5 DualSense Stack (ported from Darner)
ps5_trigger.rs,playstation.rs): Replaces the float-basedeffect()decoder with Darner's native PS5 byte-encoded trigger decoding (Feedback,Weapon,Vibration,MultiFeedback,MultiVibration,Slope,Offontarget 2/3), syncstarget 4lightbar colors (TITLE_LIGHTBAR), holds hooked effects until explicit release (0x05), and sends an initial[0xFF; 11]release on connect.vehicle_notch.rs): Ports Darner's PS5 R2 notch hook (0x140d1b510/0x140d1ab6a) usinglarp_loader::call_stub.ps5_rumble.rs): Ports Darner's PS5 motor split curve (0x140c16170/0x1441c5e30) in place of the Xbox motor curve.haptics.rs,larp-hle/Cargo.toml,apps/larp/src/run.rs): Ports Darner'sPadHapticsmixer hook (0x144e59960) playing its stereo submix on channels 3–4 of wired DualSense USB audio via WASAPI (LARP_DS_HAPTICS,LARP_HAPTICS_GAIN_DB).playstation.rs,docs/environment-variables.md):LARP_DS_TRIGGERSandLARP_DS_HAPTICSdefault to enabled when a PlayStation controller is detected (0disables).Verification
cargo check -p larp-hle -p larpcargo test -p larp-hle gameinput(43 passed, 2 hardware tests ignored)@wh1te-rgb on GitHub · 2026-12-06 02:37 UTC · original
Pushed
e673818to proactively address the real-time safety and hook-boundary points raised on #495 / #496, plus clarify how this relates to those PRs:haptics.rs):push_nonblockingnow usesRING_STATE.try_lock()on the title's mixer thread and counts any contended block (DROPPED_CONTENDED) instead of blocking the audio thread.playstation.rs): Addedhaptics::active()+rumble_report_for_modeso wired USB DualSense audio haptics clear only legacy compatible rumble (0x00) while keeping triggers independent (0x04 | 0x08) and falling back to0x03over Bluetooth or when WASAPI haptics is inactive; addedpossible_triggers+WRITE_MSretry on transient HID write failures.playstation.rs,vehicle_notch.rs,ps5_rumble.rs, andhaptics.rsverifying undersized images or mismatched target bytes refuse hook installation cleanly (cargo test -p larp-hle gameinput: 50 passed, 2 hardware tests ignored).Note: unlike #495/#496, this PR also includes the
sdl.rsfixes required whenSDL3.dllis loaded (starting Sony HID output viaensure_running(), routing Sony rumble viarumble_all(), and mappingSDL_GAMEPAD_BUTTON_TOUCHPAD->VIEWwithout affecting Xboxback).View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.