Support the Bluetooth Xbox 0x02FD pad and fix Xbox tray display#6
Merged
Conversation
…ptor fixup The Bluetooth Xbox Wireless Controller reporting product 0x02FD ships a truncated HID report descriptor (five COLLECTIONs opened, three closed). The kernel rejects it, so no driver binds and the pad produces no input device at all -- invisible to the tray and to every application, while a sibling pad reporting 0x02E0 works. Add a HID-BPF report-descriptor fixup that appends the two missing END_COLLECTION bytes, yielding the balanced descriptor the working pad already has; the only content lost is the tail of one force-feedback field the firmware had already truncated. install.sh builds it against the running kernel's BTF and installs it via udev-hid-bpf, treating a missing build toolchain as a skip-with-warning so DualSense-only setups are unaffected. The program matches product 0x028E -- xpadneo rewrites 0x02FD to 0x028E in its probe before we are attached -- with 0x02FD as a fallback, scoped to Bluetooth, and guards on the exact broken descriptor so pads on fixed firmware and unrelated 0x028E devices are left alone.
xpadneo rewrites both Bluetooth Xbox pads (0x02E0 and 0x02FD) to product
0x028E, so keying a display name on 0x028E mislabelled every Bluetooth
Xbox pad as 'Xbox 360'. Drop that mapping and fall back to the accurate
kernel name ('Xbox Wireless Controller'); two such pads share a base name
and are disambiguated by player number, like identical DualSense pads.
Render a single-choice family (Xbox: native only) as a static, disabled
line instead of a lone always-checked radio that does nothing when
clicked. It reverts to per-mode radios automatically if a second mode is
ever enabled for the family. Update the multi-pad menu test accordingly.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
A Bluetooth Xbox Wireless Controller reporting product
0x02FDpaired and connected (BlueZ showed itConnectedwith the HID service) but produced no input device at all — noevent*,js*, orhidraw*. It was invisible to the tray and to every application (tested in RetroArch). Two DualSense pads and a sibling Xbox pad (0x02E0) on the same host worked.Root cause is below this project, in the kernel HID layer: the
0x02FDfirmware advertises a truncated HID report descriptor (fiveCOLLECTIONs opened, only three closed).hid_open_report()rejects it, so no driver binds:The working
0x02E0sibling ships a well-formed 306-byte descriptor ending in… 81 02 c0; the only structural difference is the two missingEND_COLLECTIONbytes. This is a per-firmware bug Microsoft fixed later, but that update is only reachable via Windows / an Xbox console.Changes
feat(install)— HID-BPF descriptor fixup. AHID_BPF_RDESC_FIXUPprogram (hid-bpf/) appends the two missingEND_COLLECTIONbytes, producing exactly the balanced descriptor the working pad already has.install.shbuilds it against the running kernel's BTF and installs it viaudev-hid-bpf; a missing build toolchain is a skip-with-warning so DualSense-only setups are unaffected. The program matches0x028E(xpadneo rewrites0x02FD → 0x028Ein its probe before we attach) with0x02FDas a fallback, scoped to Bluetooth, and guards on the exact broken descriptor so fixed-firmware pads and unrelated0x028Edevices are untouched. Full rationale indocs/decisions/xbox-02fd-hid-bpf.md.fix(manager)— Xbox tray display. xpadneo rewrites both BT Xbox pads to0x028E, so the old0x028E → "Xbox 360"name mislabelled every BT Xbox pad; dropped it so they fall back to the accurate kernel name (Xbox Wireless Controller), disambiguated by player number. A single-choice family (Xbox: native only) now renders as a static disabled line instead of a lone always-checked radio; it reverts to radios automatically if a second mode is enabled.Verification
0x02FDpad comes up unaided via the real path (xpadneo's failing probe first, then the udev rule): descriptor 308 bytes / balanced,hid-genericbinds,js0appears.0x02E0(xpadneo) +0x02FD(fixed) all adopted with correct independent names; service healthy.scripts/validate-repo.shpass.