Skip to content

fix: DualShock4 and DualSense improvements - #94

Open
ReenigneArcher wants to merge 2 commits into
masterfrom
fix/linux
Open

fix: DualShock4 and DualSense improvements#94
ReenigneArcher wants to merge 2 commits into
masterfrom
fix/linux

Conversation

@ReenigneArcher

Copy link
Copy Markdown
Member

Description

Screenshot

Issues Fixed or Closed

Roadmap Issues

Type of Change

  • feat: New feature (non-breaking change which adds functionality)
  • fix: Bug fix (non-breaking change which fixes an issue)
  • docs: Documentation only changes
  • style: Changes that do not affect the meaning of the code (white-space, formatting, missing semicolons, etc.)
  • refactor: Code change that neither fixes a bug nor adds a feature
  • perf: Code change that improves performance
  • test: Adding missing tests or correcting existing tests
  • build: Changes that affect the build system or external dependencies
  • ci: Changes to CI configuration files and scripts
  • chore: Other changes that don't modify src or test files
  • revert: Reverts a previous commit
  • BREAKING CHANGE: Introduces a breaking change (can be combined with any type above)

Checklist

  • Code follows the style guidelines of this project
  • Code has been self-reviewed
  • Code has been commented, particularly in hard-to-understand areas
  • Code docstring/documentation-blocks for new or existing methods/components have been added or updated
  • Unit tests have been added or updated for any new or modified functionality

AI Usage

See our AI usage policy.

  • None: No AI tools were used in creating this PR
  • Light: AI provided minor assistance (formatting, simple suggestions)
  • Moderate: AI helped with code generation or debugging specific parts
  • Heavy: AI generated most or all of the code changes

@codecov

codecov Bot commented Aug 19, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 75.27%. Comparing base (d98966e) to head (0c38b9f).
✅ All tests successful. No failed tests found.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #94      +/-   ##
==========================================
+ Coverage   75.23%   75.27%   +0.04%     
==========================================
  Files          34       34              
  Lines        8091     8105      +14     
  Branches     3030     3032       +2     
==========================================
+ Hits         6087     6101      +14     
+ Misses       1467     1446      -21     
- Partials      537      558      +21     
Flag Coverage Δ
FreeBSD 51.76% <57.89%> (+0.13%) ⬆️
Linux-Clang 57.52% <64.86%> (+0.11%) ⬆️
Linux-GCC 68.16% <100.00%> (+0.07%) ⬆️
Windows-MSVC 88.24% <100.00%> (+0.02%) ⬆️
Windows-MinGW-UCRT64 65.01% <100.00%> (+0.07%) ⬆️
macOS 51.21% <57.89%> (+0.08%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
src/core/profiles.cpp 94.87% <100.00%> (ø)
src/core/report.cpp 93.12% <100.00%> (+0.11%) ⬆️
src/platform/linux/uhid_backend.cpp 81.28% <100.00%> (+0.01%) ⬆️

... and 1 file with indirect coverage changes


Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d98966e...0c38b9f. Read the comment docs.

@Kishi85

Kishi85 commented Aug 19, 2026

Copy link
Copy Markdown

As a small note: you might want to use Bluetooth as the default profile type for DualShock4 as well as it's using the same playstation kernel driver and therefore is likely to have similar issues to DualSense. Not sure about the Gyro stuff but the same note might apply for that.

EDIT: Did a quick test with ba53378 applied. Result is looking a lot better for the gyro but there's still noise spikes that cause the calibration to fail before it can finish. I know it's still a draft and you're working on it but I wanted to let you know that you're already getting a lot closer to solving this.

@ReenigneArcher
ReenigneArcher force-pushed the fix/linux branch 2 times, most recently from 780c758 to b7cd9a1 Compare August 19, 2026 21:09
@ReenigneArcher ReenigneArcher changed the title fix: DualSense improvements fix: DualShock4 and DualSense improvements Aug 19, 2026
@ReenigneArcher

Copy link
Copy Markdown
Member Author

@Kishi85 thanks! I was going to ping you after I had time to test this, but you can probably test everything on the Linux side faster than me.

I added some adjustments for DS4 as well a tweak that may fix the gyro spikes.

I probably should have tested this better in the first place, but I guess I overlooked the gyro stuff (as I normally prefer the Xbox pads). I'm assuming Moonlight Android doesn't support the gyro and probably just QT does? If so I'll need to find a better way to test this.

@Kishi85

Kishi85 commented Aug 19, 2026

Copy link
Copy Markdown

@Kishi85 thanks! I was going to ping you after I had time to test this, but you can probably test everything on the Linux side faster than me.

I added some adjustments for DS4 as well a tweak that may fix the gyro spikes.

I probably should have tested this better in the first place, but I guess I overlooked the gyro stuff (as I normally prefer the Xbox pads). I'm assuming Moonlight Android doesn't support the gyro and probably just QT does? If so I'll need to find a better way to test this.

I'll test the latest commit first thing tomorrow and give you feedback.

Moonlight-Android does support the gyro but IIRC there's a config option that needs to be enabled for gyro data to be sent to Sunshine.

@ReenigneArcher

ReenigneArcher commented Aug 19, 2026

Copy link
Copy Markdown
Member Author

I must be blind because I don't see any such option with the DualSense connected to the Nvidia Shield. I see something about it in the code though. https://github.com/moonlight-stream/moonlight-android/blob/f10085f552b367cf7203007693d91c322a0a2936/app/src/main/java/com/limelight/preferences/StreamSettings.java#L304

Edit: Gyro is still noisy, looking into it more.

Edit 2: Confirmed calibration works in CachyOS host using Moonlight QT in LizardByte/Sunshine#5531

Also discovered that rumble starts working only after opening the calibration in steam, even if rumble is already on before opening the calibration. That's probably a steam bug I guess.

Edit 3: DS4 seems to be working just as well (now). This needed some additional tweaks though in 0c38b9f

DualShock 4 Bluetooth input reports now set the HID-present header bit (0x80) while keeping existing BT framing and CRC behavior. This enables HIDAPI/SDL consumers to accept live input after hotplug on Linux. Updated report and Linux consumer tests to assert the new behavior, and refreshed platform-support docs to describe the BT report contract and unchanged transport boundaries.
@sonarqubecloud

Copy link
Copy Markdown

@ReenigneArcher
ReenigneArcher marked this pull request as ready for review August 20, 2026 01:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants