Skip to content

Defer private Bluetooth GATT open out of D0 entry; document build 26300 investigation - #4

Open
kutear wants to merge 1 commit into
aisk:masterfrom
kutear:fix/defer-bluetooth-gatt-open
Open

kutear wants to merge 1 commit into
aisk:masterfrom
kutear:fix/defer-bluetooth-gatt-open

Conversation

@kutear

@kutear kutear commented Nov 19, 2026

Copy link
Copy Markdown

Summary

Defer opening the private Bluetooth GATT session from BluetoothStart (called by StadiaD0Entry) to the existing first-rumble work-item path. Reset the open backoff on each start, retaining lazy reopen and stop cleanup. Add a controlled diagnostic procedure and a clearly labeled, unverified Windows 26300 baseline.

Draft: this is a startup isolation/hardening candidate, not a verified fix for build 26300 or a claim of ABI compatibility.

Motivation / observed baseline

Testing v0.2.0 on Windows 11 x64 26300.9457 + Intel AX200 Bluetooth 24.10.0.4 produced repeated Xbox connect/disconnect notifications. The installer returned 0; status initially reported no input received; a first XInput rumble request returned 0, but the zero request ~500 ms later returned 1167. No physical rumble success was confirmed. The same controller supports BLE rumble on macOS; the Windows inbox output path returns error 87.

No crash or changed private vtable slot has been established. The UMDF Operational channel was disabled. Removal also encountered applications holding the device open and required a restart, so the installation/connection lifecycle is a confounder. Module versions are recorded in the diagnostic document: the OS reports 26300 but the relevant Bluetooth binaries have 26100-series file versions. That is not proof of ABI stability either.

Why this change

BluetoothStart currently opens private GATT synchronously while the HID service is entering D0. Opening involves multiple asynchronous operations, each polled with a 2-second timeout. Input startup should not need to wait for an undocumented rumble interface. The existing BluetoothSendOutputReport already opens on demand from the rumble worker, so removing the eager open gives a small, reviewable way to separate input/power startup from output initialization.

Tradeoff: first nonzero rumble can take longer. This does not remove private-ABI risk when rumble is actually requested, nor change any vtable slot. Applications can trigger rumble automatically; the documented comparison accounts for that.

Validation

  • git diff --check: passed.
  • Source invariants checked: D0 no longer opens GATT; output retains lazy open and strips the report ID; stop retains session cleanup.
  • Not compiled locally: the Windows test host has no detected MSVC C++ tools / Windows SDK installation.
  • Not hardware-tested: the candidate has not been installed; baseline v0.2.0 was removed after connection cycling. Input, first rumble, reconnect, sleep/resume and USB regression checks remain pending.
  • CI / maintainer hardware review requested before treating this as a fix.

The accompanying diagnostics document distinguishes these observations from hypotheses and provides an input-only/first-rumble comparison and log collection steps without publishing device addresses or user information.

AI-assisted analysis and patch, submitted at the affected user's request.

@kutear

kutear commented Nov 19, 2026

Copy link
Copy Markdown
Author

Hardware validation update: built the candidate on windows-2025 in fork Actions run https://github.com/kutear/WinStadia/actions/runs/44568829714 (787727a; same driver patch as 3514ccf, plus manual CI trigger). After rebooting the Windows 26300.9457 test host to complete the prior uninstall, verified inbox BLE input (396 reads in 15s), exited Steam, enabled UMDF diagnostics and installed the candidate (pnputil exit 0). A 20-second input-only watch received changing stick/button/trigger reports without the status handle failing. First XInput rumble returned 0; after 3 seconds status reported receiving input, no error and RumbleWrites=1. The zero request returned 0; after another 3 seconds RumbleWrites=2, still receiving input with no reported error. Physical vibration confirmation from the user is pending, as are reconnect/resume and longer-duration tests. This is evidence of successful private GATT writes on this host, NOT yet an A/B demonstration that the patch fixes the previous reconnects; reboot and application state also changed. Keeping the PR draft.

@kutear

kutear commented Nov 19, 2026

Copy link
Copy Markdown
Author

User confirmation following the candidate hardware test: physical Bluetooth vibration was felt, and repeated Xbox controller connect/disconnect notifications are no longer occurring during the current short test. Thus short-duration BLE input + actual rumble + stop have passed on Windows 26300.9457 / Intel AX200 24.10.0.4. Reconnect, sleep/resume, longer gameplay, and controlled baseline A/B remain untested; no definitive root-cause attribution to this patch yet. Keeping draft until broader validation.

@kutear
kutear marked this pull request as ready for review November 19, 2026 17:03
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.

1 participant