[PR #249] [MERGED] Restore Switch Pro gyro after Steam use #258

Closed
opened 2026-10-22 05:08:21 +00:00 by roman · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/safijari/openpuck/pull/249
Author: @jmt-gh
Created: 8/23/2026
Status: ✅ Merged
Merged: 9/4/2026
Merged by: @safijari

Base: main ← Head: fix/filter-imu-setting-forwarding


📝 Commits (1)

  • 612a204 Restore Switch Pro gyro after Steam use

📊 Changes

4 files changed (+35 additions, -2 deletions)

View changed files

📝 OpenPuck/haptics.cpp (+13 -1)
📝 OpenPuck/steam_commands.h (+2 -0)
📝 docs/PROTOCOL.md (+3 -1)
📝 docs/TESTING_GUIDE.md (+17 -0)

📄 Description

Summary

Restore motion controls when OpenPuck presents the Steam Controller 2 as a
Switch Pro controller, including when connected to a Switch 2.

This is a regression introduced in 0.9.43. After Steam initializes the
controller, buttons and sticks continue working in Switch Pro mode, but gyro
input is missing.

Root cause

Steam writes the controller's IMU_MODE setting while using OpenPuck as a
native Steam puck. This setting persists on the controller across firmware
changes and ordinary power cycles.

Switch Pro mode depends on raw accelerometer and gyroscope samples, but it did
not explicitly request them. Consequently, a controller previously configured
by Steam could remain in an IMU mode that suppresses the RF motion samples
needed to construct Switch Pro motion reports.

This persistence also explains why downgrading to a previously working firmware
without a factory reset can leave gyro broken.

Fix

  • Leave Steam's native settings relay unchanged.
  • When a controller connects or reconnects in Switch Pro mode, set IMU_MODE
    to 0x18 (raw accelerometer + raw gyroscope).
  • Remove the IMU-off tuple from the debug haptic-reset sequence.
  • Do not change IMU handling for any other emulated controller mode.

This keeps native Steam behavior intact while making Switch Pro mode explicitly
request the input data it requires.

Regression findings

  • The stable build used as a clean baseline had working gyro.
  • 0.9.49 did not have working gyro.
  • Bisecting identified 0.9.43 as the first affected version.
  • Downgrading from an affected build without factory-resetting did not restore
    gyro, confirming that the controller retains the relevant IMU state.

Hardware verification

Tested with the following sequence:

  1. Start with the Steam Controller unplugged and unpaired.
  2. Connect OpenPuck to a PC with Steam's controller settings already open.
  3. Flash this branch using the WebUI's factory-reset option.
  4. Confirm OpenPuck appears correctly as a puck in Steam.
  5. Connect the Steam Controller and accept pairing.
  6. Switch OpenPuck to Switch Pro mode using back paddle 4 + Y.
  7. Confirm the emulated Pro Controller appears correctly.
  8. Unplug OpenPuck from the PC and connect it to a Switch 2.
  9. Select Switch Pro mode again and pair the controller.
  10. Verify motion controls in Splatoon Raiders.

Gyro worked with this build.

Validation

  • make check
  • Normal firmware build
  • Factory-reset firmware build

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/safijari/openpuck/pull/249 **Author:** [@jmt-gh](https://github.com/jmt-gh) **Created:** 8/23/2026 **Status:** ✅ Merged **Merged:** 9/4/2026 **Merged by:** [@safijari](https://github.com/safijari) **Base:** `main` ← **Head:** `fix/filter-imu-setting-forwarding` --- ### 📝 Commits (1) - [`612a204`](https://github.com/safijari/openpuck/commit/612a204abb698beaba649e2189767e5679e736f9) Restore Switch Pro gyro after Steam use ### 📊 Changes **4 files changed** (+35 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `OpenPuck/haptics.cpp` (+13 -1) 📝 `OpenPuck/steam_commands.h` (+2 -0) 📝 `docs/PROTOCOL.md` (+3 -1) 📝 `docs/TESTING_GUIDE.md` (+17 -0) </details> ### 📄 Description ## Summary Restore motion controls when OpenPuck presents the Steam Controller 2 as a Switch Pro controller, including when connected to a Switch 2. This is a regression introduced in `0.9.43`. After Steam initializes the controller, buttons and sticks continue working in Switch Pro mode, but gyro input is missing. ## Root cause Steam writes the controller's `IMU_MODE` setting while using OpenPuck as a native Steam puck. This setting persists on the controller across firmware changes and ordinary power cycles. Switch Pro mode depends on raw accelerometer and gyroscope samples, but it did not explicitly request them. Consequently, a controller previously configured by Steam could remain in an IMU mode that suppresses the RF motion samples needed to construct Switch Pro motion reports. This persistence also explains why downgrading to a previously working firmware without a factory reset can leave gyro broken. ## Fix - Leave Steam's native settings relay unchanged. - When a controller connects or reconnects in Switch Pro mode, set `IMU_MODE` to `0x18` (raw accelerometer + raw gyroscope). - Remove the IMU-off tuple from the debug haptic-reset sequence. - Do not change IMU handling for any other emulated controller mode. This keeps native Steam behavior intact while making Switch Pro mode explicitly request the input data it requires. ## Regression findings - The stable build used as a clean baseline had working gyro. - `0.9.49` did not have working gyro. - Bisecting identified `0.9.43` as the first affected version. - Downgrading from an affected build without factory-resetting did not restore gyro, confirming that the controller retains the relevant IMU state. ## Hardware verification Tested with the following sequence: 1. Start with the Steam Controller unplugged and unpaired. 2. Connect OpenPuck to a PC with Steam's controller settings already open. 3. Flash this branch using the WebUI's factory-reset option. 4. Confirm OpenPuck appears correctly as a puck in Steam. 5. Connect the Steam Controller and accept pairing. 6. Switch OpenPuck to Switch Pro mode using back paddle 4 + Y. 7. Confirm the emulated Pro Controller appears correctly. 8. Unplug OpenPuck from the PC and connect it to a Switch 2. 9. Select Switch Pro mode again and pair the controller. 10. Verify motion controls in *Splatoon Raiders*. Gyro worked with this build. ## Validation - `make check` - Normal firmware build - Factory-reset firmware build --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
roman 2026-10-22 05:08:21 +00:00
Sign in to join this conversation.
No labels
pull-request
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
safijari/openpuck#258
No description provided.