Skip to content

hid: answer vibration device mounted queries - #726

Closed
thehobbit85 wants to merge 1 commit into
seedds:mainfrom
thehobbit85:codex/fix-vibration-device-mounted
Closed

thehobbit85 wants to merge 1 commit into
seedds:mainfrom
thehobbit85:codex/fix-vibration-device-mounted

Conversation

@thehobbit85

@thehobbit85 thehobbit85 commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

Superseded by main

Main landed the same public vibration-device query in 6fe1927e, after this PR was opened. Its h && vib_targets(*h) expression returns the same normalized boolean as this PR. The runtime fix for #715 is therefore already present, with tests and documentation. Closing this duplicate PR; its broader synthetic coverage remains available in the branch.


What and why

Odyssey 1.4.1 asks whether a vibration device is mounted when entering a Sand Kingdom pipe. The query was missing from HID takeovers, so it ran the SDK's hid IPC client, failed to connect to the unsupported service, and dereferenced its null service object. Take over the public query and answer from the same validated live channel targets used by device information and vibration sends.

The answer is a normalized boolean, including player 2 or merged-controller output masks. Invalid/stale handles, no sink, disabled rumble and missing outputs return false; a playback suspension does not unmount a routed output. The change is general and adds no game profile rules.

Fixes #715.

Checked

  • Regression test first: guest-symbol lookup reported the missing takeover (144 checks, 1 failure). With the fix, t_hid passes 162 checks, covering output attachment/removal, cached startup handles, invalid handles, docked/handheld changes, player isolation/merging, suspended playback and disabled rumble.
  • make -C dm/host/tests GAME=0100000000010000 run: pass.
  • make -C dm/host/tests GAME=0100000000010000 asan tsan-threads: pass (full ASan/UBSan suite and general thread targets); make -C dm/host/tests GAME=0100000000010000 tsan: pass, including 162 HID checks.
  • Documentation tests: 11/11 pass; symptom index regenerated; git diff --check clean.
  • C compile database generated (196 sources). Local C lint could not run because clang-tidy is unavailable; no dependencies were installed. CI must complete the native lint ratchet.
  • Existing-solution check: issue timeline is empty; all-state PR searches for IsVibrationDeviceMounted and 715 return none; inspected the overlapping vibration-handle (Vibration handles before a controller's haptics are routed (a game that asks once at startup lost every value) #246), original vibration (Switch HD vibration on iOS: nn::hid's rumble goes to Core Haptics #86) and Switch 2 BLE (iOS: Switch 2 Pro Controller over CoreBluetooth #645) diffs. Current main still lacks this takeover.

No game files or controller hardware were used. The reported stack establishes the missing SDK call and the synthetic tests exercise its host replacement. The Sand Kingdom route and physical rumble have not been gameplay/device validated. No shader-chain files changed.

Static impact (no local game files)

regress.py impact origin/main..HEAD

0 games use what the change touches, 0 only through a broad rule (every game of its API), 4 not affected, 112 unknown (no usage manifest); 5 files changed, 2 NVN / HLE entry points reached through the host's callers, 0 rules of dm/tools/impact_map.tsv

game status what it uses of the change (kind: name ×count; for broad, the broad rows)
Hades 0100535012974000 not affected
The Legend of Zelda: Breath of the Wild 01007EF00011E000 not affected
Pokémon Scarlet 0100A3D008C5C000 not affected
The Legend of Zelda: Tears of the Kingdom 0100F2C0115B6000 not affected

Unknown (no usage.tsv): 112 profiles (--all lists them).

Why

  • hle:_ZN2nn3hid24IsVibrationDeviceMountedERKNS0_21VibrationDeviceHandleE ← dm/host/hle_hid.c: calls reach it from h_hid_SixFw, h_hid_VibMounted
  • hle:_ZN2nn3hid41IsFirmwareUpdateAvailableForSixAxisSensorERKNS0_19SixAxisSensorHandleE ← dm/host/hle_hid.c: calls reach it from h_hid_SixFw, h_hid_VibMounted

The new query is not recorded in the four committed usage manifests, so that report does not establish that other games are unaffected. The issue establishes Odyssey reaches it; runtime validation remains open for Odyssey and other importers.

Docs

Added the service finding and Odyssey note; regenerated the symptom index.

@thehobbit85
thehobbit85 deleted the codex/fix-vibration-device-mounted branch November 1, 2026 04:44
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.

Super Mario Odyssey: crash entering a Sand Kingdom pipe with rumble on (HD Rumble: IsVibrationDeviceMounted has no HLE)

2 participants