mirror of
https://github.com/torlando-tech/pyxis.git
synced 2026-08-14 06:39:54 +00:00
sh123/esp32_codec2 PR #4 (merged Jan 6 2026) updated the bundled codec2 to the modern stable line — addresses the v0.9.2-vs-pycodec2- v1.2.0 interop gap that motivated vendoring back on May 8. With the version gap closed, the standalone vendor in lib/codec2/ becomes pure noise: 42 .c source files (~2.9 MB tree) sitting in the repo when a single lib_deps line plus two build_flags get the same behaviour. Changes: - platformio.ini lib_deps (both env blocks): `codec2` (vendored) → `sh123/esp32_codec2@^1.0.7`. Comment notes the version history so future eyes don't re-vendor. - platformio.ini build_flags (both env blocks): add `-D__EMBEDDED__` and `-DMEMORY_CRITICAL` so codec2's codebook tables land in flash (.const) instead of BSS. Moved here from lib/codec2/library.json's `build.flags`. Without these, ~127 KB of codebook data competes with LVGL's framebuffer in BSS. - lib/codec2/ (vendored tree) deleted — 106 files, ~43,000 lines. PIO will fetch sh123 into .pio/libdeps/tdeck/esp32_codec2/ on first build. Size impact: - RAM: 27.4% → 27.4% (no change; codebooks were already in flash via __EMBEDDED__). - Flash: 77.0% → 79.8% (+~88 KB). sh123 ships the full codec2 source (69 .c files) vs the trimmed vendor (42 files): unused paths like FreeDV, OFDM, COHPSK, FSK get linked in. Well below the 100% partition limit; can revisit with `lib_ignore` if flash pressure increases. This is a real-functional change vs the rest of this PR which is purely build-config rewiring. Audio fidelity should be unchanged (sh123 carries the same codec2 SHA range as the vendor), but worth revalidating with the codec2 fidelity test against pycodec2 before merging.