You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Fast live-join option for realtime raw-TS sources (IPTV zapping) #195
Raw MPEG-TS live over HTTP (Xtream-style IPTV, isLive: true) takes 10–18 s to first frame on the native path. With targetSegmentDuration = 4.0, the first manifest is gated on 3×TD of content (HOLD-BACK 18 s via LiveEdgePolicy.startupCushionSatisfied), and a strict-realtime origin fills that buffer in wall-clock time. When the origin happens to serve a burst backlog, the join drops to ~4.5 s, which shows the gate itself is the bottleneck, not the source or the demuxer (first data arrives in ~250 ms).
For live TV zapping this is prohibitive next to FFmpeg-renderer players (~1–2 s to first frame). Sessions that dispatch to the software path (e.g. interlaced H.264) join nearly instantly, so the gap is native-path-specific.
Would you consider a LoadOptions knob for low-latency live join — e.g. liveJoinProfile: .fastZap — that:
cuts shorter live segments (~2 s), and
serves the first manifest at minStartupSegments with a reduced HOLD-BACK, accepting a slightly higher early-rebuffer risk as an explicit host opt-in?
Channel zapping UX prefers "picture fast, small chance of one early rebuffer" over "guaranteed-safe join after 10+ seconds of black".
Happy to test against real Xtream sources (progressive 1080p50 H.264, ~6 Mbps, strict-realtime origins as well as bursty ones).
Motivating media or use case
A LoadOptions knob for low-latency live join - e.g. liveJoinProfile: .fastZap - that:
cuts shorter live segments (~2 s), and
serves the first manifest at minStartupSegments with a reduced HOLD-BACK,
accepting a slightly higher early-rebuffer risk as an explicit host opt-in.
Channel zapping UX prefers "picture fast, small chance of one early rebuffer"
over "guaranteed-safe join after 10+ seconds of black". Happy to test against
real Xtream sources (both strict-realtime and bursty origins).
Implemented on #197: LoadOptions.liveJoinProfile = .fastZap.
Your diagnosis was exactly right, and the burst-backlog observation (~4.5 s join) is the proof: a backlog fills the startup cushion at I/O speed, so the gate itself is what a strict-realtime origin pays for in wall-clock time. One correction to the proposed shape, though: serving the first manifest with a reduced HOLD-BACK is not on the table. HOLD-BACK has a hard spec floor of 3 x TARGETDURATION (RFC 8216bis 4.4.3.8), and AVPlayer enforces that distance from the live edge regardless of what the playlist claims. Undercutting it is precisely the -16832 restart loop the gate was introduced to fix in #189.
So the profile shrinks TARGETDURATION itself instead of the holdback:
.fastZap cuts live segments at every keyframe past 0.5 s (instead of the standard ~4 s), so segments quantize to your source's keyframe cadence.
TARGETDURATION then collapses to ceil(max EXTINF), i.e. the real GOP length, and the holdback the first manifest is gated on (still 3 x TD, still spec-clean) shrinks proportionally.
Measured against a strict-realtime origin fixture shaped like your channels (progressive 1080p50 H.264, GOP = 1 s, ~6 Mbps TS, zero backlog): readyToPlay at +2.0 s with .fastZap vs +20.0 s with .standard, stable playback afterwards, no -16832 / -12888. Join speed tracks the origin's keyframe interval: a 2 s GOP lands at TD=2 and a 6 s holdback, a 1 s GOP at TD=1 and 3 s.
The trade-off you offered to accept is real and documented on the option: a smaller TARGETDURATION also tightens AVPlayer's unchanged-playlist patience and live-edge buffer, so an origin that stalls or bursts mid-stream will rebuffer or error more readily than under .standard. Opt in for zapping, keep .standard for lean-back viewing.
You can A/B it locally with the repro harness on the branch:
swift run aetherctl live --realtime --preroll 0 --seed <your-capture.ts> # .standard
swift run aetherctl live --realtime --preroll 0 --fast-zap --seed <your-capture.ts> # .fastZap
--preroll 0 models a strict-realtime origin with no backlog burst; the log prints timestamped readyToPlay plus a JOIN metric. Testing against your real Xtream origins (both the strict-realtime and the bursty ones) before we cut a release would be very welcome.
Join latency: timeControlStatus=playing at t+1.1–1.2 s consistently across
multiple native-path channels (progressive 1080p50 H.264 with AC-3 and AAC
audio, and one 1080p50 HEVC/HLG channel). The origins deliver 1 s GOPs, so
segments cut at ~0.9–1.36 s, TARGETDURATION:2, HOLD-BACK=6.000 — exactly
the keyframe-cadence collapse described. Under .standard these same
channels joined in 11–20 s.
Stability after join: continuous playback with zero stalls/drops (LagDiag:
drop=0+0 stall=0, forward buffer steady at ~4–5 s), across repeated zaps
between native-path and software-path channels. Blocking reloads (_HLS_msn)
behave; teardown mid-blocking-reload returns the expected 503 and shuts
down cleanly.
HLG note: the HEVC channel came up as hvc1.2.4.L150 with videoRange=hlg and
correct ITU_R_2100_HLG transfer on the AVPlayer item, and the open-GOP RASL
leading frames were dropped correctly at the join seam.
No regressions observed on software-path (interlaced) sessions. From my
side this is ready to release. Thanks for the fast turnaround — the
keyframe-cadence approach is clearly the right shape for this.
Op wo 22 jul 2026 om 18:07 schreef superuser404notfound <
***@***.***>:
*superuser404notfound* left a comment
(superuser404notfound/AetherEngine#195)
<#195 (comment)>
Implemented on #197
<#197>: LoadOptions.liveJoinProfile
= .fastZap.
Your diagnosis was exactly right, and the burst-backlog observation (~4.5
s join) is the proof: a backlog fills the startup cushion at I/O speed, so
the gate itself is what a strict-realtime origin pays for in wall-clock
time. One correction to the proposed shape, though: serving the first
manifest with a reduced HOLD-BACK is not on the table. HOLD-BACK has a
hard spec floor of 3 x TARGETDURATION (RFC 8216bis 4.4.3.8), and AVPlayer
enforces that distance from the live edge regardless of what the playlist
claims. Undercutting it is precisely the -16832 restart loop the gate was
introduced to fix in #189
<#189>.
So the profile shrinks TARGETDURATION itself instead of the holdback:
- .fastZap cuts live segments at every keyframe past 0.5 s (instead of
the standard ~4 s), so segments quantize to your source's keyframe cadence.
- TARGETDURATION then collapses to ceil(max EXTINF), i.e. the real GOP
length, and the holdback the first manifest is gated on (still 3 x TD,
still spec-clean) shrinks proportionally.
- Long-GOP channels cannot be cut shorter than their GOP, so they
degrade to .standard behavior automatically; bursty ingest origins
keep the observed-cadence TD floor from #167
<#167>.
Measured against a strict-realtime origin fixture shaped like your
channels (progressive 1080p50 H.264, GOP = 1 s, ~6 Mbps TS, zero backlog):
readyToPlay at *+2.0 s* with .fastZap vs *+20.0 s* with .standard, stable
playback afterwards, no -16832 / -12888. Join speed tracks the origin's
keyframe interval: a 2 s GOP lands at TD=2 and a 6 s holdback, a 1 s GOP at
TD=1 and 3 s.
The trade-off you offered to accept is real and documented on the option:
a smaller TARGETDURATION also tightens AVPlayer's unchanged-playlist
patience and live-edge buffer, so an origin that stalls or bursts
mid-stream will rebuffer or error more readily than under .standard. Opt
in for zapping, keep .standard for lean-back viewing.
You can A/B it locally with the repro harness on the branch:
swift run aetherctl live --realtime --preroll 0 --seed <your-capture.ts> # .standard
swift run aetherctl live --realtime --preroll 0 --fast-zap --seed <your-capture.ts> # .fastZap
--preroll 0 models a strict-realtime origin with no backlog burst; the
log prints timestamped readyToPlay plus a JOIN metric. Testing against
your real Xtream origins (both the strict-realtime and the bursty ones)
before we cut a release would be very welcome.
—
Reply to this email directly, view it on GitHub
<#195?email_source=notifications&email_token=AXPN5KGDFYD5EXXCTPGDUQT5GDRE5A5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTKMBUHA2TEMRUGI4KM4TFMFZW63VGMF2XI2DPOKSWK5TFNZ2KYZTPN52GK4S7MNWGSY3L#issuecomment-5048522428>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AXPN5KEO4YHEHJ4XGNRLLCT5GDRE5AVCNFSNUABGKJSXA33TNF2G64TZHMYTEMBYGI4DGOBYG45US43TOVSTWNBZGQ4TKOBYG44DFILWAI>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
Released in 5.19.0 (the release is content-identical to the branch you tested, so your verification carries over 1:1).
Thank you for the thorough field pass: the LagDiag numbers, the repeated-zap and mid-blocking-reload teardown checks, and especially the HLG/RASL seam confirmation on the HEVC channel. The 1.1-1.2 s joins with TARGETDURATION:2 / HOLD-BACK=6.000 on real origins are exactly the shape the profile was designed to hit; your origins clearly hand out a short connect backlog, which fills the 6 s gate at I/O speed instead of wall-clock, which is also why the same channels needed 11-20 s under .standard (18 s gate minus backlog).
Closing as released and reporter-verified. If a bursty origin ever misbehaves under .fastZap mid-stream (the tighter-patience trade-off documented on the option), please open a fresh issue with the cadence logs.
Follow-up from #195
<#195>/#197
<#197> — fastZap works
great on device. This is first-session-only, software path, physical Apple
TV (tvOS 26.5), never in the simulator. Reproduced identically across four
cold launches.
Symptom: the first dispatch: … → software session after app launch brings
up audio (decoder, resampler, first enqueue, seekClock) but produces no
video frame for ~10 s. It then recovers without any host-side action: we
verified our own retry watchdog was not involved — the recovery appears to
be your cold-start wedge revive (#93-style) firing on its internal
deadline, after which Deinterlace engaged [hardware] + first frame appear
and a same-URL reload plays in <0.6 s. Every subsequent software session in
the process joins instantly.
Timing detail: our layer measures buffering-finished at 9.7–10.3 s, i.e.
the stall is inside session bring-up before the first frame, one time per
process.
Suspects (both one-time-per-process, on the load path):
1. First Metal pipeline compile for yadif_videotoolbox — later sessions
hit the shader cache.
2. First renderer AVAudioSession activation with HDMI route renegotiation —
engine init logs maxChannels=2 output=2; the first session's renderer
audio session active shows preferred=6 output=6 (2ch→6ch LPCM switch on
a real HDMI sink).
Sessions: raw-TS IPTV, interlaced 1080i25 H.264 + AC-3 5.1. One run also
had thermal state serious, but the wedge reproduces regardless.
move this warmup off the first-frame path (precompile the deinterlace
pipeline at init/bind, and/or activate the renderer audio session
earlier/async), or shorten the revive deadline for the never-rendered
cold-start case. Host-side retries don't help — a fresh session re-wedges
until the warmup completes. Happy to test a branch on the same device; full
logs of all runs available.
Op wo 22 jul 2026 om 19:00 schreef superuser404notfound <
***@***.***>:
Activity
superuser404notfound commentedon Jul 22, 2026
Implemented on #197:
LoadOptions.liveJoinProfile = .fastZap.Your diagnosis was exactly right, and the burst-backlog observation (~4.5 s join) is the proof: a backlog fills the startup cushion at I/O speed, so the gate itself is what a strict-realtime origin pays for in wall-clock time. One correction to the proposed shape, though: serving the first manifest with a reduced
HOLD-BACKis not on the table.HOLD-BACKhas a hard spec floor of 3 xTARGETDURATION(RFC 8216bis 4.4.3.8), and AVPlayer enforces that distance from the live edge regardless of what the playlist claims. Undercutting it is precisely the-16832restart loop the gate was introduced to fix in #189.So the profile shrinks
TARGETDURATIONitself instead of the holdback:.fastZapcuts live segments at every keyframe past 0.5 s (instead of the standard ~4 s), so segments quantize to your source's keyframe cadence.TARGETDURATIONthen collapses toceil(max EXTINF), i.e. the real GOP length, and the holdback the first manifest is gated on (still 3 x TD, still spec-clean) shrinks proportionally..standardbehavior automatically; bursty ingest origins keep the observed-cadence TD floor from Bursty-ingest detection trusts self-reported TARGETDURATION, not observed cadence -- LL-HLS blocking-reload stays enabled and stalls with -15410 #167.Measured against a strict-realtime origin fixture shaped like your channels (progressive 1080p50 H.264, GOP = 1 s, ~6 Mbps TS, zero backlog):
readyToPlayat +2.0 s with.fastZapvs +20.0 s with.standard, stable playback afterwards, no-16832/-12888. Join speed tracks the origin's keyframe interval: a 2 s GOP lands at TD=2 and a 6 s holdback, a 1 s GOP at TD=1 and 3 s.The trade-off you offered to accept is real and documented on the option: a smaller
TARGETDURATIONalso tightens AVPlayer's unchanged-playlist patience and live-edge buffer, so an origin that stalls or bursts mid-stream will rebuffer or error more readily than under.standard. Opt in for zapping, keep.standardfor lean-back viewing.You can A/B it locally with the repro harness on the branch:
--preroll 0models a strict-realtime origin with no backlog burst; the log prints timestampedreadyToPlayplus a JOIN metric. Testing against your real Xtream origins (both the strict-realtime and the bursty ones) before we cut a release would be very welcome.feat(live): fastZap live-join profile for realtime raw-TS sources (#195…
Simpendaal commentedon Jul 22, 2026
superuser404notfound commentedon Jul 22, 2026
Released in 5.19.0 (the release is content-identical to the branch you tested, so your verification carries over 1:1).
Thank you for the thorough field pass: the LagDiag numbers, the repeated-zap and mid-blocking-reload teardown checks, and especially the HLG/RASL seam confirmation on the HEVC channel. The 1.1-1.2 s joins with
TARGETDURATION:2/HOLD-BACK=6.000on real origins are exactly the shape the profile was designed to hit; your origins clearly hand out a short connect backlog, which fills the 6 s gate at I/O speed instead of wall-clock, which is also why the same channels needed 11-20 s under.standard(18 s gate minus backlog).Closing as released and reporter-verified. If a bursty origin ever misbehaves under
.fastZapmid-stream (the tighter-patience trade-off documented on the option), please open a fresh issue with the cadence logs.Simpendaal commentedon Jul 22, 2026
Simpendaal commentedon Jul 23, 2026
?