Skip to content

fix(profiles): Switch Pro improvements - #114

Draft
ReenigneArcher wants to merge 5 commits into
masterfrom
fix/switch-improvements
Draft

fix(profiles): Switch Pro improvements#114
ReenigneArcher wants to merge 5 commits into
masterfrom
fix/switch-improvements

Conversation

@ReenigneArcher

@ReenigneArcher ReenigneArcher commented Aug 27, 2026

Copy link
Copy Markdown
Member

Description

Route Linux Switch Pro controllers through descriptor-driven UHID, share the native handshake/reply protocol with Windows, and pack live IMU samples into Switch input reports. The API, control UI, tests, and docs now expose Switch Pro player LED output support and document the updated Linux backend behavior.

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 27, 2026

Copy link
Copy Markdown

❌ 1 Tests Failed:

Tests completed Failed Passed Skipped
221 1 220 0
View the top 1 failed test(s) by shortest run time
LinuxBackendTest::SocketpairBackedSwitchProUsesNativeUhidProtocol
Stack Traces | 0.12s run time
.../tests/unit/test_linux_backend.cpp:793
Value of: result.switch_pro.saw_subcommand_reply
  Actual: false
Expected: true

To view more test analytics, go to the Test Analytics Dashboard
📋 Got 3 mins? Take this short survey to help us improve Test Analytics.

@ReenigneArcher ReenigneArcher changed the title Add native Switch Pro IMU and player LED support fix(profiles): Switch Pro improvements Aug 27, 2026
@ReenigneArcher
ReenigneArcher force-pushed the fix/switch-improvements branch 6 times, most recently from 7766ae1 to 8bef278 Compare August 27, 2026 22:14
Route Linux Switch Pro controllers through descriptor-driven UHID, share the native handshake/reply protocol with Windows, and pack live IMU samples into Switch input reports. The API, control UI, tests, and docs now expose Switch Pro player LED output support and document the updated Linux backend behavior.
@ReenigneArcher
ReenigneArcher force-pushed the fix/switch-improvements branch from 8bef278 to bfeef3c Compare August 27, 2026 23:29
Set the Switch Pro profile version to `0x0210` (matching physical hardware revision behavior) and extend tests to assert the profile version and Windows HID `VersionNumber` exposure. Update platform and end-user compatibility docs with revised Switch Pro motion/battery status, HOME LED limitations, and refreshed validation notes across Windows/Linux and Moonlight clients.
@ReenigneArcher
ReenigneArcher force-pushed the fix/switch-improvements branch from 102f7c6 to 3c07292 Compare August 28, 2026 01:39
Update native Switch Pro input reports to advance Nintendo's packet timer by three for each full-state IMU batch. This better matches physical controller behavior so Windows HID consumers can detect fresh motion data, and it documents the remaining Steam retest gap. Unit and Windows consumer tests were updated to cover the timer progression.
Replace the separate full-state timer (incrementing by 3) with a single per-device counter shared by both subcommand replies (0x21) and full-state input reports (0x30). The counter now increments by 1 per report, matching native controller behavior. On Windows the counter is stored per-device in the VHF record and stamped at submission time. The shared `next_switch_pro_packet_timer` helper is moved to `switch_pro_protocol.hpp` and accepts an optional override so callers can inject a specific value.
Cache the latest native Switch Pro input report in the Windows backend and resend it every 15 ms to match the controller's native 0x30 report cadence. This coalesces separate motion updates, adjusts HID consumer tests to match reports by type instead of exact packet counters, and updates the related Windows support documentation.
@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
1 New issue
1 New Code Smells (required ≤ 0)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

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.

Linux: expose Switch Pro motion through UHID Steam and Chromium rumble gaps for PlayStation and Switch Pro virtual gamepads

1 participant