Skip to content

Forward Sony controller input through owned native HID sessions - #974

Merged
capy-ai[bot] merged 1 commit into
devfrom
capy/forward-sony-controller-input
Sep 16, 2026
Merged

capy-ai[bot] merged 1 commit into
devfrom
capy/forward-sony-controller-input

Conversation

@zortos293

Copy link
Copy Markdown
Collaborator

Scope

Adds the Sony input path to the Qt/native client: complete typed SDL snapshots flow through one shared wire adapter, C ABI 11, bounded native HID state, and the existing reliable NVST control channel. This PR contains only the 38-file Sony delta on merged dev c1bd5f95. The Windows UDP correction and decoder-fixture pacing fix are already in its base.

Ownership and recovery

  • Source claims and snapshots use the selected logical player consistently. New claims precede reports; source/session incarnations reject stale input and rumble.
  • Capture loss preserves a neutral release across rapid resume without pretending the device detached. Removal releases before retiring the remote ID. Retired IDs cannot be rebound within the same association, so a replacement or selection change can use ordinary-gamepad fallback.
  • Endpoint guards close on failed startup and terminal paths. Admission and enqueue share synchronization. Healthy shutdown flushes release/removal through the real peer before disconnect.
  • The control writer reserves separate 64 KiB normal and teardown budgets within a 128 KiB total. Existing decoder-only recovery remains independent of input ownership.

End-to-end verification

The Linux Qt integration test uses virtual SDL devices, the production ControllerInput, shared SonySnapshotWire adapter, real NativeStreamRuntime/FFI, an accepted software-decoding session, and a genuine local ICE/DTLS/SCTP peer. It checks actual received reports, not just queued bytes or an idle runtime.

Six scenarios cover buttons/touch/click and both Sony Y signs; negotiated ordinary fallback and Y inversion; capture neutralization with rapid resume; detach/replacement tombstones; selected-second-source logical-zero claims and in-session selection; and peer-originated rumble routed to the selected physical source. Inactive/retired rumble is checked after an exact native post-dispatch receipt and two subsequent ordered cursor events that drain the callback path.

The peer has separate physical/logical ICE addressing, bounded stdin lines/commands and per-iteration work, and an isolated probe-only Cargo build. Its diagnostic capture has owned cleanup and bounded storage. A focused Sony test build explicitly deploys the peer. The ALSA null fixture is explicit, not a developer-machine configuration dependency.

Checks

  • Independent parent replay: 869 bundled-native tests passed, 16 ignored, with --features linux-ffmpeg-bundled.
  • Strict Clippy covers the whole workspace/all targets with bundled FFmpeg and the peer feature; formatting passed.
  • Full primary Qt suite: 351/351 passed. Final focused chain replay: six scenarios, eight QtTest passes including setup/cleanup, zero skips.
  • 158 contracts and localization passed. The software-ready Qt acceptance mode was also explicitly rendered and inspected.
  • Real-peer shutdown, endpoint lifecycle, stale-incarnation, release-ordering, and budget/flood regressions passed. The bounded peer-line regression was reproduced on the original binary and rejected by the corrected binary.

Limits

The end-to-end peer is local and the SDL devices are virtual. This does not claim authenticated GFN gameplay or physical USB qualification. G29/HOTAS production support remains blocked on the separately documented physical output, release, identity, and remote-activation gates; this PR does not silently enable or defer those profiles. No nightly signing, tag, version bump, or release is triggered here.

Open in Capy

@coderabbitai

coderabbitai Bot commented Sep 16, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: 20d8f092-730f-49af-8dbb-d9e8c028979c

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@capy-ai
capy-ai Bot merged commit 99f96bb into dev Sep 16, 2026
14 checks passed
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