fix(input): the Steam Deck's own gyro when Steam Input hides it #2660
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
4 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot!2660
Loading…
Reference in a new issue
No description provided.
Delete branch "omgitsgela/Longshot:deck-imu"
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
Fixes #2659, for the Deck itself.
On a Steam Deck the game had no motion aim: the Insert menu's Motion controls row said the connected pad had no gyro,
while Steam's own controller settings showed the deck's gyro working. Started from Steam, SDL opens only Steam Input's
stand-in pad, which has no accelerometer and no gyroscope, while the Deck's own controller keeps streaming its 64-byte
state report with the IMU in it, switched off until something asks for it.
What this changes:
host/deck_imu.c/host/deck_imu.h(new): reads the Deck's own controller. ItsDECK_STATEreport carriesaccelerometer and gyroscope, the same packet SDL's Steam Deck driver parses, in the same frame and units (accel
m/s^2, gyro rad/s). The reader finds the node that streams it without ever waiting on the device (one candidate held open for up to 100 ms across polls, one non-blocking read per poll, a directory look at most every 2 s) and judges a node by that report rather than by
Valve's vendor id, since the same device also exposes mouse and keyboard interfaces. Presence, and the Motion controls
row, follow reports actually read in the last three seconds, so nothing claims a gyro before one arrives. The sensors
are turned on with one
SETTING_IMU_MODEfeature report, written only when the value it replaces could be read, andput back only while the setting still holds what the reader wrote; a value Steam set later is left alone. Nothing else
is written, and the Deck's built-in controls are never opened as a pad, so lizard mode stays on and Steam's trackpad,
button and paddle mappings are left as Steam set them. Between reports it hands back the newest reading, the way SDL's
sensor reads do, because a filter polled with gaps resets and the aim twitches.
host/pad_sdl.c:motion_poll()uses that reader only when no open pad reports sensors, so every desktop pathand every real pad keep the SDL path they had.
gyro_statusreports the Deck's gyro, so the Motion controls row stopssaying there is none.
HOS_DECK_IMU=0turns the reader off.gpu/vk/switches.def: the row for the new switch.tests/test_deck_imu.py(new): compiles the parser and checks the axis mapping, both full scales, every field'soffset, and that foreign, short or other-version reports are refused. It also asserts the wiring invariants that keep
the pad path first, stop the reader at the run's end, and give the Deck source its own identity in
motion_poll().Relation to #1181. That PR solves the same player-visible problem from the other side: it takes Valve's ids out of
Steam's ignore list (sizing the buffer from the list, which is why the strip never ran) so SDL opens the Deck's built-in
controls and their sensors are read through SDL. Opening them runs SDL's Steam Deck driver, which clears their digital
mappings and sets the trackpad modes as it opens them, so lizard mode goes off for the run, which is what
HOS_DECK_GYRO=0there is for. This PR reads the same report beside SDL and opens nothing, so Steam's mappings survive,and it deliberately leaves
pads_start()alone: a Valve pad other than the Deck still is not opened for its motionunder Steam, which is #1181's fix rather than one duplicated here. The two do not conflict.
How to see the bug on
main: start Longshot from its Steam tile in Game Mode, open the Insert menu's Controls page(Motion controls says the pad has no gyro), and aim with the slingshot while tilting the Deck: nothing moves. The log
reads
hid: controller "Steam Deck Controller" connected (SDL), Steam Input's; ... mapping-name="Steam Virtual Gamepad"andhid: 1 controller through SDL, with no sensor-bearing pad at all.A reviewer should read
host/deck_imu.c's feature-report and hold-the-reading paths first, then themotion_poll()hunk in
host/pad_sdl.c(source selection and the sensor-status line).Testing
Tested: Steam Deck LCD (VanGogh, RADV, SteamOS 3), this change in the game. Game Mode, the desktop-mode runs and the
switch's off state all ran on head
728f14aec(the binary it was built into hashes19dcfb67..., and the log shows thereader's line and the motion-source line once each). The review's changes in
72117fa8cand the later change that keeps probe candidates open across polls are not yet run in the game: the Deck is offline and the rebuild is waiting on it, and that run will be added here.Game Mode, started from the Steam tile: the log reads
hid: the Steam Deck's own gyroscope and accelerometer: read from the controlleronce, thenhid: motion controls from the Steam Deck's built-in controls, read from the controller. Gyro aim works and feels like a Switch Pro Controller's, with the filter's bias learned after holdingstill for a second.
Desktop Mode, Steam exited, started directly: gyro works through SDL's own path, and buttons, sticks, trackpads
and rumble are normal.
Desktop Mode, Steam running, started directly: SDL opens the real controller (
with a gyroscope; guid=0300f617...)and the reader's line appears zero times; gyro works through the pad path, unchanged by this change.
The switch's off state, Game Mode from the tile with
HOS_DECK_IMU=0inlongshot_env.txt: the game reports nogyro and tilting the Deck does nothing, as on
main. In the log, the reader's line appears zero times, themotion-source line appears zero times, and the pad lines are the stock ones (
Steam Input's, mappingSteam Virtual Gamepad,1 controller through SDL). So the switch removes the reader and nothing else.A Steam Deck OLED, reported by a player on the community Discord: works there, gyro aim included, with the
controls behaving normally. That answers the one hardware question this PR carried, since the report comes from the
OLED's own report stream being read straight from hidraw rather than my LCD.
Game-free checks:
tests/test_deck_imu.py,tests/test_switch_table.py(includes the new row),tests/test_env_on.py,and the controller tests that compile blocks out of
host/pad_sdl.c(test_gyro_rearm,test_steam_pads,test_stick_rest,test_stick_dead_zone,test_touchpad_menu,test_rumble_refresh,test_vibration_pick,test_pads_after_menu,test_motion_background,test_sdl_pad_diagnostics,test_input_background) all pass.The whole suite,
tests/run_all.py(the same testsmise run testruns;miseis not installed on this machine), againstclean
86b3b9e4fin a separate worktree and against this branch:86b3b9e4f, cleanThe two failures are the same test identities on both, and they are this machine's toolchain, not the tree:
tests/test_thinlto_tls.py(itscc1plusrejects-flto=thin; the test wants clang) andtests/test_oot_song_inventory.py(GCC refuses taking the address of a temporary array in the shim it generates). The oneextra pass is this change's new test.
CI on this head (
728f14aec):Host C for Windows (llvm-mingw, compile only), both renderer build checks, lint, thewebsite check and the description check pass. Four fail, and three of them are
main's own:Rust (rustfmt, clippy, cargo test, end to end),Third-party parts and guide screenshotsandGame-free checks (part 2/2)are the same three jobs that fail onmain's own push run at86b3b9e4f. On part 2/2 there the failure istests/test_lifter.py: "this expression creates a reference which is immediately dereferenced by the compiler".Game-free checks (part 1/2)fails only on this head, ontests/test_present_semaphores.py: (no output). That checkcompiles a C++ fixture of the swapchain code with
clang++and runs it with no GPU, no game and no host code, and thisdiff does not touch
gpu/vk/, so it reads as a flake on that run and wants a re-run rather than a change.Still to test: The current changes need a game run on the Steam Deck; the Deck is offline and the rebuild is waiting on it.
Measurements
Nothing to measure: this routes input that never reached the game before; no rendering, timing or memory behaviour changes, and the switch ships on, at the behaviour that existed before the reader.
Risks
as it did before;
HOS_DECK_IMU=0or turning Motion controls off disables it, and the one setting it writes is putback when the reader stops.
only while the setting still holds what the reader wrote. If Steam turns the gyro on or off during the run, Steam's
value is the one left in place, so the two do not fight over it.
by itself if the fallback is needed again.
Steam's input mappings. A player who also has Steam Input's gyro-to-mouse layout on would get both at once.
longshot_options.inior the caches.Checklist
Ready for review
main; the title is a Conventional Commit.mise run testpasses (the two failures that also fail onmainare named in Testing).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(on; both ways run in the game, in Testing).
tests/that reads changed source is updated, not weakened.Host C for Windows (llvm-mingw, compile only)job passed on728f14aec;host/deck_imu.ccompiles clean here with its non-Linux branch selected(
gcc -U__linux__ -Werror -fsyntax-only), and returns zeros there.Ready to merge
a player's report.
Tested in game: Steam Deck LCD (VanGogh, RADV, SteamOS 3), nightly-842-86b3b9e4 with this change, in the game: Game Mode from the Steam tile (log reads 'the Steam Deck's own gyroscope and accelerometer: read from the controller' and 'motion controls from the Steam Deck's built-in controls, read from the controller'; gyro aim works and feels like a Switch Pro Controller's); Desktop Mode with Steam running and started directly (SDL opens the real controller, the reader's line appears zero times, gyro works through the pad path); Desktop Mode with Steam exited (gyro works, buttons/sticks/trackpads/rumble normal).
Possibly related, for context:
WIP: fix(input): the Steam Deck's own gyro when Steam Input hides itto fix(input): the Steam Deck's own gyro when Steam Input hides it@Beanstalk a Steam Deck OLED: start Longshot from its Steam tile in Game Mode, open the Insert menu's Controls page, and aim with the slingshot while tilting the deck. Expect the Motion controls row to name the deck's gyro, gyro aim to work like a Switch Pro controller's, and buttons, trackpads, paddles and rumble to be normal. It matters here because this change also makes the Valve-id strip in
pads_start()run for the first time: if the OLED's built-in controls report a product id other than0x28de/0x1205, SDL now opens them rather than keeping them out, which is the case that wants looking at beside Steam Input.Beanstalk test farm
Commit
0293c11· approved by nobody yet · dashboardA member of
BigBeanscan review this commit and comment@Beanstalkto test it.5a643b6ec5728f14aec3Related: #1181 solves the same problem from the other side. It lets SDL open the Deck's built-in controls, so their sensors are read through SDL, and it sizes the ignore list from the list itself. This PR reads the same 64-byte state report beside SDL and never opens the pad.
That difference is the point. Opening the Deck's built-in controls runs SDL's Steam Deck driver, which clears their digital mappings and sets the trackpad modes as it opens them, so lizard mode is off for as long as the game runs. #1181 knows this and carries
HOS_DECK_GYRO=0to keep them out. Here nothing is opened: Steam's trackpad, button and paddle mappings survive untouched, and the only thing ever sent to the controller is the one IMU-mode feature report, which is put back as it was found when the reader stops.One trap for anyone taking the read-only route later: the reader has to hand back the newest reading on every poll, whether or not a new packet arrived, the way SDL's sensor reads do. Returning nothing between packets marks the source gone, resets the Mahony filter on the next packet, and reads in game as a twitch with almost no strength. I hit exactly that on my first build tonight. The test's comment in
host/deck_imu.csays why, and Testing's Game Mode run is what caught it.What this PR deliberately does not do: it does not size the ignore list, so a Valve pad other than the Deck still is not opened for its motion under Steam. That is #1181's fix and there is no need for two, and leaving
pads_start()alone means the two PRs do not conflict.Update: a player on the community Discord reports this working on a Steam Deck OLED, gyro aim included and controls normal. That closes the last hardware question this PR carried, so Testing now reads Steam Deck LCD here and OLED from that report, and Still to test is None.
CI read from the checks tab, since the CLI's links are unreliable on this head:
The first three are main's own reds at
86b3b9e4f; on part 2/2 there the failure is tests/test_lifter.py's clippy error. Part 1/2 fails only here, on tests/test_present_semaphores.py with no output: a clang++ fixture of the swapchain code, no GPU, no game, no host code, and this diff does not touch gpu/vk. It wants a re-run rather than a change, if someone with rights can kick it.@review
Recommendation: Request changes. The fallback reports a gyro for any Valve hidraw device and can block the Linux input/window thread while probing devices. It also does not reliably restore or release the Deck's sensor setting when ownership changes.
The change reads the Deck's built-in motion sensors when Steam Input exposes only a virtual pad, and the reported Deck runs show motion aim working. The fallback adds device probing and shared sensor-setting ownership that need tighter handling.
Blocking (8): must change before merging.
host/deck_imu.c:196: Presence is reported for every Valve hidraw device, without establishing that it is a Deck controller or that its sensors can be read. (more on the line) Do: Report Deck sensor availability only after identifying a usable Deck state-report node, and clear it when that node cannot be read.host/deck_imu.c:102: The fallback waits synchronously for each candidate hidraw node on the SDL polling thread. (more on the line) Do: Identify the correct interface without blocking the polling thread, or perform probing asynchronously and publish the result safely.host/deck_imu.c:168: A failed read of the original IMU setting is treated as permission to overwrite it and later restore zero. (more on the line) Do: Do not change the mode unless its previous value was successfully read, or use a device ownership mechanism that can restore the actual prior state.host/deck_imu.c:169: Restoring the initially saved mode unconditionally can overwrite a later change made by Steam. (more on the line) Do: Coordinate sensor ownership with Steam, or avoid restoring a stale setting when another owner can change it during the run.CI / Third-party parts and guide screenshots (pull_request)fails on this head and passes on the base branch: Failing after 11s.CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request)fails on this head and passes on the base branch: Failing after 3m49s.CI / Game-free checks (run_all.py, part 2/2) (pull_request)fails on this head and passes on the base branch: Failing after 7m16s.CI / Game-free checks (run_all.py, part 1/2) (pull_request)fails on this head and passes on the base branch: Failing after 10m20s.Should fix (3): not blocking, but worth doing before merging.
host/pad_sdl.c:253: The Deck reader remains open and its IMU setting remains owned after a sensor-bearing SDL pad becomes available. (more on the line) Do: Stop and restore the Deck reader when the SDL sensor path takes over, and reopen it cleanly if the fallback becomes necessary again.host/deck_imu.c:99: FD_SET is used without checking whether the opened descriptor fits in fd_set. (more on the line) Do: Use poll for the descriptor or reject descriptors at or above FD_SETSIZE before calling FD_SET.tests/test_deck_imu.py:21: The new test hard-codes gcc instead of using the compiler selected by the test runner. (more on the line) Do: Use the runner's {cc} placeholder and honor CC for direct invocation.@fixcan do L1, L2, L3, L4, L5, L6, L7, L8, L9, L10 and L11.More: does it help, other systems, switches, what was read
Does it help: Yes for the reported fix: the author reports no motion aim on the base and working aim on this head in Steam Deck LCD Game Mode; an OLED player also reports success. No performance gain is claimed.
Other systems: The Linux window thread also handles SDL input, so synchronous hidraw probing can affect input and window responsiveness on Linux PCs with Valve devices. A connected sensor-bearing pad changes source selection, and Steam can independently change the Deck's IMU mode. Windows uses the stub; its compile-only CI check passed.
Switches: HOS_DECK_IMU is added as an on-by-default kill switch, with a switches.def row. Both states were reported tested on the Deck, but the default-on fallback needs the device detection and ownership fixes below.
Reviewed:
728f14aec3against86b3b9e4f0: Read AGENTS.md, CONTRIBUTING.md, the PR template, the diff and commit, the new reader, header and test, and the changed motion and controller polling paths. Read relevant standards and build-source references; skimmed the rest of pad_sdl.c and switch table. docs/review-checklist.md and ../Tooling/AGENTS.md were absent. No generated files or translations changed.; nothing run (a code review).Checked and fine:
Testing: Read-only review; no tests or project code were run. The supplied CI marks four checks as failing on this head; those failures are not repeated as review items.
Overlaps and merge order: #1181 addresses the same Deck symptom by exposing Valve controllers to SDL; the PR describes complementary approaches and no textual conflict. Merge order was not established.
Automated code review by BeanBot (gpt-6.1-terra), asked for by HumanBean. Nothing was run; a maintainer decides.
@ -0,0 +96,4 @@fd_set set;struct timeval tv = {0, 20000};FD_ZERO(&set);FD_SET(fd, &set);L6 (should fix): FD_SET is used without checking whether the opened descriptor fits in fd_set.
When: If the process already has at least FD_SETSIZE descriptors open, opening a candidate returns a descriptor outside fd_set and FD_SET writes beyond the set's bounds.
Do: Use poll for the descriptor or reject descriptors at or above FD_SETSIZE before calling FD_SET.
@ -0,0 +99,4 @@FD_SET(fd, &set);if (select(fd + 1, &set, NULL, NULL, &tv) <= 0) {close(fd);return -1;L2 (blocking): The fallback waits synchronously for each candidate hidraw node on the SDL polling thread.
When: On Linux with a Valve device whose hidraw interfaces do not stream Deck reports, each candidate can wait 20 ms; the failed scan repeats every three seconds. The Linux window thread runs this poll, so input and window event processing pause for the sum of those waits.
Do: Identify the correct interface without blocking the polling thread, or perform probing asynchronously and publish the result safely.
@ -0,0 +165,4 @@if (imu_fd < 0) return;if (imu_writable && imu_set >= 0) {const int back = imu_saved >= 0 ? imu_saved : 0;deck_imu_send_setting(imu_fd, DECK_IMU_ID_SET_SETTINGS_VALUES, back);L3 (blocking): A failed read of the original IMU setting is treated as permission to overwrite it and later restore zero.
When: If the GET feature report fails but the SET succeeds, imu_saved remains -1 and closing the reader sends mode 0. A Steam layout that had enabled the gyro loses its prior setting when Motion controls are disabled or the game exits.
Do: Do not change the mode unless its previous value was successfully read, or use a device ownership mechanism that can restore the actual prior state.
@ -0,0 +166,4 @@if (imu_writable && imu_set >= 0) {const int back = imu_saved >= 0 ? imu_saved : 0;deck_imu_send_setting(imu_fd, DECK_IMU_ID_SET_SETTINGS_VALUES, back);}L5 (blocking): Restoring the initially saved mode unconditionally can overwrite a later change made by Steam.
When: Start with Steam's gyro layout off, so the reader saves mode 0 and enables the IMU; then switch Steam to a layout that uses its gyro. When Longshot stops the reader it writes the old 0, disabling the sensor mode Steam now needs.
Do: Coordinate sensor ownership with Steam, or avoid restoring a stale setting when another owner can change it during the run.
@ -0,0 +193,4 @@if (deck_imu_valve_uevent(uevent)) {present = 1;break;}L1 (blocking): Presence is reported for every Valve hidraw device, without establishing that it is a Deck controller or that its sensors can be read.
When: On a Linux desktop with a Valve device but no Deck, or with a Deck node that cannot be opened, deck_imu_present returns 1. motion_poll then reports gyro_status 2 even though deck_imu_open finds no usable sensor, so the Motion controls row claims a gyro exists and aim still receives no motion.
Do: Report Deck sensor availability only after identifying a usable Deck state-report node, and clear it when that node cannot be read.
@ -245,1 +251,3 @@InterlockedExchange(&gyro_status, any ? 2 : count ? 1 : 0);/* (longshot) the Deck's own sensors when no open pad has any: Steam Input's stand-in pad has none, and the Deck'scontrols keep theirs (host/deck_imu.h). The pad path above stays the one used wherever a pad has a gyroscope */const int deck = !any && deck_imu_present(now);L4 (should fix): The Deck reader remains open and its IMU setting remains owned after a sensor-bearing SDL pad becomes available.
When: Start with the Deck fallback active, then connect a gyro-equipped pad. any becomes true, so deck_imu_poll is no longer called, but deck_imu_stop is called only when motion is off or at shutdown. The Deck stays enabled and its queued reports are not drained; disconnecting the pad later can initially consume stale readings.
Do: Stop and restore the Deck reader when the SDL sensor path takes over, and reopen it cleanly if the fallback becomes necessary again.
@ -0,0 +18,4 @@import subprocessimport tempfileRUN_ALL_ARGS = ["--cc", "gcc"]L7 (should fix): The new test hard-codes gcc instead of using the compiler selected by the test runner.
When: With CC set to clang, or on a supported test machine with clang but no gcc, run_all selects the configured compiler but this test requests gcc and is skipped or cannot run.
Do: Use the runner's {cc} placeholder and honor CC for direct invocation.
728f14aec372117fa8c6All seven code items are fixed in
72117fa8c. The four CI items need a re-read, with the links below.L1 — presence is no longer a vendor scan.
deck_imu_present()now answers from the reader's own state: a state report read in the last three seconds. The first valid packet is what validates the node, so a Valve mouse or keyboard interface can no longer make the Motion controls row claim a gyro, andgyro_statusinmotion_poll()is set from the reading rather than from the device's presence.L2 — the blocking
select()is gone. One candidate is tried per poll with a single non-blocking read, at most one candidate per 100 ms, and the directory scan happens at most once per 2 s. Nothing on the poll thread waits on the device, and a machine with no Valve controller costs one directory look every two seconds.L3 — the mode is written only when the previous value was read successfully. When that read fails, the reader logs one line and leaves Steam's value alone.
L4 — the reader is released whenever a pad with sensors of its own is open, not only when Motion controls goes off, and it reopens if the fallback is needed again. The setting goes back with it.
L5 — the setting is restored only when the value read at close is the one this reader wrote. If Steam changed it during the run, Steam's value is kept.
L6 —
FD_SETis gone withselect(); the node is only used withopen,read,writeandioctl.L7 — the test takes the runner's
{cc}and honoursCCfor a direct run.Controller checks pass after the change, including the updated invariants.
L8 to L11 — these do not pass on the base. On
main's own push run at86b3b9e4f(run 55611):tests/test_lifter.py: "this expression creates a reference which is immediately dereferenced by the compiler" (job 8).tests/test_present_semaphores.pywith no output at all. That check compiles a C++ fixture of the swapchain code withclang++and runs it with no GPU, no game and no host code, and this diff does not touchgpu/vk/, so it reads as a flake on that run. This push has triggered a fresh run of it.The Deck the fallback was built and played on is offline right now (no route over its network), so the game run of this head is pending; I will add it here as soon as it is back up rather than leave the testing claim standing on the previous head.
@review
Recommendation: Request changes. The new probe closes a candidate immediately when its first nonblocking read finds no packet, so the Deck controller can remain undiscovered and motion aim unavailable. The earlier in-game results predate this probe.
The change adds a fallback for the Steam Deck’s built-in motion sensors while leaving SDL pads first. It removes the previous synchronous probe wait, but the replacement can discard the controller before its first report arrives.
Blocking (1): must change before merging.
host/deck_imu.c:130: The probe discards a newly opened candidate when no report has arrived at the instant of its first nonblocking read. (more on the line) Do: Keep the candidate descriptor open across polls for a bounded interval, reading it nonblockingly until a valid report arrives or the probe expires, then advance to the next candidate.@fixcan do L12.Since the last review (on
728f14aec3)Resolved: L1 (Presence is reported for every Valve hidraw device, without establishing that it is a Deck…); L2 (The fallback waits synchronously for each candidate hidraw node on the SDL polling thread.); L3 (A failed read of the original IMU setting is treated as permission to overwrite it and lat…); L4 (The Deck reader remains open and its IMU setting remains owned after a sensor-bearing SDL…); L5 (Restoring the initially saved mode unconditionally can overwrite a later change made by St…); L6 (FD_SET is used without checking whether the opened descriptor fits in fd_set.); L7 (The new test hard-codes gcc instead of using the compiler selected by the test runner.); L11 (The check
CI / Game-free checks (run_all.py, part 1/2) (pull_request)fails on this head…)Still open: L8 (The check
CI / Third-party parts and guide screenshots (pull_request)fails on this head…); L9 (The checkCI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request)fails on th…); L10 (The checkCI / Game-free checks (run_all.py, part 2/2) (pull_request)fails on this head…)New: L12 (The probe discards a newly opened candidate when no report has arrived at the instant of i…)
Checks: Failing on this head, which is behind its base, where they pass:
CI / Third-party parts and guide screenshots (pull_request),CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request),CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request),CI / Game-free checks (run_all.py, part 2/2) (pull_request).@rebase(or@fix) brings it up to date and runs them again; not held against it.Also noticed (2; not asked for, not blocking)
More: does it help, other systems, switches, what was read
Does it help: Unproven on this head. The author reports working gyro aim on an LCD Deck and an OLED report on the earlier implementation; the revised discovery and setting ownership have not been run in game.
Other systems: SDL sensor-bearing pads retain priority; Windows uses the no-op fallback. Linux hidraw discovery and feature reports affect the Deck path, whose revised behavior needs an in-game run.
Switches: HOS_DECK_IMU is added, on by default; =0 disables the fallback. The table documents it, but the on default’s behavior needs validation on this head.
Reviewed:
72117fa8c6against86b3b9e4f0: Read the diff, commit, host/deck_imu.c, host/deck_imu.h, tests/test_deck_imu.py, AGENTS.md, CONTRIBUTING.md and the pull request template; inspected the changed motion path in host/pad_sdl.c. The switch table and remainder of pad_sdl.c were skimmed.; nothing run (a code review).Checked and fine:
Testing: No commands from the project or tests were run. The author reports parser and controller checks and in-game runs on the previous head; the revised head still needs a Deck Game Mode run after the probe is corrected.
Overlaps and merge order: #1181 addresses the same visible issue through SDL and is described as nonconflicting; no merge order was established.
Automated code review by BeanBot (gpt-6.1-terra), asked for by HumanBean. Nothing was run; a maintainer decides.
@ -0,0 +127,4 @@uint8_t pkt[DECK_IMU_REPORT_BYTES];float a[3], g[3];const ssize_t n = read(fd, pkt, sizeof pkt);if (n != (ssize_t)sizeof pkt || !deck_imu_parse(pkt, (int)n, a, g)) {L12 (blocking): The probe discards a newly opened candidate when no report has arrived at the instant of its first nonblocking read.
When: A hidraw file’s report queue starts empty at open. If the Deck’s next state report arrives after this immediate read, read returns EAGAIN and the descriptor is closed; subsequent attempts reopen an empty queue, so the fallback can fail to find the controller and gyro aim remains unavailable.
Do: Keep the candidate descriptor open across polls for a bounded interval, reading it nonblockingly until a valid report arrives or the probe expires, then advance to the next candidate.
@fix
72117fa8c60293c11553Recommendation: Approve. The probe now keeps a candidate open across polls, allowing its first report to arrive without waiting on the device. The current probe and setting-ownership changes still need the planned in-game Steam Deck run. Nothing blocking is left. Recommend approval; not approved on the forge.
What
@fixchangedI changed this pull request: the new head is
0293c11553. I rebased it ontomain(9b7aaea4a0). I edited its description to match the change.Changed
Nothing was built or run: the checks run again on the new head.
The change gives Deck players gyro aim when Steam Input exposes only a virtual pad, while retaining SDL's sensor path for other controllers. The fallback adds a hidraw reader and feature-report handling.
Checks: they run again on this head (
CI / Third-party parts and guide screenshots (pull_request),CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request),CI / Game-free checks (run_all.py, part 2/2) (pull_request),CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request)failed on the last one); a failure shows on the pull request.Also noticed (4; not asked for, not blocking)
More: does it help, other systems, switches, what was read
Does it help: Unproven on the current head. The author reports working gyro aim on an LCD Deck and an OLED on an earlier revision, but the revised probe has not yet been run in the game.
Other systems: The reader is Linux-only; other platforms use the existing SDL path. A sensor-bearing SDL pad takes precedence and closes the fallback. The current head has not yet been tested on Deck hardware.
Switches: HOS_DECK_IMU is added, defaults on, and is listed in switches.def. Its off state was tested on the earlier revision; the current default still needs the planned Deck run.
Reviewed:
0293c11553against9b7aaea4a0: Read AGENTS.md, CONTRIBUTING.md, docs/dev/standards.md, the PR template, host/deck_imu.c, host/deck_imu.h, tests/test_deck_imu.py, the probe fix diff, and the relevant pad and switch changes. Skimmed the wider base diff and commit list; the base diff includes many unrelated upstream changes. Tooling's AGENTS.md was not present locally.; nothing run (a code review).Checked and fine:
Testing: No commands that build or run tests were executed. The author reports passing game-free checks and earlier Deck runs; the current head's game run and CI are pending.
Overlaps and merge order: #1181 addresses the same Steam Input gyro problem through SDL; the description says the two changes do not conflict.
Automated code review by BeanBot (gpt-6.1-terra), asked for by BeanBot, after its fix. Nothing was run; a maintainer decides.