Skip to content

USB Audio 0.4.3-experimental: recording costs less CPU, and almost nothing at rest - #2462

Merged
repeat98 merged 19 commits into
mainfrom
module/usb-audio-043
Nov 30, 2026
Merged

repeat98 merged 19 commits into
mainfrom
module/usb-audio-043

Conversation

@repeat98

@repeat98 repeat98 commented Nov 30, 2026 •

Copy link
Copy Markdown
Owner

USB Audio 0.4.3-experimental: almost nothing at rest, and cheaper recording in lighter projects. The release package passed steps 1-9 of the test procedure on a 0.8.5 twin, and the owner approved it (30 November 2026).

  • What works:
    • Installed with nothing streaming: +0.1 % of a frame (priced on the unit, inside the 0.2 at-rest rule; 0.4.2 cost +0.6 in the same scene). USB Audio is off the pending-price list.
    • Recording in a lighter project (Windows, bank A pattern 1): MAIN 46.7 % → 37.4 % of the frame interrupt, with the computer playing in 50.7 % → 40.0 %, 16 tracks 56.7 % → 50.3 %.
    • Against the built-in MAIN + CUE in a busy scene on 0.8.5 (INPUTS OFF, like for like): 3.1 % of a frame and 3.6 idle points dearer, inside the stock benchmark's limits.
    • Ten minutes on a Mac with the release, playing 1 kHz into INPUTS AB while recording MAIN: no buzz (sidebands -62 to -75 dB; 0.4.1 reached -6 dB).
    • The test procedure on the release (3c3c996d): software checks, beside every other module, the scripted unit pass (12 of 12 Part switches), a 2-minute soak, the price. The audio is the same as 0.4.2's.
  • What's broken or open:
    • In a busy project with INPUTS on, a Mac recording costs about 15 points, as with 0.4.2 (51 % against the built-in's 41 %), with single frames just over 100 % on both versions. The input path is the extra; worth its own issue after this release. The release notes say so.
    • Step 10 of the procedure (put back) could not read the unit: it had dropped off USB after the price's rollback, the base's known rare loss (three times today in about 30 reconnects, 0.4.2 too). After a power cycle the price ran again alone and the twin was put back clean.
    • The procedure needed cbcd00b70 (a trial waits until the USB function reconnects), applied uncommitted; without it the soak lost its link. That fix goes to main in its own Fix pull request.
    • Not bit exact while the computer plays in, as in 0.4.2 (needs an explicit feedback endpoint in the base). Not run: listening, the settings on the unit, POST LEVEL, 20 channels, INPUTS ABCD, an MKI, a Keep and a power cycle.
  • Musically: nothing taken from players who have USB Audio installed but aren't streaming, and more room while recording lighter projects; busy projects record as before.
  • Who must act: nobody before the merge; the owner approved this source (sdk/approvals).
  • Ran on your unit: yes, the owner's MKII, OS 1.40C: development twins of 0.8.4 (16c87945) and 0.8.5 (5ac74d69, 8fb901eb), Windows 11 and macOS, rolled-back trials, nothing kept.
  • Next step: merge; then check the site serves 0.4.3 and keeps 0.4.2 as the Undo.

The module's author is Mark Roberts (markandrus, MIT port). The owner maintains its Modwerk releases (0.4.0-0.4.2) and asked for this update.

What changed
  • usb_audio_settings.c mwua_begin_frame decides once a frame whether any packet needs a track word (mwua_no_tracks), and whether a high-speed packet is one run of consecutive ring words (mwua_run_words 2, 4 or 16, mwua_run_off). After a change that starts sending tracks without a reconnect (MAIN to TRACK 8), mwua_tracks_stale is up for one ring lap (64 blocks, 23 ms) and the packet copy sends those tracks silent (mwua_copy_fresh), so the packets never carry older ring words. The routes are untouched, so the base's settings test stays as on main; the new checks are in sdk/tests/usb_audio_runs_test.c.
  • usb_audio_configurable.py: the producer skips the sixteen track stores on mwua_no_tracks (was MAIN + CUE only); mwua_copy_run moves a run with moveml (2, 4 or 16 words a frame); the frame hook returns before its register save while no stream is asked for, none needs tearing down, the idle bookkeeping is done and POST LEVEL is off.
  • Inventory kind 11; the site replaces 0.4.2 (kind 10, configurable-0.4.2) and keeps it as the Undo. Recipes re-captured (same copy sites, new source hashes), release package rebuilt.
Measurements

All in TESTING.md and evidence/performance.json; the method and every reading are in TESTING.md's 0.4.3 entry. Three readings a state (the base's guard and CPU meter), alternated A B A B against 0.4.2's code built the same way.

Tested on a unit: package 3c3c996d2789, MKII OS 1.40C, test:procedure steps 6, 7, 8, 9 on development twin 5ac74d69 of base 0.8.5; the developer's stage not done (no listening test); the owner approved the release on 30 November 2026.
Edge cases

Case Why this change makes it a risk How run Result
A stream starts after rest the frame hook returns early at rest every recording after an install, Windows and Mac pass
The Mac playing in for 10 minutes 0.4.2's buzz fix lives on this path the release, 1 kHz into INPUTS AB, MAIN recorded back pass: sidebands -62 to -75 dB
A busy scene, recording the stream's cost under load the benchmark above pass against the built-in with INPUTS OFF; with INPUTS AB as dear as 0.4.2
Beside other modules the shared sites and pool modules:compat (step 2) passed; not run on the unit beside other modules
MAIN to TRACK 8 without a reconnect the ring's track words are old for one lap host test pass on the host; not run on the unit
Install and rollback reconnects each one reconnects USB about 30 on the Mac this evening two left the unit off USB until a power cycle (the known loss)
Persistence: Keep and power cycle the saved settings not run the owner's, after release

What the guides lacked or got wrong: nothing in the guides; the test tool missed cbcd00b70 (fixed in its own pull request). A 0.8.5 development twin with every beta flag overflows a flash slot by 1,332 bytes; the twins here leave out the stream channel (and, for the benchmark pair, the sample editor).

🤖 Generated with Claude Code

repeat98 and others added 18 commits November 30, 2026 11:52
…copy

MAIN, like MAIN + CUE before it, no longer stores the sixteen track words a frame or
routes its packets through the C copy: mwua_begin_frame decides both once a frame for
every layout (mwua_no_tracks, mwua_bus_words). A change that starts sending a track
without a reconnect keeps that track silent for one ring lap instead of sending the
ring's older words.

Owner's MKII, twin of base 0.8.4, Windows 11, MAIN + INPUTS AB: recording 51.6 -> 41.6-42.8 %
of the frame interrupt, recording with input 54.3 -> 45.9 % (and 50.7 -> 40.1 % in a second
pair); the recorded samples are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ev_usb_frame does not rest, so the hook ran its register save, the routing snapshot and the
idle bookkeeping every block with no host. It now returns before saving a register while no
stream is asked for, none needs tearing down, the idle bookkeeping is done and no POST gain
history has to follow core 0. The first block a host asks for takes the whole path.

Owner's MKII, twin of base 0.8.4, playing: base alone 30.8 %, installed at rest 31.3 % (0.4.2)
and 31.4 % (previous commit) -> 30.9 %; recording and recording with input unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ut the routes

The bus-only copy becomes a run copy: mwua_begin_frame finds a packet whose pairs are
consecutive ring words (one pair, two pairs or the eight tracks) and the packet copy moves
that run alone, so TRACKS, TRACK 8 and single or double Outbox-style runs skip the routed
C copy as MAIN and MAIN + CUE do.

Owner's MKII, twin of base 0.8.4, Windows 11, recording only (frame interrupt, previous
commit -> this one): TRACKS 16 channels 56.7 -> 50.3 %, TRACK 8 46.7 -> 44.6 %; at rest
30.9 % both; the recorded channels' peaks are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…11 with 0.4.2 as its Undo, recipes and the release package

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…uilt packages

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts:
#	src/engine/assets/module-build.json
… merge with main

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…t is not run yet

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…nerate the module documents

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…in the routes; the base's settings test back as on main

The routing snapshot keeps every route as before; mwua_begin_frame raises mwua_tracks_stale for one ring
lap after the producer stores track words again, and the packet copy then sends those tracks silent
(mwua_copy_fresh). The new checks live in sdk/tests/usb_audio_runs_test.c, outside the base's sources.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…NG.md names the release and its last change

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…f, no buzz

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… unchanged

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ne scene on 0.8.5, the release note for busy projects, the owner's approval on this source

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…t price (+0.1 % of a frame), the record

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@repeat98
repeat98 marked this pull request as ready for review November 30, 2026 19:46
@repeat98
repeat98 merged commit 2f84802 into main Nov 30, 2026
18 of 28 checks passed
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