Skip to content

Fix: Octatrack base, remote keys wait until the panel has finished its report - #1540

Merged
repeat98 merged 2 commits into
mainfrom
fix/octatrack-remote-key-boundary
Nov 13, 2026
Merged

repeat98 merged 2 commits into
mainfrom
fix/octatrack-remote-key-boundary

Conversation

@repeat98

Copy link
Copy Markdown
Owner
  • What was wrong or hard: On the Octatrack, a remote key rung into the panel's byte stream between the two bytes of a physical report corrupted both (Octatrack base: USB development keys corrupt split physical fader reports with no modules loaded #1110, reproduced in the emulator by @twwwy with no module installed): the panel's parser took the remote header as the fader's value and the fader's value as key rows, so TRIG5-7 stayed held or a FUNC release was lost. modwerk_panel_bytes masks interrupts around its own two bytes but never checked whether a physical report had already started. The base's self-test presses PLAY and STOP through the same path, so a knob or fader moved during a self-test could hit it on any base, not only a development one.

  • What this changes:

    • Every base: the self-test presses PLAY and STOP only when the panel's ringer holds nothing and its parser expects a report's first byte; otherwise it asks again on the next tick.
    • Development bases: USB keys and encoder steps (dev requests 5 and 8) queue, up to 16, and the base's tick rings them at such a boundary. They come from the USB interrupt, which could see the parser's state in the middle of its run, so they are never rung from there. A key arrives up to a tick (16 ms) after its request; the KEY reply is 0 when the queue is full.
    • The code sits in dsp.c, which links after the lease entries, so those did not move and Analog BD's reviewed recipe holds. The private port's patch (resident_base.patch) only has its dsp.c line numbers shifted.
    • The beta base is regenerated (identity 432edaff…) and the base-bound packages are re-bound to it, Sidechain's lagging row by hand.
  • How I checked it:

    • npm run pr:ready: Ready, after merging current main.
    • Host test (test_selftest.c): the control, the press race and the release race on a model of the parser's state (header seen, value rung but not parsed, report whole), the self-test's own gate, two keys of one row in one tick, and the queue limit.
    • The Octatrack packages rebuilt in the pinned toolchain (build-modules-isolated.sh) and compared with the committed ones as CI does (import-module-build.mjs --development --check-only --verify-existing): all validated. The elemod rebuild was not run; this change touches none of those packages.
    • Owner's MKII, OS 1.40C, 13 November 2026, RAM boots only:
      • a development twin with the queue (2d97f42d…): single keys, FUNC, BANK and PART chords, bank and Part switches and effect picks went through it, and the held-key rows read released afterwards;
      • the regenerated release-type base (432edaff…): selftest passed with E-Verb installed as a trial, so PLAY and STOP went through the gate.
    • Not tested: the interleaving itself against the real parser. Half a physical report cannot be sent over USB. @twwwy, could you rerun your emulator receipt (control, press race, release race) on this build?
    • Limits that remain:
      • The STOP the base presses before an update (boot.c) still takes the direct path. That code links before the lease entries; changing it moves them and needs Analog BD's recipe recaptured, so it waits for the next base change that does that.
      • The base is close to the USB update limit (1,310,720 bytes): the tightest variant has 265 bytes left, the default one 565. A first version with the queue in every base was 145 bytes over.
  • What the guides lacked or got wrong, and where I fixed it: docs/OCTATRACK_DRIVING.md said remote packets are spliced into the panel's stream and told readers to serialize input themselves. It now says what the base does, what was run and what was not.

Related to #1110. It stays open until this base is live and checked.

🤖 Generated with Claude Code

repeat98 and others added 2 commits November 13, 2026 21:27
…s report (#1110)

The self-test's PLAY and STOP are pressed only between two physical panel
reports; a development base's USB keys and encoder steps queue for the tick.
Base regenerated (432edaff), base-bound packages re-bound.

Co-Authored-By: Claude <noreply@anthropic.com>
@github-actions github-actions Bot added the bug Something isn't working label Nov 13, 2026
@repeat98
repeat98 enabled auto-merge November 13, 2026 21:02
@repeat98
repeat98 merged commit 57e352a into main Nov 13, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant