[PR #122] [MERGED] Fix relay/poll PID collision halving delivered rate in Steam mode #211

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

📋 Pull Request Information

Original PR: https://github.com/safijari/openpuck/pull/122
Author: @Copilot
Created: 7/4/2026
Status: ✅ Merged
Merged: 7/6/2026
Merged by: @safijari

Base: main ← Head: copilot/mouse-smoothness-issue


📝 Commits (6)

  • 2ff9ee2 Fix RF poll rate jitter: skip session beacon RX, poll before beacons
  • 12a37cf Fix comment formatting per style guide
  • f3142c6 Fix relay/poll PID collision halving F1 rate in Steam mode
  • ad3169f Merge branch 'main' into copilot/mouse-smoothness-issue
  • d6bf914 Mouse very smooth now but overpolling
  • ed55ee8 Go back to a fixed 250hz polling

📊 Changes

9 files changed (+157 additions, -34 deletions)

View changed files

📝 OpenPuck/config.cpp (+5 -3)
📝 OpenPuck/config.h (+10 -3)
📝 OpenPuck/haptics.cpp (+21 -3)
📝 OpenPuck/haptics.h (+6 -2)
📝 OpenPuck/puck_hid.cpp (+44 -5)
📝 OpenPuck/puck_hid.h (+4 -0)
📝 OpenPuck/rf_link.cpp (+29 -16)
📝 OpenPuck/rf_link.h (+3 -2)
📝 OpenPuck/serial_console.cpp (+35 -0)

📄 Description

In Steam mode the WebUSB panel's "Delivered" rate showed ~120 Hz instead of ~250 Hz. g_relayPid and g_pollPid both initialized to 0 and incremented once per cycle, keeping them permanently equal. Whenever a relay frame preceded the E3 GET in the same cycle, the controller's ESB deduplicator saw the same 2-bit PID on both packets and discarded the GET — no F1 reply. Steam mode is the only mode where the relay queue is almost always non-empty (continuous 0x87 keepalives + haptic commands), so ~50% of E3 polls were silently dropped.

Changes

  • rf_link.cpp — initialize g_relayPid to {2, 2, 2, 2} instead of {}. Both counters still increment once per cycle, so they stay (pollPid + 2) mod 4 forever and can never collide.
// before
static uint8_t g_relayPid[NSLOT] = {};

// after — relay PID stays (pollPid+2) mod 4, never equal to poll PID
static uint8_t g_relayPid[NSLOT] = { 2, 2, 2, 2 };
  • haptics.h — update comment to document the offset invariant rather than just stating the requirement.

🔄 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/122 **Author:** [@Copilot](https://github.com/apps/copilot-swe-agent) **Created:** 7/4/2026 **Status:** ✅ Merged **Merged:** 7/6/2026 **Merged by:** [@safijari](https://github.com/safijari) **Base:** `main` ← **Head:** `copilot/mouse-smoothness-issue` --- ### 📝 Commits (6) - [`2ff9ee2`](https://github.com/safijari/openpuck/commit/2ff9ee2382d54b2ddfba57cfdcb2dec516a309da) Fix RF poll rate jitter: skip session beacon RX, poll before beacons - [`12a37cf`](https://github.com/safijari/openpuck/commit/12a37cf6f32308d8a5fe2152dfd3982e8ff38238) Fix comment formatting per style guide - [`f3142c6`](https://github.com/safijari/openpuck/commit/f3142c6ef68b0b5ed0d6040f343c08eb345dd686) Fix relay/poll PID collision halving F1 rate in Steam mode - [`ad3169f`](https://github.com/safijari/openpuck/commit/ad3169f521c2e905712c51cc4e98f635cb650eb9) Merge branch 'main' into copilot/mouse-smoothness-issue - [`d6bf914`](https://github.com/safijari/openpuck/commit/d6bf914c373130769f2c37efa86520c1724f0c77) Mouse very smooth now but overpolling - [`ed55ee8`](https://github.com/safijari/openpuck/commit/ed55ee84bdd125954fa827347a42b73e5baa47d7) Go back to a fixed 250hz polling ### 📊 Changes **9 files changed** (+157 additions, -34 deletions) <details> <summary>View changed files</summary> 📝 `OpenPuck/config.cpp` (+5 -3) 📝 `OpenPuck/config.h` (+10 -3) 📝 `OpenPuck/haptics.cpp` (+21 -3) 📝 `OpenPuck/haptics.h` (+6 -2) 📝 `OpenPuck/puck_hid.cpp` (+44 -5) 📝 `OpenPuck/puck_hid.h` (+4 -0) 📝 `OpenPuck/rf_link.cpp` (+29 -16) 📝 `OpenPuck/rf_link.h` (+3 -2) 📝 `OpenPuck/serial_console.cpp` (+35 -0) </details> ### 📄 Description In Steam mode the WebUSB panel's "Delivered" rate showed ~120 Hz instead of ~250 Hz. `g_relayPid` and `g_pollPid` both initialized to `0` and incremented once per cycle, keeping them permanently equal. Whenever a relay frame preceded the E3 GET in the same cycle, the controller's ESB deduplicator saw the same 2-bit PID on both packets and discarded the GET — no F1 reply. Steam mode is the only mode where the relay queue is almost always non-empty (continuous 0x87 keepalives + haptic commands), so ~50% of E3 polls were silently dropped. ## Changes - **`rf_link.cpp`** — initialize `g_relayPid` to `{2, 2, 2, 2}` instead of `{}`. Both counters still increment once per cycle, so they stay `(pollPid + 2) mod 4` forever and can never collide. ```c // before static uint8_t g_relayPid[NSLOT] = {}; // after — relay PID stays (pollPid+2) mod 4, never equal to poll PID static uint8_t g_relayPid[NSLOT] = { 2, 2, 2, 2 }; ``` - **`haptics.h`** — update comment to document the offset invariant rather than just stating the requirement. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
roman 2026-10-22 05:07:41 +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#211
No description provided.