Skip to content
This repository was archived by the owner on Sep 23, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -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-<cp-version>`, built
**audiodsp's parity oracle is `bin/circuitpython-oracle-<cp-version>`, 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.
Expand Down
1 change: 1 addition & 0 deletions AUDIODSP_PATCHES_COMMIT
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
4e5809195af58dd17f1705edcb9981e6fec3a312
1 change: 0 additions & 1 deletion AUDIOIF_PATCHES_COMMIT

This file was deleted.

2 changes: 1 addition & 1 deletion build_cp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
10 changes: 5 additions & 5 deletions build_interpreters.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
# cp-oracle CircuitPython unix / coverage built at
# CIRCUITPY_SYNTHIO_MAX_CHANNELS=64
# → bin/circuitpython-oracle-<cp-version>, 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,
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion patches/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
31 changes: 29 additions & 2 deletions patches/adafruit_mp3/0001-windows-msvc-inline-assembly.patch
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions patches/adafruit_mp3/README.md
Original file line number Diff line number Diff line change
@@ -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`.

Expand Down
64 changes: 32 additions & 32 deletions scripts/sync_from_overlay.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,19 @@
# 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).
#
# Usage:
# ./scripts/sync_from_overlay.sh # sync using pinned refs
# ./scripts/sync_from_overlay.sh --mp-ref <ref> # sync micropython-pydevices at <ref>
# ./scripts/sync_from_overlay.sh --audioif-ref <ref>
# ./scripts/sync_from_overlay.sh --audiodsp-ref <ref>
# ./scripts/sync_from_overlay.sh --check # diff mirrors against pinned refs; exit nonzero on drift
#
# <ref> 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.
#
Expand All @@ -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/^# \?//'
Expand All @@ -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)
Expand Down Expand Up @@ -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
Loading