WIP: Android: DualSense mode, rumble, haptics and lights on the controller #830

Draft
aoleg94 wants to merge 9 commits from aoleg94/android-dualsense-output into main
aoleg94 commented 2026-10-03 17:42:02 -05:00 (Migrated from github.com)

Stacked on #828 (includes its commits until it is merged).

Summary

The app never enables DualSense mode, so the console sends no haptics, trigger effects or
lightbar colours, and rumble always plays on the phone. This adds:

  • Settings → DualSense features (PS5): Auto (default, on when a DualSense or DualSense Edge
    is connected at stream start) / On / Off. Non-DualSense and touch-only users connect exactly as
    before.
  • Rumble on the controller (Android 12+, InputDevice.getVibratorManager()), falling back
    to the phone's vibrator as before when the controller can't rumble.
  • Settings → PS5 haptics as rumble: Off / Very weak / Weak / Normal (default) / Strong /
    Very strong. PS5 haptic audio is converted to rumble the same way desktop's
    QueueRumbleHaptics does, scaled by the console's vibration intensity setting.
  • Lightbar colour and player LED through InputDevice.getLightsManager() (Android 12+).

Implementation

  • JNI forwards the lib's DualSense events (trigger effects, LED colour, player index, haptic and
    trigger intensity, haptics strength) to Session.
  • OutputRouter sends rumble/haptics/lights to the active controller through a backend
    (InputDeviceOutput, PhoneVibratorOutput) and replays state when the controller changes.

Limitations

What reaches the pad through public APIs depends on the kernel's hid-playstation driver. On
the test phone (kernel 5.10 backport) the lights aren't exposed to Android and rumble uses the
coarse "compatibility" vibration mode, so it feels like a phone motor. #831 adds a direct Bluetooth
path that avoids both.

Testing

  • New DualSenseTest, HapticsRumbleTest, DualSenseIntensityStateTest, OutputRouterTest.
  • Galaxy Z Fold 4 (Android 13) + DualSense over Bluetooth, PS5 (Astro's Playroom, GTA V): DualSense
    mode enables only with a DualSense, rumble on the pad, strength setting has a clear effect,
    touch-only rumble on the phone as before.

Notes

Developed with the assistance of Claude Code, and tested on real hardware as described above.

🤖 Generated with Claude Code

Stacked on #828 (includes its commits until it is merged). ### Summary The app never enables DualSense mode, so the console sends no haptics, trigger effects or lightbar colours, and rumble always plays on the phone. This adds: - **Settings → DualSense features (PS5)**: Auto (default, on when a DualSense or DualSense Edge is connected at stream start) / On / Off. Non-DualSense and touch-only users connect exactly as before. - **Rumble on the controller** (Android 12+, `InputDevice.getVibratorManager()`), falling back to the phone's vibrator as before when the controller can't rumble. - **Settings → PS5 haptics as rumble**: Off / Very weak / Weak / Normal (default) / Strong / Very strong. PS5 haptic audio is converted to rumble the same way desktop's `QueueRumbleHaptics` does, scaled by the console's vibration intensity setting. - **Lightbar colour and player LED** through `InputDevice.getLightsManager()` (Android 12+). ### Implementation - JNI forwards the lib's DualSense events (trigger effects, LED colour, player index, haptic and trigger intensity, haptics strength) to `Session`. - `OutputRouter` sends rumble/haptics/lights to the active controller through a backend (`InputDeviceOutput`, `PhoneVibratorOutput`) and replays state when the controller changes. ### Limitations What reaches the pad through public APIs depends on the kernel's `hid-playstation` driver. On the test phone (kernel 5.10 backport) the lights aren't exposed to Android and rumble uses the coarse "compatibility" vibration mode, so it feels like a phone motor. #831 adds a direct Bluetooth path that avoids both. ### Testing - New `DualSenseTest`, `HapticsRumbleTest`, `DualSenseIntensityStateTest`, `OutputRouterTest`. - Galaxy Z Fold 4 (Android 13) + DualSense over Bluetooth, PS5 (Astro's Playroom, GTA V): DualSense mode enables only with a DualSense, rumble on the pad, strength setting has a clear effect, touch-only rumble on the phone as before. ### Notes Developed with the assistance of Claude Code, and tested on real hardware as described above. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
This pull request is broken due to missing fork information.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'aoleg94/android-dualsense-output:aoleg94/android-dualsense-output'
git switch 'aoleg94/android-dualsense-output'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'aoleg94/android-dualsense-output'
git switch 'aoleg94/android-dualsense-output'
git rebase 'main'
git switch 'main'
git merge --ff-only 'aoleg94/android-dualsense-output'
git switch 'aoleg94/android-dualsense-output'
git rebase 'main'
git switch 'main'
git merge --no-ff 'aoleg94/android-dualsense-output'
git switch 'main'
git merge --squash 'aoleg94/android-dualsense-output'
git switch 'main'
git merge --ff-only 'aoleg94/android-dualsense-output'
git switch 'main'
git merge 'aoleg94/android-dualsense-output'
git push origin 'main'
Sign in to join this conversation.
No description provided.