You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Elektron: shared runtime glue and Digitone II runtime bindings #2443
Shared Elektron runtime glue and the Digitone II runtime bindings.
Write the common runtime glue and one adapter contract both machines bind to, plus the Digitone II bindings. Kári leads the Digitakt II bindings (Digitakt II: OS 1.17 USB link binding preflight #2380 is its preflight).
Both targets are reviewed against the same contract. No claimed Digitakt II DSP support, and no Digitone II addresses copied across.
Starts after the link extraction, since the runtime sits on it.
Hey @prodbysmolec! The DT2 USB link responds on hardware. On the host, the loader passed load, swap, undo and remove with two executable module packages. A separate shared-service test passed timeout rollback. Native DT2 execution still needs qualification and the runtime is disabled.
We've settled on four simultaneously active runtime modules for the initial experimental DT2 profile, a 16 KiB pool, and separate linker reservations for the pool and upload staging. Those reservations still need verification on a linked candidate. The existing journal allows one record per module in a transaction. Four active slots bring its verify/accept stack frames down from 7,136/7,144 bytes to 920/928 bytes in the ColdFire build. This applies only to the dynamic loader; ordinary linked modules and hook tables keep their existing behavior.
A CPU-only profile could bring loader BSS plus staging to 47,792 bytes, excluding glue, code and task stacks. I'd like to agree on which limits belong in the machine adapter, how #2442 reports them to the client, and which task owns staging and the journal in #2443. Where does the shared runtime stand, and is there an adapter branch or contract you'd like me to test the DT2 profile against?
The Digitakt II's side of the shared runtime is ready to plug in, and I'd like your view on two things before a first RAM trial. Nothing is linked or enabled on a Digitakt II; all of this is offline or read-only on my unit.
What's done on the DT2 side: the bindings (Digitakt II base: OS 1.17 runtime-loader bindings, fail closed and not linked (#2525) #2641) have their playing flag and uncached alias read on my unit, and the 17 stock tasks fit RUNTIME_PAUSED = 32 without touching loader.h. The shared loader.c, upload.c, wire.c and sha256.c, linked with the DT2 machine file and the CPU-only profile set by flags only (4 modules, 16 KiB pool), leave only memcpy/memset undefined. So the DT2 needs no shared-code change, just the glue this issue will share.
Interrupt levels, from the OS 1.17 code (your DN2 method): time slice 1 (PIT0, and every yield forces it), USB transactions 4, frame 5, kernel timers 5 and 6, plus a second USB service at 6. So your level-4 lock() fits the DT2 too, and I'll move it from 7 to 4 once a read-only check of those registers on my unit agrees.
Question 2, a private trial with your glue: to test the DT2 file before Elektron: shared runtime glue and Digitone II runtime bindings #2443 lands, may I stage your DN2 glue (link.c upload part and runtime.c trampolines from machine/digitone-ii-loader) with the DT2 addresses in a private development build, for one Try/Undo on my unit? It would not be pushed or proposed as a PR, and whatever breaks comes back here for the shared version. If you'd rather I wait for your branch, that's fine.
Next step: with your answers, the first CPU-only trial on the Digitakt II: one tiny module (a screen dot, like your corner_dot.c), Try, Undo, power cycle.
My earlier two questions (modwerk_machine_stack() and where the profile limits live) are on #2641.
Details
Composition size: .text 19,100 B, .rodata 690 B, .bss 17,748 B (pool included); staging from the glue, about 30 KiB in the CPU-only profile.
lock() at 7 would hold the frame interrupt during reclaim()'s scan: about 1.7 ms typical, up to tens of ms with full stacks. So 4, as on DN2, is needed before any trial, not only allowed.
Every DT2 task switch goes through PIT0 at level 1: the kernel's yield sets INTC2's force bit 13. The level-5/6 kernel timers wake tasks the same way.
Unit reads (RB01, 4 Dec, then stock restored): playing flag 0x43164f94 0 stopped and 1 playing or recording; alias +0x08000000 uncached 3/3; RX source tag 2 in USB MIDI and Audio/MIDI. Results.
@btzz5w8w5d-star, thanks. The DT2 side is further along than this issue, and here are answers to everything open on #2443 and #2641. Where it stands: the shared glue starts once the Digitone II stack (#1763 → #1842) has landed in base/digitone-ii-next. That stack is in its unit session this week. Until then the DN2 glue on machine/digitone-ii-loader is the reference.
The loader already has it: modwerk_runtime_list() writes the Octatrack's INVENTORY record (MWI\2, 24 bytes an entry), which the Octatrack's vendor link serves and octatrack-link.ts reads.
The SysEx link will carry it in parts, as screen and log are carried: the unit chooses the bytes, and the part offset is checked.
The identity carrier stays about the build. The modules in RAM are runtime state.
A private trial with the DN2 glue: yes, go ahead. The code is GPL and in the repository. Stage the upload part of link.c and the trampolines of runtime.c with your addresses for a Try/Undo on your unit. Please bring back whatever you had to change: those are the seams Elektron: shared runtime glue and Digitone II runtime bindings #2443 has to make.
Paused spans:
Keep your merge of neighbouring task records for now. It needs no shared change, and extra words only make the loader keep memory or refuse a switch.
In the machine file and base.json: everything that depends on memory, so the pool's address and size, staging's address and size, and the number of active slots. Your four slots and 16 KiB pool are the DT2 profile, against DN2's 2 MiB pool and 256 KiB staging.
In the shared glue: only reading those limits and refusing past them.
The link reports them to the client beside HELLO, so the page can say "no room" before an upload.
Which task owns staging and the journal: the UI task. On DN2 the MIDI task only copies a received frame into its slot. The controller, staging writes, admission, the journal and every switch run in ev_tick (LOADER.md, "the UI task runs it"). The DT2 should do the same.
lock(): level 4 is right for DN2 for the reason you give, since reclaim()'s scan must not hold the frame interrupt. Please confirm the audio level on your unit before a trial, as you plan.
Activity
btzz5w8w5d-star commentedon Dec 3, 2026
Hey @prodbysmolec! The DT2 USB link responds on hardware. On the host, the loader passed load, swap, undo and remove with two executable module packages. A separate shared-service test passed timeout rollback. Native DT2 execution still needs qualification and the runtime is disabled.
We've settled on four simultaneously active runtime modules for the initial experimental DT2 profile, a 16 KiB pool, and separate linker reservations for the pool and upload staging. Those reservations still need verification on a linked candidate. The existing journal allows one record per module in a transaction. Four active slots bring its verify/accept stack frames down from 7,136/7,144 bytes to 920/928 bytes in the ColdFire build. This applies only to the dynamic loader; ordinary linked modules and hook tables keep their existing behavior.
A CPU-only profile could bring loader BSS plus staging to 47,792 bytes, excluding glue, code and task stacks. I'd like to agree on which limits belong in the machine adapter, how #2442 reports them to the client, and which task owns staging and the journal in #2443. Where does the shared runtime stand, and is there an adapter branch or contract you'd like me to test the DT2 profile against?
btzz5w8w5d-star commentedon Dec 4, 2026
The Digitakt II's side of the shared runtime is ready to plug in, and I'd like your view on two things before a first RAM trial. Nothing is linked or enabled on a Digitakt II; all of this is offline or read-only on my unit.
RUNTIME_PAUSED= 32 without touchingloader.h. The sharedloader.c,upload.c,wire.candsha256.c, linked with the DT2 machine file and the CPU-only profile set by flags only (4 modules, 16 KiB pool), leave onlymemcpy/memsetundefined. So the DT2 needs no shared-code change, just the glue this issue will share.lock()fits the DT2 too, and I'll move it from 7 to 4 once a read-only check of those registers on my unit agrees.modwerk_runtime_list()has the names, but no link command carries it. Would you add it to the shared link (Elektron: extract the shared link and diagnostics from the Digitone II work #2442) beside HELLO, or should it ride in the diagnostic identity carrier?link.cupload part andruntime.ctrampolines frommachine/digitone-ii-loader) with the DT2 addresses in a private development build, for one Try/Undo on my unit? It would not be pushed or proposed as a PR, and whatever breaks comes back here for the shared version. If you'd rather I wait for your branch, that's fine.corner_dot.c), Try, Undo, power cycle.My earlier two questions (
modwerk_machine_stack()and where the profile limits live) are on #2641.Details
.text19,100 B,.rodata690 B,.bss17,748 B (pool included); staging from the glue, about 30 KiB in the CPU-only profile.lock()at 7 would hold the frame interrupt duringreclaim()'s scan: about 1.7 ms typical, up to tens of ms with full stacks. So 4, as on DN2, is needed before any trial, not only allowed.0x43164f940 stopped and 1 playing or recording; alias+0x08000000uncached 3/3; RX source tag 2 in USB MIDI and Audio/MIDI. Results.prodbysmolec commentedon Dec 5, 2026
@btzz5w8w5d-star, thanks. The DT2 side is further along than this issue, and here are answers to everything open on #2443 and #2641. Where it stands: the shared glue starts once the Digitone II stack (#1763 → #1842) has landed in
base/digitone-ii-next. That stack is in its unit session this week. Until then the DN2 glue onmachine/digitone-ii-loaderis the reference.modwerk_runtime_list()writes the Octatrack's INVENTORY record (MWI\2, 24 bytes an entry), which the Octatrack's vendor link serves andoctatrack-link.tsreads.screenandlogare carried: the unit chooses the bytes, and the part offset is checked.link.cand the trampolines ofruntime.cwith your addresses for a Try/Undo on your unit. Please bring back whatever you had to change: those are the seams Elektron: shared runtime glue and Digitone II runtime bindings #2443 has to make.#ifndef RUNTIME_PAUSEDinloader.h, default 32), so no machine has to be clever to fit.modwerk_machine_stack():loader.cnever calls it.base.json: everything that depends on memory, so the pool's address and size, staging's address and size, and the number of active slots. Your four slots and 16 KiB pool are the DT2 profile, against DN2's 2 MiB pool and 256 KiB staging.ev_tick(LOADER.md, "the UI task runs it"). The DT2 should do the same.lock(): level 4 is right for DN2 for the reason you give, sincereclaim()'s scan must not hold the frame interrupt. Please confirm the audio level on your unit before a trial, as you plan.