docs(embedded-mpv): document the Linux frame-copy port

- architecture doc: frame-copy section covers Linux (EGL display tiers,
  build deps, package strip), Linux support matrix notes the frame-copy
  exception to the X11 + system-mpv requirements, Linux measured baseline.
- RESULTS.md: Ubuntu 25.04 / i7-1165G7 (Iris Xe) measurement rows via the
  production helper + reader probe; viewport-size claim reproduced.
- PORTING.md: Linux marked done with pointers to what changed; Windows
  remains the open port and its perf gate the open decision.
- CLAUDE.md + tools/embedded-mpv/README.md: platform scope, Linux dev
  build requirements, system-headers fallback, helper strip.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
4grayandClaude Fable 5 authored and 4gray committed 2026-07-15 19:52:41 +02:00
1 parent 4316f4d95d
commit c17666ec49
5 files changed
+83 -22

No files matched your search

+11 -4
View File
@@ -13,9 +13,16 @@
restart → helper process renders mpv offscreen → shm ring → preload pump
→ WebGL canvas. Verified live with real IPTV + Stalker VOD.
- Scope decision: macOS = arm64 only (Intel Macs keep the native engine).
Windows/Linux are NOT ported yet — this branch on those OSes behaves
exactly like master (helper doesn't build there, engine can't activate,
env flag falls back to native).
- **UPDATE 2026-07-11: the Linux port below is DONE** (branch
`claude/linux-frame-copy-port-0a871b`, stacked PR on #1169) — headless
EGL helper, portable clock, reader on `__linux__`, TS gates, i18n,
measurements in RESULTS.md. Verified end-to-end in-app on Ubuntu 25.04
(Wayland session) with the xtream mock portal. Dev-build-only on Linux:
the helper links system libmpv and `electron-after-pack.cjs` strips it
from packages until milestone 3 (bundled runtime) — remove that strip
when milestone 3 lands. Windows is NOT ported yet — this branch on
Windows behaves exactly like master (helper doesn't build there, engine
can't activate, env flag falls back to native).
- Coordination: PR #1169 credits larsemig's idea (#1154 comment 4932807350)
and proposes the series merge plan: merge the shared-controls subset
(#1148/#1149/#1152–54) rebased, supersede immersive (#1150/#1151) with
@@ -61,7 +68,7 @@ create/open a Windows twin, flip the TS gates, extend packaging.
## Per-platform task lists
### Linux (do first — much closer to done)
### Linux (DONE 2026-07-11 — see the update in "State" above)
1. **Render backend**: headless EGL (`EGL_PLATFORM_SURFACELESS_MESA` /
`eglGetPlatformDisplay(EGL_PLATFORM_SURFACELESS_MESA)` with fallback to
+33
View File
@@ -107,6 +107,39 @@ would not have been representative. The macOS hardware gate is therefore
closed by the M1 Pro numbers above; the remaining risk hardware is
Windows/Linux.
## Linux mid-range laptop (iGPU) — Ubuntu 25.04, i7-1165G7 / Iris Xe, x64 — 2026-07-11
Source: Linux port branch (headless-EGL `frame_helper_gl.h` backend), system
libmpv 2.5.0 (mpv 0.40), Mesa 25.0 iris. Measured with the production helper
binary + `embedded_mpv_frame_reader.node` in a Node probe loop (the spike
viewer harness is macOS-only), so *age* here is produce→reader-copy and
excludes the renderer texture upload. hwdec was NOT active — this machine
has no VAAPI driver installed (`intel-media-va-driver`), so HEVC rows are
software decode; treat them as a decode-limited floor, not a pipeline
ceiling.
| Scenario | New fps | copy ms avg/p95 | age ms avg/p95 | torn |
| --- | --- | --- | --- | --- |
| 1080p60 testsrc2, sw | 60.1 | 1.16 / 1.37 | 2.26 / 3.21 | 0 |
| 4K60 testsrc2, sw | 50.0 | 5.75 / 6.92 | 7.22 / 8.00 | 0 |
| 4K60 HEVC 25 Mbit, sw decode | 39.9 | 7.62 / 14.6 | 9.06 / 17.0 | 0 |
| 4K60 HEVC 25 Mbit in a 1280×720 viewport | 53.1 | 0.94 / 2.57 | 2.42 / 5.28 | 0 |
Readings:
- 1080p60 — the realistic viewport class for this laptop's 1920×1200
screen — holds a clean 60 fps with ~1 ms copies.
- The 4K rows are stress rows: producers are limited by software
decode/source generation on 4 cores, not by the copy path (copy stays
well under one 60 Hz frame budget even at full 4K).
- The viewport-size claim reproduces on Linux: the same 4K60 HEVC clip in a
720p viewport drops the copy from 7.6 ms to 0.94 ms and lifts fps from
~40 to ~53 (remaining gap = software decode).
- torn=0 across every run; the aspect-fit generation bump was verified
separately (4:3 source in a 16:9 viewport → `-g2` at 960×720).
- EGL display tier used: Mesa surfaceless platform (first tier; no display
server needed).
## Windows mid-range laptop (iGPU) — PENDING
Blocked on the Windows helper port (WGL or D3D11 readback path).