Skip to content
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
1 change: 1 addition & 0 deletions .github/workflows/android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ jobs:
- uses: actions/checkout@v4
with:
fetch-depth: 0
filter: blob:none # Keep release history/tags; fetch current files on checkout.
submodules: recursive # projectM is built from source (third_party/projectm)

- name: Determine version
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/preset-lab.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,15 @@ jobs:
run: python -m pip install --no-deps -e tools/preset-lab
- name: Test measurements, cache reuse and bundle integrity
run: python -m pytest tools/preset-lab/tests -m 'not native' -q
- name: Verify source-bound predictive collections beta
run: python tools/milk-analyzer/beta_export.py --check --bundle core/src/main/assets/preset-genres
- name: Reject tracked user audio and raw captures
run: |
python - <<'PY'
import subprocess
from pathlib import Path
forbidden = {'.m4a', '.webm', '.wav', '.mp3', '.flac', '.ogg', '.opus', '.aac', '.f32', '.rgb', '.mp4'}
files = subprocess.check_output(['git', 'ls-files', '-z', 'tools/preset-lab', 'core/src/main/assets/preset-genres']).decode().split('\0')
files = subprocess.check_output(['git', 'ls-files', '-z', 'tools/preset-lab', 'tools/milk-analyzer', 'core/src/main/assets/preset-genres']).decode().split('\0')
invalid = [name for name in files if name and Path(name).suffix.lower() in forbidden]
if invalid:
raise SystemExit('User audio/raw captures must remain untracked: ' + ', '.join(invalid))
Expand Down
23 changes: 18 additions & 5 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

## Pull requests and release notes

Each successfully tested merge to `main` publishes a versioned APK and capped/Native core AARs, then updates Milkbeat through the capped compatibility alias. Use a feature branch and PR for changes.
Each successfully tested merge to `main` publishes a versioned APK and capped/Native core AARs, then updates Milkbeat through the capped compatibility alias. Use a feature branch and PR for changes. Android APK CI retains full Git history and
tags with `filter: blob:none`; current source and historical version metadata are
fetched on demand rather than downloading every historical evidence blob.

- Include a substantive `## Release notes` section in every PR body. Follow `.github/pull_request_template.md`.
- Write for people using the app: describe the changed behavior, its effect, and relevant limits. Include a concrete trigger or before/after example when useful.
Expand Down Expand Up @@ -44,7 +46,13 @@ ProjectM TV is a music visualizer for Android TV. It renders [projectM](https://
- **Core rendering policy:** `-PprojectmCoreRenderingPolicy=capped|native`, default `native` for normal APK/Gradle tasks. Both local policy builds write `core/build/outputs/aar/core-release.aar`; stage/copy each result separately. Published canonical `projectM-TV-core[-<version>].aar` is capped (1330 maximum enforced in JNI, upscaled presentation, no Native/diffusion); explicit `projectM-TV-core-native[-<version>].aar` is Native-capable (Auto/numeric still capped 1330, eligible diffusion). Keep Milkbeat on the canonical capped alias. See `docs/RELEASING.md`. Policy-specific build/test outcomes must be recorded for the current revision; earlier 0e3 measurements precede this policy boundary.

The focused `tools/milk-analyzer` subset imports PR #25's selector-domain proof and
models the native implicit-global policy. Build its source adapters against a hash-
models the native implicit-global policy. It also includes the separate beta activity
scorer using the published standard core AAR through JNI, and a source-bound collection
exporter/verifier. Its direct-delta beta model is fitted on eight historical user
judgments transferred onto native features; archived producer and derived-scoring
identities are kept separate. Optional offline refitting uses
`tools/milk-analyzer/requirements-calibration.txt`. These execution-based predictions are not independent source-only
visual forecasts. Build its source adapters against a hash-
identified host engine before `python -m pytest tools/milk-analyzer -q`; Preset Lab CI
performs this setup. Its results are source diagnostics, not visual certification.

Expand All @@ -54,7 +62,8 @@ performs this setup. Its results are source diagnostics, not visual certificatio
- Architecture: [docs/ARCHITECTURE.md](docs/ARCHITECTURE.md) §5 (threading rules, transitions, resolution, frame pacing, threads, overlay UI, device tiers). Its title says v1.9 and §1–4 and §6–8 are historical analysis; verify against the code. Design specs, plans and evidence for engine work are in `docs/superpowers/{specs,plans,evidence}`.
- projectM sources: `third_party/projectm` shows patched code only after a CMake configure or a manual apply; the committed source of truth is `tools/projectm-patches/`. Search both the submodule and the patches.
- Logs for tracing behavior: native tag `projectM-Native` (`LOAD`, `PREWARM`, `TRANSITION`, `OUTPUT` lines per switch); `VisualizerRenderer` logs `STATS fps=… surface=… audio=…` every 5 s.
- Committed generated data indexes (not code indexes): `core/src/main/assets/presets.idx` (regenerate with `tools/gen-preset-index.py` whenever presets or textures change; CI enforces `--check`) and the genre bundle in `core/src/main/assets/preset-genres/` (produced by Preset Lab, imported with `tools/import-preset-genres.py`).
- Committed generated data indexes (not code indexes): `core/src/main/assets/presets.idx` (regenerate with `tools/gen-preset-index.py` whenever presets or textures change; CI enforces `--check`) and the collection bundle in `core/src/main/assets/preset-genres/` (current beta schema2 produced/verified with `tools/milk-analyzer/beta_export.py`;
legacy schema1 Preset Lab imports are historical).

## Design and user experience

Expand Down Expand Up @@ -161,7 +170,7 @@ Preserve the release/version rules above. Treat the core AAR’s interface and c
- **Preset equation loading (patches 0029, 0033–0035):** code the evaluator rejects is compiled once more in MilkDrop's form (numbered records joined, `//`/`\\` comments removed, NS-EEL's stray `;` in parentheses read as a space); a lone `.` is the number 0; a block that still does not compile is left out like MilkDrop's `CState::RecompileExpressions` (q/t variables zero after a failed init) and reported through `projectm_set_preset_initialization_warning_event_callback`, which `native-lib.cpp` logs as `Preset code left out (<preset>): <reason> (line N, column M)`. Only parse errors fail a load. Keep accepted programs on the unchanged path.
- **Random textures (0037):** image selection belongs to slots 00–15 in a preset and is reused across warp/composite and shader reloads. Rebuild the descriptor for each exact alias and requested mode. Within a shader, filtered `randNN_prefix` aliases choose an empty slot before unfiltered aliases; competing prefixes keep lexical precedence. Across stages, the already selected slot wins. `sampler_state` fields remain ignored (0032); name prefixes select mode. Default user-texture mode is linear/wrap. Bind emitted short aliases to the same unit as their full alias and deduplicate declaration lines. Preserve `Texture::SourcePath()` and base names for diagnostics; generated textures have no source path. Production uses `std::random_device` for each new texture choice; a host seed does not establish Android/AAR association.
- **Blur framebuffer ownership (0041):** capture both caller read/draw framebuffer bindings before allocating or resizing blur textures. `Framebuffer::SetSize` unbinds both targets; saving after allocation sends later shapes/waves/borders to framebuffer zero when warp shaders sample blur. The native runner checks first use, unchanged size, resize, scaled blur, constant-color output and the unchanged midgit preset with isolated TGA assets. The same ownership control is verified on AM6/Mali-G52; Android framebuffer zero can be valid and hide the host error, so assert binding identity as well as checking GL errors (evidence: `docs/superpowers/evidence/midgit-framebuffer/`).
- **Patch identity in the Dance bundle:** `tools/import-preset-genres.py` refuses a bundle whose `app_patches_sha256` differs from the current patch series. Changing the series means a re-measured bundle is needed before the next import.
- **Predictive collection identity:** `tools/milk-analyzer/beta_export.py --check --bundle core/src/main/assets/preset-genres` validates the beta schema2 source/texture/weight inventory, frozen scoring code/model, standard published-AAR identity, raw activity formula, relative ranks and exact overlapping group membership. The numerical profile is capped2.3.3 at128×72, not a certificate of Native/TV fidelity. A changed renderer needs a separately identified run; historical schema1 Preset Lab imports do not produce the current bundle.
- **Presets and textures:** CI rejects presets that cannot react to audio or use excluded or missing textures (`tools/check-presets.py`) and a stale `presets.idx` (`tools/gen-preset-index.py --check`). Preset Lab CI rejects tracked audio/raw capture files under `tools/preset-lab` and `core/src/main/assets/preset-genres`.
- **Licensing and attribution:** app code LGPL-2.1 (`LICENSE`); presets and textures CC0 1.0 (`LICENSES/CC0-1.0.txt`). Record new third-party content and new patches in [docs/THIRD_PARTY.md](docs/THIRD_PARTY.md); keep upstream attribution in patch headers and release notes.
- **Privacy claims:** README states no network access except opt-in auto-update to GitHub, and in-memory audio analysis only. New network use or data storage contradicts published documentation and must update it.
Expand Down Expand Up @@ -250,7 +259,11 @@ A successful tested merge to `main` triggers the versioned APK/dual-policy core
| `.github/pull_request_template.md` | Required PR sections and checklists |
| `RELEASE_NOTES.md`, `fastlane/metadata/android/en-US/` | Historical release notes; F-Droid store listing and changelogs |

