Skip to content

USB Multi: 42-channel class-compliant USB audio for the Digitone II - #2461

Draft
naturarum wants to merge 2 commits into
repeat98:base/digitone-ii-nextfrom
naturarum:module/digitone-ii-usb-multi
Draft

naturarum wants to merge 2 commits into
repeat98:base/digitone-ii-nextfrom
naturarum:module/digitone-ii-usb-multi

Conversation

@naturarum

Copy link
Copy Markdown
  • What changed: USB Multi 0.4.1-experimental, a Digitone II module (own code, GPL-2.0-or-later). It adds a fourth choice to SETTINGS > SYSTEM > USB CONFIG, USB MULTI/MIDI: the Digitone becomes a class-compliant USB Audio 2.0 device with 42 inputs at 48 kHz and 24 bits. Inputs 1-32 are the 16 tracks as stereo pairs, then the main mix, the three FX returns and the audio inputs. The DSP already sends these 42 channels to the ColdFire every block; the module sends them all instead of the two that USB AUDIO/MIDI sends.
    • Nine sites of its own, none of the base's 14; no core events. Claims: SYSTEM > USB CONFIG, the USB AUDIO/MIDI stream and descriptors, and an SRAM range inside Overbridge's packet ring (used only in OVERBRIDGE mode).
    • USB AUDIO/MIDI, USB MIDI and OVERBRIDGE stay as they are. A saved USB MULTI/MIDI reads as USB MIDI on the stock OS.
    • The pinned package and the changelog. Not in yet: the import records and the browser package, since elekloader:update --overlay needs a commit this pull request names.
  • Where it comes from: first released in Digiwerk (naturarum/dn2-cfw), where 0.3 and 0.4 ran on a Digitone II. For Modwerk, the USB CONFIG item's four callbacks are rewritten: in 0.4 three of them were assembly modelled instruction for instruction on USB AUDIO/MIDI's own; now they are C, and the name is a short routine of our own. The rest of the code is 0.4's.
  • Waits for the base: like Voice Spread (Voice Spread: the first Digitone II module, and the Digitone II becomes a preview #2003), a draft against base/digitone-ii-next until Digitone II base (cumulative): the Digitakt II base for OS 1.12 #1767 is on main. Rebased on that branch after Voice Spread: the first Digitone II module, and the Digitone II becomes a preview #2003.
  • How I checked it:
    • modules:check and machines:check pass. module:doctor: green but for the browser package (above) and the board claim, which is not made.
    • The pinned Docker build (GCC 16.2.0) exported usb-multi-0.4.1-experimental-os1.12.elemod (sha256 af6d8fbc…). Linked with the development base and stock 1.12, it gives exactly the image the unit ran (af0671ed…).
    • That image: sealed and verified by the kit's own writer and verifier, 2,004,120 bytes decoded (under the 2 MiB limit). The base alone, linked the same way, gives the main OS of the base that ran on a unit (20d418e9…).
    • Our own brick checker (dn2-cfw) accepts the image: sections other than the main OS stock, the seal, the unit's own depacker giving exactly this main OS at both stages, protected ranges, no new flash references, an emulated cold boot with no flash write, the startup and upgrade menus, and the in-OS upgrade's flash window.
    • In an emulator: the four items, the name, the boxes with the setting at 3 and at 2, and YES writing the 42-channel descriptors. No USB controller there, so the restart and the stream are the unit's.
    • Not run yet: npm run check and pr:ready.
  • Tested on a unit: Digitone II, OS 1.12, image af0671ed… (MW41: the development base plus this module alone), flashed on 30 November 2026. The tester (the author) reported it "flashed and working"; no per-step results were reported.
    • Not reported: the 42 inputs on a Mac and on an iPhone or iPad, a long recording, switching between the four choices, OVERBRIDGE after USB MULTI/MIDI, a power cycle with USB MULTI/MIDI saved, an OS transfer after a quiet spell, and screenshots.
  • What the guides lacked: scripts/link-image.mjs stops on the Digitone II ("This writer cannot rebuild a sealed HMAC OS"), so a local flashable test image needs the kit's own writer and verifier and fit-update's repack, as the site's builder does. Not fixed here: that belongs in its own Fix: pull request.

Edge cases

Case Why this change makes it a risk How run Result
Switch USB AUDIO/MIDI to USB MULTI/MIDI and back while connected Same USB mode (5): the module restarts USB itself Unit Not reported
Turn on the item instead of YES Rewritten turn callback Unit Not reported
Box ticks with the setting at 3 and at 2 Rewritten box callback Emulator with the setting poked; unit Emulator: only the chosen item ticked; unit: not reported
OVERBRIDGE after USB MULTI/MIDI Shares SRAM with Overbridge's packet ring Unit Not reported
Power cycle with USB MULTI/MIDI saved Start-up path (one patched branch) Unit Not reported
Quiet spell, then play 0.3 wrote past its ring after a long pause Unit Not reported
OS transfer after a quiet spell The case that crashed 0.3 Unit Not reported

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for bringing USB Multi over to Modwerk. Recording every Digitone II track at once, with no driver, is a great thing to offer. The code reads well: the menu callbacks are now your own C, and the module patches its own sites without touching any of the base's. Staying a draft until the Digitone II base (#1767) is on main is the right call.

Before it can be marked ready, these need doing:

  1. A full unit record on the exact build. So far TESTING.md has "flashed and working" for MW41 and nothing for each case. Please run the test procedure on the build you release and fill in every row of your edge-case table with what you saw. The most important ones:
    • an OS transfer after a long quiet spell. 0.3 crashed there, and a crash while the OS is being written matters most for the unit.
    • a power cycle with USB MULTI/MIDI saved.
    • USB AUDIO/MIDI, USB MIDI and OVERBRIDGE behaving exactly as stock with the module installed but not chosen, including OVERBRIDGE after USB MULTI/MIDI, since the module uses part of Overbridge's buffer.
    • the 42 inputs on a computer, and a long recording checked for dropouts.
    • a screenshot of USB CONFIG with the fourth item.
  2. Bring the manifest in line with TESTING.md. tests.summary still says 0.4.1 hasn't run on a unit, and the limitation still says it hasn't run on Modwerk's base, but TESTING.md records MW41 on that base. Update both, and the evidence tier, after the run.
  3. Finish the package and the checks. Add the import records and the browser package once the commit is fixed, then run npm run module:doctor -- usb-multi and npm run pr:ready until both are green. pr:ready also claims usb-multi on the agent board, which isn't done yet.

Writing the link-image.mjs finding up as its own Fix: pull request, as you suggested, would be very welcome.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant