Skip to content

feat(mp3): vendor minimp3 and add dual-backend scaffold #4051

Closed

Description

@zackees

Context

FastLED/license#14 defines Phase 0 of the gated replacement of the RPSL/RCSL Helix MP3 decoder with CC0 minimp3. FastLED currently compiles src/third_party/libhelix_mp3/ unconditionally and src/fl/codec/mp3.cpp.hpp is Helix-only. Upstream minimp3 is CC0-1.0; the pinned baseline for this phase is lieff/minimp3@ea99364f61c14656440e8d77e9c233ccf3124633.

Proposal

Vendor pristine minimp3, add FastLED build/licensing integration, add a caller-owned scratch API as a minimal documented upstream patch, and introduce a compile-time dual-backend adapter while leaving Helix as the default. Add a host golden harness that builds both Helix and minimp3-float and validates frame behavior and PCM quality over the available deterministic corpus.

Acceptance criteria

  • Capture RED evidence before implementation: a focused backend-selection/build test fails because the minimp3 backend and vendor tree do not yet exist.
  • Vendor minimp3.h and, only if the harness needs it, test-only minimp3_ex.h at src/third_party/minimp3/, wrapped/integrated according to FastLED conventions.
  • Record upstream SHA ea99364f61c14656440e8d77e9c233ccf3124633; include the CC0-1.0 license, required third-party manifest data, and per-file license markers.
  • Add mp3dec_decode_frame_r(dec, scratch, ...) with caller-owned mp3dec_scratch_t; keep the pristine upstream source plus a minimal documented diff/patch contract.
  • Preserve the public fl::Mp3 API and add mutually exclusive FASTLED_MP3_BACKEND_HELIX / FASTLED_MP3_BACKEND_MINIMP3 selection, with Helix remaining the default.
  • The minimp3 adapter maps frame decode behavior and derives Mp3Info.version from MPEG header bytes.
  • Add a deterministic host golden harness comparing Helix and minimp3-float frame acceptance/sample counts and checking both decoders against the available ISO-quality floor; Helix-vs-minimp3 PSNR is report-only in this phase.
  • Turn the focused RED signal GREEN, then pass Linux/Windows/macOS host validation and compile-only coverage including AVR and WASM.
  • Merge a PR that closes this issue and links Execution plan: vendor minimp3, optimize to Helix parity, SIMD past Helix, delete libhelix_mp3 (phased, gated) license#14.

Decisions

  • Helix remains the default in this phase so G0 is behavior-preserving; the default changes only at Phase 5.
  • The vendored baseline is pinned to the current upstream master SHA so provenance and later diffs are reproducible.
  • minimp3_ex.h is test-only unless implementation proves the production streaming adapter needs it.
  • Phase 0 owns only G0; performance, fixed-point conversion, SIMD, and Helix deletion remain in later child issues.

Related issues

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions