From 4bf76a9aa76815b3ce42dfc7e71e8b73931dc6dc Mon Sep 17 00:00:00 2001 From: Brad Barnett <127794626+bdbarnett@users.noreply.github.com> Date: Mon, 21 Sep 2026 16:50:29 -0500 Subject: [PATCH] audioif is audiodsp: the pin file, the CI checkout, the ignore list and the docs The DSP repository was renamed on 2026-09-21. AUDIOIF_PATCHES_COMMIT is AUDIODSP_PATCHES_COMMIT, the checks workflow fetches PyDevices/audiodsp, and the workspace's usermod link is cmods/audiodsp. /audiopump joins the ignore list: it is the link to the pump's platform driver, which a plain build needs beside the DSP repo. The patches pin moves to audiodsp@4e58091 and the adafruit_mp3 mirror is resynced from it, because the mirror's README names the repository and has to match byte for byte. The patch itself gains its header and one reworded comment and nothing else -- the documentation-only difference #28 described. Closes #28. --- .github/workflows/checks.yml | 12 ++-- .gitignore | 3 +- AGENTS.md | 4 +- AUDIODSP_PATCHES_COMMIT | 1 + AUDIOIF_PATCHES_COMMIT | 1 - build_cp.sh | 2 +- build_interpreters.sh | 10 +-- patches/README.md | 2 +- .../0001-windows-msvc-inline-assembly.patch | 31 ++++++++- patches/adafruit_mp3/README.md | 4 +- scripts/sync_from_overlay.sh | 64 +++++++++---------- 11 files changed, 81 insertions(+), 53 deletions(-) create mode 100644 AUDIODSP_PATCHES_COMMIT delete mode 100644 AUDIOIF_PATCHES_COMMIT diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index 645b49e..805909c 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -33,7 +33,7 @@ jobs: id: pins run: | echo "mp=$(cat cmods/MICROPYTHON_PYDEVICES_COMMIT)" >> "$GITHUB_OUTPUT" - echo "audioif=$(cat cmods/AUDIOIF_PATCHES_COMMIT)" >> "$GITHUB_OUTPUT" + echo "audiodsp=$(cat cmods/AUDIODSP_PATCHES_COMMIT)" >> "$GITHUB_OUTPUT" - name: Check out micropython-pydevices at the pinned commit uses: actions/checkout@v4 @@ -43,15 +43,15 @@ jobs: path: micropython-pydevices fetch-depth: 1 - - name: Check out audioif at the pinned commit + - name: Check out audiodsp at the pinned commit uses: actions/checkout@v4 with: - repository: PyDevices/audioif - ref: ${{ steps.pins.outputs.audioif }} - path: audioif + repository: PyDevices/audiodsp + ref: ${{ steps.pins.outputs.audiodsp }} + path: audiodsp fetch-depth: 1 - # cmods, micropython-pydevices, and audioif land as siblings under + # cmods, micropython-pydevices, and audiodsp land as siblings under # $GITHUB_WORKSPACE, matching the workspace layout sync_from_overlay.sh # expects for its sibling-checkout lookup. - name: Diff mirrors against pinned sources diff --git a/.gitignore b/.gitignore index 84fdc24..44e4c44 100644 --- a/.gitignore +++ b/.gitignore @@ -51,7 +51,8 @@ user_post_mpconfigport.mk /esp32_partitions/*.csv # Top-level symlinks to clones/siblings (/* / does not match symlinks) -/audioif +/audiodsp +/audiopump /cameraif /displayif /earful diff --git a/AGENTS.md b/AGENTS.md index d3079c9..560ca65 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -58,9 +58,9 @@ the organization portal, simulator, and documentation sites. | `mp-wasm` | `./build_mp.sh --port webassembly --variant pydevices` | `bin/micropython.{mjs,wasm}` | `../pydevices/bin/micropython.{mjs,wasm}` and `../PyDevices.github.io/vendor/micropython/micropython.{mjs,wasm}` | | `cp-unix` | `./build_cp.sh --port unix --variant coverage` | `bin/circuitpython` | `../pydevices/bin/circuitpython` | -**audioif's parity oracle is `bin/circuitpython-oracle-`, built +**audiodsp's parity oracle is `bin/circuitpython-oracle-`, built only by the opt-in `--only cp-oracle` target** (the same unix coverage build at -`CIRCUITPY_SYNTHIO_MAX_CHANNELS=64`) and re-pinned by sha256 in audioif's +`CIRCUITPY_SYNTHIO_MAX_CHANNELS=64`) and re-pinned by sha256 in audiodsp's `tests/test_voice_ceiling_consistency.py` in the same change that builds it — `bin/circuitpython` is `cp-unix`'s, at the variant's own 14-voice ceiling, and a bare run of this script overwrites it. diff --git a/AUDIODSP_PATCHES_COMMIT b/AUDIODSP_PATCHES_COMMIT new file mode 100644 index 0000000..f8f6c74 --- /dev/null +++ b/AUDIODSP_PATCHES_COMMIT @@ -0,0 +1 @@ +4e5809195af58dd17f1705edcb9981e6fec3a312 diff --git a/AUDIOIF_PATCHES_COMMIT b/AUDIOIF_PATCHES_COMMIT deleted file mode 100644 index 2f17617..0000000 --- a/AUDIOIF_PATCHES_COMMIT +++ /dev/null @@ -1 +0,0 @@ -667cb0f30debc3d11baff7872f652e7b95c4a7c9 diff --git a/build_cp.sh b/build_cp.sh index d297129..20cc019 100755 --- a/build_cp.sh +++ b/build_cp.sh @@ -392,7 +392,7 @@ user_config=$(cp_user_config_make_opts) # # compiles and yields 64. # -# Why it exists: docs/correctness-standard.md in audioif holds a node +# Why it exists: docs/correctness-standard.md in audiodsp holds a node # CircuitPython also has to CircuitPython's own bytes *at the same compile-time # configuration*, so a comparison build has to be able to take the ceiling this # workspace ships. diff --git a/build_interpreters.sh b/build_interpreters.sh index 2e980de..2a0c0f7 100755 --- a/build_interpreters.sh +++ b/build_interpreters.sh @@ -16,9 +16,9 @@ # cp-oracle CircuitPython unix / coverage built at # CIRCUITPY_SYNTHIO_MAX_CHANNELS=64 # → bin/circuitpython-oracle-, and nowhere else. -# That file is audioif's parity oracle: every golden in that +# That file is audiodsp's parity oracle: every golden in that # repository means "the bytes this binary rendered". Its sha256 -# is pinned in audioif's tests/test_voice_ceiling_consistency.py, +# is pinned in audiodsp's tests/test_voice_ceiling_consistency.py, # so re-pinning the hash there is part of running this target, # in the same change. bin/circuitpython is NOT the oracle — it # is cp-unix's, at the coverage variant's own 14-voice ceiling, @@ -289,12 +289,12 @@ install_one() { exit 1 } # Workspace bin only, never the sibling pydevices tree: this is a - # test fixture for audioif's parity gates, not an interpreter - # anybody runs. Re-pin its sha256 in audioif's + # test fixture for audiodsp's parity gates, not an interpreter + # anybody runs. Re-pin its sha256 in audiodsp's # tests/test_voice_ceiling_consistency.py in the same change. install_file "$CP_UNIX_SRC" "$WORKSPACE_BIN" \ "circuitpython-oracle-$(cp_version)" - echo "Pin this in audioif tests/test_voice_ceiling_consistency.py:" + echo "Pin this in audiodsp tests/test_voice_ceiling_consistency.py:" sha256sum "$WORKSPACE_BIN/circuitpython-oracle-$(cp_version)" ;; esac diff --git a/patches/README.md b/patches/README.md index 401b8db..0acec1e 100644 --- a/patches/README.md +++ b/patches/README.md @@ -55,7 +55,7 @@ sync here — never the reverse** (single-writer, same rule as lvgl): with provenance; `apply_patches.sh` there applies them standalone). - `0012` and `0014` are cmods-local board integration (the P4 and S3 board headers, respectively) and have no upstream home; they are authored here. -- `adafruit_mp3/` → `PyDevices/audioif` (`patches/adafruit_mp3/`, +- `adafruit_mp3/` → `PyDevices/audiodsp` (`patches/adafruit_mp3/`, applied by its `scripts/fetch_deps.sh`). ## Regenerate diff --git a/patches/adafruit_mp3/0001-windows-msvc-inline-assembly.patch b/patches/adafruit_mp3/0001-windows-msvc-inline-assembly.patch index dffc2c8..1f249f2 100644 --- a/patches/adafruit_mp3/0001-windows-msvc-inline-assembly.patch +++ b/patches/adafruit_mp3/0001-windows-msvc-inline-assembly.patch @@ -1,3 +1,30 @@ +From: PyDevices audiodsp +Date: Mon, 25 Aug 2026 00:00:00 +0000 +Subject: [PATCH] src/assembly.h: keep mingw-w64 GCC off the MSVC-only branch + +Purpose: assembly.h guards its MSVC-only inline-`__asm{}` branch (and an +MSVC-only `#pragma warning`) on `defined _WIN32`, which mingw-w64 GCC -- +this workspace's Windows MicroPython target -- also defines. Excluding +`__GNUC__` makes mingw fall through to the portable C fallback at the +bottom of the file, the same one the unix build already uses. Upstream +never hits this: CircuitPython has no Windows port, so the branch was +only ever reached by real MSVC. + +Provenance: written for the audiodsp Windows MicroPython port (originally +carried in the parent workspace's own patches/adafruit_mp3; ownership +moved here in Phase 2 of the modernization program). Full rationale: +docs/upstream-diff.md in +the audiodsp repository, "Tier 5 audiomp3: three Windows-only local +fixes, no unix impact". +Upstream-version: authored against Adafruit_MP3 +aac02afd9f24d2ee930f650156654ab9211a306a, the exact commit +CircuitPython 10.2.1 vendors (see DEPENDENCIES.lock). +Order: first and only patch in the series. Applied by +scripts/fetch_deps.sh on top of the pinned commit. +Test: build the Windows MicroPython port (mingw-w64) with the audiodsp +usermod; the unix build is unaffected because it never entered this +branch. + diff --git a/src/assembly.h b/src/assembly.h index 7c714cd..f5ca2e2 100644 --- a/src/assembly.h @@ -7,8 +34,8 @@ index 7c714cd..f5ca2e2 100644 #endif -#if (defined _WIN32 && !defined _WIN32_WCE) || (defined __WINS__ && defined _SYMBIAN) || defined(_OPENWAVE_SIMULATOR) || defined(WINCE_EMULATOR) /* Symbian emulator for Ix86 */ -+/* PyDevices local patch (see cmods/micropython-audio/docs/upstream-diff.md, -+ * "cmods/mp3 local patch"): added `&& !defined(__GNUC__)` to this branch's ++/* PyDevices local patch (see docs/upstream-diff.md in the audiodsp repo, ++ * "Tier 5 audiomp3"): added `&& !defined(__GNUC__)` to this branch's + * condition. It guards MSVC-only `__asm { ... }` intrinsic syntax and an + * MSVC-only `#pragma warning`, neither of which mingw-w64 GCC accepts, but + * mingw-w64 GCC (this workspace's Windows MicroPython target) also defines diff --git a/patches/adafruit_mp3/README.md b/patches/adafruit_mp3/README.md index 7f5dd82..8b94ce5 100644 --- a/patches/adafruit_mp3/README.md +++ b/patches/adafruit_mp3/README.md @@ -1,7 +1,7 @@ # Adafruit_MP3 patch queue -Owned by audioif (Phase 2 of the modernization program moved ownership -here from cmods/patches/adafruit_mp3). Applied by +Owned by audiodsp (Phase 2 of the modernization program moved ownership +here from the parent workspace's own patches/adafruit_mp3). Applied by `scripts/fetch_deps.sh` on top of the pinned Adafruit_MP3 commit declared in `DEPENDENCIES.lock`. diff --git a/scripts/sync_from_overlay.sh b/scripts/sync_from_overlay.sh index fc5d5ca..4be1778 100755 --- a/scripts/sync_from_overlay.sh +++ b/scripts/sync_from_overlay.sh @@ -5,7 +5,7 @@ # PyDevices/micropython-pydevices -> patches/000*.patch # wasmbridge/ # variants/webassembly/pydevices/ -# PyDevices/audioif -> patches/adafruit_mp3/ +# PyDevices/audiodsp -> patches/adafruit_mp3/ # # Edit those files in the source repo, never here (single-writer, same rule # as lvgl-python/scripts/sync_from_lvgl_bindings.sh). @@ -13,11 +13,11 @@ # Usage: # ./scripts/sync_from_overlay.sh # sync using pinned refs # ./scripts/sync_from_overlay.sh --mp-ref # sync micropython-pydevices at -# ./scripts/sync_from_overlay.sh --audioif-ref +# ./scripts/sync_from_overlay.sh --audiodsp-ref # ./scripts/sync_from_overlay.sh --check # diff mirrors against pinned refs; exit nonzero on drift # # is an exact 40-character commit SHA or a tag. If a sibling checkout -# (../micropython-pydevices, ../audioif) exists next to this workspace, it is +# (../micropython-pydevices, ../audiodsp) exists next to this workspace, it is # used directly (after fetching the ref if not already present locally); # otherwise a shallow temp clone is made from GitHub. # @@ -26,21 +26,21 @@ set -euo pipefail MP_REPO_URL="${MICROPYTHON_PYDEVICES_REPO:-https://github.com/PyDevices/micropython-pydevices.git}" -AUDIOIF_REPO_URL="${AUDIOIF_REPO:-https://github.com/PyDevices/audioif.git}" +AUDIODSP_REPO_URL="${AUDIODSP_REPO:-https://github.com/PyDevices/audiodsp.git}" SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" CMODS_DIR="$(cd "$SCRIPT_DIR/.." && pwd)" WORKSPACE_DIR="$(cd "$CMODS_DIR/.." && pwd)" MP_SIBLING="$WORKSPACE_DIR/micropython-pydevices" -AUDIOIF_SIBLING="$WORKSPACE_DIR/audioif" +AUDIODSP_SIBLING="$WORKSPACE_DIR/audiodsp" MP_PIN_FILE="$CMODS_DIR/MICROPYTHON_PYDEVICES_COMMIT" -AUDIOIF_PIN_FILE="$CMODS_DIR/AUDIOIF_PATCHES_COMMIT" +AUDIODSP_PIN_FILE="$CMODS_DIR/AUDIODSP_PATCHES_COMMIT" CHECK=0 MP_REF="" -AUDIOIF_REF="" +AUDIODSP_REF="" usage() { sed -n '2,24p' "$0" | sed 's/^# \?//' @@ -52,8 +52,8 @@ while [[ $# -gt 0 ]]; do MP_REF=$2 shift 2 ;; - --audioif-ref) - AUDIOIF_REF=$2 + --audiodsp-ref) + AUDIODSP_REF=$2 shift 2 ;; --check) @@ -186,57 +186,57 @@ else fi # --------------------------------------------------------------------------- -# audioif -> patches/adafruit_mp3/ +# audiodsp -> patches/adafruit_mp3/ # --------------------------------------------------------------------------- if [[ "$CHECK" -eq 1 ]]; then - [[ -f "$AUDIOIF_PIN_FILE" ]] || { - echo "Error: $AUDIOIF_PIN_FILE missing; run without --check first to establish pins." >&2 + [[ -f "$AUDIODSP_PIN_FILE" ]] || { + echo "Error: $AUDIODSP_PIN_FILE missing; run without --check first to establish pins." >&2 exit 1 } - AUDIOIF_REF=$(tr -d '[:space:]' < "$AUDIOIF_PIN_FILE") -elif [[ -z "$AUDIOIF_REF" ]]; then - if [[ -f "$AUDIOIF_PIN_FILE" ]]; then - AUDIOIF_REF=$(tr -d '[:space:]' < "$AUDIOIF_PIN_FILE") - elif [[ -d "$AUDIOIF_SIBLING/.git" ]]; then - AUDIOIF_REF=$(git -C "$AUDIOIF_SIBLING" rev-parse HEAD) + AUDIODSP_REF=$(tr -d '[:space:]' < "$AUDIODSP_PIN_FILE") +elif [[ -z "$AUDIODSP_REF" ]]; then + if [[ -f "$AUDIODSP_PIN_FILE" ]]; then + AUDIODSP_REF=$(tr -d '[:space:]' < "$AUDIODSP_PIN_FILE") + elif [[ -d "$AUDIODSP_SIBLING/.git" ]]; then + AUDIODSP_REF=$(git -C "$AUDIODSP_SIBLING" rev-parse HEAD) else - echo "Error: no AUDIOIF_PATCHES_COMMIT pin, no --audioif-ref, and no sibling checkout to default from." >&2 + echo "Error: no AUDIODSP_PATCHES_COMMIT pin, no --audiodsp-ref, and no sibling checkout to default from." >&2 exit 1 fi fi -AUDIOIF_TMP=$(mktemp -d) -CLONE_DIRS+=("$AUDIOIF_TMP") -AUDIOIF_RESOLVED=$(resolve_and_export "$AUDIOIF_REPO_URL" "$AUDIOIF_REF" "$AUDIOIF_SIBLING" "$AUDIOIF_TMP") +AUDIODSP_TMP=$(mktemp -d) +CLONE_DIRS+=("$AUDIODSP_TMP") +AUDIODSP_RESOLVED=$(resolve_and_export "$AUDIODSP_REPO_URL" "$AUDIODSP_REF" "$AUDIODSP_SIBLING" "$AUDIODSP_TMP") -if [[ ! -d "$AUDIOIF_TMP/patches/adafruit_mp3" ]]; then - echo "Error: patches/adafruit_mp3/ not found in audioif @ ${AUDIOIF_RESOLVED}." >&2 +if [[ ! -d "$AUDIODSP_TMP/patches/adafruit_mp3" ]]; then + echo "Error: patches/adafruit_mp3/ not found in audiodsp @ ${AUDIODSP_RESOLVED}." >&2 exit 1 fi if [[ "$CHECK" -eq 1 ]]; then - diff_tree "$AUDIOIF_TMP/patches/adafruit_mp3" "$CMODS_DIR/patches/adafruit_mp3" "patches/adafruit_mp3/ vs audioif@${AUDIOIF_RESOLVED}" || DRIFT=1 + diff_tree "$AUDIODSP_TMP/patches/adafruit_mp3" "$CMODS_DIR/patches/adafruit_mp3" "patches/adafruit_mp3/ vs audiodsp@${AUDIODSP_RESOLVED}" || DRIFT=1 else rm -rf "$CMODS_DIR/patches/adafruit_mp3" mkdir -p "$CMODS_DIR/patches/adafruit_mp3" - cp -a "$AUDIOIF_TMP/patches/adafruit_mp3/." "$CMODS_DIR/patches/adafruit_mp3/" - printf '%s\n' "$AUDIOIF_RESOLVED" > "$AUDIOIF_PIN_FILE" - echo "Synced patches/adafruit_mp3/ from audioif@${AUDIOIF_RESOLVED}" + cp -a "$AUDIODSP_TMP/patches/adafruit_mp3/." "$CMODS_DIR/patches/adafruit_mp3/" + printf '%s\n' "$AUDIODSP_RESOLVED" > "$AUDIODSP_PIN_FILE" + echo "Synced patches/adafruit_mp3/ from audiodsp@${AUDIODSP_RESOLVED}" fi if [[ "$CHECK" -eq 1 ]]; then if [[ "$DRIFT" -ne 0 ]]; then echo echo "Mirror drift detected against pinned commits. Re-run without --check to resync," >&2 - echo "or bump MICROPYTHON_PYDEVICES_COMMIT / AUDIOIF_PATCHES_COMMIT after verifying the source change." >&2 + echo "or bump MICROPYTHON_PYDEVICES_COMMIT / AUDIODSP_PATCHES_COMMIT after verifying the source change." >&2 exit 1 fi echo "No drift: mirrors match pinned commits." echo " micropython-pydevices @ ${MP_RESOLVED}" - echo " audioif @ ${AUDIOIF_RESOLVED}" + echo " audiodsp @ ${AUDIODSP_RESOLVED}" else echo echo "Commit when ready:" - echo " git add MICROPYTHON_PYDEVICES_COMMIT AUDIOIF_PATCHES_COMMIT patches wasmbridge variants/webassembly/pydevices" - echo " git commit -m \"Sync overlay mirrors from micropython-pydevices@${MP_RESOLVED:0:12} / audioif@${AUDIOIF_RESOLVED:0:12}.\"" + echo " git add MICROPYTHON_PYDEVICES_COMMIT AUDIODSP_PATCHES_COMMIT patches wasmbridge variants/webassembly/pydevices" + echo " git commit -m \"Sync overlay mirrors from micropython-pydevices@${MP_RESOLVED:0:12} / audiodsp@${AUDIODSP_RESOLVED:0:12}.\"" fi