feat(input): a Steam Controller (2026)'s grips can play under Steam Input, on its own HID device (#3181) #3302
No reviewers
Labels
No labels
area/accessibility
area/audio
area/input
area/install
area/menu
area/mods
area/renderer
area/saves
area/tooling
area/upscaling
beanstalk: approved
beanstalk: failed
beanstalk: needs approval
beanstalk: running
beanstalk: tested
ci: approved
good first issue
gpu/amd
gpu/igpu
gpu/intel
gpu/nvidia
help wanted
kind
bug
kind
chore
kind
docs
kind
feature
kind
performance
kind
question
needs measurements
platform/linux
platform/macos
platform/steam-deck
platform/windows
preview
priority
critical
priority
high
priority
low
regression
risk
high
risk
low
risk
medium
status
blocked
status
confirmed
status
duplicate
status
invalid
status
needs-info
status
wontfix
ci: approved
No milestone
No project
No assignees
3 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot!3302
Loading…
Reference in a new issue
No description provided.
Delete branch "sandymac/Longshot:feat/steam-controller-haptics"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Part 1 of #3181: a Steam Controller (2026)'s HD grip haptics can play under Steam Input (opt-in, experimental), and
Steam Input's stand-in no longer tries the grips and fails.
Under Steam Input the builder's SDL opens two pads for one Steam Controller (2026). One is Steam's stand-in pad, which
carries the controller's ids (
28de:1302). The other is the real controller, read for its motion only (#3045). Onmainit went wrong like this:VIB_RH_STEAM).0x88to a node that isn't the controller's, and the writes failed.the Steam Controller's grip reports keep failing: its motors insteadand fell back to Steam'smotor rumble. It tried the grips again every 30 s.
To see it on
main: on SteamOS, play with a Steam Controller (2026) under Steam Input and draw the slingshot. The logshows those lines, and the controller only gets Steam's motor rumble.
This PR:
Steam's Game rumble switch and intensity apply. This is
main's rumble without the failing writes.HOS_STEAM_CONTROLLER_HAPTICS=1(opt-in, experimental; anattemptrow ingpu/vk/switches.def) plays thegrips. The real controller picks
VIB_RH_STEAM: RenHDrum, writing through the builder's HID writer thread, offthe pads' request thread. Its stand-in stays quiet while they play, so the controller isn't vibrated twice, and
falls back to motors if they stop. It's opt-in because the grips bypass Steam's Game rumble switch and intensity,
which no file of Steam's holds (see Risks).
vibration_steam_pair): exactly one real SteamController, and either the one stand-in with Steam Controller ids or the only stand-in (Steam's handle or
28de:11ff, not its ids, says it's a stand-in). Only that stand-in goes quiet. With two Steam Controllers, or anydoubt, Steam plays them all, as by default.
mode_sentinhost/rumble_renhdrum.c).28de:1305) is a SteamController too. This applies both in
host/vibration.hand in the builder'sOut::fits, which refused its gripreports before.
0x1304(the Puck) and0x1302(a cable) were already covered.docs/dev/reference/input.md, Vibration section.Read first:
vibration_steam_pair,vibration_steam_inputandvibration_steam_pickinhost/vibration.h(the decision,pure functions);
pads_pollandvib_chooseinhost/pad_sdl.c;Out::fitsinbuilder/crates/build-core/src/pads.rs.Part 2 of #3181 (following Steam's rumble intensity) is not in this PR. See Risks, and the comment on #3181.
See #3181.
Testing
Tested:
Steam Input, Steam haptics on, near the start of the game. I drew the slingshot and pressed Controls → Test
vibration several times. The runs below up to the Windows one had the grips on by default (before the review);
each ran with the grips on, as
HOS_STEAM_CONTROLLER_HAPTICS=1now does.28de:1305): the grips played, a subtler vibration than the motors',and no press or draw was skipped. The log shows: There was no
keep failingline in the whole run.Out::fitschange: the same run loggedgrip reports keep failingevery 30 s. The builder refused0x1305.28de:1304): the same result.28de:1302): the same result, with the cable's 8 kHz format (report 0x88, 8 kHz on its cable). On a cable the real controller has the same ids as the stand-in. Longshot still tells them apart (bySteam's handle) and plays the grips on the real one.
the grips resumed. There were no failures and the rumble didn't play twice.
28de:1303): built fromsource on that PC (llvm-mingw) at
8fe6e193, the previous head; the rebase since touches none of this PR's files.The same result: the grips played on the controller's own Bluetooth HID device,
its grips beside Steam Input,the stand-in quiet, no
keep failing. (That build's shader preparation stopped when the NVIDIA driver hung on 2of 38809 programs, so the first launch froze while it compiled them in play. No shader changes here, and an earlier
build on that PC had the same stall.)
haptics-2c16a14f, the same code as the head before its rebase onto6c06d981, which touchesnone of its files), on the Steam Machine's own receiver:
HOS_STEAM_CONTROLLER_HAPTICS=1(logged asswitches set: HOS_STEAM_CONTROLLER_HAPTICS=1 (attempt)): thepair was found, the grips played and felt the same, the stand-in stayed quiet, no
keep failing;"Steam Controller": its motors), no grips,and no
keep failingeither, wheremainlogs it every 30 s.Checks (WSL, Ubuntu):
tests/run_all.pyon the pad, vibration and switch checks (test_vibration_pick,test_vibration_menu,test_steam_pads,test_hid_imu,test_renhdrum,test_rumble_*,test_pad_*,test_input_backgroundandothers, 25 in all): 24 pass.
test_mouse_nativecan't run there (not found: clang), which is the same onmain.test_vibration_pick(vibration_steam_pair,vibration_steam_input,vibration_steam_pick,0x1305; the pair for one or two controllers, a DualSense's stand-in beside, a stand-in without ids) fail onmain, where the functions don't exist.test_vibration_menuchecks the switch is read off by default and thepairing is wired in.
cargo test -p build-core --lib pads: 18 pass. The new0x1305assertions ina_pad_output_goes_only_to_a_pad_of_its_kindfail onmain.cargo clippy -p build-core --all-targets -- -D warnings: clean.cargo fmt --check -p build-core: clean.mise run test --container(CI's container, WSL) at the head,ced284e8: 912 passed, 31 failed, 13 skipped.mainatbe494221, run the same way: 912 passed, 31 failed, 13 skipped, the same 31 checks (none new,none fixed). They are renderer, shader, present and sandbox checks this container can't run, such as
test_host_shaders,test_lifter,test_present_thread,test_sandbox_windowsandtest_utf8_paths.clang-format(not installed there).Still to test: None.
Measurements
Nothing to measure: the grips run on RenHDrum's existing writer thread, and the pads' poll only adds a few comparisons; no frame, build or load path changes.
Risks
Steam's rumble intensity, only affect what goes through the stand-in; the grips follow Longshot's own Vibration
settings. Tested: with Game rumble off in Steam's settings, the grips still played. Turning the switch wrote
nothing to Steam's
.vdffiles, so the game can't read it from there. That's why the grips are opt-in; by defaultSteam's settings apply as on
main.testing, but the two may compete for the grips' mode report.
reconnect, the stand-in is set to motors before it goes quiet. The rumble plays twice only if the game sends some
in that instant.
as by default. Checked by
test_vibration_pick, not on hardware (one Steam Controller here).failing writes behind it; the grips only with
HOS_STEAM_CONTROLLER_HAPTICS=1. A revert is enough.Checklist
Ready for review
main; the title is a Conventional Commit.mise run testpasses (any failure that also fails onmainis named).main, or Measurements says why there is nothing to measure.third_party/untouched; nothing GPL-incompatible.When it applies
mainand passes here.gpu/vk/switches.def.tests/that reads changed source is updated, not weakened.Assisted-by:/Co-Authored-By:trailers.Ready to merge
main, measured again or a comment says why the numbers still hold.🤖 Generated with Claude Code
Under Steam Input the builder's SDL opens Steam's stand-in pad, which carries the controller's ids, and the real controller beside it (motion only). The stand-in picked the grips, wrote report 0x88 to a node that isn't the controller's, failed ("grip reports keep failing") and fell back to motors, again every 30 s; the real controller played nothing. Now the real controller plays its grips (RenHDrum, through the builder's HID writer thread) and the stand-in for it stays quiet while they play; the stand-in never tries the grips itself. HOS_STEAM_CONTROLLER_HAPTICS=0 leaves the vibration to Steam. The grips' mode-off report at the end goes out only when Longshot turned the mode on. A controller through a Steam Machine's own receiver (28de:1305) is a Steam Controller too, in host/vibration.h and in the builder's Out::fits, which refused its grip reports before. Co-Authored-By: Claude Opus 5.5 <[email protected]>Tested in game: SteamOS on a Steam Machine (AMD, RADV NAVI33, Mesa 26.2.0-devel), one Steam Controller (2026) under Steam Input, near the start of the game: drew the slingshot and pressed Controls > Test vibration. The grips played (subtler than the motors, nothing skipped), Steam Input's pad stayed quiet, and the log had no 'grip reports keep failing', through the Steam Machine's own receiver (28de:1305), through the Puck (28de:1304), and switching from the Puck to the receiver mid-game. Build: this change before its rebase onto
a2b7abf9(comments and docs changed since).@review
1091ec41dd8fe6e193d8Recommendation: Request changes. The new default bypasses Steam’s rumble preference, and controller selection can either silence a second controller or vibrate one twice. The single-controller receiver tests show the intended haptics working, but the remaining transport and Windows paths still need runs.
The change sends Steam Controller grip haptics to the real HID device under Steam Input and suppresses the stand-in’s rumble. It fixes the reported receiver case, but its global suppression and bypass of Steam settings cause player-visible regressions.
Blocking (3): must change before merging.
host/pad_sdl.c:978: The default sends grip haptics independently of Steam’s per-controller rumble setting and intensity. (more on the line) Do: Honor Steam’s rumble enable and intensity when driving the grips, or keep this path opt-in until those settings can be honored.host/pad_sdl.c:950: One controller’s active grips silence every recognized Steam Controller stand-in. (more on the line) Do: Associate each real controller with its stand-in and suppress only the matching stand-in; leave other stand-ins on Steam rumble.host/vibration.h:112: A Steam Input stand-in without the physical controller’s IDs is never suppressed. (more on the line) Do: Identify the corresponding stand-in independently of its reported product ID, and suppress it only while that controller’s grips are active.Testing before merging (2) (runs on the systems it can change; it doesn't hold the recommendation)
host/pad_sdl.c:978: The USB and Bluetooth grip paths have not been exercised under Steam Input. (more on the line) Do: Run the slingshot and vibration test over USB and Bluetooth, including fallback and reconnect, and record the results.host/pad_sdl.c:978: The Windows real-controller HID path has not been exercised. (more on the line) Do: Run the Steam Input grip and fallback checks on Windows with the supported controller and record the result.@fixcan do L1, L2 and L3.Questions (1) (not confirmed from the code; they don't hold the recommendation)
tests/test_vibration_menu.py:107: What current polling failure occurs at HEAD that this test gap leaves undetected?Checks: Still running: 11 checks.
More: does it help, other systems, switches, what was read
Does it help: Yes for the tested Steam Machine receiver and Puck: the author reports grip haptics, no skipped test vibrations, and no repeated write-failure log. USB, Bluetooth, and Windows remain unverified.
Other systems: The selection also affects multiple controllers and stand-ins without controller IDs. USB uses a different report format; Bluetooth and Windows use device paths not covered by the reported run. The builder’s HID output policy also changes for product 0x1305.
Switches: HOS_STEAM_CONTROLLER_HAPTICS is added, on by default. Its default bypasses Steam’s Game rumble setting and intensity, so it is not right for players relying on those settings; it has a switches.def row.
Reviewed:
1091ec41ddagainsta2b7abf9ee: Read AGENTS.md, CONTRIBUTING.md, the PR template, standards, the diff and commit, vibration.h, steam_pads.h, the changed tests and the relevant pad polling, RenHDrum and builder HID paths. Skimmed the remaining portions of the larger changed code files, input documentation and switch table; no review-checklist.md was present.; nothing run (a code review).Checked and fine:
Testing: Read-only review; no commands from the project, builds or tests were run. The author reports 24 of 25 selected checks passing, with the remaining compiler failure also present on main; CI is still running.
Overlaps and merge order: Not checked; network access is closed.
Automated code review by BeanBot (gpt-6.1-terra), asked for by HumanBean. Nothing was run; a maintainer decides.
@ -938,0 +947,4 @@if (steam_haptics < 0) steam_haptics = env_on_or("HOS_STEAM_CONTROLLER_HAPTICS", 1);int grips_play = 0;for (int i = 0; i < MAX_PADS; i++)grips_play |= pads[i].gc && pads[i].motion_only && pads[i].vib == VIB_RH_STEAM && rh_steam_alive();L2 (blocking): One controller’s active grips silence every recognized Steam Controller stand-in.
When: With two Steam Controllers under Steam Input, RenHDrum owns only one real pad. The global grips_play is nevertheless true for both stand-ins, so both choose VIB_NONE and the second controller receives no rumble.
Do: Associate each real controller with its stand-in and suppress only the matching stand-in; leave other stand-ins on Steam rumble.
@ -962,0 +975,4 @@/* (longshot) a Steam Controller (2026)'s grips, on its own HID device beside Steam Input: its own threadplays them (host/rumble_renhdrum.c); any other motion-only pad's vibration is Steam's */if (vibration_steam_input(pads[i].vib_kind, 0, 1, steam_haptics, grips_play) == VIB_STEAM_GRIPS_ONLY)vib_choose(i, mode, now, VIB_STEAM_GRIPS_ONLY);L1 (blocking): The default sends grip haptics independently of Steam’s per-controller rumble setting and intensity.
When: With Game rumble disabled in Steam and Longshot vibration on Auto, the real pad still opens the grip backend and vibrates; the author reproduced this. Players who disabled or reduced rumble in Steam get unwanted or stronger vibration.
Do: Honor Steam’s rumble enable and intensity when driving the grips, or keep this path opt-in until those settings can be honored.
L4 (should fix): The USB and Bluetooth grip paths have not been exercised under Steam Input.
When: USB selects the 8 kHz report format and Bluetooth uses its own HID transport; the reported successful runs cover the two receiver products.
Do: Run the slingshot and vibration test over USB and Bluetooth, including fallback and reconnect, and record the results.
L5 (should fix): The Windows real-controller HID path has not been exercised.
When: The tested build ran on SteamOS; Windows may open or write the controller’s HID device differently.
Do: Run the Steam Input grip and fallback checks on Windows with the supported controller and record the result.
@ -92,0 +109,4 @@static inline int vibration_steam_input(int kind, int stand_in, int motion_only, int haptics, int grips_play) {if (motion_only) return kind == VIB_PAD_STEAM && haptics ? VIB_STEAM_GRIPS_ONLY : VIB_STEAM_NOT_HERE;if (stand_in && kind == VIB_PAD_STEAM) return grips_play ? VIB_STEAM_QUIET : VIB_STEAM_NO_GRIPS;return VIB_STEAM_AS_ALWAYS;L3 (blocking): A Steam Input stand-in without the physical controller’s IDs is never suppressed.
When: When Steam exposes the stand-in as 28de:11ff, its kind is VIB_PAD_OTHER, so it keeps motor rumble while the real Steam Controller is selected for grips. The same effect reaches the controller twice.
Do: Identify the corresponding stand-in independently of its reported product ID, and suppress it only while that controller’s grips are active.
8fe6e193d8b312f7e48cb312f7e48c27377be8d9WIP: feat(input): a Steam Controller (2026)'s grips play under Steam Input, on its own HID device (#3181)to feat(input): a Steam Controller (2026)'s grips play under Steam Input, on its own HID device (#3181)@iafx this is ready for review: part 1 of your #3181. Under Steam Input, a Steam Controller (2026)'s grips now play on the
real controller, and Steam's stand-in pad stays quiet while they do.
I tested it with a Steam Controller (2026) under Steam Input, over every connection it has:
28de:1305), through the Puck (28de:1304), switching betweenthe two mid-game, and on a USB cable (
28de:1302).28de:1303).In every case the grips played, and the log had no failed grip writes. The full check suite in CI's container fails
the same 31 checks as
main, none of them new.Part 2, following Steam's rumble settings, isn't in this PR. My findings are in the comment on #3181. The open question
there is whether Steam's level should replace Longshot's Vibration strength, cap it, or scale it.
feat(input): a Steam Controller (2026)'s grips play under Steam Input, on its own HID device (#3181)to WIP: feat(input): a Steam Controller (2026)'s grips play under Steam Input, on its own HID device (#3181)Back to work in progress while I address BeanBot's review:
HOS_STEAM_CONTROLLER_HAPTICS=1turns them on, and they're experimental; by default Steam plays the rumble through its stand-in, so its Game rumble switch and intensity apply.L4 and L5 (cable, Bluetooth, Windows) were tested after the review ran. They're in the description. I'll reply to each point when the revision is pushed and tested on hardware.
27377be8d9ced284e855WIP: feat(input): a Steam Controller (2026)'s grips play under Steam Input, on its own HID device (#3181)to WIP: feat(input): a Steam Controller (2026)'s grips can play under Steam Input, on its own HID device (#3181)Thanks. Here's how each point of BeanBot's review (on
1091ec41) is handled inced284e8:HOS_STEAM_CONTROLLER_HAPTICSis now anattemptswitch, off by default. Without it, Steam's stand-in plays the rumble, so Steam's Game rumble switch andintensity apply. That's
main's rumble without its failing grip writes. Honouring the settings with the grips onisn't possible yet. Turning Game rumble off for the controller wrote nothing to Steam's
.vdfor.jsonfiles (see#3181), so the game has nothing to read. Tested on the Steam Machine without the switch: motor rumble through the
stand-in, and no
keep failing.vibration_steam_pair(host/vibration.h) pairs the realcontroller with its stand-in. That needs exactly one real Steam Controller, and either the one stand-in with Steam
Controller ids or the only stand-in. Only that stand-in goes quiet. With two Steam Controllers there's no pair, so no
grips, and Steam plays both, as by default.
test_vibration_pickcovers one and two controllers, two stand-ins withthe ids, and a DualSense's stand-in beside.
28de:11ffstand-in never suppressed: fixed. The pair is found by stand-in status (Steam's handle or11ff), not by ids. A stand-in without the ids, as the only stand-in, is the pair's, and goes quiet while the gripsplay (
vibration_steam_input(VIB_PAD_OTHER, 1, 0, 1, 1, 1) == VIB_STEAM_QUIET). When it can't be told apart fromanother stand-in, there are no grips.
28de:1302, 8 kHz) on SteamOS, and overBluetooth (
28de:1303) on Windows 11, the grips played and there was nokeep failing. Reconnects were tested on thereceivers: switching the Puck to the Steam Machine's receiver mid-game, and Steam re-creating its stand-in. The
fallback is the stand-in's motors, the same path as the new default, now tested too.
source there with llvm-mingw. The grips played on the controller's own Bluetooth HID device.
tests/test_vibration_menu.py:107: none at the head. That check readspads_poll's source. Thecall it looked for,
vib_choose(i, mode, now, vibration_pick(...))on one line, is now split over lines and takesthe Steam Input role, so the check looks for its start (
vib_choose(i, mode, now,\n). The new lines check the grips'call, that the switch is read off by default, and that the pairing is wired in, so nothing was dropped.
The description has the results. The full suite in CI's container at the head fails only checks that
mainalsofails.
WIP: feat(input): a Steam Controller (2026)'s grips can play under Steam Input, on its own HID device (#3181)to feat(input): a Steam Controller (2026)'s grips can play under Steam Input, on its own HID device (#3181)View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.