Repository navigation
Conversation
|
Review for both halves is on trigcondition/sidecar-firmware#67 (the cu fm check change, the sq / smpswitch test changes and the report rate apply here). |
- 0025: the send-FX reporter skips its 13-track scan when the last scan ended with nothing to send, no track is pending, no kit change is under way and none of the 18 words it reads changed. Otherwise it runs as before: same order, same sends, same block. - 0026: pin_frame reads the hardware timer only after its early returns. Why: with 12 tracks of 16ths and the Sidecar on, keys and knobs lag, worst in scene edit; the Rytm is CPU-bound there and the UI task starves first. Reverting each audio-interrupt hook to stock bytes one at a time in rytm-emu (1.74, link up, held to 122 M instructions a second) showed the reporter's scan as the largest single cost (0.53 M instructions a second for values that change only at a lock, a turn or a kit change). Measured there on an image with more of the Sidecar's mods: scene-edit knob latency 521 ms -> 37 ms (stock with Overbridge: 32 ms); the reports the host gets are the same. Design notes: 0025 and 0026 design.md "hook-throttle". Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…10 ticks (um-tick) us_tick runs on every value text, and a screen update draws its value texts in a burst: - The commit, the 1C write-backs and us_tick3 run at the first value text of an audio block (0.67 ms) and are skipped by the rest of that block's. - The walk for missing enum lists checks the cache's free list once per slot, before its knobs, and after a walk with nothing to ask the next one waits US_SCAN_GAP (10) ticks, as an ask already did. The same asks go out. Why: with every slot READY the walk found nothing to ask and ran again on the next value text, and with 8 user-slot tracks the knobs lagged (rytm-emu 1.74 at 122 M instructions a second). The ask throttles still count every value text. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…o (params-delta)
With a track's LFO on a user machine's knob, ext_render sent a 41-byte
03 for the voice every 16 blocks (~90 a second), all 16 values for the
one that moved; on a Rytm that USB MIDI traffic made the UI lag.
- A host's 1D SLOTS may now be 16 bytes, <slot> <result> <caps> (slot 0:
no answer; an older 0021 reads it so). Caps bit 0: the host reads 56;
bit 1: resync. A shorter 1D, or the port going down, turns it off.
- Then a parameter-only report is
F0 7D 52 54 56 01 <vb> <m0> <m1> <m2> {<hi> <lo>} x n <tag> F7
(13 + 2n B; one value 15 B), at most every 32 blocks (~21 ms) a
voice; a value that jumped (a whole step between two blocks) after
16, as before. The voice's first parameter-only report after the host
turned it on or asked a resync, 14+ changed values and the MIDI
machine's 43 stay whole. Trigs (04 / 44), note-offs and 45 unchanged;
a value that moved and stopped is still reported once at the end.
- slots=0 unchanged.
- tools/emu/pd_emu.py (suite pd): no 1D / an older 1D -> 03s only; caps
-> 56s, fewer, the same end values; resync -> one whole 03.
The host side is sidecar-firmware's "host_link: read 56 PARAMS DELTA,
say so in the 1D". Design notes: 0021 design.md "params-delta".
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…gs bit 3) The Rytm walks its pattern (dk_poll, unchanged: 4 KB a tick, a pass in 1.05 s) only while the host needs the 0Bs. The host's 2E flags bit 3 = none wanted (the Sidecar's touch view not fetching the pattern, no pattern write running); then there is no walk at all. Clear (an older host never sets it): as before. Wanted again: a fresh pass and one 0B at once, so the host fetches the pattern as it is. A hello or the port down: wanted. The 2D 0A edit reports are unaffected. Why: on a CPU-starved Rytm (12 tracks playing, scene edit) the walk, 85 KB every 21 ticks, was 0026's largest UI-task cost. tools/emu/sq_emu.py dirty: not wanted - a placed trig gives no 0B and the walk's done mask stays 0; wanted again - one 0B and the walk. The host side is sidecar-firmware's "seq: DIRTY wanted in the 2E (flags bit 3 = none)". Design notes: 0026 design.md "2D 0B DIRTY only when wanted". Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…a placed trig's 0B only with its edit report Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ispatch them - sq "mode: 32 encoder A +6 while T1 is held": any split of 32s, all encoder A, +6 in all, between T1's down and up. - cu "fm: knob E": 24 turns of +5 store 4 entries, as stock's own list knob does with the same turn (stock 1.74, BD's FLTR TYPE: 0 -> 4). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The check read the machine byte 2 blocks after the switch its first run found, in a second run with a BD trig 2M before it. With the audio-block hooks throttled, the machine list's last preview can land a block later there, so the read saw the previous machine (43). Both builds take every DOWN at the same times and reach 44. At 0.5M both read 44 with the sample silent. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Wanted while the Sidecar's pattern mirror fetches (the touch view's PAT or VOICE page, a fetch asked for) or a pattern write runs (FILL's fills and undo, from the job's start to its end); not wanted otherwise. The rule and its tests are sidecar-firmware docs/SEQUENCER.md's "When the host wants the DIRTYs". Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… stock dispatch them" This reverts commit 5a3bea0.
This reverts commit 2959245.
Review of trigcondition/sidecar-firmware#67: - A parameter-only report goes at most every REPORT_GAP = 16 blocks, as an 03 did, with or without the host's caps. The first version held a 56 for 32 blocks, which was not behaviour-preserving for slowly moving values. REPORT_GAP_D, DELTA_JUMP and the jump test are gone. - Refresh: a voice whose last report was a 56 (x->dlast, the old jump byte: no struct change) sends a whole 03 in its slot of every 2048 blocks (~1.37 s, staggered by voice), changed or not. So a 56 the host lost is not stale until the next trig. tools/emu/pd_emu.py: delta expects 03's rate (62 vs 62 reports, 956 B vs 2,542 B) and allows the refresh's whole 03s. New `refresh`: after the last 56, exactly one whole 03 with the 56s' values. modes allows a refresh inside a 56 run. On the previous build, delta and refresh fail. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Review of trigcondition/sidecar-firmware#67. When the host turns DIRTYs back on, the walk starts afresh and takes about 1.05 s (21 UI ticks) to sum the whole pattern. An edit without its own 0A (a p-lock, a parameter change) in a chunk not yet summed raised no 0B at all. A host that read the pattern at the first 0B could then write over it, and still verify. Now (dk_arm) the Rytm sends that 0B when the first pass has summed every chunk, not at once. While armed, every other 0B (an edit report's, a pattern switch's) waits and goes as that one. So the first 0B after the host turns them on is the pass's; the host reads after it (patwrite's kArming), and every later edit is in a summed chunk and raises a 0B. Turned off again while armed: nothing held. tools/emu/sq_emu.py dirty: wanted again with a trig placed during the pass: no 0B in the first 0.5 s (its 0A goes), then the pass's 0B, at most one more. On the previous build the 0B came at once (fails). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…able, rerunnable Review of trigcondition/sidecar-firmware#67 ("please add the latency harness"). - What it plays: 12 tracks of 16ths, and two knobs turning (200 detents, 25 ms apart), with and without scene edit. - What it runs on: stock (this tree's stock/ OS, booted as us_base.sh boots a build), a baseline tag and a candidate tag. The builds talk to the Sidecar's real core (RYTM_TEENSY's sim/rui_link) on the emulator's Overbridge link. The emulator is held to IPS M instructions per emulated second. - What it prints: mean / max knob latency (a detent to the OS's encoder dispatch), CPU busy, key latency, and the gate the PRs used (exit 1). The gate fails on a lost detent, a mean > BASE + 10 ms or > 2x stock, or a max > 2x BASE + 20 ms. Everything it writes is firmware-derived and git-ignored: build/knoblag/ here, sections/us_stock.* in rytm-emu. Run it in a port tree; its addresses are 1.73's, as every suite's. Not a suite (it needs the core and takes minutes): tools/emu/README.md "Knob latency under load". Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ult) On analog-emu's sidecar-upstream branch the panel takes at most about 30 detents a second. The first table's 100 detents every 50 ms a knob lost a quarter of them on every image there, stock included, at 122 and at 200 M alike: it measured the panel, not the Rytm. Now --detents N --gap MS, default 50 every 100 ms (inside the 5.5 s scene hold). The same command on the older emulator binary took 186 of 200 detents; on sidecar-upstream it took 151. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With the scan skipped on ~98 % of blocks, the skip test itself was most of the reporter's cost: 18 words read in two loops, each zero-extended, compared and stored, about 250 instructions every audio block (1,500 a second). moved() compares them unrolled against a zero-extended shadow, first difference out: about 60 instructions a block. The same words decide the same skip; when the scan runs, raw is refreshed from the words (the same end state as the word-by-word update before). Measured with tools/emu/knoblag.py on analog-emu sidecar-upstream (122 M, link up): scene edit 68.7 / 116 -> 64.0 / 107 ms, without 56.8 / 101 -> 53.0 / 96 ms, CPU busy -0.21 %. +272 B of area code, +36 B of state. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…k's 50 ms) Two knobs every 100 ms, half a gap apart, is a detent every 50 ms: the UI tick's period, so each image's boot phase moved its mean by several ms. 113 ms keeps the detents off the tick; the ordering of the images is the same at 97 and 113 ms. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Rebased on 0.5.2's The host half (trigcondition/sidecar-firmware#67) is rebased on firmware Build: OS 1.74,
Suites:
The failures shared with Knob latency (
All 90 detents were dispatched on every image. The key latency for three page presses: |
|
Thanks for the rebase and the numbers. The knob and page-key latency with scene edit open is a real improvement. One change for the pair, asked on trigcondition/sidecar-firmware#67 (trigcondition/sidecar-firmware#67 (comment)), and it touches this half too. With a Rytm still on 0.5.2's mods, the host sends 2E bit 3, gets no early 0B, and every FILL / CLEAR / UNDO waits in kArming for 2.5 s. Could 0026 set the next free bit in its hello's caps byte (the one where bit 2 = 4B reports)? The host would then use kArming and bit 3 only when that bit is there, and keep DIRTY on as now for an older Rytm. A test on each side for both hellos would cover it. Once both halves have it, we run our emulator suites on the pair and merge it for 0.6. |
…d the end-of-pass 0B The host (trigcondition/sidecar-firmware#67) sends 2E bit 3, and a pattern write waits for the end-of-pass 0B, only to a Rytm whose hello has this bit, so a Rytm on 0.5.2's mods keeps DIRTY on and FILL does not wait 2.5 s. caps2 is 127 now (bits 0..6); the caps byte was full already. rui_emu rehello expects caps2 127. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Done: 0026's hello now sends caps2 bit 6 (64), so caps2 is 127. The caps byte was already full (127, bit 6 being param modulation), so I used caps2's next free bit; it's caps2's last one. The host side and its tests are on trigcondition/sidecar-firmware#67. 0026's design.md has a paragraph on the bit, and Build
The PR body is updated to match (the end-of-pass 0B, 56 at 03's rate, the caps2 bit, the 0.5.2 numbers). |
Closes trigcondition/sidecar-firmware#70 (the go is there; its conditions are met).
Topic 1 of the roadmap, trigcondition/sidecar-firmware#66. The host half is trigcondition/sidecar-firmware#67. The first two commits work alone. The 56 and DIRTY changes need the host half to take effect, and with an older host they behave as now.
Why
With 12 tracks of 16ths playing and the Sidecar connected, the Rytm's keys and knobs lag, worst in scene edit. There the Rytm is CPU-bound, and its UI task starves first. In rytm-emu (OS 1.74, the link up, held to 122 M instructions a second, about where the lag shows), I put each hook back to stock bytes one at a time to find what costs most. These commits remove those costs without changing what the host or the user sees.
What
pin_framereads the hardware timer only after its early returns.us_tickruns on every value text, and a screen update draws its value texts in a burst. The commit, the 1C write-backs andus_tick3now run at the first value text of an audio block, not at each one.US_SCAN_GAP(10) ticks. The same asks go out.56 PARAMS DELTA, to a host that says it reads themext_rendersent a 41-byte 03 about 90 times a second. When the host's 16-byte 1D sets caps bit 0, a parameter-only report carries only the changed values,F0 7D 52 54 56 01 <vb> <m0> <m1> <m2> {<hi> <lo>} x n <tag> F7, at 03's rate (every 16 blocks a voice).slots=0builds are unchanged.2D 0B DIRTY's pattern walk only while the host wants it (2E flags bit 3)tools/emu/pd_emu.py(new suitepd): no 1D or an older 1D gives 03s only, caps give fewer 56s with the same end values, and a resync gives one whole 03.sq_emu dirty: not wanted means no walk, and a placed trig's 0B comes only with its edit report. Wanted again: no 0B within 0.5 s, then exactly one after the first pass.rui_emu rehello: the hello's caps2 is 127.tools/emu/knoblag.py(new, not a suite): the knob latency table below, rerunnable. README section intools/emu/README.md.Each
stub.sis regenerated with its mod'sbuild.sh. The design notes are in each mod'sdesign.md: "hook-throttle", "params-delta", "2D 0B DIRTY only when wanted".Tests
OS 1.74,
tools/build_rui.sh, elekloader 2bcafa1,hash_expect.py --checkPASS.tools/emu/suites.py <tag> --changed upstream/dev, each image with its own host (firmwaredevfordev, #67 for this branch), on analog-emu'ssidecar-upstream(951dcbc).dev, check by check, except:devpass / failpinpasses here)dev(in ar, ms, pj, rled, rui, sa44, sfu, sq, sv and us) come from my emulator setup, not this series: they fail the same way ondev's image.tools/emu/knoblag.py: 12 tracks of 16ths, knobs E / F turning, 45 detents every 113 ms each, the emulator held to 122 M instructions a second), mean / max:dev(0.5.2)All 90 detents were dispatched on every image. This exact image hasn't been on hardware yet: the emulator is not the unit, so the latency numbers are a guide.
🤖 Generated with Claude Code