Repository navigation
Description
The use case
I'm adding an optional determinate loading indicator to the host app's pre-playback screen: a progress bar with a percentage instead of the usual indeterminate spinner, so the user can tell a slow open apart from a stuck one.
I want the number to be honest, so it's driven purely by real startup checkpoints (completed steps over total steps), never elapsed time, byte counts, or an ETA. A slow stage holds, a skipped stage jumps. That part works and I'm happy with the semantics.
What's possible host-side today
The host can already derive a coarse ladder from existing publishes, and that's what I shipped:
- load dispatched
playbackPhaseleaves.idle- first non-empty
audioTracks(or a nonzeroduration) lands, meaning the probe finished isSessionReadyhasFirstFrameReadyForDisplay(nice addition in 6.13.0, this is its first use here)- first
.playing
Six edges, so the bar moves in roughly 20% steps. Livable, but the real problem is where the edges sit: on a slow origin almost the entire wait is inside the open/probe window, between steps 2 and 3, and the host has zero visibility into it. The bar sits at 20% for ten seconds and then sprints to 100%, which reads worse than it should given how much real work the engine is progressing through in that window.
The ask
A published, generation-scoped startup progress snapshot the host can observe. Shape I'd find useful:
- a semantic current stage plus completed/total checkpoint counts (or a normalized fraction derived from them)
- monotonic within one load generation; steady republishes deduped
- a new
load()starts a fresh generation at zero; publishes from a superseded generation are ignored - an engine-internal reroute (the remote-HLS bypass decision, a backend correction) stays inside the same user-visible startup and never lowers the value; it can update the stage label
- error/stop ends the sequence without ever publishing the final checkpoint
- checkpoints emitted from the code that actually completes the work, roughly: connection opened, probe finished, route chosen, backend host constructed, ready, first frame, playing
- paths that legitimately skip work (audio-only, the AVPlayer-direct bypass) complete the skipped checkpoints immediately rather than stalling
The biggest single win would be any sub-steps inside the open/probe window itself (connected vs first bytes vs probe complete, or however the internals naturally divide), since that's the stretch the host can't see at all and it's where slow sources spend their time.
Explicitly not asking for time estimates, byte-based percentages, or anything driven by timers. Checkpoints only, and no extra work on the startup path beyond publishing them.
If there's already a better seam for this than a new published property, happy to adapt to whatever fits the engine's conventions.
Activity
superuser404notfound commentedon Aug 13, 2026
Shipped in 6.23.0. Thanks for the writeup: the six-edge ladder and the measurement of where the wait actually sits made this straightforward to place, and the shape you asked for is close to what landed.
startupProgresspublishes aStartupProgress?carryingcompleted/total, a normalizedfraction, and astagenaming the work in flight:Three of those sit inside the open, which was the ask: the connection coming up and delivering its first bytes,
avformat_open_inputidentifying the container, and the stream-info pass after it. That is as fine-grained as it gets without reaching insideavformat_find_stream_info, which does not narrate itself. A fourth checkpoint covers the display-criteria handshake, which on a real SDR to HDR switch runs for seconds and was invisible from the outside for the same reason the open was.The ladder is one ordered axis rather than a set, so a path that legitimately skips work records the checkpoint it does reach and the ones behind it are credited by that alone. A local file has no connection to bring up, the remote-HLS bypass demuxes nothing and runs no panel handshake, an audio session has no picture. Nothing stalls waiting for a checkpoint its path never emits, and there is no per-path total to reconcile.
Three notes on where the implementation diverges from the request, all three worth knowing before wiring a bar to it:
The generation is not the engine's internal load counter. That one counts teardowns, and the engine's own reroutes (an HLS playlist discovered on the loopback path, a carriage case rerouted onto ingest) tear down and re-enter
load()underneath one uninterrupted wait. Scoping to it would have done exactly what you asked it not to.StartupProgress.generationcounts the waits a user sat through; the reroutes mark the continuation explicitly. Measured on a rerouted load, the ladder reads0,5,6,8with the generation unchanged.The last checkpoint is the first frame, not
.playing. On the native pathstatebecomes.playingbefore the item is ready, becauseautomaticallyWaitsToMinimizeStallinghandles play-before-ready, so a ladder ending at the first.playingreports 100% over a black screen. It also never completes on a paused mount. If your current ladder ends on.playing, that is worth checking against your own traces.readyis often overtaken on the native path. AVPlayer's layer holds a picture before the item publishesreadyToPlay, so the bar steps straight fromsessionConstructedtopresentingthere. It is kept because the software and audio paths pass it in order, and because on a start where the picture lags readiness it is the only movement in that stretch.Error and stop behave as requested: the sequence ends without the last checkpoint ever being published, and nothing fakes an ending. Steady republishes are deduped, so a sink fires once per real step.
Every checkpoint also emits a log line (
[AetherEngine] #361 startup 3/8 streamsProbed (gen 1)), which is the cheapest way to sanity-check what your own sources do before building UI on it.Verified with
aetherctl playacross the native, software, both audio and bypass paths, including against an origin throttled to 600 kbit/s with 400 ms of added latency, where the three open checkpoints land seconds apart. The full matrix is in the release notes. Leaving this open until you have had a chance to try it on your side.feat(engine): publish generation-scoped startup progress checkpoints (s…
fix(engine): record the session checkpoint where the host is built, n…
dlev02 commentedon Aug 13, 2026
Thank you for shipping this and for the detailed explanation. This looks like exactly the kind of signal I was hoping for, especially the checkpoints inside the open and probe window and the display-preparation step.
I will take a look at 6.23.0, wire it up on my side, and test it against some slow sources (will try to report back within the next week, want to ensure I have proper time to test though).
feat(native): a host can decline or observe the software-path rebuild…
fix(engine): a cancelled load leaves the session the way a newer load…
dlev02 commentedon Oct 20, 2026
Thanks for shipping this. The checkpoints are wired into my loading screen now and they work really well. Closing this.