From 1b8b6beca9a8b35a53bc39523f632fb33a35c46c Mon Sep 17 00:00:00 2001 From: astar76 Date: Thu, 12 Nov 2026 12:02:58 -0600 Subject: [PATCH] S026: plan ticks, PROGRESS, D-016, INDEX (code on branch s022-mse-proto) Co-Authored-By: Claude Opus 5.5 --- Plans/05 Engine/S026-gst-mse-fixes.md | 22 +++++++++++----------- Plans/INDEX.md | 2 +- docs/DECISIONS.md | 1 + docs/PROGRESS.md | 8 ++++++++ 4 files changed, 21 insertions(+), 12 deletions(-) diff --git a/Plans/05 Engine/S026-gst-mse-fixes.md b/Plans/05 Engine/S026-gst-mse-fixes.md index b4335d3..fe965c1 100644 --- a/Plans/05 Engine/S026-gst-mse-fixes.md +++ b/Plans/05 Engine/S026-gst-mse-fixes.md @@ -24,27 +24,27 @@ branch lands on main at the end of S028 (see S028), not here. all init segments), the MSE spec "init segment received" and HAVE_METADATA steps. ## Steps -- [ ] `git merge main` into `s022-mse-proto` (worktree), build, `tools/smoke.sh tests/smoke/mse.txt` still green -- [ ] Vendor the gst_mse library + mse plugin sources (1.28.9, LGPL-2.1, keep headers and COPYING) into +- [x] `git merge main` into `s022-mse-proto` (worktree), build, `tools/smoke.sh tests/smoke/mse.txt` still green +- [x] Vendor the gst_mse library + mse plugin sources (1.28.9, LGPL-2.1, keep headers and COPYING) into `vendor/gst-mse/` with a small meson (or cc) build; `tools/gst-mse.sh` builds `libgstmse-1.0.so.0` and the plugin into `target/gst-mse/`. Mark every change "Nacre patch". -- [ ] Load our copy: the library ahead of the system one (rpath or `LD_LIBRARY_PATH` set before GStreamer +- [x] Load our copy: the library ahead of the system one (rpath or `LD_LIBRARY_PATH` set before GStreamer init — check which works with gstreamer-mse-sys) and the plugin via `GST_PLUGIN_PATH`/registry; log the loaded path once. Decide and record how release builds find it. -- [ ] Bug 1: signal update/update-end only after the end-of-append for that append has been consumed +- [x] Bug 1: signal update/update-end only after the end-of-append for that append has been consumed (`consume_all_samples` done); C test: buffered is non-empty at the first update-end after a media segment -- [ ] Bug 2: no update/update-end without an outstanding append/removal; C test: no signals while idle for 3 s -- [ ] Bug 3: msesrc exposes no streams (and stays HAVE_NOTHING) until every SourceBuffer of the attached +- [x] Bug 2: no update/update-end without an outstanding append/removal; C test: no signals while idle for 3 s +- [x] Bug 3: msesrc exposes no streams (and stays HAVE_NOTHING) until every SourceBuffer of the attached MediaSource has received its first init segment; C test with two SourceBuffers (audio fMP4 + video WebM), video init appended 2 s before audio, then both play -- [ ] Remove the settle work-around (`SETTLE`, `pending`) from `vendor/servo-media-gstreamer/mse.rs`; rebuild; +- [x] Remove the settle work-around (`SETTLE`, `pending`) from `vendor/servo-media-gstreamer/mse.rs`; rebuild; `tests/smoke/mse.txt` green -- [ ] Add a two-SourceBuffer case to `tests/smoke/pages/mse-basic.html` (`?split`: audio-only + video-only clips, +- [x] Add a two-SourceBuffer case to `tests/smoke/pages/mse-basic.html` (`?split`: audio-only + video-only clips, video appended first); smoke asserts it plays -- [ ] YouTube probe (heavy-web.txt watch-page steps): record codecs, readyState, currentTime, picture in the shot -- [ ] Write the patches up for upstream (`docs/engine/gst-mse-patches.md`: what, why, test), no MR opened +- [x] YouTube probe (heavy-web.txt watch-page steps): record codecs, readyState, currentTime, picture in the shot +- [x] Write the patches up for upstream (`docs/engine/gst-mse-patches.md`: what, why, test), no MR opened without the user's OK -- [ ] PROGRESS entry, DECISIONS if the loading scheme binds S030, INDEX line, commit `S026: …` on the branch, push the branch +- [x] PROGRESS entry, DECISIONS if the loading scheme binds S030, INDEX line, commit `S026: …` on the branch, push the branch ## End criteria - `tools/gst-mse.sh` builds; the C tests for bugs 1–3 pass (command in the plan's PROGRESS entry). diff --git a/Plans/INDEX.md b/Plans/INDEX.md index ec2cb96..f7895b6 100644 --- a/Plans/INDEX.md +++ b/Plans/INDEX.md @@ -35,7 +35,7 @@ Tracker: https://claude.ai/artifact/9AD7fPfwJ4ASFzVTJGKU4h ## 05 Engine - [x] [S022 — MediaSource (MSE) spike](05%20Engine/S022-mse-spike.md) · Opus high · 🧑 -- [ ] [S026 — Fix gst_mse for split audio/video MSE](05%20Engine/S026-gst-mse-fixes.md) · Opus high +- [x] [S026 — Fix gst_mse for split audio/video MSE](05%20Engine/S026-gst-mse-fixes.md) · Opus high - [ ] [S027 — MSE DOM to spec](05%20Engine/S027-mse-dom-spec.md) · Opus high - [ ] [S028 — MSE player integration and merge to main](05%20Engine/S028-mse-player.md) · Opus high - [ ] [S029 — YouTube and Reddit video pass](05%20Engine/S029-youtube-reddit-pass.md) · Opus high · 🧑 diff --git a/docs/DECISIONS.md b/docs/DECISIONS.md index 1c6fcf3..ac8bc73 100644 --- a/docs/DECISIONS.md +++ b/docs/DECISIONS.md @@ -18,3 +18,4 @@ - D-013 — 2026-11-12 — New plans: S022 MSE spike (05 Engine) runs right after S006; privacy plans S023 (request headers + third-party cookies in the vendored servo-net), S024 (privacy mode, R1-16), S025 (encrypted cookies, R1-19) run after S009, before the S010 review. — The user wants real YouTube playback in the page (no yt-dlp workaround) and asked whether missing Servo features can be added from reference engines; the spike sizes MSE before committing weeks to it. — S006–S025 run order - D-014 — 2026-11-12 — Two more Nacre patches in the vendored servo-net (D-012), marked "Nacre patch": `fetch/methods.rs` lets the certificate warning's `chrome:allowcert` request through (it ended as UnsupportedScheme, so "Open anyway" never worked); `http_cache.rs` `flush_to_disk` + `resource_thread.rs` Exit write the memory HTTP cache to the disk cache at quit (Servo only wrote evicted entries, so a session's cache was lost). — Both are Servo 0.7 bugs the embedder can't work around. — any plan that upgrades Servo: re-check both, re-run `tests/smoke/net-privacy.txt` and `cache.txt` + `cache-restart.txt` - D-015 — 2026-11-12 — MSE: go, option A (S022). Keep GStreamer's gst_mse library for parsing and coded frame processing; Nacre fixes its three 1.28.9 defects (early update-end, idle ticks, split A/V init segments) in its own copy of the library and plugin, plus a thin MSE DOM in the vendored `servo-script`/`servo-script-bindings`/`servo-media*` crates (`[patch.crates-io]`, like D-012). Option B (an own MSE core in Rust feeding appsrc) is the fallback only if bug 3 can't be fixed in msesrc. Plans S026–S030 run after S009 and before S023–S025. The prototype branch `s022-mse-proto` carries S026–S027 and merges into main in S028. — Decided by the orchestrator overnight on the user's standing OK; the user wants engine fixes, not workarounds (no yt-dlp). The spike showed gst_mse does the hard parts, and the blockers are concrete (docs/engine/mse-spike.md). — S026–S030, any Servo upgrade (drop the patches when Servo ships MSE) +- D-016 — 2026-11-12 — Patched gst_mse loading (S026). Nacre ships its own `libgstmse-1.0.so.0` and `mse` plugin built from `vendor/gst-mse` (`tools/gst-mse.sh`). Release layout: library in `/lib/`, plugin in `/lib/gstreamer-1.0/`; a dev build uses `target/gst-mse/{lib,gstreamer-1.0}`. The binary's RUNPATH (`$ORIGIN/lib:$ORIGIN/../gst-mse/lib`, from `build.rs`) finds the library ahead of the system copy (same soname), and `main.rs` prepends the plugin dir to `GST_PLUGIN_PATH` before GStreamer starts (paths in GST_PLUGIN_PATH beat the system plugin of the same name). Windows: the DLLs sit next to `nacre.exe` / in `lib\gstreamer-1.0` (unverified). — RUNPATH needs no wrapper script or re-exec; LD_LIBRARY_PATH would have to be set before the process starts. — S030 packaging (AppImage, tarball, Windows), S028 merge diff --git a/docs/PROGRESS.md b/docs/PROGRESS.md index 182c3b5..ab2681c 100644 --- a/docs/PROGRESS.md +++ b/docs/PROGRESS.md @@ -273,6 +273,14 @@ One entry per session, newest last, ≤ 15 lines: done, verified how, not done, - Not done: per-site privacy-mode flag (privacy mode is global, S024); importer for the old Python Nacre's JSON stores (none exists); native file dialogs behind Import/Export; addresses, cards, generator, auto-lock timer; notification display; user-script disable/edit/exclude. - Later: tab titles of nacre:// pages show a generic icon; selftest `set` with a bad value only logs (does not fail the run). +## S026 — gst_mse fixes for split audio/video MSE (2026-11-12, branch s022-mse-proto) +- Our gst_mse 1.28.9 copy in `vendor/gst-mse/` (LGPL, `nacre.patch`, write-up `docs/engine/gst-mse-patches.md`); `tools/gst-mse.sh` builds it into `target/gst-mse/`. Nacre finds the library by RUNPATH (`build.rs`) and the plugin by GST_PLUGIN_PATH (`src/main.rs`), and logs both paths (D-016). +- Fixed: update-end before parsing (append now waits for its end-of-append), idle update/update-end ticks, streams exposed before every SourceBuffer's init segment (plus a leaked `media_source_lock`), msesrc pad task giving up on a not-yet-active peer (split A/V hung ~1 in 4). Settle work-around gone from `mse.rs`; `remove()` reports its own updateend (gst_mse's remove is a stub). Opus counts as supported with a decoder only (Arch has no opusparse). +- Tests: `tools/gst-mse.sh test` (3 C tests, each fails on the system 1.28.9); `tools/smoke.sh tests/smoke/mse.txt` green incl. `?split` (video WebM first, audio fMP4 2 s later, picture shown). +- YouTube (`tests/smoke/youtube-mse.txt`, internet): plays with picture and captions. Run 1 VP9 144p + Opus, time 8 → 10.7 s between 15 and 30 s (stalls); run 2 VP9 240p + Opus, played to the end ("Up next"); the js probe after the end never returned. +- Not done: YouTube stalls and the hung js probe not investigated (S027/S028); the pad-task race only shows in the C test under CPU load. +- Later (S027/S028): coded frame removal in gst_mse (`remove` is a stub); `HTMLMediaElement.buffered` from the MediaSource; script thread blocking (S022 note) seen again after the video ended. + ## Later - Turnstile widget paints as a black half-disc (Servo painting of its iframe/shadow DOM, S006 site doctor). - Google sign-in past the email step: press Next with a real account, by the user (S006).