Known documentation drift (2026-10-04, not yet fixed): README says it describes the app "as of version 2.1.5" while releases reach v2.2.6; `docs/ARCHITECTURE.md` §5 describes embedding `core/` as a Gradle module, while `docs/RELEASING.md` describes Milkbeat consuming the released AAR; the committed Dance bundle's `app_patches_sha256` does not match the current patch series (computed with Preset Lab's digest function, not by running the import check).
Known documentation drift: `docs/ARCHITECTURE.md` §5 still describes embedding
`core/` as a Gradle module, while `docs/RELEASING.md` describes Milkbeat consuming
released AARs. Historical Dance research is retained; current collection behaviour
is documented in `docs/user-guide/predictive-collections.md`. The beta exporter
and numerical scoring commands are documented in `tools/milk-analyzer/README.md`.

## Mandatory workflow — scope and completion

Expand Down
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ ProjectM TV is a music visualizer for Android TV. It runs [projectM](https://git

## User guide

The [ProjectM TV user guide](https://johnneerdael.github.io/ProjectM-TV/) covers installation, remote controls, settings and troubleshooting. The technical section explains [how the Dance collection is measured](https://johnneerdael.github.io/ProjectM-TV/dance-measurement/).
The [ProjectM TV user guide](https://johnneerdael.github.io/ProjectM-TV/) covers installation, remote controls, settings and troubleshooting. The technical section explains [how the predictive collections work](https://johnneerdael.github.io/ProjectM-TV/predictive-collections/).

## Highlights

- **9,606 curated MilkDrop presets** with smooth blends between them
- **Dance collection:** 500 presets selected automatically for large bass-driven changes on screen. **All** remains the default, keeping the full library available.
- **Predictive preset engine (beta):** choose **Chill**, **Normal** or **Intense** by predicted visual activity. **All** remains the default and keeps the full library available.
- **Corrected shader maths** restores colours and detail in presets affected by projectM translator bugs; [proof and upstream contribution](https://github.com/projectM-visualizer/projectm/pull/1031)
- **More presets run their own shaders:** 102 bundled presets that fell back to the default shader because of translator errors (flat array initializers, `sampler_state` blocks) now run as written, and shaders that change `q` variables or `time` start from their real values instead of undefined ones
- **Additional shader compatibility fixes:** presets using a local named `sample`, declaration or statement macros, or swizzles after parenthesized constructors can use their authored shaders. GPU driver acceptance and visual fidelity remain device-dependent.
Expand All @@ -45,7 +45,7 @@ The [ProjectM TV user guide](https://johnneerdael.github.io/ProjectM-TV/) covers

- **Visualizes music from another app.** Play music in a music app, then start ProjectM TV. The visuals usually react to the music within a second or two of launch, and within a few seconds after you pause and resume. The app only looks for the music while Android reports that music is playing.
- **Shows 9,606 presets in shuffled order, with smooth blends.** Every 30 seconds by default it blends the old preset into the new one over 7 seconds. The next preset's shaders are compiled in the background beforehand, so the switch does not freeze the picture, and the blend adapts its resolution to keep the frame rate up. Left and Right on the remote cut straight to a random or the previous preset.
- **Offers a Dance collection.** Open the settings panel and set *Music category* to *Dance* for 500 presets ranked by measured bass-caused visual change. Automatic changes, Random and Previous stay within the selected collection, subject to the existing skip rules. The choice is saved. *All* is the default and uses the full library. [How the Dance collection was measured](https://johnneerdael.github.io/ProjectM-TV/dance-measurement/).
- **Offers Chill, Normal and Intense collections.** Open the settings panel and set *Preset mood*. The beta predictor ranks activity from 1 to 100: Chill 1–30, Normal 25–75 and Intense 70–100. The ranges overlap. Automatic changes, Random and Previous stay within your saved collection, subject to existing skip rules. *All* remains the default. Saved Dance selections return to All. [How the predictive collections work](https://johnneerdael.github.io/ProjectM-TV/predictive-collections/).
- **Shows the track that is playing.** The cover, artist and title of the playing track appear in the upper left for as long as it plays (taken from the music app's media session); *Settings › Track display* shows them for 10–60 s per track instead, in the small lower-left pill, or not at all. Covers have only been verified with Spotify and [Milkbeat](https://github.com/johnneerdael/Milkbeat). SoundCloud and SmartTube have been verified to show the artist and title only, without a cover. No other music apps have been verified. This needs *notification access*, see [Track titles](#track-titles) below; without it, nothing is shown. The preset name is in the settings panel.
- **Replaces presets that stay black.** If a preset shows only black for about 7 seconds while music plays, the app moves on. A preset that is black a second time is skipped from then on. Since 1.9.5, the presets that used to be black render; this rule remains as a safety net (details under *Presets* below).
- **Adapts the resolution.** *Auto* remains the default and lowers or raises the render resolution to hold the frame rate, up to 1330p and within the panel and memory limits. The TV's scaler upscales to the panel. An explicit *Native* choice uses the detected panel height when the memory limit permits it; it does not adapt to a slow preset and may change its appearance.
Expand Down Expand Up @@ -76,12 +76,12 @@ The main panel shows the current preset and a live audio level (*Listening*, *Ve
<img src="docs/user-guide/images/setup/advanced-settings.png" alt="The advanced settings panel with diagnostics" width="32%">
</p>

These settings captures use an isolated test installation on an Ugoos AM6. The [setup walkthrough](https://johnneerdael.github.io/ProjectM-TV/getting-started/) shows audio permission and notification access step by step.
These settings captures use an earlier isolated test installation on an Ugoos AM6; the current collection row is named Preset mood. The [setup walkthrough](https://johnneerdael.github.io/ProjectM-TV/getting-started/) shows audio permission and notification access step by step.

| Setting | Values | Default |
|---|---|---|
| Auto change | Off, On | On |
| Music category | All, Dance | All |
| Preset mood | All, Chill, Normal, Intense | All |
| Preset duration | 10, 15, 20, 30, 45, 60, 90 s | 30 s |
| Resolution | Auto or numeric fixed heights up to 1330p, within the panel and memory limits; Native uses the detected panel height when it is above 1330p and memory permits | Auto |

Expand Down Expand Up @@ -129,8 +129,8 @@ These settings captures use an isolated test installation on an Ugoos AM6. The [

**Presets**
- 189 of the 9,795 *Cream of the Crop* presets are not included: 116 that cannot react to music, 73 that use images with text, logos or people (one preset is in both groups), and 1 whose texture could not be found.
- You can select the prebuilt Dance collection, but cannot search for an individual preset or build custom playlists. Presets play in shuffled order within the selected category.
- Dance ranks screen response under controlled bass tests; it is not a guarantee of the same response for every song, resolution or GPU. Some presets respond through color or brightness changes, others through geometry or feedback. Device-specific skips can reduce the number available on a TV. The [technical guide](https://johnneerdael.github.io/ProjectM-TV/dance-measurement/) documents the signals, measurements and limits.
- You can select All, Chill, Normal or Intense, but cannot search for an individual preset or build custom playlists. Presets play in shuffled order within the selected collection.
- The predictive engine is **beta**. Scores order activity within this library under a short shared quiet/melodic/kick probe using the published core AAR. They are not accuracy percentages or guarantees of calmness. Different songs, random inputs, render sizes and GPUs can change behaviour. Effects with no visible activity in the probe remain in All and are excluded from the curated groups. Device-specific skips can reduce the available counts. The [technical guide](https://johnneerdael.github.io/ProjectM-TV/predictive-collections/) records the protocol and limits.
- The black-preset check has limits. It judges each preset only in the first 20 seconds or so after it starts, and only after 3 seconds of uninterrupted music. "Black" means every sampled pixel is at or below about 8% brightness, so a very dark preset can count as black. After 3 black presets in a row it stops acting until a preset shows something, in case the fault is the renderer rather than the presets.
- Random-image samplers keep their selected image when a preset uses it in both rendering stages, including aliases requesting different filtering or edge wrapping. Short aliases use the same image as their full filename-filtered form. The image is chosen anew for each preset load, so revisiting a preset can look different.
- Versions before 1.9.5 marked some presets as black that now render. If you used an earlier version, reset the skip list: *Settings › Advanced › Skipped presets*.
Expand Down
Loading
Loading