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
2 changes: 2 additions & 0 deletions quest/m1/tstd/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,5 @@ nightly.

- [Fixed-delay release](/quest/m1/tstd/delay.md) - frames go out at media time plus a fixed `--delay`, in one order under loss
- [TS byte schedule](/quest/m1/tstd/byte-schedule.md) - PCRs sit on the byte grid the mux rate implies, paced against the fixed delay
- [Send-ahead within the delay](/quest/m1/tstd/send-ahead.md) - total lag is `--delay`, send-ahead included, with a 1 s default
- [Mux-rate hold](/quest/m1/tstd/mux-rate-hold.md) - import publishes its catalog once the mux rate is measured, so export is constant-rate from the start
39 changes: 39 additions & 0 deletions quest/m1/tstd/mux-rate-hold.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# [S] TS import publishes its catalog once the mux rate is measured

## Goal

A TS→MoQ→TS export is constant-rate from its first packet. `moq import ts`
holds the catalog until its mux-rate meter settles, so `mpegts.muxRate` is
there from the start rather than appearing about 2 s in. A VBR source that
never settles is published without it once the window closes.

## Plan

Decided (2026-10-01). Found in [fixed-delay release](/quest/m1/tstd/delay.md)
(#4645): the importer's meter (`rs/moq-mux/src/container/ts/mux_rate.rs`)
publishes `mpegts.muxRate` only after a 2 s window agrees. So the export's
first ~2 s go out unpadded, and the harness skips them (`pcr-timing.py`
grades from the first null packet).

- Hold the whole catalog until the meter settles, or until one `WINDOW` of
PCR time has passed with no rate published, whichever is first: a
one-time ~2 s start-up cost at ingest. The meter itself keeps rolling and
never times out, so the hold needs that explicit bound. Media written in
the meantime is still published.
- A source whose rate never settles (VBR) publishes after that window
without `muxRate`, and the export stays unpadded, as today.
- End of input releases a held catalog without `muxRate` before
`catalog.finish` closes it: a TS shorter than one window never completes
a measurement, and finishing would otherwise close the catalog track with
the reservation unpublished, leaving media with no catalog.
- Remove the harness's "grade from the first null packet" skip, and the
export's grace for a rate that arrives mid-stream, if nothing else needs
them.
- Test: an imported CBR source's first catalog carries `muxRate`, a VBR
source's catalog arrives after the window without it, and a CBR import
shorter than 2 s still publishes its catalog. A TS→TS export passes
`pcr-schedule` from its first PCR.

## Required

- [Fixed-delay release](/quest/m1/tstd/delay.md) - its export is what reads the rate from the start
37 changes: 37 additions & 0 deletions quest/m1/tstd/send-ahead.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# [M] TS export lag stays within the delay, send-ahead included

## Goal

`moq export ts` output trails the source by `--delay`, not twice it. The
send-ahead window that pre-loads the receiver's buffers comes out of the same
budget, capped at what the decoder buffer can hold. The default becomes 1 s,
so broadcast-sized CPBs fit out of the box.

## Plan

Decided (2026-10-01). Found in [fixed-delay release](/quest/m1/tstd/delay.md)
(#4645): frames are held until anchor + DTS + delay, and the schedule then
sends each unit up to another delay ahead of its DTS, so a mid-group joiner
trails the source by two delays. t0ms measured about 1.7 s of delivery at
500 ms: the two delays plus the join and the source's own send-ahead, so
carving alone should cut it by about one delay, not to 0.5 s.

- One budget. A frame's release deadline is anchor + DTS + delay − its
send-ahead. The send-ahead is at most what the PID's decoder buffer can hold
ahead of its DTS (EB from the SPS HRD or the level, B per 13818-1); sending
further ahead only adds latency (0.93 s of reach on `hrd9m` against a 2 s
delay).
- The default `--delay` rises from 500 ms to 1 s. Broadcast CPBs need
0.6-1 s of send-ahead (t0ms's CNN capture, `hrd9m`). A source that needs
more than the delay allows fails loud and names the `--delay` it needs.
Update `doc/bin/cli.md`, moq-srt egress (which passes its SRT latency as
the delay), and every example invocation.
- Test: a mid-group joiner's every slot goes out `delay` after the source sent
it (the existing `a_joiner_runs_at_the_delay_from_its_first_output`, tightened
from two delays to one). `hrd9m` passes strict `tstd` at the 1 s default,
and a delay below its buffer delay fails loud.
- Ask t0ms to re-grade the CNN capture: latency should drop by about a delay.

## Required

- [Fixed-delay release](/quest/m1/tstd/delay.md) - the hold and schedule this merges into one budget
Loading