Skip to content

fix(Linux): add Xbox One/Series UHID Bluetooth transport - #115

Open
ReenigneArcher wants to merge 1 commit into
masterfrom
fix/linux/xbox-uhid
Open

fix(Linux): add Xbox One/Series UHID Bluetooth transport#115
ReenigneArcher wants to merge 1 commit into
masterfrom
fix/linux/xbox-uhid

Conversation

@ReenigneArcher

@ReenigneArcher ReenigneArcher commented Aug 28, 2026

Copy link
Copy Markdown
Member

Description

Route Xbox One and Xbox Series gamepads through descriptor-driven uhid on Linux using native Bluetooth identities (0x0B20/0x0B13) and a 283-byte BLE report descriptor. This exposes canonical ABS_RX/ABS_RY and ABS_Z/ABS_RZ axes for Steam and enables independent four-motor trigger rumble via report ID 3 output parsing.

Both profiles now advertise supports_trigger_rumble. A uinput fallback is retained when /dev/uhid is unavailable, but it clears trigger-rumble support. Physical and unique IDs are scoped by vendor:product to avoid metadata collisions across profile changes. Adds SDL3 consumer probe and socketpair-backed unit tests validating the full transport lifecycle.

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

@ReenigneArcher
ReenigneArcher force-pushed the fix/linux/xbox-uhid branch 2 times, most recently from becd909 to 73f0e1a Compare August 28, 2026 19:28
@codecov

codecov Bot commented Aug 28, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 91.42857% with 9 lines in your changes missing coverage. Please review.
✅ Project coverage is 73.42%. Comparing base (70f9843) to head (eb6e80a).
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/platform/linux/uhid_backend.cpp 91.00% 3 Missing and 6 partials ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #115      +/-   ##
==========================================
+ Coverage   70.77%   73.42%   +2.64%     
==========================================
  Files          34       34              
  Lines        9026     9188     +162     
  Branches     3125     3420     +295     
==========================================
+ Hits         6388     6746     +358     
+ Misses       1831     1788      -43     
+ Partials      807      654     -153     
Flag Coverage Δ
FreeBSD 52.76% <80.00%> (+0.03%) ⬆️
Linux-Clang 54.92% <63.63%> (-0.11%) ⬇️
Linux-GCC 65.80% <91.57%> (?)
Windows-MSVC 88.28% <100.00%> (+<0.01%) ⬆️
Windows-MinGW-UCRT64 62.91% <100.00%> (+0.04%) ⬆️
macOS 48.67% <100.00%> (+0.03%) ⬆️

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

Files with missing lines Coverage Δ
src/core/gamepad_adapter.cpp 98.78% <100.00%> (+<0.01%) ⬆️
src/core/profiles.cpp 94.89% <100.00%> (+1.22%) ⬆️
src/core/report.cpp 94.14% <100.00%> (ø)
src/include/libvirtualhid/types.hpp 97.41% <100.00%> (+0.89%) ⬆️
src/platform/linux/uhid_backend.cpp 81.98% <91.00%> (+12.94%) ⬆️

... and 5 files 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 70f9843...eb6e80a. Read the comment docs.

@ReenigneArcher
ReenigneArcher force-pushed the fix/linux/xbox-uhid branch 19 times, most recently from c0e0cc4 to eb6e80a Compare August 29, 2026 17:17
Route Xbox One and Xbox Series gamepads through descriptor-driven uhid on Linux using native Bluetooth identities (0x0B20/0x0B13) and a 283-byte BLE report descriptor. This exposes canonical ABS_RX/ABS_RY and ABS_Z/ABS_RZ axes for Steam and enables independent four-motor trigger rumble via report ID 3 output parsing.

Both profiles now advertise supports_trigger_rumble. A uinput fallback is retained when /dev/uhid is unavailable, but it clears trigger-rumble support. Physical and unique IDs are scoped by vendor:product to avoid metadata collisions across profile changes. Adds SDL3 consumer probe and socketpair-backed unit tests validating the full transport lifecycle.
@ReenigneArcher ReenigneArcher changed the title fix(Linux): route Xbox pads through UHID fix(Linux): add Xbox One/Series UHID Bluetooth transport Aug 29, 2026
@ReenigneArcher
ReenigneArcher marked this pull request as ready for review August 29, 2026 20:35
@sonarqubecloud

Copy link
Copy Markdown

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: support Xbox Impulse Triggers

1 participant