Skip to content

Integrate loaded-track DJ metadata - #8

Open
djdefi wants to merge 10 commits into
djdefi-library-index-v2from
djdefi-track-metadata-integration
Open

Integrate loaded-track DJ metadata#8
djdefi wants to merge 10 commits into
djdefi-library-index-v2from
djdefi-track-metadata-integration

Conversation

@djdefi

@djdefi djdefi commented Aug 22, 2026

Copy link
Copy Markdown
Owner

This wires the reviewed JAYDMETA/1 reader into DjSession and the index-v2 library lifecycle. Sidecars remain optional: missing, corrupt, unsupported, stale, or ambiguous metadata never blocks ordinary indexed AAC browsing or playback.

The integration keeps metadata association atomic with deck loads, publishes only compact copied snapshot fields plus semantic read-only accessors, invalidates associations on verified library identity changes, and prevents recursive index work while load/play/record activity is active. It does not add sync, quantize, seeking, loops, UI, or browser behavior, and it does not depend on JayD-Library CircuitMess#21.

Prerequisites and merge order

  1. Fix Mixer clip() overflow bug; add per-channel hot-swap loading CircuitMess/JayD-Library#19 at 4ad5108ff1acc309ebc96d91d61d8cb24637f07e and MixScreen: load decks one at a time, stop blocking on both files CircuitMess/JayD-Firmware#42.
  2. SongList: render visible tracks directly #2 (direct rendering), then Persist SongList index across opens #5 (index v2, final 307ba95ad9632d009b45f57ae821c59a53cfe617). This PR is stacked on Persist SongList index across opens #5.
  3. Reviewed sibling foundations: Add host-side DJ metadata sidecar converter #1 (converter), Add firmware-owned DJ session authority #3 (DjSession authority), and Add bounded firmware metadata reader #4 (firmware reader). Their commits are preserved patch-equivalently in this branch; if those PRs land independently first, rebase this PR and drop only the duplicate dependency patches.
  4. Merge this PR's focused integration commit ada60009a9abf06252ccfcd68cfb4ad482f59378 and review fix 8c0ae10acbb2e28a8ba303c29ac64a57763b8f52.
Dependency commit traceability
  • DjSession: f5ade3d74d5e1541d145e9b14dcefa72ff9b0399 -> 7588cc1; follow-ups 41b1df3 -> c0a28bd, final 74c98d39a5872bc154fac72b628924911201f2e2 -> 6cdc72c
  • Converter: faa9a2fd0cc957cf9ecb834c42295fc5ea91a3e5 -> f17d7aa; 6102f90 -> 2808d3b
  • Firmware reader: 4e967e2 -> 68d25a8; final 68577ee2b1201e09a9f52519ab411e07eda1967c -> 5ea7fc8
  • Index recovery follow-up: 307ba95ad9632d009b45f57ae821c59a53cfe617 -> 74f72e1

Each source/local pair has the same stable patch ID.

Behavior

  • Opens bounded /library.jydm during SD/library initialization without making it a playback prerequisite.
  • Resolves by normalized path plus available fingerprint/source identity and rejects stale or ambiguous matches.
  • Publishes absent, valid, stale, corrupt, or unsupported, provenance/confidence, source rate/frame duration, BPM/key/rating, and cue/grid/downbeat/phrase capabilities and counts.
  • Failed deck loads retain the prior deck and metadata. A successful Library Feature/hardware test CircuitMess/JayD-Firmware#19 openChannel() enqueue is the logical swap point; hot-swaps replace both association and path together.
  • Verified SD/index identity changes invalidate loaded associations. Allocation failure during a gated reload preserves the last verified identity and attached deck metadata instead of publishing a transient zero identity.
  • Index verification/rebuild stays deferred while either deck is loading, playing, or recording; the existing explicit Verifying/manual-rebuild policy remains bounded.

Validation

  • python3 -m unittest -v tools/jayd-library/test_jayd_library.py: 13 passed
  • python3 tools/jayd-library/firmware_reader_self_check.py: passed, including malformed and fractional-duration boundary fixtures
  • CMake/CTest host self-checks: 3/3 passed
  • Clean Arduino firmware build pinned to JayD-Library Feature/hardware test CircuitMess/JayD-Firmware#19 4ad5108: passed
  • Firmware size: 1,791,510 bytes flash (49%), 47,192 bytes static RAM (14%)
  • Review-fix delta from ada6000: +76 bytes flash, +0 bytes static RAM
  • Delta from index-v2 base 5b36e506: +19,568 bytes flash, +40 bytes static RAM

djdefi and others added 10 commits August 21, 2026 21:52
Move mixer ownership and semantic control state out of MixScreen into a long-lived DjSession with a bounded command queue and cached snapshot.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Parse JAYDMETA/1 sidecars from SD with streaming CRC and record validation, expose concrete lookup records, and add converter-backed malformed fixture checks.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Keep empty-deck effect commands authoritative and defer Speed activation until a track is loaded.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Keep a successfully reloaded generation in verifying state after rebuild failure, and run the host regression checks through the existing CMake/CTest build.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Keep DjSession effect state authoritative for empty decks and defer Speed attachment until a channel is successfully loaded.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Compare fractional cue, loop, grid, and phrase times exactly on ESP32 without fixed-width multiplication overflow, and reject the same invalid timelines in the converter.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Bind bounded JAYDMETA sidecars to DjSession deck loads, publish compact metadata snapshots, invalidate associations with library generations, and gate index rebuild work on playback state.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Keep the last verified card/index identity when a gated reload cannot allocate its index, and only refresh or invalidate deck metadata after a verified identity or proven card change.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant