Skip to content

modules.lock: audiodsp 6d08b07, the reverb tank at -O2 in -Os firmware - #375

Merged
bdbarnett merged 2 commits into
mainfrom
audiodsp-pin-6d08b07
Nov 10, 2026
Merged

bdbarnett merged 2 commits into
mainfrom
audiodsp-pin-6d08b07

Conversation

@bdbarnett

Copy link
Copy Markdown
Contributor

Moves the audiodsp pin to audiodsp#399, its only change since 1a387e5. On size-optimised firmware, including the classic ESP32's, the reverb tank now compiles at -O2. At 48 kHz and 160 MHz that takes it from 4.7 ms to 4.0 ms of each 5.3 ms block. Its output is identical to the bit: 400 random configurations matched the old code.

Together with the AUDIO_KIT variant at 240 MHz (#374), this fixes PyDevices/apps#44. On the ESP32 Audio Kit, the issue's seven-note soundmodule run plays with its Reverb on and no dropouts or starved blocks. The capture was taken with audiodsp#399's branch built into the firmware; this pin moves to the same code, squashed.

Moves audiodsp to audiodsp#399. In size-optimised firmware, the classic
ESP32's for one, the reverb tank now compiles for speed: 4.7 to 4.0 ms per
48 kHz block at 160 MHz, with output identical to the bit (400 random
configurations against the old code). With the AUDIO_KIT variant at
240 MHz (#374) the seven-note soundmodule run from apps#44 plays with its
Reverb and no dropouts.
…sizes

On a GIGA whose BCM4 option bit is set, the M4 starts from the bytes at
0x08100000, so a build refuses an image whose bytes there point at memory
and pads the code before that address until they don't. It tried 16, 32,
48 and 64 bytes, which move the address only 24 to 72 bytes through the
code. An image whose address landed in a literal pool of flash addresses
(the end of mp_builtin_help here) was refused at every size, and the build
failed: audiodsp 6d08b07 grew the code before the address by 1,456 bytes
and put it there.

Now the padding function is always compiled, so the build knows where it
is, and every padding from 0 to 4,096 bytes in 16-byte steps is read off
the image already linked: growing the pad by a multiple of .text's largest
alignment (8) moves everything after it by exactly that much. The build
relinks once with the smallest padding whose bytes pass, checks them, and
tries again (up to four times) only if the relink didn't put there what
the image said. Windows 16 bytes apart over 4 KB can't all sit in one
literal pool.

The GIGA DISPLAY_SHIELD build with audiodsp 6d08b07, which failed with
"none of 16, 32, 48, 64 bytes of padding moved it clear", now prints
"m4 pad: 96 bytes" after one relink, and the bytes at 0x08100000 are
stack 0xf7e84809, reset 0x3501f82c, HardFault 0xbf18429d. Over 4 KB of
growth either way from that image, the smallest padding that passes is
never more than 224 bytes. tests/test_build_mp.py passes (97 tests).
@bdbarnett

Copy link
Copy Markdown
Contributor Author

This branch now carries #379's commit too: the GIGA DISPLAY_SHIELD build failed here because its M4 boot padding tried only four sizes, and #379 searches 4 KB. Once #379 is in main, this PR's diff is the pin alone again.

@bdbarnett
bdbarnett merged commit 94c6cb6 into main Nov 10, 2026
42 checks passed
@bdbarnett
bdbarnett deleted the audiodsp-pin-6d08b07 branch November 10, 2026 05:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

soundmodule on a classic ESP32: the engine's Reverb can't keep up at 48 kHz

1 participant