diff --git a/biome.jsonc b/biome.jsonc index 4d6b347e59d..309ddb470f4 100644 --- a/biome.jsonc +++ b/biome.jsonc @@ -19,7 +19,9 @@ // indexes. Exclude two kinds it can't handle: // - MPEG transport-stream fixtures whose `.ts` extension collides with TypeScript. // - SVG assets, which Biome routes to its HTML parser and rejects. - "includes": ["**", "!rs/moq-mux/src/container/ts/test_data", "!**/*.svg"] + // - The audio jitter corpus, which is generated and byte-compared by its own test, + // so a formatter rewriting it would fight the generator on every `just fix`. + "includes": ["**", "!rs/moq-mux/src/container/ts/test_data", "!**/*.svg", "!doc/concept/audio-jitter/*.json"] }, "linter": { "rules": { @@ -59,6 +61,31 @@ } }, "overrides": [ + { + // The audio jitter reference is the corpus generator, not a library: an + // implementation that calls it proves nothing about the normative document. + "includes": ["**", "!doc/concept/audio-jitter/**"], + "linter": { + "rules": { + "style": { + "noRestrictedImports": { + "level": "error", + "options": { + "patterns": [ + { + "group": [ + "**/concept/audio-jitter/reference", + "**/concept/audio-jitter/reference.*" + ], + "message": "doc/concept/audio-jitter/reference.ts is non-normative. Implement the document, don't import the reference." + } + ] + } + } + } + } + } + }, { "includes": ["doc/.vitepress/theme/custom.css"], "linter": { diff --git a/doc/.vitepress/config.ts b/doc/.vitepress/config.ts index e5555e56f9a..53fdc40395d 100644 --- a/doc/.vitepress/config.ts +++ b/doc/.vitepress/config.ts @@ -90,6 +90,7 @@ export default defineConfig({ { text: "Transport", link: "/concept/transport" }, { text: "moq-lite", link: "/concept/moq-lite" }, { text: "hang", link: "/concept/hang" }, + { text: "Audio jitter", link: "/concept/audio-jitter" }, { text: "Standards", link: "/concept/standard" }, { text: "Use cases", diff --git a/doc/concept/audio-jitter.md b/doc/concept/audio-jitter.md new file mode 100644 index 00000000000..bb316d007ff --- /dev/null +++ b/doc/concept/audio-jitter.md @@ -0,0 +1,444 @@ +--- +title: Audio jitter +description: How a receiver sizes its audio playout target from arrival timing +--- + +# Audio jitter + +A receiver cannot play audio the instant it arrives. Frames leave the publisher +in bursts and cross a network that delivers them unevenly, so a playhead that +starts on the first frame runs dry on the first gap. The buffer it holds ahead +of the playhead is the **playout target**, and this page says how to compute it. + +This document is normative. `@moq/hang` and `moq-audio` each implement it, and +neither is the reference for the other: parity is held by the [conformance +corpus](#conformance-corpus), one set of arrival traces with the target series +both must produce. Nothing here is negotiated on the wire, so a receiver that +chooses a different target is still conformant. It will just sound worse. + +The target is a *measurement*, not a round trip. `max(20ms, 1.25 x minRtt)` +sizes a buffer for one retransmit, which describes how long the network takes +to recover a loss and says nothing about how unevenly a publisher emits frames. +A sender flushing 100 ms of media at once needs 100 ms of buffer on a perfect +network, and the round trip cannot see it. + +## The observation point + +Every frame is observed **as it comes off the transport, before any group can be +skipped**. A target derived from what survives the age budget only ever confirms +the budget it was cut to. + +That point is one await in each implementation, resolving once per container +frame: + +| | Observation point | +| --- | --- | +| Browser | `Group.Consumer.readFrame()`, inside the container consumer's per-group loop | +| Native | `container::Consumer::read()`, awaited by `moq-audio`'s decode consumer | + +Both sit below the decoder and above nothing: no reordering, no gap handling, no +age budget. A frame dropped by the relay is never observed, which is correct. +A frame the container will later discard *is* observed, which is also correct: +it arrived, and when it arrived is the measurement. + +## Units and clocks + +Two implementations that disagree here produce different targets from the same +trace while both look right, so this is fixed rather than left to taste. + +- **Arrival** is the receiver's monotonic clock in **milliseconds**, as `f64`. + `performance.now()` in the browser, `Instant` natively. Never the wall clock: + a step adjustment would read as a burst of jitter. +- **Media** is the frame's container timestamp converted to **milliseconds**, as + `f64`, using the track's declared timescale. Convert once, at the observation + point, as `ticks * 1000 / timescale` in `f64`. The legacy hang container is + microseconds; CMAF and Matroska carry their own scale. +- **Every value below is `f64` milliseconds.** No fixed point and no integer + rounding. WebRTC's Q15 arithmetic exists for 2010-era DSPs and buys nothing + here except a class of cross-language parity bug. + +Arithmetic is IEEE-754 and evaluated in the order written, so both languages get +bit-identical results. Do not reassociate the sums, do not use compensated +summation, and do not accumulate in a wider type. + +## The estimator + +``` +observe(arrival, media): + if media <= newest: return # reordered, excluded entirely + newest = media + + drop history entries with entry.media < media - WINDOW + push (arrival, media) onto history + + ref = entry in history minimising (entry.arrival - entry.media) + delay = max(0, (arrival - ref.arrival) - (media - ref.media)) + + if first observation: + origin = arrival; interval = 0; peak = delay; return + + index = floor((arrival - origin) / RESAMPLE) + if index <= interval: + peak = max(peak, delay); return + + fold(bucket of peak) + fold(nothing) for each elapsed empty interval, at most IDLE_MAX + interval = index; peak = delay + +fold(bucket): + count += 1 + forget = min(FORGET, count / (count + RAMP)) + histogram = forget * histogram + (1 - forget) * (bucket or PRIOR) + +target(): + measured = upper edge of the first bucket whose cumulative weight exceeds QUANTILE + return max(measured, advertised) + frame +``` + +### Relative arrival delay + +`delay` is measured against the **fastest frame in the recent window**, not +against the previous frame. This is the whole design in one line, and it is what +an inter-arrival estimator structurally cannot do: a queue filling at 2 ms per +frame reads as a hundred tiny inter-arrival observations, where this reads as a +delay climbing to 200 ms. + +The window is **media time**, not arrival time. Pruning `entry.media < media - +WINDOW` is what makes a timestamp jump self-correcting: everything before it +leaves the window at once, the new frame becomes its own reference, and the +delay measured across the jump is zero rather than the size of the jump. A +tune-in that reads a frame from a stale group and then the live edge needs no +special case, and neither does a group the relay dropped. + +`WINDOW` is also the horizon over which a build-up is visible. A queue that +fills over ten seconds is measured as the part of it that happened in the last +two. + +### Reordered arrivals are excluded, not measured + +A frame whose media timestamp is not newer than the newest already observed is +**reordered**, and it is dropped: it updates no state, joins no history, and +produces no delay. + +This is not a refinement. When a newer group arrives before an older one, +`arrival - ref.arrival` is positive while `media - ref.media` is negative, so the +media-time gap between them is *added* to the delay. That is exactly the failure +this whole design exists to avoid, a media-time distance leaking into a delay +measurement, and it arrives through the front door: the container consumer takes +groups off the transport in delivery order and sorts afterwards, so out-of-order +observation is ordinary input rather than an edge case. + +Reordering is a real cost, and a receiver that wanted to price it would weigh +late arrivals against the loss of playing without them. That is WebRTC's +`ReorderOptimizer` and SpeexDSP's `compute_opt_delay`, which reached the same +shape independently. It is deliberately out of scope here: ship the underrun +estimator first. + +### One observation per interval, the maximum + +The histogram takes **one observation per `RESAMPLE` interval, the largest delay +in it**. Easy to miss and behaviourally significant for two reasons. + +It decorrelates the observations. A hundred frames stuck behind one queue are +one event, not a hundred, and weighting them as a hundred would let frame rate +set the time constant. + +It turns the forget factor into a wall-clock time constant, which is the only +form worth stating: the histogram halves a sample's weight after +`RESAMPLE * ln(0.5) / ln(FORGET)`, about **20 s**, and retains 1% of it after +about **135 s**. The forget factor decays **once per resampled observation, not +once per arrival**. Applying a per-observation factor per arrival is the mistake +the #3517 branch makes, and the resulting number reads plausible either way. + +### The histogram + +An empirical distribution of `BUCKETS` buckets `BUCKET` wide, holding total +weight 1. Each observation is an exponential update: + +``` +histogram = forget * histogram + (1 - forget) * x +``` + +where `x` is all weight on the observed bucket. Weight stays normalised for +free, so there is no separate renormalisation step and no running total. + +A delay at or beyond `BUCKETS * BUCKET` lands in the last bucket rather than +being discarded. WebRTC discards it, which makes a genuine multi-second spread +indistinguishable from none; the target is bounded by its own ceiling instead. + +The cold start is seeded with a decaying prior, `PRIOR[i] = 0.5^(i+1)`. Its +95th percentile falls in bucket 4, so a receiver that has observed nothing at +all targets **100 ms plus one frame**. That number is a consequence of the +prior, not a chosen default. + +`RAMP` holds the forget factor below `FORGET` for the first observations, so +early evidence overwrites the prior instead of being averaged into it. It +reaches `FORGET` after about 116 observations, roughly a minute, and has no +effect after that. Without it a receiver crawls toward the truth for a minute; +with it, the corpus's evenly paced trace converges in under two seconds. + +### Reading the target + +`measured` is the **upper edge** of the first bucket whose cumulative weight +exceeds `QUANTILE`. The upper edge, because the delays in that bucket sit +somewhere inside it and covering the whole bucket is what actually covers the +quantile. + +A quantile of an empirical distribution, rather than a mean plus k deviations, +because network delay is heavy-tailed and one-sided. A Gaussian assumption +sizes that tail wrong in both directions. + +## The frame duration + +One frame duration is added on top of `measured`. The buffer swings by the +spread the quantile measures, so without it the bottom of the swing lands on an +empty ring. + +**Frame duration is a codec property. It is never learned from observed +timestamps.** Deriving it from timestamp arithmetic makes a tune-in artifact +indistinguishable from a real frame duration, which is precisely how the #3517 +branch reaches a 14.56 s target. A receiver takes the first of these that +applies: + +1. The container's own per-sample duration, when it carries one. CMAF does. +2. The codec's in-band duration. An Opus packet states its own duration in its + TOC byte (RFC 6716 ยง3.1), at 48 kHz regardless of the encoder's internal + bandwidth, which covers every duration Opus can pick from 2.5 to 60 ms. This + is available at the observation point, needs no catalog change, and + `rs/moq-mux` already has the parser. +3. A codec constant over the catalog's sample rate: 1024 samples for AAC-LC, + 2048 for AAC-HE, 1152 or 576 for MP3 depending on the MPEG version. +4. Nothing. The term is zero and the target is the measured part alone. + +A new catalog field was considered and rejected. `AudioConfig` carries +`sampleRate` and `bitrate` and concedes in its own comment that frame duration +"depends on the codec, sample rate, etc"; adding one would mean the full +cross-package sync, in `rs/hang`, `js/hang`, this page, and the hang draft, to +carry a number the payload already states. + +### What is not in the frame duration + +The browser's AudioWorklet renders in fixed 128-sample blocks, and +`js/watch/src/audio/config.ts` currently adds that block to the per-codec frame +duration, so 48 kHz Opus reads as 23 ms rather than 20 ms. **That block is not +part of the target.** It is a property of the render backend, not of the +network, and native has no worklet at all. If one language's step carried it and +the other's did not, the two would produce different target series from the same +trace and the corpus could not hold. + +It belongs in the **render slack**: the margin the playback ring keeps above the +target so a render callback never arrives to find exactly zero samples. In the +browser that is the worklet quantum; natively it is the backend's device period. +Each side sizes its own, above the shared target, and neither is this page's +business. + +## The advertised flush span, and how it composes + +A hang rendition may advertise `jitter`: the largest delay the publisher has +seen between a frame being ready and handing it to the transport. It is +described in [hang](/concept/hang) and specified in +[draft-lcurley-moq-hang](/draft/moq-hang). The two quantities share a word and +get confused for each other, so plainly: + +| | Advertised `jitter` | The estimate here | +| --- | --- | --- | +| Measured by | the publisher, once | each receiver, continuously | +| Measured at | the transport handoff | the receiver's transport | +| Covers | encoder latency, packet packing, reorder, segmentation | all of that, plus the network | +| Is | a declared lower bound | an observation | + +**They compose as a maximum, and the reason matters.** Both are the same +formula, lateness relative to a windowed minimum, evaluated one hop apart. The +receiver measures from the frame's media timestamp to its own arrival, so the +publisher's flush delay is already inside every number on this page: a publisher +flushing 100 ms of media at once produces arrivals whose relative delay reaches +100 ms less one frame, on a perfect network, with no help from the catalog. + +So the advertised value is a **floor**, not an addend: + +``` +target = max(measured, advertised) + frame +``` + +Adding them double-counts the publisher, and doubles the buffer for exactly the +publishers that need it most. Taking the maximum on the grounds that they +"describe the same quantity" reaches the right operation by the wrong argument: +they are the same quantity measured at different points, and the receiver's +point strictly contains the publisher's. The floor earns its place by being +correct *immediately*, before the estimator has seen a full flush cycle, which +is the one thing a measurement cannot be. + +Note that `js/watch` today adds the two rather than taking the maximum, which +over-buffers a bursty publisher by its own flush span. + +## Rise, fall, startup, and the ceiling + +There is **no separate rise or fall limiter**. The histogram is the only +dynamic, and a second rate limit on top of it would be two knobs describing one +behaviour. + +The asymmetry a playout target needs falls out of the shape rather than being +dialled in. An underrun is an audible glitch and excess buffer is latency nobody +can hear, so the target should rise readily and fall grudgingly, and it does: + +- **Rising** is driven by the maximum-over-interval resampling. A single late + arrival defines its whole interval, so a burst is weighted as heavily as the + hundreds of punctual frames around it. +- **Falling** is driven by the forget factor alone, over the 20 s half-life + above. Old mass in the tail has to decay out before the quantile can move + down, and nothing can make it decay faster. +- **A single bad observation does not move the target at all.** It adds at most + `1 - forget` weight, which past the startup ramp is 1.7%, well under the 5% + the 95th percentile needs. It takes a few intervals of genuine lateness before + the target responds, which is the correct answer to a one-off straggler. + +The #3517 branch needed an explicit rise clamp and a one-frame-per-second fall +limiter because it had an unbounded instant-rise path that bypassed the +histogram entirely: `percentile() + step` was published the moment it rose, and +`step` was learned from observed timestamps. Removing that path removes the need +for the limiters. + +**The ceiling is structural.** `measured` cannot exceed `BUCKETS * BUCKET`, so +nothing the receiver observes can carry the target past `BUCKETS * BUCKET + +frame`, about 2 s. There is no magic number to clamp against, which is the +specific failure of the #3517 branch: it clamped the percentile and then added +an unbounded frame term on top. + +The advertised floor is the one term that can exceed that bound, and it is +deliberately not clamped to it. The ceiling is a property of the histogram's +size; the floor is a number the publisher declared about itself, so clamping +the floor to the ceiling would under-buffer precisely the publisher that was +honest about a long flush. + +Policy limits sit above the algorithm. A receiver's own configured maximum and +the track's retention window both cap what it may hold, and neither is the +estimator's business. + +## Idle intervals + +An interval with no arrival in it still folds, seeded with the **prior** rather +than with an observed bucket: + +``` +histogram = forget * histogram + (1 - forget) * PRIOR +``` + +This is the only honest answer to "does the wall-clock memory survive a pause". +Skipping empty intervals freezes a stale estimate indefinitely. Decaying without +seeding un-normalises the histogram and the quantile falls through to the +ceiling. Seeding with the prior relaxes the estimate back toward cold start at +the same time constant as everything else, which is what an evidence-free +interval should do, and it raises the target rather than lowering it, so the +error is on the safe side. + +`IDLE_MAX` caps how many intervals are folded at once. It exists only to bound +the work: after 1024 folds the retained weight is about 2e-8, so the cap changes +no output an `f64` can represent. + +The startup ramp is not restarted. A receiver coming back from a pause is not +cold, and re-converging at the base rate is correct. + +## Fixed targets + +An explicit delay **fixes the target and disables adaptation**. It is taken +literally: no advertised floor, no frame term, no estimate. + +``` +target = delay +``` + +An impossible fixed target is refused, not silently adjusted. A negative delay, +or one beyond the track's retention window, is an error at configuration time. +Supported or refused, not warned about and continued. + +In the browser this is the numeric `delay` setting; natively it is +`decode::Options::delay`, where `None` selects the estimator. The two spell the +same thing the same way on purpose. It is distinct from `max_age`, which is the +live-edge skip budget and not a buffer. + +## Constants + +Every value comes from WebRTC's NetEq, whose algorithm lives in +`underrun_optimizer`, `histogram`, and `packet_arrival_history` under +`modules/audio_coding/neteq/`, not in the `delay_manager.cc` the name suggests. +The two exceptions are marked. + +| Constant | Value | Origin | +| --- | --- | --- | +| `WINDOW` | 2000 ms | `PacketArrivalHistory` window size | +| `BUCKET` | 20 ms | `Histogram` bucket size | +| `BUCKETS` | 100 | `UnderrunOptimizer` bucket count | +| `QUANTILE` | 0.95 | NetEq's default delay histogram quantile | +| `FORGET` | 0.983 | NetEq's underrun forget factor. The widely repeated 0.97 is a transitional value, and 0.9993 is the *reorder* factor, which the #3517 branch uses by mistake | +| `RESAMPLE` | 500 ms | NetEq's resample interval | +| `RAMP` | 2 | NetEq's start forget weight | +| `PRIOR[i]` | `0.5^(i+1)` | NetEq's histogram seed | +| `IDLE_MAX` | 1024 intervals | Ours. A work bound with no effect on output | +| Out-of-range delays | clamped, not dropped | Ours. See [the histogram](#the-histogram) | + +## Implementing from this page + +WebRTC is BSD-3 plus a patents grant, and copying its source would carry a third +license and its disclaimer into an `MIT OR Apache-2.0` repository. Implement +from the description above, citing NetEq as the design's source in a comment. +SpeexDSP's `jitter.c` is BSD-3 and safe to read. Asterisk's `jitterbuf.c` +(GPLv2) and FreeSWITCH's `switch_jitterbuffer.c` (MPL 1.1) are not. + +No crate was adopted. The `neteq` crate is the only viable candidate and takes a +percentile over per-packet deltas each clamped at zero, which cannot see a +build-up, the one property this design exists for. It is also a whole NetEq, +sample-rate-locked ring buffers and WSOLA and packet loss concealment, where +this is a few hundred lines of estimator whose shape would then be its. Neither +`webrtc-rs` nor `str0m` implements playout at all, GStreamer's +`rtpjitterbuffer` solves clock skew rather than target sizing and is LGPL, and +no browser-usable port exists. + +## Conformance corpus + +`doc/concept/audio-jitter/` holds one JSON file per case: an arrival trace and +the target series it must produce. Both implementations read these files +directly, so neither is graded against the other. + +```json +{ + "name": "tunein", + "about": "One frame from a stale group, then the live edge 14.5 s later, ...", + "frame": 20, + "arrival": [0, 10, 30], + "media": [0, 14500, 14520], + "target": [[0, 120], [26, 80]] +} +``` + +`arrival` and `media` are parallel arrays in **delivery order**, the order the +receiver observes them, so `media` is deliberately out of order in the +reordering case. `advertised` and `delay` are present only where the case uses +them. `target` lists `[frame index, target]` at every frame where the target +differs from the previous frame's, starting at frame 0, so an implementation +folds the trace one frame at a time and compares its target at each listed +index. Tolerance is 1e-6 ms, which the `f64` rules above make generous. + +| Case | Holds the implementation to | +| --- | --- | +| `paced` | An even sender converges to one bucket plus one frame, and the startup ramp gets it there in under two seconds | +| `flush` | The measured term follows a flush span, and tracks it when the span doubles | +| `advertised` | The advertised span floors the target instead of adding to it | +| `buildup` | A queue filling at 2 ms per frame is measured against the fastest recent arrival | +| `reorder` | Out-of-order media timestamps never reach the delay measurement | +| `idle` | A 30 s gap relaxes the histogram toward the prior | +| `tunein` | A stale frame then the live edge 14.5 s later leaves the target near the frame duration. This is the #3517 regression | +| `spike` | A recurring stall raises the target, and it decays once the stalls stop | +| `fixed` | An explicit delay ignores the arrivals entirely | + +`reference.ts` beside them generated the numbers. It is **not normative and not +shipped**: this page is. When the two disagree, this page wins, the reference is +corrected, and the corpus is regenerated with +`bun doc/concept/audio-jitter/corpus.ts`. An implementation that imports the +reference has proved nothing, so none of them may; `biome.jsonc` forbids the +import outside this directory rather than leaving it to review. + +`corpus.test.ts` re-runs the reference and fails when the checked-in files no +longer match it, which is what stops a file being edited by hand to make a +failing implementation pass. It compares rather than rewrites; regenerating is +the `bun doc/concept/audio-jitter/corpus.ts` command above. It runs in +`just test` and `just check`. diff --git a/doc/concept/audio-jitter/advertised.json b/doc/concept/audio-jitter/advertised.json new file mode 100644 index 00000000000..553a70accf8 --- /dev/null +++ b/doc/concept/audio-jitter/advertised.json @@ -0,0 +1 @@ +{"name":"advertised","about":"The same even sender as `paced`, with a publisher advertising a 200 ms flush span. The advertised value is a floor on the measured term, not an addition to it, so the target holds there instead of converging down.","frame":20,"advertised":200,"arrival":[50,70,90,110,130,150,170,190,210,230,250,270,290,310,330,350,370,390,410,430,450,470,490,510,530,550,570,590,610,630,650,670,690,710,730,750,770,790,810,830,850,870,890,910,930,950,970,990,1010,1030,1050,1070,1090,1110,1130,1150,1170,1190,1210,1230,1250,1270,1290,1310,1330,1350,1370,1390,1410,1430,1450,1470,1490,1510,1530,1550,1570,1590,1610,1630,1650,1670,1690,1710,1730,1750,1770,1790,1810,1830,1850,1870,1890,1910,1930,1950,1970,1990,2010,2030,2050,2070,2090,2110,2130,2150,2170,2190,2210,2230,2250,2270,2290,2310,2330,2350,2370,2390,2410,2430,2450,2470,2490,2510,2530,2550,2570,2590,2610,2630,2650,2670,2690,2710,2730,2750,2770,2790,2810,2830,2850,2870,2890,2910,2930,2950,2970,2990,3010,3030,3050,3070,3090,3110,3130,3150,3170,3190,3210,3230,3250,3270,3290,3310,3330,3350,3370,3390,3410,3430,3450,3470,3490,3510,3530,3550,3570,3590,3610,3630,3650,3670,3690,3710,3730,3750,3770,3790,3810,3830,3850,3870,3890,3910,3930,3950,3970,3990,4010,4030,4050,4070,4090,4110,4130,4150,4170,4190,4210,4230,4250,4270,4290,4310,4330,4350,4370,4390,4410,4430,4450,4470,4490,4510,4530,4550,4570,4590,4610,4630,4650,4670,4690,4710,4730,4750,4770,4790,4810,4830,4850,4870,4890,4910,4930,4950,4970,4990,5010,5030,5050,5070,5090,5110,5130,5150,5170,5190,5210,5230,5250,5270,5290,5310,5330,5350,5370,5390,5410,5430,5450,5470,5490,5510,5530,5550,5570,5590,5610,5630,5650,5670,5690,5710,5730,5750,5770,5790,5810,5830,5850,5870,5890,5910,5930,5950,5970,5990,6010,6030,6050,6070,6090,6110,6130,6150,6170,6190,6210,6230,6250,6270,6290,6310,6330,6350,6370,6390,6410,6430,6450,6470,6490,6510,6530,6550,6570,6590,6610,6630,6650,6670,6690,6710,6730,6750,6770,6790,6810,6830,6850,6870,6890,6910,6930,6950,6970,6990,7010,7030,7050,7070,7090,7110,7130,7150,7170,7190,7210,7230,7250,7270,7290,7310,7330,7350,7370,7390,7410,7430,7450,7470,7490,7510,7530,7550,7570,7590,7610,7630,7650,7670,7690,7710,7730,7750,7770,7790,7810,7830,7850,7870,7890,7910,7930,7950,7970,7990,8010,8030,8050,8070,8090,8110,8130,8150,8170,8190,8210,8230,8250,8270,8290,8310,8330,8350,8370,8390,8410,8430,8450,8470,8490,8510,8530,8550,8570,8590,8610,8630,8650,8670,8690,8710,8730,8750,8770,8790,8810,8830,8850,8870,8890,8910,8930,8950,8970,8990,9010,9030,9050,9070,9090,9110,9130,9150,9170,9190,9210,9230,9250,9270,9290,9310,9330,9350,9370,9390,9410,9430,9450,9470,9490,9510,9530,9550,9570,9590,9610,9630,9650,9670,9690,9710,9730,9750,9770,9790,9810,9830,9850,9870,9890,9910,9930,9950,9970,9990,10010,10030,10050,10070,10090,10110,10130,10150,10170,10190,10210,10230,10250,10270,10290,10310,10330,10350,10370,10390,10410,10430,10450,10470,10490,10510,10530,10550,10570,10590,10610,10630,10650,10670,10690,10710,10730,10750,10770,10790,10810,10830,10850,10870,10890,10910,10930,10950,10970,10990,11010,11030,11050,11070,11090,11110,11130,11150,11170,11190,11210,11230,11250,11270,11290,11310,11330,11350,11370,11390,11410,11430,11450,11470,11490,11510,11530,11550,11570,11590,11610,11630,11650,11670,11690,11710,11730,11750,11770,11790,11810,11830,11850,11870,11890,11910,11930,11950,11970,11990,12010,12030,12050,12070,12090,12110,12130,12150,12170,12190,12210,12230,12250,12270,12290,12310,12330,12350,12370,12390,12410,12430,12450,12470,12490,12510,12530,12550,12570,12590,12610,12630,12650,12670,12690,12710,12730,12750,12770,12790,12810,12830,12850,12870,12890,12910,12930,12950,12970,12990,13010,13030,13050,13070,13090,13110,13130,13150,13170,13190,13210,13230,13250,13270,13290,13310,13330,13350,13370,13390,13410,13430,13450,13470,13490,13510,13530,13550,13570,13590,13610,13630,13650,13670,13690,13710,13730,13750,13770,13790,13810,13830,13850,13870,13890,13910,13930,13950,13970,13990,14010,14030,14050,14070,14090,14110,14130,14150,14170,14190,14210,14230,14250,14270,14290,14310,14330,14350,14370,14390,14410,14430,14450,14470,14490,14510,14530,14550,14570,14590,14610,14630,14650,14670,14690,14710,14730,14750,14770,14790,14810,14830,14850,14870,14890,14910,14930,14950,14970,14990,15010,15030,15050,15070,15090,15110,15130,15150,15170,15190,15210,15230,15250,15270,15290,15310,15330,15350,15370,15390,15410,15430,15450,15470,15490,15510,15530,15550,15570,15590,15610,15630,15650,15670,15690,15710,15730,15750,15770,15790,15810,15830,15850,15870,15890,15910,15930,15950,15970,15990,16010,16030,16050,16070,16090,16110,16130,16150,16170,16190,16210,16230,16250,16270,16290,16310,16330,16350,16370,16390,16410,16430,16450,16470,16490,16510,16530,16550,16570,16590,16610,16630,16650,16670,16690,16710,16730,16750,16770,16790,16810,16830,16850,16870,16890,16910,16930,16950,16970,16990,17010,17030,17050,17070,17090,17110,17130,17150,17170,17190,17210,17230,17250,17270,17290,17310,17330,17350,17370,17390,17410,17430,17450,17470,17490,17510,17530,17550,17570,17590,17610,17630,17650,17670,17690,17710,17730,17750,17770,17790,17810,17830,17850,17870,17890,17910,17930,17950,17970,17990,18010,18030,18050,18070,18090,18110,18130,18150,18170,18190,18210,18230,18250,18270,18290,18310,18330,18350,18370,18390,18410,18430,18450,18470,18490,18510,18530,18550,18570,18590,18610,18630,18650,18670,18690,18710,18730,18750,18770,18790,18810,18830,18850,18870,18890,18910,18930,18950,18970,18990,19010,19030,19050,19070,19090,19110,19130,19150,19170,19190,19210,19230,19250,19270,19290,19310,19330,19350,19370,19390,19410,19430,19450,19470,19490,19510,19530,19550,19570,19590,19610,19630,19650,19670,19690,19710,19730,19750,19770,19790,19810,19830,19850,19870,19890,19910,19930,19950,19970,19990,20010,20030],"media":[0,20,40,60,80,100,120,140,160,180,200,220,240,260,280,300,320,340,360,380,400,420,440,460,480,500,520,540,560,580,600,620,640,660,680,700,720,740,760,780,800,820,840,860,880,900,920,940,960,980,1000,1020,1040,1060,1080,1100,1120,1140,1160,1180,1200,1220,1240,1260,1280,1300,1320,1340,1360,1380,1400,1420,1440,1460,1480,1500,1520,1540,1560,1580,1600,1620,1640,1660,1680,1700,1720,1740,1760,1780,1800,1820,1840,1860,1880,1900,1920,1940,1960,1980,2000,2020,2040,2060,2080,2100,2120,2140,2160,2180,2200,2220,2240,2260,2280,2300,2320,2340,2360,2380,2400,2420,2440,2460,2480,2500,2520,2540,2560,2580,2600,2620,2640,2660,2680,2700,2720,2740,2760,2780,2800,2820,2840,2860,2880,2900,2920,2940,2960,2980,3000,3020,3040,3060,3080,3100,3120,3140,3160,3180,3200,3220,3240,3260,3280,3300,3320,3340,3360,3380,3400,3420,3440,3460,3480,3500,3520,3540,3560,3580,3600,3620,3640,3660,3680,3700,3720,3740,3760,3780,3800,3820,3840,3860,3880,3900,3920,3940,3960,3980,4000,4020,4040,4060,4080,4100,4120,4140,4160,4180,4200,4220,4240,4260,4280,4300,4320,4340,4360,4380,4400,4420,4440,4460,4480,4500,4520,4540,4560,4580,4600,4620,4640,4660,4680,4700,4720,4740,4760,4780,4800,4820,4840,4860,4880,4900,4920,4940,4960,4980,5000,5020,5040,5060,5080,5100,5120,5140,5160,5180,5200,5220,5240,5260,5280,5300,5320,5340,5360,5380,5400,5420,5440,5460,5480,5500,5520,5540,5560,5580,5600,5620,5640,5660,5680,5700,5720,5740,5760,5780,5800,5820,5840,5860,5880,5900,5920,5940,5960,5980,6000,6020,6040,6060,6080,6100,6120,6140,6160,6180,6200,6220,6240,6260,6280,6300,6320,6340,6360,6380,6400,6420,6440,6460,6480,6500,6520,6540,6560,6580,6600,6620,6640,6660,6680,6700,6720,6740,6760,6780,6800,6820,6840,6860,6880,6900,6920,6940,6960,6980,7000,7020,7040,7060,7080,7100,7120,7140,7160,7180,7200,7220,7240,7260,7280,7300,7320,7340,7360,7380,7400,7420,7440,7460,7480,7500,7520,7540,7560,7580,7600,7620,7640,7660,7680,7700,7720,7740,7760,7780,7800,7820,7840,7860,7880,7900,7920,7940,7960,7980,8000,8020,8040,8060,8080,8100,8120,8140,8160,8180,8200,8220,8240,8260,8280,8300,8320,8340,8360,8380,8400,8420,8440,8460,8480,8500,8520,8540,8560,8580,8600,8620,8640,8660,8680,8700,8720,8740,8760,8780,8800,8820,8840,8860,8880,8900,8920,8940,8960,8980,9000,9020,9040,9060,9080,9100,9120,9140,9160,9180,9200,9220,9240,9260,9280,9300,9320,9340,9360,9380,9400,9420,9440,9460,9480,9500,9520,9540,9560,9580,9600,9620,9640,9660,9680,9700,9720,9740,9760,9780,9800,9820,9840,9860,9880,9900,9920,9940,9960,9980,10000,10020,10040,10060,10080,10100,10120,10140,10160,10180,10200,10220,10240,10260,10280,10300,10320,10340,10360,10380,10400,10420,10440,10460,10480,10500,10520,10540,10560,10580,10600,10620,10640,10660,10680,10700,10720,10740,10760,10780,10800,10820,10840,10860,10880,10900,10920,10940,10960,10980,11000,11020,11040,11060,11080,11100,11120,11140,11160,11180,11200,11220,11240,11260,11280,11300,11320,11340,11360,11380,11400,11420,11440,11460,11480,11500,11520,11540,11560,11580,11600,11620,11640,11660,11680,11700,11720,11740,11760,11780,11800,11820,11840,11860,11880,11900,11920,11940,11960,11980,12000,12020,12040,12060,12080,12100,12120,12140,12160,12180,12200,12220,12240,12260,12280,12300,12320,12340,12360,12380,12400,12420,12440,12460,12480,12500,12520,12540,12560,12580,12600,12620,12640,12660,12680,12700,12720,12740,12760,12780,12800,12820,12840,12860,12880,12900,12920,12940,12960,12980,13000,13020,13040,13060,13080,13100,13120,13140,13160,13180,13200,13220,13240,13260,13280,13300,13320,13340,13360,13380,13400,13420,13440,13460,13480,13500,13520,13540,13560,13580,13600,13620,13640,13660,13680,13700,13720,13740,13760,13780,13800,13820,13840,13860,13880,13900,13920,13940,13960,13980,14000,14020,14040,14060,14080,14100,14120,14140,14160,14180,14200,14220,14240,14260,14280,14300,14320,14340,14360,14380,14400,14420,14440,14460,14480,14500,14520,14540,14560,14580,14600,14620,14640,14660,14680,14700,14720,14740,14760,14780,14800,14820,14840,14860,14880,14900,14920,14940,14960,14980,15000,15020,15040,15060,15080,15100,15120,15140,15160,15180,15200,15220,15240,15260,15280,15300,15320,15340,15360,15380,15400,15420,15440,15460,15480,15500,15520,15540,15560,15580,15600,15620,15640,15660,15680,15700,15720,15740,15760,15780,15800,15820,15840,15860,15880,15900,15920,15940,15960,15980,16000,16020,16040,16060,16080,16100,16120,16140,16160,16180,16200,16220,16240,16260,16280,16300,16320,16340,16360,16380,16400,16420,16440,16460,16480,16500,16520,16540,16560,16580,16600,16620,16640,16660,16680,16700,16720,16740,16760,16780,16800,16820,16840,16860,16880,16900,16920,16940,16960,16980,17000,17020,17040,17060,17080,17100,17120,17140,17160,17180,17200,17220,17240,17260,17280,17300,17320,17340,17360,17380,17400,17420,17440,17460,17480,17500,17520,17540,17560,17580,17600,17620,17640,17660,17680,17700,17720,17740,17760,17780,17800,17820,17840,17860,17880,17900,17920,17940,17960,17980,18000,18020,18040,18060,18080,18100,18120,18140,18160,18180,18200,18220,18240,18260,18280,18300,18320,18340,18360,18380,18400,18420,18440,18460,18480,18500,18520,18540,18560,18580,18600,18620,18640,18660,18680,18700,18720,18740,18760,18780,18800,18820,18840,18860,18880,18900,18920,18940,18960,18980,19000,19020,19040,19060,19080,19100,19120,19140,19160,19180,19200,19220,19240,19260,19280,19300,19320,19340,19360,19380,19400,19420,19440,19460,19480,19500,19520,19540,19560,19580,19600,19620,19640,19660,19680,19700,19720,19740,19760,19780,19800,19820,19840,19860,19880,19900,19920,19940,19960,19980],"target":[[0,220]]} diff --git a/doc/concept/audio-jitter/buildup.json b/doc/concept/audio-jitter/buildup.json new file mode 100644 index 00000000000..052def44fec --- /dev/null +++ b/doc/concept/audio-jitter/buildup.json @@ -0,0 +1 @@ +{"name":"buildup","about":"A queue filling at 2 ms per frame for 2 s, then holding. An inter-arrival estimator reads a hundred tiny observations; this reads the delay climbing against the fastest recent frame.","frame":20,"arrival":[50,70,90,110,130,150,170,190,210,230,250,270,290,310,330,350,370,390,410,430,450,470,490,510,530,550,570,590,610,630,650,670,690,710,730,750,770,790,810,830,850,870,890,910,930,950,970,990,1010,1030,1050,1070,1090,1110,1130,1150,1170,1190,1210,1230,1250,1270,1290,1310,1330,1350,1370,1390,1410,1430,1450,1470,1490,1510,1530,1550,1570,1590,1610,1630,1650,1670,1690,1710,1730,1750,1770,1790,1810,1830,1850,1870,1890,1910,1930,1950,1970,1990,2010,2030,2050,2070,2090,2110,2130,2150,2170,2190,2210,2230,2250,2270,2290,2310,2330,2350,2370,2390,2410,2430,2450,2470,2490,2510,2530,2550,2570,2590,2610,2630,2650,2670,2690,2710,2730,2750,2770,2790,2810,2830,2850,2870,2890,2910,2930,2950,2970,2990,3010,3030,3050,3070,3090,3110,3130,3150,3170,3190,3210,3230,3250,3270,3290,3310,3330,3350,3370,3390,3410,3430,3450,3470,3490,3510,3530,3550,3570,3590,3610,3630,3650,3670,3690,3710,3730,3750,3770,3790,3810,3830,3850,3870,3890,3910,3930,3950,3970,3990,4010,4030,4050,4070,4090,4110,4130,4150,4170,4190,4210,4230,4250,4270,4290,4310,4330,4350,4370,4390,4410,4430,4450,4470,4490,4510,4530,4550,4570,4590,4610,4630,4650,4670,4690,4710,4730,4750,4770,4790,4810,4830,4850,4870,4890,4910,4930,4950,4970,4990,5010,5030,5052,5074,5096,5118,5140,5162,5184,5206,5228,5250,5272,5294,5316,5338,5360,5382,5404,5426,5448,5470,5492,5514,5536,5558,5580,5602,5624,5646,5668,5690,5712,5734,5756,5778,5800,5822,5844,5866,5888,5910,5932,5954,5976,5998,6020,6042,6064,6086,6108,6130,6152,6174,6196,6218,6240,6262,6284,6306,6328,6350,6372,6394,6416,6438,6460,6482,6504,6526,6548,6570,6592,6614,6636,6658,6680,6702,6724,6746,6768,6790,6812,6834,6856,6878,6900,6922,6944,6966,6988,7010,7032,7054,7076,7098,7120,7142,7164,7186,7208,7230,7250,7270,7290,7310,7330,7350,7370,7390,7410,7430,7450,7470,7490,7510,7530,7550,7570,7590,7610,7630,7650,7670,7690,7710,7730,7750,7770,7790,7810,7830,7850,7870,7890,7910,7930,7950,7970,7990,8010,8030,8050,8070,8090,8110,8130,8150,8170,8190,8210,8230,8250,8270,8290,8310,8330,8350,8370,8390,8410,8430,8450,8470,8490,8510,8530,8550,8570,8590,8610,8630,8650,8670,8690,8710,8730,8750,8770,8790,8810,8830,8850,8870,8890,8910,8930,8950,8970,8990,9010,9030,9050,9070,9090,9110,9130,9150,9170,9190,9210,9230,9250,9270,9290,9310,9330,9350,9370,9390,9410,9430,9450,9470,9490,9510,9530,9550,9570,9590,9610,9630,9650,9670,9690,9710,9730,9750,9770,9790,9810,9830,9850,9870,9890,9910,9930,9950,9970,9990,10010,10030,10050,10070,10090,10110,10130,10150,10170,10190,10210,10230,10250,10270,10290,10310,10330,10350,10370,10390,10410,10430,10450,10470,10490,10510,10530,10550,10570,10590,10610,10630,10650,10670,10690,10710,10730,10750,10770,10790,10810,10830,10850,10870,10890,10910,10930,10950,10970,10990,11010,11030,11050,11070,11090,11110,11130,11150,11170,11190,11210,11230,11250,11270,11290,11310,11330,11350,11370,11390,11410,11430,11450,11470,11490,11510,11530,11550,11570,11590,11610,11630,11650,11670,11690,11710,11730,11750,11770,11790,11810,11830,11850,11870,11890,11910,11930,11950,11970,11990,12010,12030,12050,12070,12090,12110,12130,12150,12170,12190,12210,12230,12250,12270,12290,12310,12330,12350,12370,12390,12410,12430,12450,12470,12490,12510,12530,12550,12570,12590,12610,12630,12650,12670,12690,12710,12730,12750,12770,12790,12810,12830,12850,12870,12890,12910,12930,12950,12970,12990,13010,13030,13050,13070,13090,13110,13130,13150,13170,13190,13210,13230,13250,13270,13290,13310,13330,13350,13370,13390,13410,13430,13450,13470,13490,13510,13530,13550,13570,13590,13610,13630,13650,13670,13690,13710,13730,13750,13770,13790,13810,13830,13850,13870,13890,13910,13930,13950,13970,13990,14010,14030,14050,14070,14090,14110,14130,14150,14170,14190,14210,14230,14250,14270,14290,14310,14330,14350,14370,14390,14410,14430,14450,14470,14490,14510,14530,14550,14570,14590,14610,14630,14650,14670,14690,14710,14730,14750,14770,14790,14810,14830,14850,14870,14890,14910,14930,14950,14970,14990,15010,15030,15050,15070,15090,15110,15130,15150,15170,15190,15210,15230,15250,15270,15290,15310,15330,15350,15370,15390,15410,15430,15450,15470,15490,15510,15530,15550,15570,15590,15610,15630,15650,15670,15690,15710,15730,15750,15770,15790,15810,15830,15850,15870,15890,15910,15930,15950,15970,15990,16010,16030,16050,16070,16090,16110,16130,16150,16170,16190,16210,16230,16250,16270,16290,16310,16330,16350,16370,16390,16410,16430,16450,16470,16490,16510,16530,16550,16570,16590,16610,16630,16650,16670,16690,16710,16730,16750,16770,16790,16810,16830,16850,16870,16890,16910,16930,16950,16970,16990,17010,17030,17050,17070,17090,17110,17130,17150,17170,17190,17210,17230,17250,17270,17290,17310,17330,17350,17370,17390,17410,17430,17450,17470,17490,17510,17530,17550,17570,17590,17610,17630,17650,17670,17690,17710,17730,17750,17770,17790,17810,17830,17850,17870,17890,17910,17930,17950,17970,17990,18010,18030,18050,18070,18090,18110,18130,18150,18170,18190,18210,18230,18250,18270,18290,18310,18330,18350,18370,18390,18410,18430,18450,18470,18490,18510,18530,18550,18570,18590,18610,18630,18650,18670,18690,18710,18730,18750,18770,18790,18810,18830,18850,18870,18890,18910,18930,18950,18970,18990,19010,19030,19050,19070,19090,19110,19130,19150,19170,19190,19210,19230,19250,19270,19290,19310,19330,19350,19370,19390,19410,19430,19450,19470,19490,19510,19530,19550,19570,19590,19610,19630,19650,19670,19690,19710,19730,19750,19770,19790,19810,19830,19850,19870,19890,19910,19930,19950,19970,19990,20010,20030,20050,20070,20090,20110,20130,20150,20170,20190,20210,20230,20250,20270,20290,20310,20330,20350,20370,20390,20410,20430,20450,20470,20490,20510,20530,20550,20570,20590,20610,20630,20650,20670,20690,20710,20730,20750,20770,20790,20810,20830,20850,20870,20890,20910,20930,20950,20970,20990,21010,21030,21050,21070,21090,21110,21130,21150,21170,21190,21210,21230,21250,21270,21290,21310,21330,21350,21370,21390,21410,21430,21450,21470,21490,21510,21530,21550,21570,21590,21610,21630,21650,21670,21690,21710,21730,21750,21770,21790,21810,21830,21850,21870,21890,21910,21930,21950,21970,21990,22010,22030,22050,22070,22090,22110,22130,22150,22170,22190,22210,22230,22250,22270,22290,22310,22330,22350,22370,22390,22410,22430,22450,22470,22490,22510,22530,22550,22570,22590,22610,22630,22650,22670,22690,22710,22730,22750,22770,22790,22810,22830,22850,22870,22890,22910,22930,22950,22970,22990,23010,23030,23050,23070,23090,23110,23130,23150,23170,23190,23210,23230,23250,23270,23290,23310,23330,23350,23370,23390,23410,23430,23450,23470,23490,23510,23530,23550,23570,23590,23610,23630,23650,23670,23690,23710,23730,23750,23770,23790,23810,23830,23850,23870,23890,23910,23930,23950,23970,23990,24010,24030,24050,24070,24090,24110,24130,24150,24170,24190,24210,24230,24250,24270,24290,24310,24330,24350,24370,24390,24410,24430,24450,24470,24490,24510,24530,24550,24570,24590,24610,24630,24650,24670,24690,24710,24730,24750,24770,24790,24810,24830,24850,24870,24890,24910,24930,24950,24970,24990,25010,25030,25050,25070,25090,25110,25130,25150,25170,25190,25210,25230,25250,25270,25290,25310,25330,25350,25370,25390,25410,25430,25450,25470,25490,25510,25530,25550,25570,25590,25610,25630,25650,25670,25690,25710,25730,25750,25770,25790,25810,25830,25850,25870,25890,25910,25930,25950,25970,25990,26010,26030,26050,26070,26090,26110,26130,26150,26170,26190,26210,26230,26250,26270,26290,26310,26330,26350,26370,26390,26410,26430,26450,26470,26490,26510,26530,26550,26570,26590,26610,26630,26650,26670,26690,26710,26730,26750,26770,26790,26810,26830,26850,26870,26890,26910,26930,26950,26970,26990,27010,27030,27050,27070,27090,27110,27130,27150,27170,27190,27210,27230,27250,27270,27290,27310,27330,27350,27370,27390,27410,27430,27450,27470,27490,27510,27530,27550,27570,27590,27610,27630,27650,27670,27690,27710,27730,27750,27770,27790,27810,27830,27850,27870,27890,27910,27930,27950,27970,27990,28010,28030,28050,28070,28090,28110,28130,28150,28170,28190,28210,28230,28250,28270,28290,28310,28330,28350,28370,28390,28410,28430,28450,28470,28490,28510,28530,28550,28570,28590,28610,28630,28650,28670,28690,28710,28730,28750,28770,28790,28810,28830,28850,28870,28890,28910,28930,28950,28970,28990,29010,29030,29050,29070,29090,29110,29130,29150,29170,29190,29210,29230,29250,29270,29290,29310,29330,29350,29370,29390,29410,29430,29450,29470,29490,29510,29530,29550,29570,29590,29610,29630,29650,29670,29690,29710,29730,29750,29770,29790,29810,29830,29850,29870,29890,29910,29930,29950,29970,29990,30010,30030,30050,30070,30090,30110,30130,30150,30170,30190,30210,30230],"media":[0,20,40,60,80,100,120,140,160,180,200,220,240,260,280,300,320,340,360,380,400,420,440,460,480,500,520,540,560,580,600,620,640,660,680,700,720,740,760,780,800,820,840,860,880,900,920,940,960,980,1000,1020,1040,1060,1080,1100,1120,1140,1160,1180,1200,1220,1240,1260,1280,1300,1320,1340,1360,1380,1400,1420,1440,1460,1480,1500,1520,1540,1560,1580,1600,1620,1640,1660,1680,1700,1720,1740,1760,1780,1800,1820,1840,1860,1880,1900,1920,1940,1960,1980,2000,2020,2040,2060,2080,2100,2120,2140,2160,2180,2200,2220,2240,2260,2280,2300,2320,2340,2360,2380,2400,2420,2440,2460,2480,2500,2520,2540,2560,2580,2600,2620,2640,2660,2680,2700,2720,2740,2760,2780,2800,2820,2840,2860,2880,2900,2920,2940,2960,2980,3000,3020,3040,3060,3080,3100,3120,3140,3160,3180,3200,3220,3240,3260,3280,3300,3320,3340,3360,3380,3400,3420,3440,3460,3480,3500,3520,3540,3560,3580,3600,3620,3640,3660,3680,3700,3720,3740,3760,3780,3800,3820,3840,3860,3880,3900,3920,3940,3960,3980,4000,4020,4040,4060,4080,4100,4120,4140,4160,4180,4200,4220,4240,4260,4280,4300,4320,4340,4360,4380,4400,4420,4440,4460,4480,4500,4520,4540,4560,4580,4600,4620,4640,4660,4680,4700,4720,4740,4760,4780,4800,4820,4840,4860,4880,4900,4920,4940,4960,4980,5000,5020,5040,5060,5080,5100,5120,5140,5160,5180,5200,5220,5240,5260,5280,5300,5320,5340,5360,5380,5400,5420,5440,5460,5480,5500,5520,5540,5560,5580,5600,5620,5640,5660,5680,5700,5720,5740,5760,5780,5800,5820,5840,5860,5880,5900,5920,5940,5960,5980,6000,6020,6040,6060,6080,6100,6120,6140,6160,6180,6200,6220,6240,6260,6280,6300,6320,6340,6360,6380,6400,6420,6440,6460,6480,6500,6520,6540,6560,6580,6600,6620,6640,6660,6680,6700,6720,6740,6760,6780,6800,6820,6840,6860,6880,6900,6920,6940,6960,6980,7000,7020,7040,7060,7080,7100,7120,7140,7160,7180,7200,7220,7240,7260,7280,7300,7320,7340,7360,7380,7400,7420,7440,7460,7480,7500,7520,7540,7560,7580,7600,7620,7640,7660,7680,7700,7720,7740,7760,7780,7800,7820,7840,7860,7880,7900,7920,7940,7960,7980,8000,8020,8040,8060,8080,8100,8120,8140,8160,8180,8200,8220,8240,8260,8280,8300,8320,8340,8360,8380,8400,8420,8440,8460,8480,8500,8520,8540,8560,8580,8600,8620,8640,8660,8680,8700,8720,8740,8760,8780,8800,8820,8840,8860,8880,8900,8920,8940,8960,8980,9000,9020,9040,9060,9080,9100,9120,9140,9160,9180,9200,9220,9240,9260,9280,9300,9320,9340,9360,9380,9400,9420,9440,9460,9480,9500,9520,9540,9560,9580,9600,9620,9640,9660,9680,9700,9720,9740,9760,9780,9800,9820,9840,9860,9880,9900,9920,9940,9960,9980,10000,10020,10040,10060,10080,10100,10120,10140,10160,10180,10200,10220,10240,10260,10280,10300,10320,10340,10360,10380,10400,10420,10440,10460,10480,10500,10520,10540,10560,10580,10600,10620,10640,10660,10680,10700,10720,10740,10760,10780,10800,10820,10840,10860,10880,10900,10920,10940,10960,10980,11000,11020,11040,11060,11080,11100,11120,11140,11160,11180,11200,11220,11240,11260,11280,11300,11320,11340,11360,11380,11400,11420,11440,11460,11480,11500,11520,11540,11560,11580,11600,11620,11640,11660,11680,11700,11720,11740,11760,11780,11800,11820,11840,11860,11880,11900,11920,11940,11960,11980,12000,12020,12040,12060,12080,12100,12120,12140,12160,12180,12200,12220,12240,12260,12280,12300,12320,12340,12360,12380,12400,12420,12440,12460,12480,12500,12520,12540,12560,12580,12600,12620,12640,12660,12680,12700,12720,12740,12760,12780,12800,12820,12840,12860,12880,12900,12920,12940,12960,12980,13000,13020,13040,13060,13080,13100,13120,13140,13160,13180,13200,13220,13240,13260,13280,13300,13320,13340,13360,13380,13400,13420,13440,13460,13480,13500,13520,13540,13560,13580,13600,13620,13640,13660,13680,13700,13720,13740,13760,13780,13800,13820,13840,13860,13880,13900,13920,13940,13960,13980,14000,14020,14040,14060,14080,14100,14120,14140,14160,14180,14200,14220,14240,14260,14280,14300,14320,14340,14360,14380,14400,14420,14440,14460,14480,14500,14520,14540,14560,14580,14600,14620,14640,14660,14680,14700,14720,14740,14760,14780,14800,14820,14840,14860,14880,14900,14920,14940,14960,14980,15000,15020,15040,15060,15080,15100,15120,15140,15160,15180,15200,15220,15240,15260,15280,15300,15320,15340,15360,15380,15400,15420,15440,15460,15480,15500,15520,15540,15560,15580,15600,15620,15640,15660,15680,15700,15720,15740,15760,15780,15800,15820,15840,15860,15880,15900,15920,15940,15960,15980,16000,16020,16040,16060,16080,16100,16120,16140,16160,16180,16200,16220,16240,16260,16280,16300,16320,16340,16360,16380,16400,16420,16440,16460,16480,16500,16520,16540,16560,16580,16600,16620,16640,16660,16680,16700,16720,16740,16760,16780,16800,16820,16840,16860,16880,16900,16920,16940,16960,16980,17000,17020,17040,17060,17080,17100,17120,17140,17160,17180,17200,17220,17240,17260,17280,17300,17320,17340,17360,17380,17400,17420,17440,17460,17480,17500,17520,17540,17560,17580,17600,17620,17640,17660,17680,17700,17720,17740,17760,17780,17800,17820,17840,17860,17880,17900,17920,17940,17960,17980,18000,18020,18040,18060,18080,18100,18120,18140,18160,18180,18200,18220,18240,18260,18280,18300,18320,18340,18360,18380,18400,18420,18440,18460,18480,18500,18520,18540,18560,18580,18600,18620,18640,18660,18680,18700,18720,18740,18760,18780,18800,18820,18840,18860,18880,18900,18920,18940,18960,18980,19000,19020,19040,19060,19080,19100,19120,19140,19160,19180,19200,19220,19240,19260,19280,19300,19320,19340,19360,19380,19400,19420,19440,19460,19480,19500,19520,19540,19560,19580,19600,19620,19640,19660,19680,19700,19720,19740,19760,19780,19800,19820,19840,19860,19880,19900,19920,19940,19960,19980,20000,20020,20040,20060,20080,20100,20120,20140,20160,20180,20200,20220,20240,20260,20280,20300,20320,20340,20360,20380,20400,20420,20440,20460,20480,20500,20520,20540,20560,20580,20600,20620,20640,20660,20680,20700,20720,20740,20760,20780,20800,20820,20840,20860,20880,20900,20920,20940,20960,20980,21000,21020,21040,21060,21080,21100,21120,21140,21160,21180,21200,21220,21240,21260,21280,21300,21320,21340,21360,21380,21400,21420,21440,21460,21480,21500,21520,21540,21560,21580,21600,21620,21640,21660,21680,21700,21720,21740,21760,21780,21800,21820,21840,21860,21880,21900,21920,21940,21960,21980,22000,22020,22040,22060,22080,22100,22120,22140,22160,22180,22200,22220,22240,22260,22280,22300,22320,22340,22360,22380,22400,22420,22440,22460,22480,22500,22520,22540,22560,22580,22600,22620,22640,22660,22680,22700,22720,22740,22760,22780,22800,22820,22840,22860,22880,22900,22920,22940,22960,22980,23000,23020,23040,23060,23080,23100,23120,23140,23160,23180,23200,23220,23240,23260,23280,23300,23320,23340,23360,23380,23400,23420,23440,23460,23480,23500,23520,23540,23560,23580,23600,23620,23640,23660,23680,23700,23720,23740,23760,23780,23800,23820,23840,23860,23880,23900,23920,23940,23960,23980,24000,24020,24040,24060,24080,24100,24120,24140,24160,24180,24200,24220,24240,24260,24280,24300,24320,24340,24360,24380,24400,24420,24440,24460,24480,24500,24520,24540,24560,24580,24600,24620,24640,24660,24680,24700,24720,24740,24760,24780,24800,24820,24840,24860,24880,24900,24920,24940,24960,24980,25000,25020,25040,25060,25080,25100,25120,25140,25160,25180,25200,25220,25240,25260,25280,25300,25320,25340,25360,25380,25400,25420,25440,25460,25480,25500,25520,25540,25560,25580,25600,25620,25640,25660,25680,25700,25720,25740,25760,25780,25800,25820,25840,25860,25880,25900,25920,25940,25960,25980,26000,26020,26040,26060,26080,26100,26120,26140,26160,26180,26200,26220,26240,26260,26280,26300,26320,26340,26360,26380,26400,26420,26440,26460,26480,26500,26520,26540,26560,26580,26600,26620,26640,26660,26680,26700,26720,26740,26760,26780,26800,26820,26840,26860,26880,26900,26920,26940,26960,26980,27000,27020,27040,27060,27080,27100,27120,27140,27160,27180,27200,27220,27240,27260,27280,27300,27320,27340,27360,27380,27400,27420,27440,27460,27480,27500,27520,27540,27560,27580,27600,27620,27640,27660,27680,27700,27720,27740,27760,27780,27800,27820,27840,27860,27880,27900,27920,27940,27960,27980,28000,28020,28040,28060,28080,28100,28120,28140,28160,28180,28200,28220,28240,28260,28280,28300,28320,28340,28360,28380,28400,28420,28440,28460,28480,28500,28520,28540,28560,28580,28600,28620,28640,28660,28680,28700,28720,28740,28760,28780,28800,28820,28840,28860,28880,28900,28920,28940,28960,28980,29000,29020,29040,29060,29080,29100,29120,29140,29160,29180,29200,29220,29240,29260,29280,29300,29320,29340,29360,29380,29400,29420,29440,29460,29480,29500,29520,29540,29560,29580,29600,29620,29640,29660,29680,29700,29720,29740,29760,29780,29800,29820,29840,29860,29880,29900,29920,29940,29960,29980],"target":[[0,120],[25,80],[50,60],[75,40],[273,80],[296,120],[319,160],[341,220],[365,240],[590,220],[840,200],[1065,160],[1215,140],[1390,120],[1490,100]]} diff --git a/doc/concept/audio-jitter/corpus.test.ts b/doc/concept/audio-jitter/corpus.test.ts new file mode 100644 index 00000000000..dd24b2b887d --- /dev/null +++ b/doc/concept/audio-jitter/corpus.test.ts @@ -0,0 +1,52 @@ +// The corpus is data the two implementations are graded against, so the one thing this +// has to catch is the corpus drifting from the algorithm it claims to encode: a checked-in +// file edited by hand to make a failing implementation pass would otherwise go unnoticed. +// +// Grading an implementation is each language's own test suite, since neither exists yet. + +import { describe, expect, test } from "bun:test"; +import { readFileSync } from "node:fs"; +import { dirname, join } from "node:path"; +import { fileURLToPath } from "node:url"; +import { type Case, cases } from "./corpus"; + +const here = dirname(fileURLToPath(import.meta.url)); + +describe("audio jitter corpus", () => { + for (const expected of cases) { + describe(expected.name, () => { + const actual = JSON.parse(readFileSync(join(here, `${expected.name}.json`), "utf8")) as Case; + + test("matches the checked-in file", () => { + expect(actual).toEqual(expected); + }); + + test("is a trace of equal-length clocks", () => { + expect(actual.arrival.length).toBe(actual.media.length); + expect(actual.arrival.length).toBeGreaterThan(0); + }); + + test("arrives in a monotonic order", () => { + for (let i = 1; i < actual.arrival.length; i++) { + expect(actual.arrival[i]).toBeGreaterThanOrEqual(actual.arrival[i - 1]); + } + }); + + test("names a target for the first frame", () => { + expect(actual.target[0]?.[0]).toBe(0); + }); + + test("reports every target as a change", () => { + let previous: number | undefined; + let last = -1; + for (const [index, value] of actual.target) { + expect(index).toBeGreaterThan(last); + expect(index).toBeLessThan(actual.arrival.length); + expect(value).not.toBe(previous); + previous = value; + last = index; + } + }); + }); + } +}); diff --git a/doc/concept/audio-jitter/corpus.ts b/doc/concept/audio-jitter/corpus.ts new file mode 100644 index 00000000000..c9c61c521aa --- /dev/null +++ b/doc/concept/audio-jitter/corpus.ts @@ -0,0 +1,204 @@ +// Builds the conformance corpus described in /concept/audio-jitter. +// +// Run `bun doc/concept/audio-jitter/corpus.ts` to rewrite the JSON; `corpus.test.ts` +// fails when the checked-in files no longer match, so the corpus cannot be edited by +// hand to make a failing implementation pass. + +import { writeFileSync } from "node:fs"; +import { dirname, join } from "node:path"; +import { fileURLToPath } from "node:url"; +import { Estimator } from "./reference"; + +/** One arrival trace and the target series every implementation must produce from it. */ +export interface Case { + name: string; + /** What the trace is shaped like, and what it is holding the implementation to. */ + about: string; + /** The codec frame duration, in milliseconds. */ + frame: number; + /** The publisher's advertised flush span, when the catalog carries one. */ + advertised?: number; + /** An explicit target that fixes the buffer and disables adaptation. */ + delay?: number; + /** The receiver's monotonic clock per frame, in delivery order. */ + arrival: number[]; + /** Each frame's container timestamp in milliseconds, in the same order. */ + media: number[]; + /** `[frame index, target]` wherever the target differs from the previous frame's. */ + target: [number, number][]; +} + +type Trace = { arrival: number[]; media: number[] }; + +/** A sender emitting one frame per `frame` ms, every run of `run` flushed together. */ +function flushed(frames: number, frame: number, run: number, base: number): Trace { + const arrival: number[] = []; + const media: number[] = []; + for (let i = 0; i < frames; i++) { + const last = Math.floor(i / run) * run + run - 1; + arrival.push(base + last * frame); + media.push(i * frame); + } + return { arrival, media }; +} + +/** Delay every frame in `[from, from + count)` by a ramp climbing `step` ms per frame. */ +function ramp(trace: Trace, from: number, count: number, step: number): Trace { + const arrival = [...trace.arrival]; + for (let i = from; i < arrival.length; i++) { + arrival[i] += step * Math.min(i - from + 1, count); + } + return { arrival, media: trace.media }; +} + +/** Deliver every `period`-th run of `run` frames after the run that follows it. */ +function reordered(trace: Trace, run: number, period: number): Trace { + const arrival: number[] = []; + const media: number[] = []; + const runs = Math.floor(trace.media.length / run); + const order: number[] = []; + for (let r = 0; r < runs; r++) order.push(r); + for (let r = 0; r + 1 < runs; r += period) { + [order[r], order[r + 1]] = [order[r + 1], order[r]]; + } + // Arrival stays monotonic because delivery order is what the receiver sees; only + // the media timestamps come back out of order. + let now = trace.arrival[0]; + for (const r of order) { + for (let k = 0; k < run; k++) { + const i = r * run + k; + arrival.push(now); + media.push(trace.media[i]); + now += trace.arrival[1] - trace.arrival[0]; + } + } + return { arrival, media }; +} + +/** Splice a gap into both clocks, as a suspended tab or a paused publisher would. */ +function gap(trace: Trace, at: number, length: number): Trace { + const arrival = trace.arrival.map((v, i) => (i >= at ? v + length : v)); + const media = trace.media.map((v, i) => (i >= at ? v + length : v)); + return { arrival, media }; +} + +function paced(frames: number, frame: number, base: number): Trace { + return flushed(frames, frame, 1, base); +} + +/** Replay a trace through the reference and keep only the frames where the target moved. */ +function run(trace: Trace, config: { frame: number; advertised?: number; delay?: number }): [number, number][] { + if (config.delay !== undefined) return [[0, config.delay]]; + + const estimator = new Estimator({ frame: config.frame, advertised: config.advertised }); + const target: [number, number][] = []; + let previous: number | undefined; + + for (let i = 0; i < trace.arrival.length; i++) { + estimator.observe({ arrival: trace.arrival[i], media: trace.media[i] }); + const value = estimator.target; + if (value !== previous) target.push([i, value]); + previous = value; + } + + return target; +} + +const FRAME = 20; + +const traces: Omit[] = [ + { + name: "paced", + about: "A perfectly even sender for 60 s, long enough to leave the cold-start ramp. The target settles on one bucket plus one frame, which is the floor the estimator can report.", + frame: FRAME, + ...paced(3000, FRAME, 50), + }, + { + name: "flush", + about: "A sender flushing 100 ms of media at a time, then 200 ms from halfway. The measured term follows the flush span less one frame, which is what the round-trip formula could not see.", + frame: FRAME, + ...(() => { + const first = flushed(500, FRAME, 5, 50); + const second = flushed(500, FRAME, 10, 50); + const offset = 500 * FRAME; + return { + arrival: [...first.arrival, ...second.arrival.map((v) => v + offset)], + media: [...first.media, ...second.media.map((v) => v + offset)], + }; + })(), + }, + { + name: "advertised", + about: "The same even sender as `paced`, with a publisher advertising a 200 ms flush span. The advertised value is a floor on the measured term, not an addition to it, so the target holds there instead of converging down.", + frame: FRAME, + advertised: 200, + ...paced(1000, FRAME, 50), + }, + { + name: "buildup", + about: "A queue filling at 2 ms per frame for 2 s, then holding. An inter-arrival estimator reads a hundred tiny observations; this reads the delay climbing against the fastest recent frame.", + frame: FRAME, + ...ramp(paced(1500, FRAME, 50), 250, 100, 2), + }, + { + name: "reorder", + about: "Every other run of five frames delivered after the run that follows it. The media-time gap between the runs must not land in the delay measurement.", + frame: FRAME, + ...reordered(paced(1000, FRAME, 50), 5, 2), + }, + { + name: "idle", + about: "A 30 s gap in both clocks, as a suspended tab produces. The idle intervals relax the histogram back toward the prior rather than freezing it.", + frame: FRAME, + ...gap(paced(1000, FRAME, 50), 500, 30_000), + }, + { + name: "tunein", + about: "One frame from a stale group, then the live edge 14.5 s later, then 30 s of even audio. The #3517 branch reported 14.56 s here; the target must stay near the frame duration.", + frame: FRAME, + arrival: [ + 0, + 10, + ...paced(1500, FRAME, 10) + .arrival.slice(1) + .map((v) => v), + ], + media: [ + 0, + 14_500, + ...paced(1500, FRAME, 10) + .media.slice(1) + .map((v) => v + 14_500), + ], + }, + { + name: "spike", + about: "A 300 ms stall every 5 s for the first 10 s, then 30 s of clean arrivals. The target rises to cover the stalls, then decays at the forget factor once they stop.", + frame: FRAME, + ...(() => { + const trace = paced(2000, FRAME, 50); + const arrival = [...trace.arrival]; + for (let start = 250; start <= 500; start += 250) { + for (let i = start; i < start + 15; i++) arrival[i] = arrival[start + 14]; + } + return { arrival, media: trace.media }; + })(), + }, + { + name: "fixed", + about: "An explicit 250 ms target over the bursty trace. Adaptation is off: the target is what was asked for, whatever the arrivals say.", + frame: FRAME, + delay: 250, + ...flushed(500, FRAME, 5, 50), + }, +]; + +export const cases: Case[] = traces.map((trace) => ({ ...trace, target: run(trace, trace) })); + +if (import.meta.main) { + const here = dirname(fileURLToPath(import.meta.url)); + for (const entry of cases) { + writeFileSync(join(here, `${entry.name}.json`), `${JSON.stringify(entry)}\n`); + } + console.log(`wrote ${cases.length} cases`); +} diff --git a/doc/concept/audio-jitter/fixed.json b/doc/concept/audio-jitter/fixed.json new file mode 100644 index 00000000000..2c1309b6322 --- /dev/null +++ b/doc/concept/audio-jitter/fixed.json @@ -0,0 +1 @@ +{"name":"fixed","about":"An explicit 250 ms target over the bursty trace. Adaptation is off: the target is what was asked for, whatever the arrivals say.","frame":20,"delay":250,"arrival":[130,130,130,130,130,230,230,230,230,230,330,330,330,330,330,430,430,430,430,430,530,530,530,530,530,630,630,630,630,630,730,730,730,730,730,830,830,830,830,830,930,930,930,930,930,1030,1030,1030,1030,1030,1130,1130,1130,1130,1130,1230,1230,1230,1230,1230,1330,1330,1330,1330,1330,1430,1430,1430,1430,1430,1530,1530,1530,1530,1530,1630,1630,1630,1630,1630,1730,1730,1730,1730,1730,1830,1830,1830,1830,1830,1930,1930,1930,1930,1930,2030,2030,2030,2030,2030,2130,2130,2130,2130,2130,2230,2230,2230,2230,2230,2330,2330,2330,2330,2330,2430,2430,2430,2430,2430,2530,2530,2530,2530,2530,2630,2630,2630,2630,2630,2730,2730,2730,2730,2730,2830,2830,2830,2830,2830,2930,2930,2930,2930,2930,3030,3030,3030,3030,3030,3130,3130,3130,3130,3130,3230,3230,3230,3230,3230,3330,3330,3330,3330,3330,3430,3430,3430,3430,3430,3530,3530,3530,3530,3530,3630,3630,3630,3630,3630,3730,3730,3730,3730,3730,3830,3830,3830,3830,3830,3930,3930,3930,3930,3930,4030,4030,4030,4030,4030,4130,4130,4130,4130,4130,4230,4230,4230,4230,4230,4330,4330,4330,4330,4330,4430,4430,4430,4430,4430,4530,4530,4530,4530,4530,4630,4630,4630,4630,4630,4730,4730,4730,4730,4730,4830,4830,4830,4830,4830,4930,4930,4930,4930,4930,5030,5030,5030,5030,5030,5130,5130,5130,5130,5130,5230,5230,5230,5230,5230,5330,5330,5330,5330,5330,5430,5430,5430,5430,5430,5530,5530,5530,5530,5530,5630,5630,5630,5630,5630,5730,5730,5730,5730,5730,5830,5830,5830,5830,5830,5930,5930,5930,5930,5930,6030,6030,6030,6030,6030,6130,6130,6130,6130,6130,6230,6230,6230,6230,6230,6330,6330,6330,6330,6330,6430,6430,6430,6430,6430,6530,6530,6530,6530,6530,6630,6630,6630,6630,6630,6730,6730,6730,6730,6730,6830,6830,6830,6830,6830,6930,6930,6930,6930,6930,7030,7030,7030,7030,7030,7130,7130,7130,7130,7130,7230,7230,7230,7230,7230,7330,7330,7330,7330,7330,7430,7430,7430,7430,7430,7530,7530,7530,7530,7530,7630,7630,7630,7630,7630,7730,7730,7730,7730,7730,7830,7830,7830,7830,7830,7930,7930,7930,7930,7930,8030,8030,8030,8030,8030,8130,8130,8130,8130,8130,8230,8230,8230,8230,8230,8330,8330,8330,8330,8330,8430,8430,8430,8430,8430,8530,8530,8530,8530,8530,8630,8630,8630,8630,8630,8730,8730,8730,8730,8730,8830,8830,8830,8830,8830,8930,8930,8930,8930,8930,9030,9030,9030,9030,9030,9130,9130,9130,9130,9130,9230,9230,9230,9230,9230,9330,9330,9330,9330,9330,9430,9430,9430,9430,9430,9530,9530,9530,9530,9530,9630,9630,9630,9630,9630,9730,9730,9730,9730,9730,9830,9830,9830,9830,9830,9930,9930,9930,9930,9930,10030,10030,10030,10030,10030],"media":[0,20,40,60,80,100,120,140,160,180,200,220,240,260,280,300,320,340,360,380,400,420,440,460,480,500,520,540,560,580,600,620,640,660,680,700,720,740,760,780,800,820,840,860,880,900,920,940,960,980,1000,1020,1040,1060,1080,1100,1120,1140,1160,1180,1200,1220,1240,1260,1280,1300,1320,1340,1360,1380,1400,1420,1440,1460,1480,1500,1520,1540,1560,1580,1600,1620,1640,1660,1680,1700,1720,1740,1760,1780,1800,1820,1840,1860,1880,1900,1920,1940,1960,1980,2000,2020,2040,2060,2080,2100,2120,2140,2160,2180,2200,2220,2240,2260,2280,2300,2320,2340,2360,2380,2400,2420,2440,2460,2480,2500,2520,2540,2560,2580,2600,2620,2640,2660,2680,2700,2720,2740,2760,2780,2800,2820,2840,2860,2880,2900,2920,2940,2960,2980,3000,3020,3040,3060,3080,3100,3120,3140,3160,3180,3200,3220,3240,3260,3280,3300,3320,3340,3360,3380,3400,3420,3440,3460,3480,3500,3520,3540,3560,3580,3600,3620,3640,3660,3680,3700,3720,3740,3760,3780,3800,3820,3840,3860,3880,3900,3920,3940,3960,3980,4000,4020,4040,4060,4080,4100,4120,4140,4160,4180,4200,4220,4240,4260,4280,4300,4320,4340,4360,4380,4400,4420,4440,4460,4480,4500,4520,4540,4560,4580,4600,4620,4640,4660,4680,4700,4720,4740,4760,4780,4800,4820,4840,4860,4880,4900,4920,4940,4960,4980,5000,5020,5040,5060,5080,5100,5120,5140,5160,5180,5200,5220,5240,5260,5280,5300,5320,5340,5360,5380,5400,5420,5440,5460,5480,5500,5520,5540,5560,5580,5600,5620,5640,5660,5680,5700,5720,5740,5760,5780,5800,5820,5840,5860,5880,5900,5920,5940,5960,5980,6000,6020,6040,6060,6080,6100,6120,6140,6160,6180,6200,6220,6240,6260,6280,6300,6320,6340,6360,6380,6400,6420,6440,6460,6480,6500,6520,6540,6560,6580,6600,6620,6640,6660,6680,6700,6720,6740,6760,6780,6800,6820,6840,6860,6880,6900,6920,6940,6960,6980,7000,7020,7040,7060,7080,7100,7120,7140,7160,7180,7200,7220,7240,7260,7280,7300,7320,7340,7360,7380,7400,7420,7440,7460,7480,7500,7520,7540,7560,7580,7600,7620,7640,7660,7680,7700,7720,7740,7760,7780,7800,7820,7840,7860,7880,7900,7920,7940,7960,7980,8000,8020,8040,8060,8080,8100,8120,8140,8160,8180,8200,8220,8240,8260,8280,8300,8320,8340,8360,8380,8400,8420,8440,8460,8480,8500,8520,8540,8560,8580,8600,8620,8640,8660,8680,8700,8720,8740,8760,8780,8800,8820,8840,8860,8880,8900,8920,8940,8960,8980,9000,9020,9040,9060,9080,9100,9120,9140,9160,9180,9200,9220,9240,9260,9280,9300,9320,9340,9360,9380,9400,9420,9440,9460,9480,9500,9520,9540,9560,9580,9600,9620,9640,9660,9680,9700,9720,9740,9760,9780,9800,9820,9840,9860,9880,9900,9920,9940,9960,9980],"target":[[0,250]]} diff --git a/doc/concept/audio-jitter/flush.json b/doc/concept/audio-jitter/flush.json new file mode 100644 index 00000000000..3acadec61d7 --- /dev/null +++ b/doc/concept/audio-jitter/flush.json @@ -0,0 +1 @@ +{"name":"flush","about":"A sender flushing 100 ms of media at a time, then 200 ms from halfway. The measured term follows the flush span less one frame, which is what the round-trip formula could not see.","frame":20,"arrival":[130,130,130,130,130,230,230,230,230,230,330,330,330,330,330,430,430,430,430,430,530,530,530,530,530,630,630,630,630,630,730,730,730,730,730,830,830,830,830,830,930,930,930,930,930,1030,1030,1030,1030,1030,1130,1130,1130,1130,1130,1230,1230,1230,1230,1230,1330,1330,1330,1330,1330,1430,1430,1430,1430,1430,1530,1530,1530,1530,1530,1630,1630,1630,1630,1630,1730,1730,1730,1730,1730,1830,1830,1830,1830,1830,1930,1930,1930,1930,1930,2030,2030,2030,2030,2030,2130,2130,2130,2130,2130,2230,2230,2230,2230,2230,2330,2330,2330,2330,2330,2430,2430,2430,2430,2430,2530,2530,2530,2530,2530,2630,2630,2630,2630,2630,2730,2730,2730,2730,2730,2830,2830,2830,2830,2830,2930,2930,2930,2930,2930,3030,3030,3030,3030,3030,3130,3130,3130,3130,3130,3230,3230,3230,3230,3230,3330,3330,3330,3330,3330,3430,3430,3430,3430,3430,3530,3530,3530,3530,3530,3630,3630,3630,3630,3630,3730,3730,3730,3730,3730,3830,3830,3830,3830,3830,3930,3930,3930,3930,3930,4030,4030,4030,4030,4030,4130,4130,4130,4130,4130,4230,4230,4230,4230,4230,4330,4330,4330,4330,4330,4430,4430,4430,4430,4430,4530,4530,4530,4530,4530,4630,4630,4630,4630,4630,4730,4730,4730,4730,4730,4830,4830,4830,4830,4830,4930,4930,4930,4930,4930,5030,5030,5030,5030,5030,5130,5130,5130,5130,5130,5230,5230,5230,5230,5230,5330,5330,5330,5330,5330,5430,5430,5430,5430,5430,5530,5530,5530,5530,5530,5630,5630,5630,5630,5630,5730,5730,5730,5730,5730,5830,5830,5830,5830,5830,5930,5930,5930,5930,5930,6030,6030,6030,6030,6030,6130,6130,6130,6130,6130,6230,6230,6230,6230,6230,6330,6330,6330,6330,6330,6430,6430,6430,6430,6430,6530,6530,6530,6530,6530,6630,6630,6630,6630,6630,6730,6730,6730,6730,6730,6830,6830,6830,6830,6830,6930,6930,6930,6930,6930,7030,7030,7030,7030,7030,7130,7130,7130,7130,7130,7230,7230,7230,7230,7230,7330,7330,7330,7330,7330,7430,7430,7430,7430,7430,7530,7530,7530,7530,7530,7630,7630,7630,7630,7630,7730,7730,7730,7730,7730,7830,7830,7830,7830,7830,7930,7930,7930,7930,7930,8030,8030,8030,8030,8030,8130,8130,8130,8130,8130,8230,8230,8230,8230,8230,8330,8330,8330,8330,8330,8430,8430,8430,8430,8430,8530,8530,8530,8530,8530,8630,8630,8630,8630,8630,8730,8730,8730,8730,8730,8830,8830,8830,8830,8830,8930,8930,8930,8930,8930,9030,9030,9030,9030,9030,9130,9130,9130,9130,9130,9230,9230,9230,9230,9230,9330,9330,9330,9330,9330,9430,9430,9430,9430,9430,9530,9530,9530,9530,9530,9630,9630,9630,9630,9630,9730,9730,9730,9730,9730,9830,9830,9830,9830,9830,9930,9930,9930,9930,9930,10030,10030,10030,10030,10030,10230,10230,10230,10230,10230,10230,10230,10230,10230,10230,10430,10430,10430,10430,10430,10430,10430,10430,10430,10430,10630,10630,10630,10630,10630,10630,10630,10630,10630,10630,10830,10830,10830,10830,10830,10830,10830,10830,10830,10830,11030,11030,11030,11030,11030,11030,11030,11030,11030,11030,11230,11230,11230,11230,11230,11230,11230,11230,11230,11230,11430,11430,11430,11430,11430,11430,11430,11430,11430,11430,11630,11630,11630,11630,11630,11630,11630,11630,11630,11630,11830,11830,11830,11830,11830,11830,11830,11830,11830,11830,12030,12030,12030,12030,12030,12030,12030,12030,12030,12030,12230,12230,12230,12230,12230,12230,12230,12230,12230,12230,12430,12430,12430,12430,12430,12430,12430,12430,12430,12430,12630,12630,12630,12630,12630,12630,12630,12630,12630,12630,12830,12830,12830,12830,12830,12830,12830,12830,12830,12830,13030,13030,13030,13030,13030,13030,13030,13030,13030,13030,13230,13230,13230,13230,13230,13230,13230,13230,13230,13230,13430,13430,13430,13430,13430,13430,13430,13430,13430,13430,13630,13630,13630,13630,13630,13630,13630,13630,13630,13630,13830,13830,13830,13830,13830,13830,13830,13830,13830,13830,14030,14030,14030,14030,14030,14030,14030,14030,14030,14030,14230,14230,14230,14230,14230,14230,14230,14230,14230,14230,14430,14430,14430,14430,14430,14430,14430,14430,14430,14430,14630,14630,14630,14630,14630,14630,14630,14630,14630,14630,14830,14830,14830,14830,14830,14830,14830,14830,14830,14830,15030,15030,15030,15030,15030,15030,15030,15030,15030,15030,15230,15230,15230,15230,15230,15230,15230,15230,15230,15230,15430,15430,15430,15430,15430,15430,15430,15430,15430,15430,15630,15630,15630,15630,15630,15630,15630,15630,15630,15630,15830,15830,15830,15830,15830,15830,15830,15830,15830,15830,16030,16030,16030,16030,16030,16030,16030,16030,16030,16030,16230,16230,16230,16230,16230,16230,16230,16230,16230,16230,16430,16430,16430,16430,16430,16430,16430,16430,16430,16430,16630,16630,16630,16630,16630,16630,16630,16630,16630,16630,16830,16830,16830,16830,16830,16830,16830,16830,16830,16830,17030,17030,17030,17030,17030,17030,17030,17030,17030,17030,17230,17230,17230,17230,17230,17230,17230,17230,17230,17230,17430,17430,17430,17430,17430,17430,17430,17430,17430,17430,17630,17630,17630,17630,17630,17630,17630,17630,17630,17630,17830,17830,17830,17830,17830,17830,17830,17830,17830,17830,18030,18030,18030,18030,18030,18030,18030,18030,18030,18030,18230,18230,18230,18230,18230,18230,18230,18230,18230,18230,18430,18430,18430,18430,18430,18430,18430,18430,18430,18430,18630,18630,18630,18630,18630,18630,18630,18630,18630,18630,18830,18830,18830,18830,18830,18830,18830,18830,18830,18830,19030,19030,19030,19030,19030,19030,19030,19030,19030,19030,19230,19230,19230,19230,19230,19230,19230,19230,19230,19230,19430,19430,19430,19430,19430,19430,19430,19430,19430,19430,19630,19630,19630,19630,19630,19630,19630,19630,19630,19630,19830,19830,19830,19830,19830,19830,19830,19830,19830,19830,20030,20030,20030,20030,20030,20030,20030,20030,20030,20030],"media":[0,20,40,60,80,100,120,140,160,180,200,220,240,260,280,300,320,340,360,380,400,420,440,460,480,500,520,540,560,580,600,620,640,660,680,700,720,740,760,780,800,820,840,860,880,900,920,940,960,980,1000,1020,1040,1060,1080,1100,1120,1140,1160,1180,1200,1220,1240,1260,1280,1300,1320,1340,1360,1380,1400,1420,1440,1460,1480,1500,1520,1540,1560,1580,1600,1620,1640,1660,1680,1700,1720,1740,1760,1780,1800,1820,1840,1860,1880,1900,1920,1940,1960,1980,2000,2020,2040,2060,2080,2100,2120,2140,2160,2180,2200,2220,2240,2260,2280,2300,2320,2340,2360,2380,2400,2420,2440,2460,2480,2500,2520,2540,2560,2580,2600,2620,2640,2660,2680,2700,2720,2740,2760,2780,2800,2820,2840,2860,2880,2900,2920,2940,2960,2980,3000,3020,3040,3060,3080,3100,3120,3140,3160,3180,3200,3220,3240,3260,3280,3300,3320,3340,3360,3380,3400,3420,3440,3460,3480,3500,3520,3540,3560,3580,3600,3620,3640,3660,3680,3700,3720,3740,3760,3780,3800,3820,3840,3860,3880,3900,3920,3940,3960,3980,4000,4020,4040,4060,4080,4100,4120,4140,4160,4180,4200,4220,4240,4260,4280,4300,4320,4340,4360,4380,4400,4420,4440,4460,4480,4500,4520,4540,4560,4580,4600,4620,4640,4660,4680,4700,4720,4740,4760,4780,4800,4820,4840,4860,4880,4900,4920,4940,4960,4980,5000,5020,5040,5060,5080,5100,5120,5140,5160,5180,5200,5220,5240,5260,5280,5300,5320,5340,5360,5380,5400,5420,5440,5460,5480,5500,5520,5540,5560,5580,5600,5620,5640,5660,5680,5700,5720,5740,5760,5780,5800,5820,5840,5860,5880,5900,5920,5940,5960,5980,6000,6020,6040,6060,6080,6100,6120,6140,6160,6180,6200,6220,6240,6260,6280,6300,6320,6340,6360,6380,6400,6420,6440,6460,6480,6500,6520,6540,6560,6580,6600,6620,6640,6660,6680,6700,6720,6740,6760,6780,6800,6820,6840,6860,6880,6900,6920,6940,6960,6980,7000,7020,7040,7060,7080,7100,7120,7140,7160,7180,7200,7220,7240,7260,7280,7300,7320,7340,7360,7380,7400,7420,7440,7460,7480,7500,7520,7540,7560,7580,7600,7620,7640,7660,7680,7700,7720,7740,7760,7780,7800,7820,7840,7860,7880,7900,7920,7940,7960,7980,8000,8020,8040,8060,8080,8100,8120,8140,8160,8180,8200,8220,8240,8260,8280,8300,8320,8340,8360,8380,8400,8420,8440,8460,8480,8500,8520,8540,8560,8580,8600,8620,8640,8660,8680,8700,8720,8740,8760,8780,8800,8820,8840,8860,8880,8900,8920,8940,8960,8980,9000,9020,9040,9060,9080,9100,9120,9140,9160,9180,9200,9220,9240,9260,9280,9300,9320,9340,9360,9380,9400,9420,9440,9460,9480,9500,9520,9540,9560,9580,9600,9620,9640,9660,9680,9700,9720,9740,9760,9780,9800,9820,9840,9860,9880,9900,9920,9940,9960,9980,10000,10020,10040,10060,10080,10100,10120,10140,10160,10180,10200,10220,10240,10260,10280,10300,10320,10340,10360,10380,10400,10420,10440,10460,10480,10500,10520,10540,10560,10580,10600,10620,10640,10660,10680,10700,10720,10740,10760,10780,10800,10820,10840,10860,10880,10900,10920,10940,10960,10980,11000,11020,11040,11060,11080,11100,11120,11140,11160,11180,11200,11220,11240,11260,11280,11300,11320,11340,11360,11380,11400,11420,11440,11460,11480,11500,11520,11540,11560,11580,11600,11620,11640,11660,11680,11700,11720,11740,11760,11780,11800,11820,11840,11860,11880,11900,11920,11940,11960,11980,12000,12020,12040,12060,12080,12100,12120,12140,12160,12180,12200,12220,12240,12260,12280,12300,12320,12340,12360,12380,12400,12420,12440,12460,12480,12500,12520,12540,12560,12580,12600,12620,12640,12660,12680,12700,12720,12740,12760,12780,12800,12820,12840,12860,12880,12900,12920,12940,12960,12980,13000,13020,13040,13060,13080,13100,13120,13140,13160,13180,13200,13220,13240,13260,13280,13300,13320,13340,13360,13380,13400,13420,13440,13460,13480,13500,13520,13540,13560,13580,13600,13620,13640,13660,13680,13700,13720,13740,13760,13780,13800,13820,13840,13860,13880,13900,13920,13940,13960,13980,14000,14020,14040,14060,14080,14100,14120,14140,14160,14180,14200,14220,14240,14260,14280,14300,14320,14340,14360,14380,14400,14420,14440,14460,14480,14500,14520,14540,14560,14580,14600,14620,14640,14660,14680,14700,14720,14740,14760,14780,14800,14820,14840,14860,14880,14900,14920,14940,14960,14980,15000,15020,15040,15060,15080,15100,15120,15140,15160,15180,15200,15220,15240,15260,15280,15300,15320,15340,15360,15380,15400,15420,15440,15460,15480,15500,15520,15540,15560,15580,15600,15620,15640,15660,15680,15700,15720,15740,15760,15780,15800,15820,15840,15860,15880,15900,15920,15940,15960,15980,16000,16020,16040,16060,16080,16100,16120,16140,16160,16180,16200,16220,16240,16260,16280,16300,16320,16340,16360,16380,16400,16420,16440,16460,16480,16500,16520,16540,16560,16580,16600,16620,16640,16660,16680,16700,16720,16740,16760,16780,16800,16820,16840,16860,16880,16900,16920,16940,16960,16980,17000,17020,17040,17060,17080,17100,17120,17140,17160,17180,17200,17220,17240,17260,17280,17300,17320,17340,17360,17380,17400,17420,17440,17460,17480,17500,17520,17540,17560,17580,17600,17620,17640,17660,17680,17700,17720,17740,17760,17780,17800,17820,17840,17860,17880,17900,17920,17940,17960,17980,18000,18020,18040,18060,18080,18100,18120,18140,18160,18180,18200,18220,18240,18260,18280,18300,18320,18340,18360,18380,18400,18420,18440,18460,18480,18500,18520,18540,18560,18580,18600,18620,18640,18660,18680,18700,18720,18740,18760,18780,18800,18820,18840,18860,18880,18900,18920,18940,18960,18980,19000,19020,19040,19060,19080,19100,19120,19140,19160,19180,19200,19220,19240,19260,19280,19300,19320,19340,19360,19380,19400,19420,19440,19460,19480,19500,19520,19540,19560,19580,19600,19620,19640,19660,19680,19700,19720,19740,19760,19780,19800,19820,19840,19860,19880,19900,19920,19940,19960,19980],"target":[[0,120],[520,220]]} diff --git a/doc/concept/audio-jitter/idle.json b/doc/concept/audio-jitter/idle.json new file mode 100644 index 00000000000..40b04fe9fd7 --- /dev/null +++ b/doc/concept/audio-jitter/idle.json @@ -0,0 +1 @@ +{"name":"idle","about":"A 30 s gap in both clocks, as a suspended tab produces. The idle intervals relax the histogram back toward the prior rather than freezing it.","frame":20,"arrival":[50,70,90,110,130,150,170,190,210,230,250,270,290,310,330,350,370,390,410,430,450,470,490,510,530,550,570,590,610,630,650,670,690,710,730,750,770,790,810,830,850,870,890,910,930,950,970,990,1010,1030,1050,1070,1090,1110,1130,1150,1170,1190,1210,1230,1250,1270,1290,1310,1330,1350,1370,1390,1410,1430,1450,1470,1490,1510,1530,1550,1570,1590,1610,1630,1650,1670,1690,1710,1730,1750,1770,1790,1810,1830,1850,1870,1890,1910,1930,1950,1970,1990,2010,2030,2050,2070,2090,2110,2130,2150,2170,2190,2210,2230,2250,2270,2290,2310,2330,2350,2370,2390,2410,2430,2450,2470,2490,2510,2530,2550,2570,2590,2610,2630,2650,2670,2690,2710,2730,2750,2770,2790,2810,2830,2850,2870,2890,2910,2930,2950,2970,2990,3010,3030,3050,3070,3090,3110,3130,3150,3170,3190,3210,3230,3250,3270,3290,3310,3330,3350,3370,3390,3410,3430,3450,3470,3490,3510,3530,3550,3570,3590,3610,3630,3650,3670,3690,3710,3730,3750,3770,3790,3810,3830,3850,3870,3890,3910,3930,3950,3970,3990,4010,4030,4050,4070,4090,4110,4130,4150,4170,4190,4210,4230,4250,4270,4290,4310,4330,4350,4370,4390,4410,4430,4450,4470,4490,4510,4530,4550,4570,4590,4610,4630,4650,4670,4690,4710,4730,4750,4770,4790,4810,4830,4850,4870,4890,4910,4930,4950,4970,4990,5010,5030,5050,5070,5090,5110,5130,5150,5170,5190,5210,5230,5250,5270,5290,5310,5330,5350,5370,5390,5410,5430,5450,5470,5490,5510,5530,5550,5570,5590,5610,5630,5650,5670,5690,5710,5730,5750,5770,5790,5810,5830,5850,5870,5890,5910,5930,5950,5970,5990,6010,6030,6050,6070,6090,6110,6130,6150,6170,6190,6210,6230,6250,6270,6290,6310,6330,6350,6370,6390,6410,6430,6450,6470,6490,6510,6530,6550,6570,6590,6610,6630,6650,6670,6690,6710,6730,6750,6770,6790,6810,6830,6850,6870,6890,6910,6930,6950,6970,6990,7010,7030,7050,7070,7090,7110,7130,7150,7170,7190,7210,7230,7250,7270,7290,7310,7330,7350,7370,7390,7410,7430,7450,7470,7490,7510,7530,7550,7570,7590,7610,7630,7650,7670,7690,7710,7730,7750,7770,7790,7810,7830,7850,7870,7890,7910,7930,7950,7970,7990,8010,8030,8050,8070,8090,8110,8130,8150,8170,8190,8210,8230,8250,8270,8290,8310,8330,8350,8370,8390,8410,8430,8450,8470,8490,8510,8530,8550,8570,8590,8610,8630,8650,8670,8690,8710,8730,8750,8770,8790,8810,8830,8850,8870,8890,8910,8930,8950,8970,8990,9010,9030,9050,9070,9090,9110,9130,9150,9170,9190,9210,9230,9250,9270,9290,9310,9330,9350,9370,9390,9410,9430,9450,9470,9490,9510,9530,9550,9570,9590,9610,9630,9650,9670,9690,9710,9730,9750,9770,9790,9810,9830,9850,9870,9890,9910,9930,9950,9970,9990,10010,10030,40050,40070,40090,40110,40130,40150,40170,40190,40210,40230,40250,40270,40290,40310,40330,40350,40370,40390,40410,40430,40450,40470,40490,40510,40530,40550,40570,40590,40610,40630,40650,40670,40690,40710,40730,40750,40770,40790,40810,40830,40850,40870,40890,40910,40930,40950,40970,40990,41010,41030,41050,41070,41090,41110,41130,41150,41170,41190,41210,41230,41250,41270,41290,41310,41330,41350,41370,41390,41410,41430,41450,41470,41490,41510,41530,41550,41570,41590,41610,41630,41650,41670,41690,41710,41730,41750,41770,41790,41810,41830,41850,41870,41890,41910,41930,41950,41970,41990,42010,42030,42050,42070,42090,42110,42130,42150,42170,42190,42210,42230,42250,42270,42290,42310,42330,42350,42370,42390,42410,42430,42450,42470,42490,42510,42530,42550,42570,42590,42610,42630,42650,42670,42690,42710,42730,42750,42770,42790,42810,42830,42850,42870,42890,42910,42930,42950,42970,42990,43010,43030,43050,43070,43090,43110,43130,43150,43170,43190,43210,43230,43250,43270,43290,43310,43330,43350,43370,43390,43410,43430,43450,43470,43490,43510,43530,43550,43570,43590,43610,43630,43650,43670,43690,43710,43730,43750,43770,43790,43810,43830,43850,43870,43890,43910,43930,43950,43970,43990,44010,44030,44050,44070,44090,44110,44130,44150,44170,44190,44210,44230,44250,44270,44290,44310,44330,44350,44370,44390,44410,44430,44450,44470,44490,44510,44530,44550,44570,44590,44610,44630,44650,44670,44690,44710,44730,44750,44770,44790,44810,44830,44850,44870,44890,44910,44930,44950,44970,44990,45010,45030,45050,45070,45090,45110,45130,45150,45170,45190,45210,45230,45250,45270,45290,45310,45330,45350,45370,45390,45410,45430,45450,45470,45490,45510,45530,45550,45570,45590,45610,45630,45650,45670,45690,45710,45730,45750,45770,45790,45810,45830,45850,45870,45890,45910,45930,45950,45970,45990,46010,46030,46050,46070,46090,46110,46130,46150,46170,46190,46210,46230,46250,46270,46290,46310,46330,46350,46370,46390,46410,46430,46450,46470,46490,46510,46530,46550,46570,46590,46610,46630,46650,46670,46690,46710,46730,46750,46770,46790,46810,46830,46850,46870,46890,46910,46930,46950,46970,46990,47010,47030,47050,47070,47090,47110,47130,47150,47170,47190,47210,47230,47250,47270,47290,47310,47330,47350,47370,47390,47410,47430,47450,47470,47490,47510,47530,47550,47570,47590,47610,47630,47650,47670,47690,47710,47730,47750,47770,47790,47810,47830,47850,47870,47890,47910,47930,47950,47970,47990,48010,48030,48050,48070,48090,48110,48130,48150,48170,48190,48210,48230,48250,48270,48290,48310,48330,48350,48370,48390,48410,48430,48450,48470,48490,48510,48530,48550,48570,48590,48610,48630,48650,48670,48690,48710,48730,48750,48770,48790,48810,48830,48850,48870,48890,48910,48930,48950,48970,48990,49010,49030,49050,49070,49090,49110,49130,49150,49170,49190,49210,49230,49250,49270,49290,49310,49330,49350,49370,49390,49410,49430,49450,49470,49490,49510,49530,49550,49570,49590,49610,49630,49650,49670,49690,49710,49730,49750,49770,49790,49810,49830,49850,49870,49890,49910,49930,49950,49970,49990,50010,50030],"media":[0,20,40,60,80,100,120,140,160,180,200,220,240,260,280,300,320,340,360,380,400,420,440,460,480,500,520,540,560,580,600,620,640,660,680,700,720,740,760,780,800,820,840,860,880,900,920,940,960,980,1000,1020,1040,1060,1080,1100,1120,1140,1160,1180,1200,1220,1240,1260,1280,1300,1320,1340,1360,1380,1400,1420,1440,1460,1480,1500,1520,1540,1560,1580,1600,1620,1640,1660,1680,1700,1720,1740,1760,1780,1800,1820,1840,1860,1880,1900,1920,1940,1960,1980,2000,2020,2040,2060,2080,2100,2120,2140,2160,2180,2200,2220,2240,2260,2280,2300,2320,2340,2360,2380,2400,2420,2440,2460,2480,2500,2520,2540,2560,2580,2600,2620,2640,2660,2680,2700,2720,2740,2760,2780,2800,2820,2840,2860,2880,2900,2920,2940,2960,2980,3000,3020,3040,3060,3080,3100,3120,3140,3160,3180,3200,3220,3240,3260,3280,3300,3320,3340,3360,3380,3400,3420,3440,3460,3480,3500,3520,3540,3560,3580,3600,3620,3640,3660,3680,3700,3720,3740,3760,3780,3800,3820,3840,3860,3880,3900,3920,3940,3960,3980,4000,4020,4040,4060,4080,4100,4120,4140,4160,4180,4200,4220,4240,4260,4280,4300,4320,4340,4360,4380,4400,4420,4440,4460,4480,4500,4520,4540,4560,4580,4600,4620,4640,4660,4680,4700,4720,4740,4760,4780,4800,4820,4840,4860,4880,4900,4920,4940,4960,4980,5000,5020,5040,5060,5080,5100,5120,5140,5160,5180,5200,5220,5240,5260,5280,5300,5320,5340,5360,5380,5400,5420,5440,5460,5480,5500,5520,5540,5560,5580,5600,5620,5640,5660,5680,5700,5720,5740,5760,5780,5800,5820,5840,5860,5880,5900,5920,5940,5960,5980,6000,6020,6040,6060,6080,6100,6120,6140,6160,6180,6200,6220,6240,6260,6280,6300,6320,6340,6360,6380,6400,6420,6440,6460,6480,6500,6520,6540,6560,6580,6600,6620,6640,6660,6680,6700,6720,6740,6760,6780,6800,6820,6840,6860,6880,6900,6920,6940,6960,6980,7000,7020,7040,7060,7080,7100,7120,7140,7160,7180,7200,7220,7240,7260,7280,7300,7320,7340,7360,7380,7400,7420,7440,7460,7480,7500,7520,7540,7560,7580,7600,7620,7640,7660,7680,7700,7720,7740,7760,7780,7800,7820,7840,7860,7880,7900,7920,7940,7960,7980,8000,8020,8040,8060,8080,8100,8120,8140,8160,8180,8200,8220,8240,8260,8280,8300,8320,8340,8360,8380,8400,8420,8440,8460,8480,8500,8520,8540,8560,8580,8600,8620,8640,8660,8680,8700,8720,8740,8760,8780,8800,8820,8840,8860,8880,8900,8920,8940,8960,8980,9000,9020,9040,9060,9080,9100,9120,9140,9160,9180,9200,9220,9240,9260,9280,9300,9320,9340,9360,9380,9400,9420,9440,9460,9480,9500,9520,9540,9560,9580,9600,9620,9640,9660,9680,9700,9720,9740,9760,9780,9800,9820,9840,9860,9880,9900,9920,9940,9960,9980,40000,40020,40040,40060,40080,40100,40120,40140,40160,40180,40200,40220,40240,40260,40280,40300,40320,40340,40360,40380,40400,40420,40440,40460,40480,40500,40520,40540,40560,40580,40600,40620,40640,40660,40680,40700,40720,40740,40760,40780,40800,40820,40840,40860,40880,40900,40920,40940,40960,40980,41000,41020,41040,41060,41080,41100,41120,41140,41160,41180,41200,41220,41240,41260,41280,41300,41320,41340,41360,41380,41400,41420,41440,41460,41480,41500,41520,41540,41560,41580,41600,41620,41640,41660,41680,41700,41720,41740,41760,41780,41800,41820,41840,41860,41880,41900,41920,41940,41960,41980,42000,42020,42040,42060,42080,42100,42120,42140,42160,42180,42200,42220,42240,42260,42280,42300,42320,42340,42360,42380,42400,42420,42440,42460,42480,42500,42520,42540,42560,42580,42600,42620,42640,42660,42680,42700,42720,42740,42760,42780,42800,42820,42840,42860,42880,42900,42920,42940,42960,42980,43000,43020,43040,43060,43080,43100,43120,43140,43160,43180,43200,43220,43240,43260,43280,43300,43320,43340,43360,43380,43400,43420,43440,43460,43480,43500,43520,43540,43560,43580,43600,43620,43640,43660,43680,43700,43720,43740,43760,43780,43800,43820,43840,43860,43880,43900,43920,43940,43960,43980,44000,44020,44040,44060,44080,44100,44120,44140,44160,44180,44200,44220,44240,44260,44280,44300,44320,44340,44360,44380,44400,44420,44440,44460,44480,44500,44520,44540,44560,44580,44600,44620,44640,44660,44680,44700,44720,44740,44760,44780,44800,44820,44840,44860,44880,44900,44920,44940,44960,44980,45000,45020,45040,45060,45080,45100,45120,45140,45160,45180,45200,45220,45240,45260,45280,45300,45320,45340,45360,45380,45400,45420,45440,45460,45480,45500,45520,45540,45560,45580,45600,45620,45640,45660,45680,45700,45720,45740,45760,45780,45800,45820,45840,45860,45880,45900,45920,45940,45960,45980,46000,46020,46040,46060,46080,46100,46120,46140,46160,46180,46200,46220,46240,46260,46280,46300,46320,46340,46360,46380,46400,46420,46440,46460,46480,46500,46520,46540,46560,46580,46600,46620,46640,46660,46680,46700,46720,46740,46760,46780,46800,46820,46840,46860,46880,46900,46920,46940,46960,46980,47000,47020,47040,47060,47080,47100,47120,47140,47160,47180,47200,47220,47240,47260,47280,47300,47320,47340,47360,47380,47400,47420,47440,47460,47480,47500,47520,47540,47560,47580,47600,47620,47640,47660,47680,47700,47720,47740,47760,47780,47800,47820,47840,47860,47880,47900,47920,47940,47960,47980,48000,48020,48040,48060,48080,48100,48120,48140,48160,48180,48200,48220,48240,48260,48280,48300,48320,48340,48360,48380,48400,48420,48440,48460,48480,48500,48520,48540,48560,48580,48600,48620,48640,48660,48680,48700,48720,48740,48760,48780,48800,48820,48840,48860,48880,48900,48920,48940,48960,48980,49000,49020,49040,49060,49080,49100,49120,49140,49160,49180,49200,49220,49240,49260,49280,49300,49320,49340,49360,49380,49400,49420,49440,49460,49480,49500,49520,49540,49560,49580,49600,49620,49640,49660,49680,49700,49720,49740,49760,49780,49800,49820,49840,49860,49880,49900,49920,49940,49960,49980],"target":[[0,120],[25,80],[50,60],[75,40],[500,120],[675,100]]} diff --git a/doc/concept/audio-jitter/paced.json b/doc/concept/audio-jitter/paced.json new file mode 100644 index 00000000000..8a1040d3ad9 --- /dev/null +++ b/doc/concept/audio-jitter/paced.json @@ -0,0 +1 @@ +{"name":"paced","about":"A perfectly even sender for 60 s, long enough to leave the cold-start ramp. The target settles on one bucket plus one frame, which is the floor the estimator can report.","frame":20,"arrival":[50,70,90,110,130,150,170,190,210,230,250,270,290,310,330,350,370,390,410,430,450,470,490,510,530,550,570,590,610,630,650,670,690,710,730,750,770,790,810,830,850,870,890,910,930,950,970,990,1010,1030,1050,1070,1090,1110,1130,1150,1170,1190,1210,1230,1250,1270,1290,1310,1330,1350,1370,1390,1410,1430,1450,1470,1490,1510,1530,1550,1570,1590,1610,1630,1650,1670,1690,1710,1730,1750,1770,1790,1810,1830,1850,1870,1890,1910,1930,1950,1970,1990,2010,2030,2050,2070,2090,2110,2130,2150,2170,2190,2210,2230,2250,2270,2290,2310,2330,2350,2370,2390,2410,2430,2450,2470,2490,2510,2530,2550,2570,2590,2610,2630,2650,2670,2690,2710,2730,2750,2770,2790,2810,2830,2850,2870,2890,2910,2930,2950,2970,2990,3010,3030,3050,3070,3090,3110,3130,3150,3170,3190,3210,3230,3250,3270,3290,3310,3330,3350,3370,3390,3410,3430,3450,3470,3490,3510,3530,3550,3570,3590,3610,3630,3650,3670,3690,3710,3730,3750,3770,3790,3810,3830,3850,3870,3890,3910,3930,3950,3970,3990,4010,4030,4050,4070,4090,4110,4130,4150,4170,4190,4210,4230,4250,4270,4290,4310,4330,4350,4370,4390,4410,4430,4450,4470,4490,4510,4530,4550,4570,4590,4610,4630,4650,4670,4690,4710,4730,4750,4770,4790,4810,4830,4850,4870,4890,4910,4930,4950,4970,4990,5010,5030,5050,5070,5090,5110,5130,5150,5170,5190,5210,5230,5250,5270,5290,5310,5330,5350,5370,5390,5410,5430,5450,5470,5490,5510,5530,5550,5570,5590,5610,5630,5650,5670,5690,5710,5730,5750,5770,5790,5810,5830,5850,5870,5890,5910,5930,5950,5970,5990,6010,6030,6050,6070,6090,6110,6130,6150,6170,6190,6210,6230,6250,6270,6290,6310,6330,6350,6370,6390,6410,6430,6450,6470,6490,6510,6530,6550,6570,6590,6610,6630,6650,6670,6690,6710,6730,6750,6770,6790,6810,6830,6850,6870,6890,6910,6930,6950,6970,6990,7010,7030,7050,7070,7090,7110,7130,7150,7170,7190,7210,7230,7250,7270,7290,7310,7330,7350,7370,7390,7410,7430,7450,7470,7490,7510,7530,7550,7570,7590,7610,7630,7650,7670,7690,7710,7730,7750,7770,7790,7810,7830,7850,7870,7890,7910,7930,7950,7970,7990,8010,8030,8050,8070,8090,8110,8130,8150,8170,8190,8210,8230,8250,8270,8290,8310,8330,8350,8370,8390,8410,8430,8450,8470,8490,8510,8530,8550,8570,8590,8610,8630,8650,8670,8690,8710,8730,8750,8770,8790,8810,8830,8850,8870,8890,8910,8930,8950,8970,8990,9010,9030,9050,9070,9090,9110,9130,9150,9170,9190,9210,9230,9250,9270,9290,9310,9330,9350,9370,9390,9410,9430,9450,9470,9490,9510,9530,9550,9570,9590,9610,9630,9650,9670,9690,9710,9730,9750,9770,9790,9810,9830,9850,9870,9890,9910,9930,9950,9970,9990,10010,10030,10050,10070,10090,10110,10130,10150,10170,10190,10210,10230,10250,10270,10290,10310,10330,10350,10370,10390,10410,10430,10450,10470,10490,10510,10530,10550,10570,10590,10610,10630,10650,10670,10690,10710,10730,10750,10770,10790,10810,10830,10850,10870,10890,10910,10930,10950,10970,10990,11010,11030,11050,11070,11090,11110,11130,11150,11170,11190,11210,11230,11250,11270,11290,11310,11330,11350,11370,11390,11410,11430,11450,11470,11490,11510,11530,11550,11570,11590,11610,11630,11650,11670,11690,11710,11730,11750,11770,11790,11810,11830,11850,11870,11890,11910,11930,11950,11970,11990,12010,12030,12050,12070,12090,12110,12130,12150,12170,12190,12210,12230,12250,12270,12290,12310,12330,12350,12370,12390,12410,12430,12450,12470,12490,12510,12530,12550,12570,12590,12610,12630,12650,12670,12690,12710,12730,12750,12770,12790,12810,12830,12850,12870,12890,12910,12930,12950,12970,12990,13010,13030,13050,13070,13090,13110,13130,13150,13170,13190,13210,13230,13250,13270,13290,13310,13330,13350,13370,13390,13410,13430,13450,13470,13490,13510,13530,13550,13570,13590,13610,13630,13650,13670,13690,13710,13730,13750,13770,13790,13810,13830,13850,13870,13890,13910,13930,13950,13970,13990,14010,14030,14050,14070,14090,14110,14130,14150,14170,14190,14210,14230,14250,14270,14290,14310,14330,14350,14370,14390,14410,14430,14450,14470,14490,14510,14530,14550,14570,14590,14610,14630,14650,14670,14690,14710,14730,14750,14770,14790,14810,14830,14850,14870,14890,14910,14930,14950,14970,14990,15010,15030,15050,15070,15090,15110,15130,15150,15170,15190,15210,15230,15250,15270,15290,15310,15330,15350,15370,15390,15410,15430,15450,15470,15490,15510,15530,15550,15570,15590,15610,15630,15650,15670,15690,15710,15730,15750,15770,15790,15810,15830,15850,15870,15890,15910,15930,15950,15970,15990,16010,16030,16050,16070,16090,16110,16130,16150,16170,16190,16210,16230,16250,16270,16290,16310,16330,16350,16370,16390,16410,16430,16450,16470,16490,16510,16530,16550,16570,16590,16610,16630,16650,16670,16690,16710,16730,16750,16770,16790,16810,16830,16850,16870,16890,16910,16930,16950,16970,16990,17010,17030,17050,17070,17090,17110,17130,17150,17170,17190,17210,17230,17250,17270,17290,17310,17330,17350,17370,17390,17410,17430,17450,17470,17490,17510,17530,17550,17570,17590,17610,17630,17650,17670,17690,17710,17730,17750,17770,17790,17810,17830,17850,17870,17890,17910,17930,17950,17970,17990,18010,18030,18050,18070,18090,18110,18130,18150,18170,18190,18210,18230,18250,18270,18290,18310,18330,18350,18370,18390,18410,18430,18450,18470,18490,18510,18530,18550,18570,18590,18610,18630,18650,18670,18690,18710,18730,18750,18770,18790,18810,18830,18850,18870,18890,18910,18930,18950,18970,18990,19010,19030,19050,19070,19090,19110,19130,19150,19170,19190,19210,19230,19250,19270,19290,19310,19330,19350,19370,19390,19410,19430,19450,19470,19490,19510,19530,19550,19570,19590,19610,19630,19650,19670,19690,19710,19730,19750,19770,19790,19810,19830,19850,19870,19890,19910,19930,19950,19970,19990,20010,20030,20050,20070,20090,20110,20130,20150,20170,20190,20210,20230,20250,20270,20290,20310,20330,20350,20370,20390,20410,20430,20450,20470,20490,20510,20530,20550,20570,20590,20610,20630,20650,20670,20690,20710,20730,20750,20770,20790,20810,20830,20850,20870,20890,20910,20930,20950,20970,20990,21010,21030,21050,21070,21090,21110,21130,21150,21170,21190,21210,21230,21250,21270,21290,21310,21330,21350,21370,21390,21410,21430,21450,21470,21490,21510,21530,21550,21570,21590,21610,21630,21650,21670,21690,21710,21730,21750,21770,21790,21810,21830,21850,21870,21890,21910,21930,21950,21970,21990,22010,22030,22050,22070,22090,22110,22130,22150,22170,22190,22210,22230,22250,22270,22290,22310,22330,22350,22370,22390,22410,22430,22450,22470,22490,22510,22530,22550,22570,22590,22610,22630,22650,22670,22690,22710,22730,22750,22770,22790,22810,22830,22850,22870,22890,22910,22930,22950,22970,22990,23010,23030,23050,23070,23090,23110,23130,23150,23170,23190,23210,23230,23250,23270,23290,23310,23330,23350,23370,23390,23410,23430,23450,23470,23490,23510,23530,23550,23570,23590,23610,23630,23650,23670,23690,23710,23730,23750,23770,23790,23810,23830,23850,23870,23890,23910,23930,23950,23970,23990,24010,24030,24050,24070,24090,24110,24130,24150,24170,24190,24210,24230,24250,24270,24290,24310,24330,24350,24370,24390,24410,24430,24450,24470,24490,24510,24530,24550,24570,24590,24610,24630,24650,24670,24690,24710,24730,24750,24770,24790,24810,24830,24850,24870,24890,24910,24930,24950,24970,24990,25010,25030,25050,25070,25090,25110,25130,25150,25170,25190,25210,25230,25250,25270,25290,25310,25330,25350,25370,25390,25410,25430,25450,25470,25490,25510,25530,25550,25570,25590,25610,25630,25650,25670,25690,25710,25730,25750,25770,25790,25810,25830,25850,25870,25890,25910,25930,25950,25970,25990,26010,26030,26050,26070,26090,26110,26130,26150,26170,26190,26210,26230,26250,26270,26290,26310,26330,26350,26370,26390,26410,26430,26450,26470,26490,26510,26530,26550,26570,26590,26610,26630,26650,26670,26690,26710,26730,26750,26770,26790,26810,26830,26850,26870,26890,26910,26930,26950,26970,26990,27010,27030,27050,27070,27090,27110,27130,27150,27170,27190,27210,27230,27250,27270,27290,27310,27330,27350,27370,27390,27410,27430,27450,27470,27490,27510,27530,27550,27570,27590,27610,27630,27650,27670,27690,27710,27730,27750,27770,27790,27810,27830,27850,27870,27890,27910,27930,27950,27970,27990,28010,28030,28050,28070,28090,28110,28130,28150,28170,28190,28210,28230,28250,28270,28290,28310,28330,28350,28370,28390,28410,28430,28450,28470,28490,28510,28530,28550,28570,28590,28610,28630,28650,28670,28690,28710,28730,28750,28770,28790,28810,28830,28850,28870,28890,28910,28930,28950,28970,28990,29010,29030,29050,29070,29090,29110,29130,29150,29170,29190,29210,29230,29250,29270,29290,29310,29330,29350,29370,29390,29410,29430,29450,29470,29490,29510,29530,29550,29570,29590,29610,29630,29650,29670,29690,29710,29730,29750,29770,29790,29810,29830,29850,29870,29890,29910,29930,29950,29970,29990,30010,30030,30050,30070,30090,30110,30130,30150,30170,30190,30210,30230,30250,30270,30290,30310,30330,30350,30370,30390,30410,30430,30450,30470,30490,30510,30530,30550,30570,30590,30610,30630,30650,30670,30690,30710,30730,30750,30770,30790,30810,30830,30850,30870,30890,30910,30930,30950,30970,30990,31010,31030,31050,31070,31090,31110,31130,31150,31170,31190,31210,31230,31250,31270,31290,31310,31330,31350,31370,31390,31410,31430,31450,31470,31490,31510,31530,31550,31570,31590,31610,31630,31650,31670,31690,31710,31730,31750,31770,31790,31810,31830,31850,31870,31890,31910,31930,31950,31970,31990,32010,32030,32050,32070,32090,32110,32130,32150,32170,32190,32210,32230,32250,32270,32290,32310,32330,32350,32370,32390,32410,32430,32450,32470,32490,32510,32530,32550,32570,32590,32610,32630,32650,32670,32690,32710,32730,32750,32770,32790,32810,32830,32850,32870,32890,32910,32930,32950,32970,32990,33010,33030,33050,33070,33090,33110,33130,33150,33170,33190,33210,33230,33250,33270,33290,33310,33330,33350,33370,33390,33410,33430,33450,33470,33490,33510,33530,33550,33570,33590,33610,33630,33650,33670,33690,33710,33730,33750,33770,33790,33810,33830,33850,33870,33890,33910,33930,33950,33970,33990,34010,34030,34050,34070,34090,34110,34130,34150,34170,34190,34210,34230,34250,34270,34290,34310,34330,34350,34370,34390,34410,34430,34450,34470,34490,34510,34530,34550,34570,34590,34610,34630,34650,34670,34690,34710,34730,34750,34770,34790,34810,34830,34850,34870,34890,34910,34930,34950,34970,34990,35010,35030,35050,35070,35090,35110,35130,35150,35170,35190,35210,35230,35250,35270,35290,35310,35330,35350,35370,35390,35410,35430,35450,35470,35490,35510,35530,35550,35570,35590,35610,35630,35650,35670,35690,35710,35730,35750,35770,35790,35810,35830,35850,35870,35890,35910,35930,35950,35970,35990,36010,36030,36050,36070,36090,36110,36130,36150,36170,36190,36210,36230,36250,36270,36290,36310,36330,36350,36370,36390,36410,36430,36450,36470,36490,36510,36530,36550,36570,36590,36610,36630,36650,36670,36690,36710,36730,36750,36770,36790,36810,36830,36850,36870,36890,36910,36930,36950,36970,36990,37010,37030,37050,37070,37090,37110,37130,37150,37170,37190,37210,37230,37250,37270,37290,37310,37330,37350,37370,37390,37410,37430,37450,37470,37490,37510,37530,37550,37570,37590,37610,37630,37650,37670,37690,37710,37730,37750,37770,37790,37810,37830,37850,37870,37890,37910,37930,37950,37970,37990,38010,38030,38050,38070,38090,38110,38130,38150,38170,38190,38210,38230,38250,38270,38290,38310,38330,38350,38370,38390,38410,38430,38450,38470,38490,38510,38530,38550,38570,38590,38610,38630,38650,38670,38690,38710,38730,38750,38770,38790,38810,38830,38850,38870,38890,38910,38930,38950,38970,38990,39010,39030,39050,39070,39090,39110,39130,39150,39170,39190,39210,39230,39250,39270,39290,39310,39330,39350,39370,39390,39410,39430,39450,39470,39490,39510,39530,39550,39570,39590,39610,39630,39650,39670,39690,39710,39730,39750,39770,39790,39810,39830,39850,39870,39890,39910,39930,39950,39970,39990,40010,40030,40050,40070,40090,40110,40130,40150,40170,40190,40210,40230,40250,40270,40290,40310,40330,40350,40370,40390,40410,40430,40450,40470,40490,40510,40530,40550,40570,40590,40610,40630,40650,40670,40690,40710,40730,40750,40770,40790,40810,40830,40850,40870,40890,40910,40930,40950,40970,40990,41010,41030,41050,41070,41090,41110,41130,41150,41170,41190,41210,41230,41250,41270,41290,41310,41330,41350,41370,41390,41410,41430,41450,41470,41490,41510,41530,41550,41570,41590,41610,41630,41650,41670,41690,41710,41730,41750,41770,41790,41810,41830,41850,41870,41890,41910,41930,41950,41970,41990,42010,42030,42050,42070,42090,42110,42130,42150,42170,42190,42210,42230,42250,42270,42290,42310,42330,42350,42370,42390,42410,42430,42450,42470,42490,42510,42530,42550,42570,42590,42610,42630,42650,42670,42690,42710,42730,42750,42770,42790,42810,42830,42850,42870,42890,42910,42930,42950,42970,42990,43010,43030,43050,43070,43090,43110,43130,43150,43170,43190,43210,43230,43250,43270,43290,43310,43330,43350,43370,43390,43410,43430,43450,43470,43490,43510,43530,43550,43570,43590,43610,43630,43650,43670,43690,43710,43730,43750,43770,43790,43810,43830,43850,43870,43890,43910,43930,43950,43970,43990,44010,44030,44050,44070,44090,44110,44130,44150,44170,44190,44210,44230,44250,44270,44290,44310,44330,44350,44370,44390,44410,44430,44450,44470,44490,44510,44530,44550,44570,44590,44610,44630,44650,44670,44690,44710,44730,44750,44770,44790,44810,44830,44850,44870,44890,44910,44930,44950,44970,44990,45010,45030,45050,45070,45090,45110,45130,45150,45170,45190,45210,45230,45250,45270,45290,45310,45330,45350,45370,45390,45410,45430,45450,45470,45490,45510,45530,45550,45570,45590,45610,45630,45650,45670,45690,45710,45730,45750,45770,45790,45810,45830,45850,45870,45890,45910,45930,45950,45970,45990,46010,46030,46050,46070,46090,46110,46130,46150,46170,46190,46210,46230,46250,46270,46290,46310,46330,46350,46370,46390,46410,46430,46450,46470,46490,46510,46530,46550,46570,46590,46610,46630,46650,46670,46690,46710,46730,46750,46770,46790,46810,46830,46850,46870,46890,46910,46930,46950,46970,46990,47010,47030,47050,47070,47090,47110,47130,47150,47170,47190,47210,47230,47250,47270,47290,47310,47330,47350,47370,47390,47410,47430,47450,47470,47490,47510,47530,47550,47570,47590,47610,47630,47650,47670,47690,47710,47730,47750,47770,47790,47810,47830,47850,47870,47890,47910,47930,47950,47970,47990,48010,48030,48050,48070,48090,48110,48130,48150,48170,48190,48210,48230,48250,48270,48290,48310,48330,48350,48370,48390,48410,48430,48450,48470,48490,48510,48530,48550,48570,48590,48610,48630,48650,48670,48690,48710,48730,48750,48770,48790,48810,48830,48850,48870,48890,48910,48930,48950,48970,48990,49010,49030,49050,49070,49090,49110,49130,49150,49170,49190,49210,49230,49250,49270,49290,49310,49330,49350,49370,49390,49410,49430,49450,49470,49490,49510,49530,49550,49570,49590,49610,49630,49650,49670,49690,49710,49730,49750,49770,49790,49810,49830,49850,49870,49890,49910,49930,49950,49970,49990,50010,50030,50050,50070,50090,50110,50130,50150,50170,50190,50210,50230,50250,50270,50290,50310,50330,50350,50370,50390,50410,50430,50450,50470,50490,50510,50530,50550,50570,50590,50610,50630,50650,50670,50690,50710,50730,50750,50770,50790,50810,50830,50850,50870,50890,50910,50930,50950,50970,50990,51010,51030,51050,51070,51090,51110,51130,51150,51170,51190,51210,51230,51250,51270,51290,51310,51330,51350,51370,51390,51410,51430,51450,51470,51490,51510,51530,51550,51570,51590,51610,51630,51650,51670,51690,51710,51730,51750,51770,51790,51810,51830,51850,51870,51890,51910,51930,51950,51970,51990,52010,52030,52050,52070,52090,52110,52130,52150,52170,52190,52210,52230,52250,52270,52290,52310,52330,52350,52370,52390,52410,52430,52450,52470,52490,52510,52530,52550,52570,52590,52610,52630,52650,52670,52690,52710,52730,52750,52770,52790,52810,52830,52850,52870,52890,52910,52930,52950,52970,52990,53010,53030,53050,53070,53090,53110,53130,53150,53170,53190,53210,53230,53250,53270,53290,53310,53330,53350,53370,53390,53410,53430,53450,53470,53490,53510,53530,53550,53570,53590,53610,53630,53650,53670,53690,53710,53730,53750,53770,53790,53810,53830,53850,53870,53890,53910,53930,53950,53970,53990,54010,54030,54050,54070,54090,54110,54130,54150,54170,54190,54210,54230,54250,54270,54290,54310,54330,54350,54370,54390,54410,54430,54450,54470,54490,54510,54530,54550,54570,54590,54610,54630,54650,54670,54690,54710,54730,54750,54770,54790,54810,54830,54850,54870,54890,54910,54930,54950,54970,54990,55010,55030,55050,55070,55090,55110,55130,55150,55170,55190,55210,55230,55250,55270,55290,55310,55330,55350,55370,55390,55410,55430,55450,55470,55490,55510,55530,55550,55570,55590,55610,55630,55650,55670,55690,55710,55730,55750,55770,55790,55810,55830,55850,55870,55890,55910,55930,55950,55970,55990,56010,56030,56050,56070,56090,56110,56130,56150,56170,56190,56210,56230,56250,56270,56290,56310,56330,56350,56370,56390,56410,56430,56450,56470,56490,56510,56530,56550,56570,56590,56610,56630,56650,56670,56690,56710,56730,56750,56770,56790,56810,56830,56850,56870,56890,56910,56930,56950,56970,56990,57010,57030,57050,57070,57090,57110,57130,57150,57170,57190,57210,57230,57250,57270,57290,57310,57330,57350,57370,57390,57410,57430,57450,57470,57490,57510,57530,57550,57570,57590,57610,57630,57650,57670,57690,57710,57730,57750,57770,57790,57810,57830,57850,57870,57890,57910,57930,57950,57970,57990,58010,58030,58050,58070,58090,58110,58130,58150,58170,58190,58210,58230,58250,58270,58290,58310,58330,58350,58370,58390,58410,58430,58450,58470,58490,58510,58530,58550,58570,58590,58610,58630,58650,58670,58690,58710,58730,58750,58770,58790,58810,58830,58850,58870,58890,58910,58930,58950,58970,58990,59010,59030,59050,59070,59090,59110,59130,59150,59170,59190,59210,59230,59250,59270,59290,59310,59330,59350,59370,59390,59410,59430,59450,59470,59490,59510,59530,59550,59570,59590,59610,59630,59650,59670,59690,59710,59730,59750,59770,59790,59810,59830,59850,59870,59890,59910,59930,59950,59970,59990,60010,60030],"media":[0,20,40,60,80,100,120,140,160,180,200,220,240,260,280,300,320,340,360,380,400,420,440,460,480,500,520,540,560,580,600,620,640,660,680,700,720,740,760,780,800,820,840,860,880,900,920,940,960,980,1000,1020,1040,1060,1080,1100,1120,1140,1160,1180,1200,1220,1240,1260,1280,1300,1320,1340,1360,1380,1400,1420,1440,1460,1480,1500,1520,1540,1560,1580,1600,1620,1640,1660,1680,1700,1720,1740,1760,1780,1800,1820,1840,1860,1880,1900,1920,1940,1960,1980,2000,2020,2040,2060,2080,2100,2120,2140,2160,2180,2200,2220,2240,2260,2280,2300,2320,2340,2360,2380,2400,2420,2440,2460,2480,2500,2520,2540,2560,2580,2600,2620,2640,2660,2680,2700,2720,2740,2760,2780,2800,2820,2840,2860,2880,2900,2920,2940,2960,2980,3000,3020,3040,3060,3080,3100,3120,3140,3160,3180,3200,3220,3240,3260,3280,3300,3320,3340,3360,3380,3400,3420,3440,3460,3480,3500,3520,3540,3560,3580,3600,3620,3640,3660,3680,3700,3720,3740,3760,3780,3800,3820,3840,3860,3880,3900,3920,3940,3960,3980,4000,4020,4040,4060,4080,4100,4120,4140,4160,4180,4200,4220,4240,4260,4280,4300,4320,4340,4360,4380,4400,4420,4440,4460,4480,4500,4520,4540,4560,4580,4600,4620,4640,4660,4680,4700,4720,4740,4760,4780,4800,4820,4840,4860,4880,4900,4920,4940,4960,4980,5000,5020,5040,5060,5080,5100,5120,5140,5160,5180,5200,5220,5240,5260,5280,5300,5320,5340,5360,5380,5400,5420,5440,5460,5480,5500,5520,5540,5560,5580,5600,5620,5640,5660,5680,5700,5720,5740,5760,5780,5800,5820,5840,5860,5880,5900,5920,5940,5960,5980,6000,6020,6040,6060,6080,6100,6120,6140,6160,6180,6200,6220,6240,6260,6280,6300,6320,6340,6360,6380,6400,6420,6440,6460,6480,6500,6520,6540,6560,6580,6600,6620,6640,6660,6680,6700,6720,6740,6760,6780,6800,6820,6840,6860,6880,6900,6920,6940,6960,6980,7000,7020,7040,7060,7080,7100,7120,7140,7160,7180,7200,7220,7240,7260,7280,7300,7320,7340,7360,7380,7400,7420,7440,7460,7480,7500,7520,7540,7560,7580,7600,7620,7640,7660,7680,7700,7720,7740,7760,7780,7800,7820,7840,7860,7880,7900,7920,7940,7960,7980,8000,8020,8040,8060,8080,8100,8120,8140,8160,8180,8200,8220,8240,8260,8280,8300,8320,8340,8360,8380,8400,8420,8440,8460,8480,8500,8520,8540,8560,8580,8600,8620,8640,8660,8680,8700,8720,8740,8760,8780,8800,8820,8840,8860,8880,8900,8920,8940,8960,8980,9000,9020,9040,9060,9080,9100,9120,9140,9160,9180,9200,9220,9240,9260,9280,9300,9320,9340,9360,9380,9400,9420,9440,9460,9480,9500,9520,9540,9560,9580,9600,9620,9640,9660,9680,9700,9720,9740,9760,9780,9800,9820,9840,9860,9880,9900,9920,9940,9960,9980,10000,10020,10040,10060,10080,10100,10120,10140,10160,10180,10200,10220,10240,10260,10280,10300,10320,10340,10360,10380,10400,10420,10440,10460,10480,10500,10520,10540,10560,10580,10600,10620,10640,10660,10680,10700,10720,10740,10760,10780,10800,10820,10840,10860,10880,10900,10920,10940,10960,10980,11000,11020,11040,11060,11080,11100,11120,11140,11160,11180,11200,11220,11240,11260,11280,11300,11320,11340,11360,11380,11400,11420,11440,11460,11480,11500,11520,11540,11560,11580,11600,11620,11640,11660,11680,11700,11720,11740,11760,11780,11800,11820,11840,11860,11880,11900,11920,11940,11960,11980,12000,12020,12040,12060,12080,12100,12120,12140,12160,12180,12200,12220,12240,12260,12280,12300,12320,12340,12360,12380,12400,12420,12440,12460,12480,12500,12520,12540,12560,12580,12600,12620,12640,12660,12680,12700,12720,12740,12760,12780,12800,12820,12840,12860,12880,12900,12920,12940,12960,12980,13000,13020,13040,13060,13080,13100,13120,13140,13160,13180,13200,13220,13240,13260,13280,13300,13320,13340,13360,13380,13400,13420,13440,13460,13480,13500,13520,13540,13560,13580,13600,13620,13640,13660,13680,13700,13720,13740,13760,13780,13800,13820,13840,13860,13880,13900,13920,13940,13960,13980,14000,14020,14040,14060,14080,14100,14120,14140,14160,14180,14200,14220,14240,14260,14280,14300,14320,14340,14360,14380,14400,14420,14440,14460,14480,14500,14520,14540,14560,14580,14600,14620,14640,14660,14680,14700,14720,14740,14760,14780,14800,14820,14840,14860,14880,14900,14920,14940,14960,14980,15000,15020,15040,15060,15080,15100,15120,15140,15160,15180,15200,15220,15240,15260,15280,15300,15320,15340,15360,15380,15400,15420,15440,15460,15480,15500,15520,15540,15560,15580,15600,15620,15640,15660,15680,15700,15720,15740,15760,15780,15800,15820,15840,15860,15880,15900,15920,15940,15960,15980,16000,16020,16040,16060,16080,16100,16120,16140,16160,16180,16200,16220,16240,16260,16280,16300,16320,16340,16360,16380,16400,16420,16440,16460,16480,16500,16520,16540,16560,16580,16600,16620,16640,16660,16680,16700,16720,16740,16760,16780,16800,16820,16840,16860,16880,16900,16920,16940,16960,16980,17000,17020,17040,17060,17080,17100,17120,17140,17160,17180,17200,17220,17240,17260,17280,17300,17320,17340,17360,17380,17400,17420,17440,17460,17480,17500,17520,17540,17560,17580,17600,17620,17640,17660,17680,17700,17720,17740,17760,17780,17800,17820,17840,17860,17880,17900,17920,17940,17960,17980,18000,18020,18040,18060,18080,18100,18120,18140,18160,18180,18200,18220,18240,18260,18280,18300,18320,18340,18360,18380,18400,18420,18440,18460,18480,18500,18520,18540,18560,18580,18600,18620,18640,18660,18680,18700,18720,18740,18760,18780,18800,18820,18840,18860,18880,18900,18920,18940,18960,18980,19000,19020,19040,19060,19080,19100,19120,19140,19160,19180,19200,19220,19240,19260,19280,19300,19320,19340,19360,19380,19400,19420,19440,19460,19480,19500,19520,19540,19560,19580,19600,19620,19640,19660,19680,19700,19720,19740,19760,19780,19800,19820,19840,19860,19880,19900,19920,19940,19960,19980,20000,20020,20040,20060,20080,20100,20120,20140,20160,20180,20200,20220,20240,20260,20280,20300,20320,20340,20360,20380,20400,20420,20440,20460,20480,20500,20520,20540,20560,20580,20600,20620,20640,20660,20680,20700,20720,20740,20760,20780,20800,20820,20840,20860,20880,20900,20920,20940,20960,20980,21000,21020,21040,21060,21080,21100,21120,21140,21160,21180,21200,21220,21240,21260,21280,21300,21320,21340,21360,21380,21400,21420,21440,21460,21480,21500,21520,21540,21560,21580,21600,21620,21640,21660,21680,21700,21720,21740,21760,21780,21800,21820,21840,21860,21880,21900,21920,21940,21960,21980,22000,22020,22040,22060,22080,22100,22120,22140,22160,22180,22200,22220,22240,22260,22280,22300,22320,22340,22360,22380,22400,22420,22440,22460,22480,22500,22520,22540,22560,22580,22600,22620,22640,22660,22680,22700,22720,22740,22760,22780,22800,22820,22840,22860,22880,22900,22920,22940,22960,22980,23000,23020,23040,23060,23080,23100,23120,23140,23160,23180,23200,23220,23240,23260,23280,23300,23320,23340,23360,23380,23400,23420,23440,23460,23480,23500,23520,23540,23560,23580,23600,23620,23640,23660,23680,23700,23720,23740,23760,23780,23800,23820,23840,23860,23880,23900,23920,23940,23960,23980,24000,24020,24040,24060,24080,24100,24120,24140,24160,24180,24200,24220,24240,24260,24280,24300,24320,24340,24360,24380,24400,24420,24440,24460,24480,24500,24520,24540,24560,24580,24600,24620,24640,24660,24680,24700,24720,24740,24760,24780,24800,24820,24840,24860,24880,24900,24920,24940,24960,24980,25000,25020,25040,25060,25080,25100,25120,25140,25160,25180,25200,25220,25240,25260,25280,25300,25320,25340,25360,25380,25400,25420,25440,25460,25480,25500,25520,25540,25560,25580,25600,25620,25640,25660,25680,25700,25720,25740,25760,25780,25800,25820,25840,25860,25880,25900,25920,25940,25960,25980,26000,26020,26040,26060,26080,26100,26120,26140,26160,26180,26200,26220,26240,26260,26280,26300,26320,26340,26360,26380,26400,26420,26440,26460,26480,26500,26520,26540,26560,26580,26600,26620,26640,26660,26680,26700,26720,26740,26760,26780,26800,26820,26840,26860,26880,26900,26920,26940,26960,26980,27000,27020,27040,27060,27080,27100,27120,27140,27160,27180,27200,27220,27240,27260,27280,27300,27320,27340,27360,27380,27400,27420,27440,27460,27480,27500,27520,27540,27560,27580,27600,27620,27640,27660,27680,27700,27720,27740,27760,27780,27800,27820,27840,27860,27880,27900,27920,27940,27960,27980,28000,28020,28040,28060,28080,28100,28120,28140,28160,28180,28200,28220,28240,28260,28280,28300,28320,28340,28360,28380,28400,28420,28440,28460,28480,28500,28520,28540,28560,28580,28600,28620,28640,28660,28680,28700,28720,28740,28760,28780,28800,28820,28840,28860,28880,28900,28920,28940,28960,28980,29000,29020,29040,29060,29080,29100,29120,29140,29160,29180,29200,29220,29240,29260,29280,29300,29320,29340,29360,29380,29400,29420,29440,29460,29480,29500,29520,29540,29560,29580,29600,29620,29640,29660,29680,29700,29720,29740,29760,29780,29800,29820,29840,29860,29880,29900,29920,29940,29960,29980,30000,30020,30040,30060,30080,30100,30120,30140,30160,30180,30200,30220,30240,30260,30280,30300,30320,30340,30360,30380,30400,30420,30440,30460,30480,30500,30520,30540,30560,30580,30600,30620,30640,30660,30680,30700,30720,30740,30760,30780,30800,30820,30840,30860,30880,30900,30920,30940,30960,30980,31000,31020,31040,31060,31080,31100,31120,31140,31160,31180,31200,31220,31240,31260,31280,31300,31320,31340,31360,31380,31400,31420,31440,31460,31480,31500,31520,31540,31560,31580,31600,31620,31640,31660,31680,31700,31720,31740,31760,31780,31800,31820,31840,31860,31880,31900,31920,31940,31960,31980,32000,32020,32040,32060,32080,32100,32120,32140,32160,32180,32200,32220,32240,32260,32280,32300,32320,32340,32360,32380,32400,32420,32440,32460,32480,32500,32520,32540,32560,32580,32600,32620,32640,32660,32680,32700,32720,32740,32760,32780,32800,32820,32840,32860,32880,32900,32920,32940,32960,32980,33000,33020,33040,33060,33080,33100,33120,33140,33160,33180,33200,33220,33240,33260,33280,33300,33320,33340,33360,33380,33400,33420,33440,33460,33480,33500,33520,33540,33560,33580,33600,33620,33640,33660,33680,33700,33720,33740,33760,33780,33800,33820,33840,33860,33880,33900,33920,33940,33960,33980,34000,34020,34040,34060,34080,34100,34120,34140,34160,34180,34200,34220,34240,34260,34280,34300,34320,34340,34360,34380,34400,34420,34440,34460,34480,34500,34520,34540,34560,34580,34600,34620,34640,34660,34680,34700,34720,34740,34760,34780,34800,34820,34840,34860,34880,34900,34920,34940,34960,34980,35000,35020,35040,35060,35080,35100,35120,35140,35160,35180,35200,35220,35240,35260,35280,35300,35320,35340,35360,35380,35400,35420,35440,35460,35480,35500,35520,35540,35560,35580,35600,35620,35640,35660,35680,35700,35720,35740,35760,35780,35800,35820,35840,35860,35880,35900,35920,35940,35960,35980,36000,36020,36040,36060,36080,36100,36120,36140,36160,36180,36200,36220,36240,36260,36280,36300,36320,36340,36360,36380,36400,36420,36440,36460,36480,36500,36520,36540,36560,36580,36600,36620,36640,36660,36680,36700,36720,36740,36760,36780,36800,36820,36840,36860,36880,36900,36920,36940,36960,36980,37000,37020,37040,37060,37080,37100,37120,37140,37160,37180,37200,37220,37240,37260,37280,37300,37320,37340,37360,37380,37400,37420,37440,37460,37480,37500,37520,37540,37560,37580,37600,37620,37640,37660,37680,37700,37720,37740,37760,37780,37800,37820,37840,37860,37880,37900,37920,37940,37960,37980,38000,38020,38040,38060,38080,38100,38120,38140,38160,38180,38200,38220,38240,38260,38280,38300,38320,38340,38360,38380,38400,38420,38440,38460,38480,38500,38520,38540,38560,38580,38600,38620,38640,38660,38680,38700,38720,38740,38760,38780,38800,38820,38840,38860,38880,38900,38920,38940,38960,38980,39000,39020,39040,39060,39080,39100,39120,39140,39160,39180,39200,39220,39240,39260,39280,39300,39320,39340,39360,39380,39400,39420,39440,39460,39480,39500,39520,39540,39560,39580,39600,39620,39640,39660,39680,39700,39720,39740,39760,39780,39800,39820,39840,39860,39880,39900,39920,39940,39960,39980,40000,40020,40040,40060,40080,40100,40120,40140,40160,40180,40200,40220,40240,40260,40280,40300,40320,40340,40360,40380,40400,40420,40440,40460,40480,40500,40520,40540,40560,40580,40600,40620,40640,40660,40680,40700,40720,40740,40760,40780,40800,40820,40840,40860,40880,40900,40920,40940,40960,40980,41000,41020,41040,41060,41080,41100,41120,41140,41160,41180,41200,41220,41240,41260,41280,41300,41320,41340,41360,41380,41400,41420,41440,41460,41480,41500,41520,41540,41560,41580,41600,41620,41640,41660,41680,41700,41720,41740,41760,41780,41800,41820,41840,41860,41880,41900,41920,41940,41960,41980,42000,42020,42040,42060,42080,42100,42120,42140,42160,42180,42200,42220,42240,42260,42280,42300,42320,42340,42360,42380,42400,42420,42440,42460,42480,42500,42520,42540,42560,42580,42600,42620,42640,42660,42680,42700,42720,42740,42760,42780,42800,42820,42840,42860,42880,42900,42920,42940,42960,42980,43000,43020,43040,43060,43080,43100,43120,43140,43160,43180,43200,43220,43240,43260,43280,43300,43320,43340,43360,43380,43400,43420,43440,43460,43480,43500,43520,43540,43560,43580,43600,43620,43640,43660,43680,43700,43720,43740,43760,43780,43800,43820,43840,43860,43880,43900,43920,43940,43960,43980,44000,44020,44040,44060,44080,44100,44120,44140,44160,44180,44200,44220,44240,44260,44280,44300,44320,44340,44360,44380,44400,44420,44440,44460,44480,44500,44520,44540,44560,44580,44600,44620,44640,44660,44680,44700,44720,44740,44760,44780,44800,44820,44840,44860,44880,44900,44920,44940,44960,44980,45000,45020,45040,45060,45080,45100,45120,45140,45160,45180,45200,45220,45240,45260,45280,45300,45320,45340,45360,45380,45400,45420,45440,45460,45480,45500,45520,45540,45560,45580,45600,45620,45640,45660,45680,45700,45720,45740,45760,45780,45800,45820,45840,45860,45880,45900,45920,45940,45960,45980,46000,46020,46040,46060,46080,46100,46120,46140,46160,46180,46200,46220,46240,46260,46280,46300,46320,46340,46360,46380,46400,46420,46440,46460,46480,46500,46520,46540,46560,46580,46600,46620,46640,46660,46680,46700,46720,46740,46760,46780,46800,46820,46840,46860,46880,46900,46920,46940,46960,46980,47000,47020,47040,47060,47080,47100,47120,47140,47160,47180,47200,47220,47240,47260,47280,47300,47320,47340,47360,47380,47400,47420,47440,47460,47480,47500,47520,47540,47560,47580,47600,47620,47640,47660,47680,47700,47720,47740,47760,47780,47800,47820,47840,47860,47880,47900,47920,47940,47960,47980,48000,48020,48040,48060,48080,48100,48120,48140,48160,48180,48200,48220,48240,48260,48280,48300,48320,48340,48360,48380,48400,48420,48440,48460,48480,48500,48520,48540,48560,48580,48600,48620,48640,48660,48680,48700,48720,48740,48760,48780,48800,48820,48840,48860,48880,48900,48920,48940,48960,48980,49000,49020,49040,49060,49080,49100,49120,49140,49160,49180,49200,49220,49240,49260,49280,49300,49320,49340,49360,49380,49400,49420,49440,49460,49480,49500,49520,49540,49560,49580,49600,49620,49640,49660,49680,49700,49720,49740,49760,49780,49800,49820,49840,49860,49880,49900,49920,49940,49960,49980,50000,50020,50040,50060,50080,50100,50120,50140,50160,50180,50200,50220,50240,50260,50280,50300,50320,50340,50360,50380,50400,50420,50440,50460,50480,50500,50520,50540,50560,50580,50600,50620,50640,50660,50680,50700,50720,50740,50760,50780,50800,50820,50840,50860,50880,50900,50920,50940,50960,50980,51000,51020,51040,51060,51080,51100,51120,51140,51160,51180,51200,51220,51240,51260,51280,51300,51320,51340,51360,51380,51400,51420,51440,51460,51480,51500,51520,51540,51560,51580,51600,51620,51640,51660,51680,51700,51720,51740,51760,51780,51800,51820,51840,51860,51880,51900,51920,51940,51960,51980,52000,52020,52040,52060,52080,52100,52120,52140,52160,52180,52200,52220,52240,52260,52280,52300,52320,52340,52360,52380,52400,52420,52440,52460,52480,52500,52520,52540,52560,52580,52600,52620,52640,52660,52680,52700,52720,52740,52760,52780,52800,52820,52840,52860,52880,52900,52920,52940,52960,52980,53000,53020,53040,53060,53080,53100,53120,53140,53160,53180,53200,53220,53240,53260,53280,53300,53320,53340,53360,53380,53400,53420,53440,53460,53480,53500,53520,53540,53560,53580,53600,53620,53640,53660,53680,53700,53720,53740,53760,53780,53800,53820,53840,53860,53880,53900,53920,53940,53960,53980,54000,54020,54040,54060,54080,54100,54120,54140,54160,54180,54200,54220,54240,54260,54280,54300,54320,54340,54360,54380,54400,54420,54440,54460,54480,54500,54520,54540,54560,54580,54600,54620,54640,54660,54680,54700,54720,54740,54760,54780,54800,54820,54840,54860,54880,54900,54920,54940,54960,54980,55000,55020,55040,55060,55080,55100,55120,55140,55160,55180,55200,55220,55240,55260,55280,55300,55320,55340,55360,55380,55400,55420,55440,55460,55480,55500,55520,55540,55560,55580,55600,55620,55640,55660,55680,55700,55720,55740,55760,55780,55800,55820,55840,55860,55880,55900,55920,55940,55960,55980,56000,56020,56040,56060,56080,56100,56120,56140,56160,56180,56200,56220,56240,56260,56280,56300,56320,56340,56360,56380,56400,56420,56440,56460,56480,56500,56520,56540,56560,56580,56600,56620,56640,56660,56680,56700,56720,56740,56760,56780,56800,56820,56840,56860,56880,56900,56920,56940,56960,56980,57000,57020,57040,57060,57080,57100,57120,57140,57160,57180,57200,57220,57240,57260,57280,57300,57320,57340,57360,57380,57400,57420,57440,57460,57480,57500,57520,57540,57560,57580,57600,57620,57640,57660,57680,57700,57720,57740,57760,57780,57800,57820,57840,57860,57880,57900,57920,57940,57960,57980,58000,58020,58040,58060,58080,58100,58120,58140,58160,58180,58200,58220,58240,58260,58280,58300,58320,58340,58360,58380,58400,58420,58440,58460,58480,58500,58520,58540,58560,58580,58600,58620,58640,58660,58680,58700,58720,58740,58760,58780,58800,58820,58840,58860,58880,58900,58920,58940,58960,58980,59000,59020,59040,59060,59080,59100,59120,59140,59160,59180,59200,59220,59240,59260,59280,59300,59320,59340,59360,59380,59400,59420,59440,59460,59480,59500,59520,59540,59560,59580,59600,59620,59640,59660,59680,59700,59720,59740,59760,59780,59800,59820,59840,59860,59880,59900,59920,59940,59960,59980],"target":[[0,120],[25,80],[50,60],[75,40]]} diff --git a/doc/concept/audio-jitter/reference.ts b/doc/concept/audio-jitter/reference.ts new file mode 100644 index 00000000000..da1de0d76ef --- /dev/null +++ b/doc/concept/audio-jitter/reference.ts @@ -0,0 +1,163 @@ +// A reference implementation of the estimator described in /concept/audio-jitter, +// used only to generate the conformance corpus beside it. +// +// It is not normative and is not shipped in any package. The document is normative: +// when the two disagree the document wins, this file is corrected, and the corpus is +// regenerated. Nothing outside this directory may import it, because an +// implementation that calls the reference proves nothing about the document. + +/** Milliseconds of media time the reference search looks back over. */ +export const WINDOW = 2000; + +/** Milliseconds of delay per histogram bucket. */ +export const BUCKET = 20; + +/** Histogram buckets, so the measured term saturates at BUCKET * BUCKETS. */ +export const BUCKETS = 100; + +/** The quantile of the delay distribution the target is read at. */ +export const QUANTILE = 0.95; + +/** Weight retained per folded observation. */ +export const FORGET = 0.983; + +/** Milliseconds of arrival time per resampled observation. */ +export const RESAMPLE = 500; + +/** Weight of the cold-start ramp, which holds the forget factor below FORGET early on. */ +export const RAMP = 2; + +/** Idle intervals folded at once, purely to bound the work. */ +export const IDLE_MAX = 1024; + +/** The cold-start distribution, which is also what an idle receiver relaxes back to. */ +export function prior(): Float64Array { + const out = new Float64Array(BUCKETS); + for (let i = 0; i < BUCKETS; i++) { + out[i] = 0.5 ** (i + 1); + } + return out; +} + +/** One frame as the receiver saw it, in milliseconds. */ +export interface Arrival { + /** The receiver's monotonic clock when the frame came off the transport. */ + arrival: number; + /** The frame's container timestamp, converted to milliseconds. */ + media: number; +} + +/** What the receiver knows about the track before any frame arrives. */ +export interface Config { + /** The codec's frame duration, never learned from observed timestamps. */ + frame: number; + /** The publisher's advertised flush span, a floor on the measured term. */ + advertised?: number; +} + +/** Estimates the audio playout target from arrival timing alone. */ +export class Estimator { + readonly #frame: number; + readonly #advertised: number; + + /** Arrivals still inside the reference window, in media order. */ + #history: Arrival[] = []; + /** The largest media timestamp observed, so a reordered frame is recognized. */ + #newest = Number.NEGATIVE_INFINITY; + + /** The arrival that resample intervals are counted from. */ + #origin?: number; + /** The interval currently accumulating, counted from #origin. */ + #interval = 0; + /** The largest delay seen in that interval. */ + #peak = 0; + + #histogram = prior(); + /** Observations folded in, which drives the cold-start ramp. */ + #count = 0; + + constructor(config: Config) { + this.#frame = config.frame; + this.#advertised = config.advertised ?? 0; + } + + /** Fold one frame's arrival into the estimate. */ + observe({ arrival, media }: Arrival): void { + // A reordered arrival is excluded rather than measured: the media-time gap back + // to the frame that overtook it would otherwise be added to the delay. + if (media <= this.#newest) return; + this.#newest = media; + + // Pruning by media time rather than by arrival is what makes a timestamp jump + // self-correcting: everything before it leaves the window at once. + while (this.#history.length > 0 && this.#history[0].media < media - WINDOW) { + this.#history.shift(); + } + this.#history.push({ arrival, media }); + + // The fastest frame still in the window, so delay is measured against the + // best-case path instead of against the previous frame. + let reference = this.#history[0]; + for (const entry of this.#history) { + if (entry.arrival - entry.media < reference.arrival - reference.media) { + reference = entry; + } + } + + const delay = Math.max(0, arrival - reference.arrival - (media - reference.media)); + + if (this.#origin === undefined) { + this.#origin = arrival; + this.#peak = delay; + return; + } + + const interval = Math.floor((arrival - this.#origin) / RESAMPLE); + if (interval <= this.#interval) { + this.#peak = Math.max(this.#peak, delay); + return; + } + + this.#fold(Math.min(BUCKETS - 1, Math.floor(this.#peak / BUCKET))); + + const idle = Math.min(interval - this.#interval - 1, IDLE_MAX); + for (let i = 0; i < idle; i++) { + this.#fold(undefined); + } + + this.#interval = interval; + this.#peak = delay; + } + + /** The target the receiver holds, in milliseconds. */ + get target(): number { + let cumulative = 0; + let measured = BUCKETS * BUCKET; + for (let i = 0; i < BUCKETS; i++) { + cumulative += this.#histogram[i]; + if (cumulative > QUANTILE) { + measured = (i + 1) * BUCKET; + break; + } + } + + return Math.max(measured, this.#advertised) + this.#frame; + } + + // One observation is `h = f*h + (1-f)*x`, where x is the bucket that was observed, + // or the prior when the interval held no arrival at all. An idle interval therefore + // relaxes the estimate back toward cold start at the same time constant, rather than + // freezing it or renormalizing the decay away. + #fold(bucket: number | undefined): void { + this.#count += 1; + const forget = Math.min(FORGET, this.#count / (this.#count + RAMP)); + const fresh = 1 - forget; + const seed = bucket === undefined ? prior() : undefined; + + for (let i = 0; i < BUCKETS; i++) { + this.#histogram[i] *= forget; + if (seed) this.#histogram[i] += fresh * seed[i]; + } + if (bucket !== undefined) this.#histogram[bucket] += fresh; + } +} diff --git a/doc/concept/audio-jitter/reorder.json b/doc/concept/audio-jitter/reorder.json new file mode 100644 index 00000000000..a6061edbb64 --- /dev/null +++ b/doc/concept/audio-jitter/reorder.json @@ -0,0 +1 @@ +{"name":"reorder","about":"Every other run of five frames delivered after the run that follows it. The media-time gap between the runs must not land in the delay measurement.","frame":20,"arrival":[50,70,90,110,130,150,170,190,210,230,250,270,290,310,330,350,370,390,410,430,450,470,490,510,530,550,570,590,610,630,650,670,690,710,730,750,770,790,810,830,850,870,890,910,930,950,970,990,1010,1030,1050,1070,1090,1110,1130,1150,1170,1190,1210,1230,1250,1270,1290,1310,1330,1350,1370,1390,1410,1430,1450,1470,1490,1510,1530,1550,1570,1590,1610,1630,1650,1670,1690,1710,1730,1750,1770,1790,1810,1830,1850,1870,1890,1910,1930,1950,1970,1990,2010,2030,2050,2070,2090,2110,2130,2150,2170,2190,2210,2230,2250,2270,2290,2310,2330,2350,2370,2390,2410,2430,2450,2470,2490,2510,2530,2550,2570,2590,2610,2630,2650,2670,2690,2710,2730,2750,2770,2790,2810,2830,2850,2870,2890,2910,2930,2950,2970,2990,3010,3030,3050,3070,3090,3110,3130,3150,3170,3190,3210,3230,3250,3270,3290,3310,3330,3350,3370,3390,3410,3430,3450,3470,3490,3510,3530,3550,3570,3590,3610,3630,3650,3670,3690,3710,3730,3750,3770,3790,3810,3830,3850,3870,3890,3910,3930,3950,3970,3990,4010,4030,4050,4070,4090,4110,4130,4150,4170,4190,4210,4230,4250,4270,4290,4310,4330,4350,4370,4390,4410,4430,4450,4470,4490,4510,4530,4550,4570,4590,4610,4630,4650,4670,4690,4710,4730,4750,4770,4790,4810,4830,4850,4870,4890,4910,4930,4950,4970,4990,5010,5030,5050,5070,5090,5110,5130,5150,5170,5190,5210,5230,5250,5270,5290,5310,5330,5350,5370,5390,5410,5430,5450,5470,5490,5510,5530,5550,5570,5590,5610,5630,5650,5670,5690,5710,5730,5750,5770,5790,5810,5830,5850,5870,5890,5910,5930,5950,5970,5990,6010,6030,6050,6070,6090,6110,6130,6150,6170,6190,6210,6230,6250,6270,6290,6310,6330,6350,6370,6390,6410,6430,6450,6470,6490,6510,6530,6550,6570,6590,6610,6630,6650,6670,6690,6710,6730,6750,6770,6790,6810,6830,6850,6870,6890,6910,6930,6950,6970,6990,7010,7030,7050,7070,7090,7110,7130,7150,7170,7190,7210,7230,7250,7270,7290,7310,7330,7350,7370,7390,7410,7430,7450,7470,7490,7510,7530,7550,7570,7590,7610,7630,7650,7670,7690,7710,7730,7750,7770,7790,7810,7830,7850,7870,7890,7910,7930,7950,7970,7990,8010,8030,8050,8070,8090,8110,8130,8150,8170,8190,8210,8230,8250,8270,8290,8310,8330,8350,8370,8390,8410,8430,8450,8470,8490,8510,8530,8550,8570,8590,8610,8630,8650,8670,8690,8710,8730,8750,8770,8790,8810,8830,8850,8870,8890,8910,8930,8950,8970,8990,9010,9030,9050,9070,9090,9110,9130,9150,9170,9190,9210,9230,9250,9270,9290,9310,9330,9350,9370,9390,9410,9430,9450,9470,9490,9510,9530,9550,9570,9590,9610,9630,9650,9670,9690,9710,9730,9750,9770,9790,9810,9830,9850,9870,9890,9910,9930,9950,9970,9990,10010,10030,10050,10070,10090,10110,10130,10150,10170,10190,10210,10230,10250,10270,10290,10310,10330,10350,10370,10390,10410,10430,10450,10470,10490,10510,10530,10550,10570,10590,10610,10630,10650,10670,10690,10710,10730,10750,10770,10790,10810,10830,10850,10870,10890,10910,10930,10950,10970,10990,11010,11030,11050,11070,11090,11110,11130,11150,11170,11190,11210,11230,11250,11270,11290,11310,11330,11350,11370,11390,11410,11430,11450,11470,11490,11510,11530,11550,11570,11590,11610,11630,11650,11670,11690,11710,11730,11750,11770,11790,11810,11830,11850,11870,11890,11910,11930,11950,11970,11990,12010,12030,12050,12070,12090,12110,12130,12150,12170,12190,12210,12230,12250,12270,12290,12310,12330,12350,12370,12390,12410,12430,12450,12470,12490,12510,12530,12550,12570,12590,12610,12630,12650,12670,12690,12710,12730,12750,12770,12790,12810,12830,12850,12870,12890,12910,12930,12950,12970,12990,13010,13030,13050,13070,13090,13110,13130,13150,13170,13190,13210,13230,13250,13270,13290,13310,13330,13350,13370,13390,13410,13430,13450,13470,13490,13510,13530,13550,13570,13590,13610,13630,13650,13670,13690,13710,13730,13750,13770,13790,13810,13830,13850,13870,13890,13910,13930,13950,13970,13990,14010,14030,14050,14070,14090,14110,14130,14150,14170,14190,14210,14230,14250,14270,14290,14310,14330,14350,14370,14390,14410,14430,14450,14470,14490,14510,14530,14550,14570,14590,14610,14630,14650,14670,14690,14710,14730,14750,14770,14790,14810,14830,14850,14870,14890,14910,14930,14950,14970,14990,15010,15030,15050,15070,15090,15110,15130,15150,15170,15190,15210,15230,15250,15270,15290,15310,15330,15350,15370,15390,15410,15430,15450,15470,15490,15510,15530,15550,15570,15590,15610,15630,15650,15670,15690,15710,15730,15750,15770,15790,15810,15830,15850,15870,15890,15910,15930,15950,15970,15990,16010,16030,16050,16070,16090,16110,16130,16150,16170,16190,16210,16230,16250,16270,16290,16310,16330,16350,16370,16390,16410,16430,16450,16470,16490,16510,16530,16550,16570,16590,16610,16630,16650,16670,16690,16710,16730,16750,16770,16790,16810,16830,16850,16870,16890,16910,16930,16950,16970,16990,17010,17030,17050,17070,17090,17110,17130,17150,17170,17190,17210,17230,17250,17270,17290,17310,17330,17350,17370,17390,17410,17430,17450,17470,17490,17510,17530,17550,17570,17590,17610,17630,17650,17670,17690,17710,17730,17750,17770,17790,17810,17830,17850,17870,17890,17910,17930,17950,17970,17990,18010,18030,18050,18070,18090,18110,18130,18150,18170,18190,18210,18230,18250,18270,18290,18310,18330,18350,18370,18390,18410,18430,18450,18470,18490,18510,18530,18550,18570,18590,18610,18630,18650,18670,18690,18710,18730,18750,18770,18790,18810,18830,18850,18870,18890,18910,18930,18950,18970,18990,19010,19030,19050,19070,19090,19110,19130,19150,19170,19190,19210,19230,19250,19270,19290,19310,19330,19350,19370,19390,19410,19430,19450,19470,19490,19510,19530,19550,19570,19590,19610,19630,19650,19670,19690,19710,19730,19750,19770,19790,19810,19830,19850,19870,19890,19910,19930,19950,19970,19990,20010,20030],"media":[100,120,140,160,180,0,20,40,60,80,300,320,340,360,380,200,220,240,260,280,500,520,540,560,580,400,420,440,460,480,700,720,740,760,780,600,620,640,660,680,900,920,940,960,980,800,820,840,860,880,1100,1120,1140,1160,1180,1000,1020,1040,1060,1080,1300,1320,1340,1360,1380,1200,1220,1240,1260,1280,1500,1520,1540,1560,1580,1400,1420,1440,1460,1480,1700,1720,1740,1760,1780,1600,1620,1640,1660,1680,1900,1920,1940,1960,1980,1800,1820,1840,1860,1880,2100,2120,2140,2160,2180,2000,2020,2040,2060,2080,2300,2320,2340,2360,2380,2200,2220,2240,2260,2280,2500,2520,2540,2560,2580,2400,2420,2440,2460,2480,2700,2720,2740,2760,2780,2600,2620,2640,2660,2680,2900,2920,2940,2960,2980,2800,2820,2840,2860,2880,3100,3120,3140,3160,3180,3000,3020,3040,3060,3080,3300,3320,3340,3360,3380,3200,3220,3240,3260,3280,3500,3520,3540,3560,3580,3400,3420,3440,3460,3480,3700,3720,3740,3760,3780,3600,3620,3640,3660,3680,3900,3920,3940,3960,3980,3800,3820,3840,3860,3880,4100,4120,4140,4160,4180,4000,4020,4040,4060,4080,4300,4320,4340,4360,4380,4200,4220,4240,4260,4280,4500,4520,4540,4560,4580,4400,4420,4440,4460,4480,4700,4720,4740,4760,4780,4600,4620,4640,4660,4680,4900,4920,4940,4960,4980,4800,4820,4840,4860,4880,5100,5120,5140,5160,5180,5000,5020,5040,5060,5080,5300,5320,5340,5360,5380,5200,5220,5240,5260,5280,5500,5520,5540,5560,5580,5400,5420,5440,5460,5480,5700,5720,5740,5760,5780,5600,5620,5640,5660,5680,5900,5920,5940,5960,5980,5800,5820,5840,5860,5880,6100,6120,6140,6160,6180,6000,6020,6040,6060,6080,6300,6320,6340,6360,6380,6200,6220,6240,6260,6280,6500,6520,6540,6560,6580,6400,6420,6440,6460,6480,6700,6720,6740,6760,6780,6600,6620,6640,6660,6680,6900,6920,6940,6960,6980,6800,6820,6840,6860,6880,7100,7120,7140,7160,7180,7000,7020,7040,7060,7080,7300,7320,7340,7360,7380,7200,7220,7240,7260,7280,7500,7520,7540,7560,7580,7400,7420,7440,7460,7480,7700,7720,7740,7760,7780,7600,7620,7640,7660,7680,7900,7920,7940,7960,7980,7800,7820,7840,7860,7880,8100,8120,8140,8160,8180,8000,8020,8040,8060,8080,8300,8320,8340,8360,8380,8200,8220,8240,8260,8280,8500,8520,8540,8560,8580,8400,8420,8440,8460,8480,8700,8720,8740,8760,8780,8600,8620,8640,8660,8680,8900,8920,8940,8960,8980,8800,8820,8840,8860,8880,9100,9120,9140,9160,9180,9000,9020,9040,9060,9080,9300,9320,9340,9360,9380,9200,9220,9240,9260,9280,9500,9520,9540,9560,9580,9400,9420,9440,9460,9480,9700,9720,9740,9760,9780,9600,9620,9640,9660,9680,9900,9920,9940,9960,9980,9800,9820,9840,9860,9880,10100,10120,10140,10160,10180,10000,10020,10040,10060,10080,10300,10320,10340,10360,10380,10200,10220,10240,10260,10280,10500,10520,10540,10560,10580,10400,10420,10440,10460,10480,10700,10720,10740,10760,10780,10600,10620,10640,10660,10680,10900,10920,10940,10960,10980,10800,10820,10840,10860,10880,11100,11120,11140,11160,11180,11000,11020,11040,11060,11080,11300,11320,11340,11360,11380,11200,11220,11240,11260,11280,11500,11520,11540,11560,11580,11400,11420,11440,11460,11480,11700,11720,11740,11760,11780,11600,11620,11640,11660,11680,11900,11920,11940,11960,11980,11800,11820,11840,11860,11880,12100,12120,12140,12160,12180,12000,12020,12040,12060,12080,12300,12320,12340,12360,12380,12200,12220,12240,12260,12280,12500,12520,12540,12560,12580,12400,12420,12440,12460,12480,12700,12720,12740,12760,12780,12600,12620,12640,12660,12680,12900,12920,12940,12960,12980,12800,12820,12840,12860,12880,13100,13120,13140,13160,13180,13000,13020,13040,13060,13080,13300,13320,13340,13360,13380,13200,13220,13240,13260,13280,13500,13520,13540,13560,13580,13400,13420,13440,13460,13480,13700,13720,13740,13760,13780,13600,13620,13640,13660,13680,13900,13920,13940,13960,13980,13800,13820,13840,13860,13880,14100,14120,14140,14160,14180,14000,14020,14040,14060,14080,14300,14320,14340,14360,14380,14200,14220,14240,14260,14280,14500,14520,14540,14560,14580,14400,14420,14440,14460,14480,14700,14720,14740,14760,14780,14600,14620,14640,14660,14680,14900,14920,14940,14960,14980,14800,14820,14840,14860,14880,15100,15120,15140,15160,15180,15000,15020,15040,15060,15080,15300,15320,15340,15360,15380,15200,15220,15240,15260,15280,15500,15520,15540,15560,15580,15400,15420,15440,15460,15480,15700,15720,15740,15760,15780,15600,15620,15640,15660,15680,15900,15920,15940,15960,15980,15800,15820,15840,15860,15880,16100,16120,16140,16160,16180,16000,16020,16040,16060,16080,16300,16320,16340,16360,16380,16200,16220,16240,16260,16280,16500,16520,16540,16560,16580,16400,16420,16440,16460,16480,16700,16720,16740,16760,16780,16600,16620,16640,16660,16680,16900,16920,16940,16960,16980,16800,16820,16840,16860,16880,17100,17120,17140,17160,17180,17000,17020,17040,17060,17080,17300,17320,17340,17360,17380,17200,17220,17240,17260,17280,17500,17520,17540,17560,17580,17400,17420,17440,17460,17480,17700,17720,17740,17760,17780,17600,17620,17640,17660,17680,17900,17920,17940,17960,17980,17800,17820,17840,17860,17880,18100,18120,18140,18160,18180,18000,18020,18040,18060,18080,18300,18320,18340,18360,18380,18200,18220,18240,18260,18280,18500,18520,18540,18560,18580,18400,18420,18440,18460,18480,18700,18720,18740,18760,18780,18600,18620,18640,18660,18680,18900,18920,18940,18960,18980,18800,18820,18840,18860,18880,19100,19120,19140,19160,19180,19000,19020,19040,19060,19080,19300,19320,19340,19360,19380,19200,19220,19240,19260,19280,19500,19520,19540,19560,19580,19400,19420,19440,19460,19480,19700,19720,19740,19760,19780,19600,19620,19640,19660,19680,19900,19920,19940,19960,19980,19800,19820,19840,19860,19880],"target":[[0,120],[30,80],[50,60],[80,40]]} diff --git a/doc/concept/audio-jitter/spike.json b/doc/concept/audio-jitter/spike.json new file mode 100644 index 00000000000..4837069edf6 --- /dev/null +++ b/doc/concept/audio-jitter/spike.json @@ -0,0 +1 @@ +{"name":"spike","about":"A 300 ms stall every 5 s for the first 10 s, then 30 s of clean arrivals. The target rises to cover the stalls, then decays at the forget factor once they stop.","frame":20,"arrival":[50,70,90,110,130,150,170,190,210,230,250,270,290,310,330,350,370,390,410,430,450,470,490,510,530,550,570,590,610,630,650,670,690,710,730,750,770,790,810,830,850,870,890,910,930,950,970,990,1010,1030,1050,1070,1090,1110,1130,1150,1170,1190,1210,1230,1250,1270,1290,1310,1330,1350,1370,1390,1410,1430,1450,1470,1490,1510,1530,1550,1570,1590,1610,1630,1650,1670,1690,1710,1730,1750,1770,1790,1810,1830,1850,1870,1890,1910,1930,1950,1970,1990,2010,2030,2050,2070,2090,2110,2130,2150,2170,2190,2210,2230,2250,2270,2290,2310,2330,2350,2370,2390,2410,2430,2450,2470,2490,2510,2530,2550,2570,2590,2610,2630,2650,2670,2690,2710,2730,2750,2770,2790,2810,2830,2850,2870,2890,2910,2930,2950,2970,2990,3010,3030,3050,3070,3090,3110,3130,3150,3170,3190,3210,3230,3250,3270,3290,3310,3330,3350,3370,3390,3410,3430,3450,3470,3490,3510,3530,3550,3570,3590,3610,3630,3650,3670,3690,3710,3730,3750,3770,3790,3810,3830,3850,3870,3890,3910,3930,3950,3970,3990,4010,4030,4050,4070,4090,4110,4130,4150,4170,4190,4210,4230,4250,4270,4290,4310,4330,4350,4370,4390,4410,4430,4450,4470,4490,4510,4530,4550,4570,4590,4610,4630,4650,4670,4690,4710,4730,4750,4770,4790,4810,4830,4850,4870,4890,4910,4930,4950,4970,4990,5010,5030,5330,5330,5330,5330,5330,5330,5330,5330,5330,5330,5330,5330,5330,5330,5330,5350,5370,5390,5410,5430,5450,5470,5490,5510,5530,5550,5570,5590,5610,5630,5650,5670,5690,5710,5730,5750,5770,5790,5810,5830,5850,5870,5890,5910,5930,5950,5970,5990,6010,6030,6050,6070,6090,6110,6130,6150,6170,6190,6210,6230,6250,6270,6290,6310,6330,6350,6370,6390,6410,6430,6450,6470,6490,6510,6530,6550,6570,6590,6610,6630,6650,6670,6690,6710,6730,6750,6770,6790,6810,6830,6850,6870,6890,6910,6930,6950,6970,6990,7010,7030,7050,7070,7090,7110,7130,7150,7170,7190,7210,7230,7250,7270,7290,7310,7330,7350,7370,7390,7410,7430,7450,7470,7490,7510,7530,7550,7570,7590,7610,7630,7650,7670,7690,7710,7730,7750,7770,7790,7810,7830,7850,7870,7890,7910,7930,7950,7970,7990,8010,8030,8050,8070,8090,8110,8130,8150,8170,8190,8210,8230,8250,8270,8290,8310,8330,8350,8370,8390,8410,8430,8450,8470,8490,8510,8530,8550,8570,8590,8610,8630,8650,8670,8690,8710,8730,8750,8770,8790,8810,8830,8850,8870,8890,8910,8930,8950,8970,8990,9010,9030,9050,9070,9090,9110,9130,9150,9170,9190,9210,9230,9250,9270,9290,9310,9330,9350,9370,9390,9410,9430,9450,9470,9490,9510,9530,9550,9570,9590,9610,9630,9650,9670,9690,9710,9730,9750,9770,9790,9810,9830,9850,9870,9890,9910,9930,9950,9970,9990,10010,10030,10330,10330,10330,10330,10330,10330,10330,10330,10330,10330,10330,10330,10330,10330,10330,10350,10370,10390,10410,10430,10450,10470,10490,10510,10530,10550,10570,10590,10610,10630,10650,10670,10690,10710,10730,10750,10770,10790,10810,10830,10850,10870,10890,10910,10930,10950,10970,10990,11010,11030,11050,11070,11090,11110,11130,11150,11170,11190,11210,11230,11250,11270,11290,11310,11330,11350,11370,11390,11410,11430,11450,11470,11490,11510,11530,11550,11570,11590,11610,11630,11650,11670,11690,11710,11730,11750,11770,11790,11810,11830,11850,11870,11890,11910,11930,11950,11970,11990,12010,12030,12050,12070,12090,12110,12130,12150,12170,12190,12210,12230,12250,12270,12290,12310,12330,12350,12370,12390,12410,12430,12450,12470,12490,12510,12530,12550,12570,12590,12610,12630,12650,12670,12690,12710,12730,12750,12770,12790,12810,12830,12850,12870,12890,12910,12930,12950,12970,12990,13010,13030,13050,13070,13090,13110,13130,13150,13170,13190,13210,13230,13250,13270,13290,13310,13330,13350,13370,13390,13410,13430,13450,13470,13490,13510,13530,13550,13570,13590,13610,13630,13650,13670,13690,13710,13730,13750,13770,13790,13810,13830,13850,13870,13890,13910,13930,13950,13970,13990,14010,14030,14050,14070,14090,14110,14130,14150,14170,14190,14210,14230,14250,14270,14290,14310,14330,14350,14370,14390,14410,14430,14450,14470,14490,14510,14530,14550,14570,14590,14610,14630,14650,14670,14690,14710,14730,14750,14770,14790,14810,14830,14850,14870,14890,14910,14930,14950,14970,14990,15010,15030,15050,15070,15090,15110,15130,15150,15170,15190,15210,15230,15250,15270,15290,15310,15330,15350,15370,15390,15410,15430,15450,15470,15490,15510,15530,15550,15570,15590,15610,15630,15650,15670,15690,15710,15730,15750,15770,15790,15810,15830,15850,15870,15890,15910,15930,15950,15970,15990,16010,16030,16050,16070,16090,16110,16130,16150,16170,16190,16210,16230,16250,16270,16290,16310,16330,16350,16370,16390,16410,16430,16450,16470,16490,16510,16530,16550,16570,16590,16610,16630,16650,16670,16690,16710,16730,16750,16770,16790,16810,16830,16850,16870,16890,16910,16930,16950,16970,16990,17010,17030,17050,17070,17090,17110,17130,17150,17170,17190,17210,17230,17250,17270,17290,17310,17330,17350,17370,17390,17410,17430,17450,17470,17490,17510,17530,17550,17570,17590,17610,17630,17650,17670,17690,17710,17730,17750,17770,17790,17810,17830,17850,17870,17890,17910,17930,17950,17970,17990,18010,18030,18050,18070,18090,18110,18130,18150,18170,18190,18210,18230,18250,18270,18290,18310,18330,18350,18370,18390,18410,18430,18450,18470,18490,18510,18530,18550,18570,18590,18610,18630,18650,18670,18690,18710,18730,18750,18770,18790,18810,18830,18850,18870,18890,18910,18930,18950,18970,18990,19010,19030,19050,19070,19090,19110,19130,19150,19170,19190,19210,19230,19250,19270,19290,19310,19330,19350,19370,19390,19410,19430,19450,19470,19490,19510,19530,19550,19570,19590,19610,19630,19650,19670,19690,19710,19730,19750,19770,19790,19810,19830,19850,19870,19890,19910,19930,19950,19970,19990,20010,20030,20050,20070,20090,20110,20130,20150,20170,20190,20210,20230,20250,20270,20290,20310,20330,20350,20370,20390,20410,20430,20450,20470,20490,20510,20530,20550,20570,20590,20610,20630,20650,20670,20690,20710,20730,20750,20770,20790,20810,20830,20850,20870,20890,20910,20930,20950,20970,20990,21010,21030,21050,21070,21090,21110,21130,21150,21170,21190,21210,21230,21250,21270,21290,21310,21330,21350,21370,21390,21410,21430,21450,21470,21490,21510,21530,21550,21570,21590,21610,21630,21650,21670,21690,21710,21730,21750,21770,21790,21810,21830,21850,21870,21890,21910,21930,21950,21970,21990,22010,22030,22050,22070,22090,22110,22130,22150,22170,22190,22210,22230,22250,22270,22290,22310,22330,22350,22370,22390,22410,22430,22450,22470,22490,22510,22530,22550,22570,22590,22610,22630,22650,22670,22690,22710,22730,22750,22770,22790,22810,22830,22850,22870,22890,22910,22930,22950,22970,22990,23010,23030,23050,23070,23090,23110,23130,23150,23170,23190,23210,23230,23250,23270,23290,23310,23330,23350,23370,23390,23410,23430,23450,23470,23490,23510,23530,23550,23570,23590,23610,23630,23650,23670,23690,23710,23730,23750,23770,23790,23810,23830,23850,23870,23890,23910,23930,23950,23970,23990,24010,24030,24050,24070,24090,24110,24130,24150,24170,24190,24210,24230,24250,24270,24290,24310,24330,24350,24370,24390,24410,24430,24450,24470,24490,24510,24530,24550,24570,24590,24610,24630,24650,24670,24690,24710,24730,24750,24770,24790,24810,24830,24850,24870,24890,24910,24930,24950,24970,24990,25010,25030,25050,25070,25090,25110,25130,25150,25170,25190,25210,25230,25250,25270,25290,25310,25330,25350,25370,25390,25410,25430,25450,25470,25490,25510,25530,25550,25570,25590,25610,25630,25650,25670,25690,25710,25730,25750,25770,25790,25810,25830,25850,25870,25890,25910,25930,25950,25970,25990,26010,26030,26050,26070,26090,26110,26130,26150,26170,26190,26210,26230,26250,26270,26290,26310,26330,26350,26370,26390,26410,26430,26450,26470,26490,26510,26530,26550,26570,26590,26610,26630,26650,26670,26690,26710,26730,26750,26770,26790,26810,26830,26850,26870,26890,26910,26930,26950,26970,26990,27010,27030,27050,27070,27090,27110,27130,27150,27170,27190,27210,27230,27250,27270,27290,27310,27330,27350,27370,27390,27410,27430,27450,27470,27490,27510,27530,27550,27570,27590,27610,27630,27650,27670,27690,27710,27730,27750,27770,27790,27810,27830,27850,27870,27890,27910,27930,27950,27970,27990,28010,28030,28050,28070,28090,28110,28130,28150,28170,28190,28210,28230,28250,28270,28290,28310,28330,28350,28370,28390,28410,28430,28450,28470,28490,28510,28530,28550,28570,28590,28610,28630,28650,28670,28690,28710,28730,28750,28770,28790,28810,28830,28850,28870,28890,28910,28930,28950,28970,28990,29010,29030,29050,29070,29090,29110,29130,29150,29170,29190,29210,29230,29250,29270,29290,29310,29330,29350,29370,29390,29410,29430,29450,29470,29490,29510,29530,29550,29570,29590,29610,29630,29650,29670,29690,29710,29730,29750,29770,29790,29810,29830,29850,29870,29890,29910,29930,29950,29970,29990,30010,30030,30050,30070,30090,30110,30130,30150,30170,30190,30210,30230,30250,30270,30290,30310,30330,30350,30370,30390,30410,30430,30450,30470,30490,30510,30530,30550,30570,30590,30610,30630,30650,30670,30690,30710,30730,30750,30770,30790,30810,30830,30850,30870,30890,30910,30930,30950,30970,30990,31010,31030,31050,31070,31090,31110,31130,31150,31170,31190,31210,31230,31250,31270,31290,31310,31330,31350,31370,31390,31410,31430,31450,31470,31490,31510,31530,31550,31570,31590,31610,31630,31650,31670,31690,31710,31730,31750,31770,31790,31810,31830,31850,31870,31890,31910,31930,31950,31970,31990,32010,32030,32050,32070,32090,32110,32130,32150,32170,32190,32210,32230,32250,32270,32290,32310,32330,32350,32370,32390,32410,32430,32450,32470,32490,32510,32530,32550,32570,32590,32610,32630,32650,32670,32690,32710,32730,32750,32770,32790,32810,32830,32850,32870,32890,32910,32930,32950,32970,32990,33010,33030,33050,33070,33090,33110,33130,33150,33170,33190,33210,33230,33250,33270,33290,33310,33330,33350,33370,33390,33410,33430,33450,33470,33490,33510,33530,33550,33570,33590,33610,33630,33650,33670,33690,33710,33730,33750,33770,33790,33810,33830,33850,33870,33890,33910,33930,33950,33970,33990,34010,34030,34050,34070,34090,34110,34130,34150,34170,34190,34210,34230,34250,34270,34290,34310,34330,34350,34370,34390,34410,34430,34450,34470,34490,34510,34530,34550,34570,34590,34610,34630,34650,34670,34690,34710,34730,34750,34770,34790,34810,34830,34850,34870,34890,34910,34930,34950,34970,34990,35010,35030,35050,35070,35090,35110,35130,35150,35170,35190,35210,35230,35250,35270,35290,35310,35330,35350,35370,35390,35410,35430,35450,35470,35490,35510,35530,35550,35570,35590,35610,35630,35650,35670,35690,35710,35730,35750,35770,35790,35810,35830,35850,35870,35890,35910,35930,35950,35970,35990,36010,36030,36050,36070,36090,36110,36130,36150,36170,36190,36210,36230,36250,36270,36290,36310,36330,36350,36370,36390,36410,36430,36450,36470,36490,36510,36530,36550,36570,36590,36610,36630,36650,36670,36690,36710,36730,36750,36770,36790,36810,36830,36850,36870,36890,36910,36930,36950,36970,36990,37010,37030,37050,37070,37090,37110,37130,37150,37170,37190,37210,37230,37250,37270,37290,37310,37330,37350,37370,37390,37410,37430,37450,37470,37490,37510,37530,37550,37570,37590,37610,37630,37650,37670,37690,37710,37730,37750,37770,37790,37810,37830,37850,37870,37890,37910,37930,37950,37970,37990,38010,38030,38050,38070,38090,38110,38130,38150,38170,38190,38210,38230,38250,38270,38290,38310,38330,38350,38370,38390,38410,38430,38450,38470,38490,38510,38530,38550,38570,38590,38610,38630,38650,38670,38690,38710,38730,38750,38770,38790,38810,38830,38850,38870,38890,38910,38930,38950,38970,38990,39010,39030,39050,39070,39090,39110,39130,39150,39170,39190,39210,39230,39250,39270,39290,39310,39330,39350,39370,39390,39410,39430,39450,39470,39490,39510,39530,39550,39570,39590,39610,39630,39650,39670,39690,39710,39730,39750,39770,39790,39810,39830,39850,39870,39890,39910,39930,39950,39970,39990,40010,40030],"media":[0,20,40,60,80,100,120,140,160,180,200,220,240,260,280,300,320,340,360,380,400,420,440,460,480,500,520,540,560,580,600,620,640,660,680,700,720,740,760,780,800,820,840,860,880,900,920,940,960,980,1000,1020,1040,1060,1080,1100,1120,1140,1160,1180,1200,1220,1240,1260,1280,1300,1320,1340,1360,1380,1400,1420,1440,1460,1480,1500,1520,1540,1560,1580,1600,1620,1640,1660,1680,1700,1720,1740,1760,1780,1800,1820,1840,1860,1880,1900,1920,1940,1960,1980,2000,2020,2040,2060,2080,2100,2120,2140,2160,2180,2200,2220,2240,2260,2280,2300,2320,2340,2360,2380,2400,2420,2440,2460,2480,2500,2520,2540,2560,2580,2600,2620,2640,2660,2680,2700,2720,2740,2760,2780,2800,2820,2840,2860,2880,2900,2920,2940,2960,2980,3000,3020,3040,3060,3080,3100,3120,3140,3160,3180,3200,3220,3240,3260,3280,3300,3320,3340,3360,3380,3400,3420,3440,3460,3480,3500,3520,3540,3560,3580,3600,3620,3640,3660,3680,3700,3720,3740,3760,3780,3800,3820,3840,3860,3880,3900,3920,3940,3960,3980,4000,4020,4040,4060,4080,4100,4120,4140,4160,4180,4200,4220,4240,4260,4280,4300,4320,4340,4360,4380,4400,4420,4440,4460,4480,4500,4520,4540,4560,4580,4600,4620,4640,4660,4680,4700,4720,4740,4760,4780,4800,4820,4840,4860,4880,4900,4920,4940,4960,4980,5000,5020,5040,5060,5080,5100,5120,5140,5160,5180,5200,5220,5240,5260,5280,5300,5320,5340,5360,5380,5400,5420,5440,5460,5480,5500,5520,5540,5560,5580,5600,5620,5640,5660,5680,5700,5720,5740,5760,5780,5800,5820,5840,5860,5880,5900,5920,5940,5960,5980,6000,6020,6040,6060,6080,6100,6120,6140,6160,6180,6200,6220,6240,6260,6280,6300,6320,6340,6360,6380,6400,6420,6440,6460,6480,6500,6520,6540,6560,6580,6600,6620,6640,6660,6680,6700,6720,6740,6760,6780,6800,6820,6840,6860,6880,6900,6920,6940,6960,6980,7000,7020,7040,7060,7080,7100,7120,7140,7160,7180,7200,7220,7240,7260,7280,7300,7320,7340,7360,7380,7400,7420,7440,7460,7480,7500,7520,7540,7560,7580,7600,7620,7640,7660,7680,7700,7720,7740,7760,7780,7800,7820,7840,7860,7880,7900,7920,7940,7960,7980,8000,8020,8040,8060,8080,8100,8120,8140,8160,8180,8200,8220,8240,8260,8280,8300,8320,8340,8360,8380,8400,8420,8440,8460,8480,8500,8520,8540,8560,8580,8600,8620,8640,8660,8680,8700,8720,8740,8760,8780,8800,8820,8840,8860,8880,8900,8920,8940,8960,8980,9000,9020,9040,9060,9080,9100,9120,9140,9160,9180,9200,9220,9240,9260,9280,9300,9320,9340,9360,9380,9400,9420,9440,9460,9480,9500,9520,9540,9560,9580,9600,9620,9640,9660,9680,9700,9720,9740,9760,9780,9800,9820,9840,9860,9880,9900,9920,9940,9960,9980,10000,10020,10040,10060,10080,10100,10120,10140,10160,10180,10200,10220,10240,10260,10280,10300,10320,10340,10360,10380,10400,10420,10440,10460,10480,10500,10520,10540,10560,10580,10600,10620,10640,10660,10680,10700,10720,10740,10760,10780,10800,10820,10840,10860,10880,10900,10920,10940,10960,10980,11000,11020,11040,11060,11080,11100,11120,11140,11160,11180,11200,11220,11240,11260,11280,11300,11320,11340,11360,11380,11400,11420,11440,11460,11480,11500,11520,11540,11560,11580,11600,11620,11640,11660,11680,11700,11720,11740,11760,11780,11800,11820,11840,11860,11880,11900,11920,11940,11960,11980,12000,12020,12040,12060,12080,12100,12120,12140,12160,12180,12200,12220,12240,12260,12280,12300,12320,12340,12360,12380,12400,12420,12440,12460,12480,12500,12520,12540,12560,12580,12600,12620,12640,12660,12680,12700,12720,12740,12760,12780,12800,12820,12840,12860,12880,12900,12920,12940,12960,12980,13000,13020,13040,13060,13080,13100,13120,13140,13160,13180,13200,13220,13240,13260,13280,13300,13320,13340,13360,13380,13400,13420,13440,13460,13480,13500,13520,13540,13560,13580,13600,13620,13640,13660,13680,13700,13720,13740,13760,13780,13800,13820,13840,13860,13880,13900,13920,13940,13960,13980,14000,14020,14040,14060,14080,14100,14120,14140,14160,14180,14200,14220,14240,14260,14280,14300,14320,14340,14360,14380,14400,14420,14440,14460,14480,14500,14520,14540,14560,14580,14600,14620,14640,14660,14680,14700,14720,14740,14760,14780,14800,14820,14840,14860,14880,14900,14920,14940,14960,14980,15000,15020,15040,15060,15080,15100,15120,15140,15160,15180,15200,15220,15240,15260,15280,15300,15320,15340,15360,15380,15400,15420,15440,15460,15480,15500,15520,15540,15560,15580,15600,15620,15640,15660,15680,15700,15720,15740,15760,15780,15800,15820,15840,15860,15880,15900,15920,15940,15960,15980,16000,16020,16040,16060,16080,16100,16120,16140,16160,16180,16200,16220,16240,16260,16280,16300,16320,16340,16360,16380,16400,16420,16440,16460,16480,16500,16520,16540,16560,16580,16600,16620,16640,16660,16680,16700,16720,16740,16760,16780,16800,16820,16840,16860,16880,16900,16920,16940,16960,16980,17000,17020,17040,17060,17080,17100,17120,17140,17160,17180,17200,17220,17240,17260,17280,17300,17320,17340,17360,17380,17400,17420,17440,17460,17480,17500,17520,17540,17560,17580,17600,17620,17640,17660,17680,17700,17720,17740,17760,17780,17800,17820,17840,17860,17880,17900,17920,17940,17960,17980,18000,18020,18040,18060,18080,18100,18120,18140,18160,18180,18200,18220,18240,18260,18280,18300,18320,18340,18360,18380,18400,18420,18440,18460,18480,18500,18520,18540,18560,18580,18600,18620,18640,18660,18680,18700,18720,18740,18760,18780,18800,18820,18840,18860,18880,18900,18920,18940,18960,18980,19000,19020,19040,19060,19080,19100,19120,19140,19160,19180,19200,19220,19240,19260,19280,19300,19320,19340,19360,19380,19400,19420,19440,19460,19480,19500,19520,19540,19560,19580,19600,19620,19640,19660,19680,19700,19720,19740,19760,19780,19800,19820,19840,19860,19880,19900,19920,19940,19960,19980,20000,20020,20040,20060,20080,20100,20120,20140,20160,20180,20200,20220,20240,20260,20280,20300,20320,20340,20360,20380,20400,20420,20440,20460,20480,20500,20520,20540,20560,20580,20600,20620,20640,20660,20680,20700,20720,20740,20760,20780,20800,20820,20840,20860,20880,20900,20920,20940,20960,20980,21000,21020,21040,21060,21080,21100,21120,21140,21160,21180,21200,21220,21240,21260,21280,21300,21320,21340,21360,21380,21400,21420,21440,21460,21480,21500,21520,21540,21560,21580,21600,21620,21640,21660,21680,21700,21720,21740,21760,21780,21800,21820,21840,21860,21880,21900,21920,21940,21960,21980,22000,22020,22040,22060,22080,22100,22120,22140,22160,22180,22200,22220,22240,22260,22280,22300,22320,22340,22360,22380,22400,22420,22440,22460,22480,22500,22520,22540,22560,22580,22600,22620,22640,22660,22680,22700,22720,22740,22760,22780,22800,22820,22840,22860,22880,22900,22920,22940,22960,22980,23000,23020,23040,23060,23080,23100,23120,23140,23160,23180,23200,23220,23240,23260,23280,23300,23320,23340,23360,23380,23400,23420,23440,23460,23480,23500,23520,23540,23560,23580,23600,23620,23640,23660,23680,23700,23720,23740,23760,23780,23800,23820,23840,23860,23880,23900,23920,23940,23960,23980,24000,24020,24040,24060,24080,24100,24120,24140,24160,24180,24200,24220,24240,24260,24280,24300,24320,24340,24360,24380,24400,24420,24440,24460,24480,24500,24520,24540,24560,24580,24600,24620,24640,24660,24680,24700,24720,24740,24760,24780,24800,24820,24840,24860,24880,24900,24920,24940,24960,24980,25000,25020,25040,25060,25080,25100,25120,25140,25160,25180,25200,25220,25240,25260,25280,25300,25320,25340,25360,25380,25400,25420,25440,25460,25480,25500,25520,25540,25560,25580,25600,25620,25640,25660,25680,25700,25720,25740,25760,25780,25800,25820,25840,25860,25880,25900,25920,25940,25960,25980,26000,26020,26040,26060,26080,26100,26120,26140,26160,26180,26200,26220,26240,26260,26280,26300,26320,26340,26360,26380,26400,26420,26440,26460,26480,26500,26520,26540,26560,26580,26600,26620,26640,26660,26680,26700,26720,26740,26760,26780,26800,26820,26840,26860,26880,26900,26920,26940,26960,26980,27000,27020,27040,27060,27080,27100,27120,27140,27160,27180,27200,27220,27240,27260,27280,27300,27320,27340,27360,27380,27400,27420,27440,27460,27480,27500,27520,27540,27560,27580,27600,27620,27640,27660,27680,27700,27720,27740,27760,27780,27800,27820,27840,27860,27880,27900,27920,27940,27960,27980,28000,28020,28040,28060,28080,28100,28120,28140,28160,28180,28200,28220,28240,28260,28280,28300,28320,28340,28360,28380,28400,28420,28440,28460,28480,28500,28520,28540,28560,28580,28600,28620,28640,28660,28680,28700,28720,28740,28760,28780,28800,28820,28840,28860,28880,28900,28920,28940,28960,28980,29000,29020,29040,29060,29080,29100,29120,29140,29160,29180,29200,29220,29240,29260,29280,29300,29320,29340,29360,29380,29400,29420,29440,29460,29480,29500,29520,29540,29560,29580,29600,29620,29640,29660,29680,29700,29720,29740,29760,29780,29800,29820,29840,29860,29880,29900,29920,29940,29960,29980,30000,30020,30040,30060,30080,30100,30120,30140,30160,30180,30200,30220,30240,30260,30280,30300,30320,30340,30360,30380,30400,30420,30440,30460,30480,30500,30520,30540,30560,30580,30600,30620,30640,30660,30680,30700,30720,30740,30760,30780,30800,30820,30840,30860,30880,30900,30920,30940,30960,30980,31000,31020,31040,31060,31080,31100,31120,31140,31160,31180,31200,31220,31240,31260,31280,31300,31320,31340,31360,31380,31400,31420,31440,31460,31480,31500,31520,31540,31560,31580,31600,31620,31640,31660,31680,31700,31720,31740,31760,31780,31800,31820,31840,31860,31880,31900,31920,31940,31960,31980,32000,32020,32040,32060,32080,32100,32120,32140,32160,32180,32200,32220,32240,32260,32280,32300,32320,32340,32360,32380,32400,32420,32440,32460,32480,32500,32520,32540,32560,32580,32600,32620,32640,32660,32680,32700,32720,32740,32760,32780,32800,32820,32840,32860,32880,32900,32920,32940,32960,32980,33000,33020,33040,33060,33080,33100,33120,33140,33160,33180,33200,33220,33240,33260,33280,33300,33320,33340,33360,33380,33400,33420,33440,33460,33480,33500,33520,33540,33560,33580,33600,33620,33640,33660,33680,33700,33720,33740,33760,33780,33800,33820,33840,33860,33880,33900,33920,33940,33960,33980,34000,34020,34040,34060,34080,34100,34120,34140,34160,34180,34200,34220,34240,34260,34280,34300,34320,34340,34360,34380,34400,34420,34440,34460,34480,34500,34520,34540,34560,34580,34600,34620,34640,34660,34680,34700,34720,34740,34760,34780,34800,34820,34840,34860,34880,34900,34920,34940,34960,34980,35000,35020,35040,35060,35080,35100,35120,35140,35160,35180,35200,35220,35240,35260,35280,35300,35320,35340,35360,35380,35400,35420,35440,35460,35480,35500,35520,35540,35560,35580,35600,35620,35640,35660,35680,35700,35720,35740,35760,35780,35800,35820,35840,35860,35880,35900,35920,35940,35960,35980,36000,36020,36040,36060,36080,36100,36120,36140,36160,36180,36200,36220,36240,36260,36280,36300,36320,36340,36360,36380,36400,36420,36440,36460,36480,36500,36520,36540,36560,36580,36600,36620,36640,36660,36680,36700,36720,36740,36760,36780,36800,36820,36840,36860,36880,36900,36920,36940,36960,36980,37000,37020,37040,37060,37080,37100,37120,37140,37160,37180,37200,37220,37240,37260,37280,37300,37320,37340,37360,37380,37400,37420,37440,37460,37480,37500,37520,37540,37560,37580,37600,37620,37640,37660,37680,37700,37720,37740,37760,37780,37800,37820,37840,37860,37880,37900,37920,37940,37960,37980,38000,38020,38040,38060,38080,38100,38120,38140,38160,38180,38200,38220,38240,38260,38280,38300,38320,38340,38360,38380,38400,38420,38440,38460,38480,38500,38520,38540,38560,38580,38600,38620,38640,38660,38680,38700,38720,38740,38760,38780,38800,38820,38840,38860,38880,38900,38920,38940,38960,38980,39000,39020,39040,39060,39080,39100,39120,39140,39160,39180,39200,39220,39240,39260,39280,39300,39320,39340,39360,39380,39400,39420,39440,39460,39480,39500,39520,39540,39560,39580,39600,39620,39640,39660,39680,39700,39720,39740,39760,39780,39800,39820,39840,39860,39880,39900,39920,39940,39960,39980],"target":[[0,120],[25,80],[50,60],[75,40],[275,320],[900,40]]} diff --git a/doc/concept/audio-jitter/tunein.json b/doc/concept/audio-jitter/tunein.json new file mode 100644 index 00000000000..18e50b81e5d --- /dev/null +++ b/doc/concept/audio-jitter/tunein.json @@ -0,0 +1 @@ +{"name":"tunein","about":"One frame from a stale group, then the live edge 14.5 s later, then 30 s of even audio. The #3517 branch reported 14.56 s here; the target must stay near the frame duration.","frame":20,"arrival":[0,10,30,50,70,90,110,130,150,170,190,210,230,250,270,290,310,330,350,370,390,410,430,450,470,490,510,530,550,570,590,610,630,650,670,690,710,730,750,770,790,810,830,850,870,890,910,930,950,970,990,1010,1030,1050,1070,1090,1110,1130,1150,1170,1190,1210,1230,1250,1270,1290,1310,1330,1350,1370,1390,1410,1430,1450,1470,1490,1510,1530,1550,1570,1590,1610,1630,1650,1670,1690,1710,1730,1750,1770,1790,1810,1830,1850,1870,1890,1910,1930,1950,1970,1990,2010,2030,2050,2070,2090,2110,2130,2150,2170,2190,2210,2230,2250,2270,2290,2310,2330,2350,2370,2390,2410,2430,2450,2470,2490,2510,2530,2550,2570,2590,2610,2630,2650,2670,2690,2710,2730,2750,2770,2790,2810,2830,2850,2870,2890,2910,2930,2950,2970,2990,3010,3030,3050,3070,3090,3110,3130,3150,3170,3190,3210,3230,3250,3270,3290,3310,3330,3350,3370,3390,3410,3430,3450,3470,3490,3510,3530,3550,3570,3590,3610,3630,3650,3670,3690,3710,3730,3750,3770,3790,3810,3830,3850,3870,3890,3910,3930,3950,3970,3990,4010,4030,4050,4070,4090,4110,4130,4150,4170,4190,4210,4230,4250,4270,4290,4310,4330,4350,4370,4390,4410,4430,4450,4470,4490,4510,4530,4550,4570,4590,4610,4630,4650,4670,4690,4710,4730,4750,4770,4790,4810,4830,4850,4870,4890,4910,4930,4950,4970,4990,5010,5030,5050,5070,5090,5110,5130,5150,5170,5190,5210,5230,5250,5270,5290,5310,5330,5350,5370,5390,5410,5430,5450,5470,5490,5510,5530,5550,5570,5590,5610,5630,5650,5670,5690,5710,5730,5750,5770,5790,5810,5830,5850,5870,5890,5910,5930,5950,5970,5990,6010,6030,6050,6070,6090,6110,6130,6150,6170,6190,6210,6230,6250,6270,6290,6310,6330,6350,6370,6390,6410,6430,6450,6470,6490,6510,6530,6550,6570,6590,6610,6630,6650,6670,6690,6710,6730,6750,6770,6790,6810,6830,6850,6870,6890,6910,6930,6950,6970,6990,7010,7030,7050,7070,7090,7110,7130,7150,7170,7190,7210,7230,7250,7270,7290,7310,7330,7350,7370,7390,7410,7430,7450,7470,7490,7510,7530,7550,7570,7590,7610,7630,7650,7670,7690,7710,7730,7750,7770,7790,7810,7830,7850,7870,7890,7910,7930,7950,7970,7990,8010,8030,8050,8070,8090,8110,8130,8150,8170,8190,8210,8230,8250,8270,8290,8310,8330,8350,8370,8390,8410,8430,8450,8470,8490,8510,8530,8550,8570,8590,8610,8630,8650,8670,8690,8710,8730,8750,8770,8790,8810,8830,8850,8870,8890,8910,8930,8950,8970,8990,9010,9030,9050,9070,9090,9110,9130,9150,9170,9190,9210,9230,9250,9270,9290,9310,9330,9350,9370,9390,9410,9430,9450,9470,9490,9510,9530,9550,9570,9590,9610,9630,9650,9670,9690,9710,9730,9750,9770,9790,9810,9830,9850,9870,9890,9910,9930,9950,9970,9990,10010,10030,10050,10070,10090,10110,10130,10150,10170,10190,10210,10230,10250,10270,10290,10310,10330,10350,10370,10390,10410,10430,10450,10470,10490,10510,10530,10550,10570,10590,10610,10630,10650,10670,10690,10710,10730,10750,10770,10790,10810,10830,10850,10870,10890,10910,10930,10950,10970,10990,11010,11030,11050,11070,11090,11110,11130,11150,11170,11190,11210,11230,11250,11270,11290,11310,11330,11350,11370,11390,11410,11430,11450,11470,11490,11510,11530,11550,11570,11590,11610,11630,11650,11670,11690,11710,11730,11750,11770,11790,11810,11830,11850,11870,11890,11910,11930,11950,11970,11990,12010,12030,12050,12070,12090,12110,12130,12150,12170,12190,12210,12230,12250,12270,12290,12310,12330,12350,12370,12390,12410,12430,12450,12470,12490,12510,12530,12550,12570,12590,12610,12630,12650,12670,12690,12710,12730,12750,12770,12790,12810,12830,12850,12870,12890,12910,12930,12950,12970,12990,13010,13030,13050,13070,13090,13110,13130,13150,13170,13190,13210,13230,13250,13270,13290,13310,13330,13350,13370,13390,13410,13430,13450,13470,13490,13510,13530,13550,13570,13590,13610,13630,13650,13670,13690,13710,13730,13750,13770,13790,13810,13830,13850,13870,13890,13910,13930,13950,13970,13990,14010,14030,14050,14070,14090,14110,14130,14150,14170,14190,14210,14230,14250,14270,14290,14310,14330,14350,14370,14390,14410,14430,14450,14470,14490,14510,14530,14550,14570,14590,14610,14630,14650,14670,14690,14710,14730,14750,14770,14790,14810,14830,14850,14870,14890,14910,14930,14950,14970,14990,15010,15030,15050,15070,15090,15110,15130,15150,15170,15190,15210,15230,15250,15270,15290,15310,15330,15350,15370,15390,15410,15430,15450,15470,15490,15510,15530,15550,15570,15590,15610,15630,15650,15670,15690,15710,15730,15750,15770,15790,15810,15830,15850,15870,15890,15910,15930,15950,15970,15990,16010,16030,16050,16070,16090,16110,16130,16150,16170,16190,16210,16230,16250,16270,16290,16310,16330,16350,16370,16390,16410,16430,16450,16470,16490,16510,16530,16550,16570,16590,16610,16630,16650,16670,16690,16710,16730,16750,16770,16790,16810,16830,16850,16870,16890,16910,16930,16950,16970,16990,17010,17030,17050,17070,17090,17110,17130,17150,17170,17190,17210,17230,17250,17270,17290,17310,17330,17350,17370,17390,17410,17430,17450,17470,17490,17510,17530,17550,17570,17590,17610,17630,17650,17670,17690,17710,17730,17750,17770,17790,17810,17830,17850,17870,17890,17910,17930,17950,17970,17990,18010,18030,18050,18070,18090,18110,18130,18150,18170,18190,18210,18230,18250,18270,18290,18310,18330,18350,18370,18390,18410,18430,18450,18470,18490,18510,18530,18550,18570,18590,18610,18630,18650,18670,18690,18710,18730,18750,18770,18790,18810,18830,18850,18870,18890,18910,18930,18950,18970,18990,19010,19030,19050,19070,19090,19110,19130,19150,19170,19190,19210,19230,19250,19270,19290,19310,19330,19350,19370,19390,19410,19430,19450,19470,19490,19510,19530,19550,19570,19590,19610,19630,19650,19670,19690,19710,19730,19750,19770,19790,19810,19830,19850,19870,19890,19910,19930,19950,19970,19990,20010,20030,20050,20070,20090,20110,20130,20150,20170,20190,20210,20230,20250,20270,20290,20310,20330,20350,20370,20390,20410,20430,20450,20470,20490,20510,20530,20550,20570,20590,20610,20630,20650,20670,20690,20710,20730,20750,20770,20790,20810,20830,20850,20870,20890,20910,20930,20950,20970,20990,21010,21030,21050,21070,21090,21110,21130,21150,21170,21190,21210,21230,21250,21270,21290,21310,21330,21350,21370,21390,21410,21430,21450,21470,21490,21510,21530,21550,21570,21590,21610,21630,21650,21670,21690,21710,21730,21750,21770,21790,21810,21830,21850,21870,21890,21910,21930,21950,21970,21990,22010,22030,22050,22070,22090,22110,22130,22150,22170,22190,22210,22230,22250,22270,22290,22310,22330,22350,22370,22390,22410,22430,22450,22470,22490,22510,22530,22550,22570,22590,22610,22630,22650,22670,22690,22710,22730,22750,22770,22790,22810,22830,22850,22870,22890,22910,22930,22950,22970,22990,23010,23030,23050,23070,23090,23110,23130,23150,23170,23190,23210,23230,23250,23270,23290,23310,23330,23350,23370,23390,23410,23430,23450,23470,23490,23510,23530,23550,23570,23590,23610,23630,23650,23670,23690,23710,23730,23750,23770,23790,23810,23830,23850,23870,23890,23910,23930,23950,23970,23990,24010,24030,24050,24070,24090,24110,24130,24150,24170,24190,24210,24230,24250,24270,24290,24310,24330,24350,24370,24390,24410,24430,24450,24470,24490,24510,24530,24550,24570,24590,24610,24630,24650,24670,24690,24710,24730,24750,24770,24790,24810,24830,24850,24870,24890,24910,24930,24950,24970,24990,25010,25030,25050,25070,25090,25110,25130,25150,25170,25190,25210,25230,25250,25270,25290,25310,25330,25350,25370,25390,25410,25430,25450,25470,25490,25510,25530,25550,25570,25590,25610,25630,25650,25670,25690,25710,25730,25750,25770,25790,25810,25830,25850,25870,25890,25910,25930,25950,25970,25990,26010,26030,26050,26070,26090,26110,26130,26150,26170,26190,26210,26230,26250,26270,26290,26310,26330,26350,26370,26390,26410,26430,26450,26470,26490,26510,26530,26550,26570,26590,26610,26630,26650,26670,26690,26710,26730,26750,26770,26790,26810,26830,26850,26870,26890,26910,26930,26950,26970,26990,27010,27030,27050,27070,27090,27110,27130,27150,27170,27190,27210,27230,27250,27270,27290,27310,27330,27350,27370,27390,27410,27430,27450,27470,27490,27510,27530,27550,27570,27590,27610,27630,27650,27670,27690,27710,27730,27750,27770,27790,27810,27830,27850,27870,27890,27910,27930,27950,27970,27990,28010,28030,28050,28070,28090,28110,28130,28150,28170,28190,28210,28230,28250,28270,28290,28310,28330,28350,28370,28390,28410,28430,28450,28470,28490,28510,28530,28550,28570,28590,28610,28630,28650,28670,28690,28710,28730,28750,28770,28790,28810,28830,28850,28870,28890,28910,28930,28950,28970,28990,29010,29030,29050,29070,29090,29110,29130,29150,29170,29190,29210,29230,29250,29270,29290,29310,29330,29350,29370,29390,29410,29430,29450,29470,29490,29510,29530,29550,29570,29590,29610,29630,29650,29670,29690,29710,29730,29750,29770,29790,29810,29830,29850,29870,29890,29910,29930,29950,29970,29990],"media":[0,14500,14520,14540,14560,14580,14600,14620,14640,14660,14680,14700,14720,14740,14760,14780,14800,14820,14840,14860,14880,14900,14920,14940,14960,14980,15000,15020,15040,15060,15080,15100,15120,15140,15160,15180,15200,15220,15240,15260,15280,15300,15320,15340,15360,15380,15400,15420,15440,15460,15480,15500,15520,15540,15560,15580,15600,15620,15640,15660,15680,15700,15720,15740,15760,15780,15800,15820,15840,15860,15880,15900,15920,15940,15960,15980,16000,16020,16040,16060,16080,16100,16120,16140,16160,16180,16200,16220,16240,16260,16280,16300,16320,16340,16360,16380,16400,16420,16440,16460,16480,16500,16520,16540,16560,16580,16600,16620,16640,16660,16680,16700,16720,16740,16760,16780,16800,16820,16840,16860,16880,16900,16920,16940,16960,16980,17000,17020,17040,17060,17080,17100,17120,17140,17160,17180,17200,17220,17240,17260,17280,17300,17320,17340,17360,17380,17400,17420,17440,17460,17480,17500,17520,17540,17560,17580,17600,17620,17640,17660,17680,17700,17720,17740,17760,17780,17800,17820,17840,17860,17880,17900,17920,17940,17960,17980,18000,18020,18040,18060,18080,18100,18120,18140,18160,18180,18200,18220,18240,18260,18280,18300,18320,18340,18360,18380,18400,18420,18440,18460,18480,18500,18520,18540,18560,18580,18600,18620,18640,18660,18680,18700,18720,18740,18760,18780,18800,18820,18840,18860,18880,18900,18920,18940,18960,18980,19000,19020,19040,19060,19080,19100,19120,19140,19160,19180,19200,19220,19240,19260,19280,19300,19320,19340,19360,19380,19400,19420,19440,19460,19480,19500,19520,19540,19560,19580,19600,19620,19640,19660,19680,19700,19720,19740,19760,19780,19800,19820,19840,19860,19880,19900,19920,19940,19960,19980,20000,20020,20040,20060,20080,20100,20120,20140,20160,20180,20200,20220,20240,20260,20280,20300,20320,20340,20360,20380,20400,20420,20440,20460,20480,20500,20520,20540,20560,20580,20600,20620,20640,20660,20680,20700,20720,20740,20760,20780,20800,20820,20840,20860,20880,20900,20920,20940,20960,20980,21000,21020,21040,21060,21080,21100,21120,21140,21160,21180,21200,21220,21240,21260,21280,21300,21320,21340,21360,21380,21400,21420,21440,21460,21480,21500,21520,21540,21560,21580,21600,21620,21640,21660,21680,21700,21720,21740,21760,21780,21800,21820,21840,21860,21880,21900,21920,21940,21960,21980,22000,22020,22040,22060,22080,22100,22120,22140,22160,22180,22200,22220,22240,22260,22280,22300,22320,22340,22360,22380,22400,22420,22440,22460,22480,22500,22520,22540,22560,22580,22600,22620,22640,22660,22680,22700,22720,22740,22760,22780,22800,22820,22840,22860,22880,22900,22920,22940,22960,22980,23000,23020,23040,23060,23080,23100,23120,23140,23160,23180,23200,23220,23240,23260,23280,23300,23320,23340,23360,23380,23400,23420,23440,23460,23480,23500,23520,23540,23560,23580,23600,23620,23640,23660,23680,23700,23720,23740,23760,23780,23800,23820,23840,23860,23880,23900,23920,23940,23960,23980,24000,24020,24040,24060,24080,24100,24120,24140,24160,24180,24200,24220,24240,24260,24280,24300,24320,24340,24360,24380,24400,24420,24440,24460,24480,24500,24520,24540,24560,24580,24600,24620,24640,24660,24680,24700,24720,24740,24760,24780,24800,24820,24840,24860,24880,24900,24920,24940,24960,24980,25000,25020,25040,25060,25080,25100,25120,25140,25160,25180,25200,25220,25240,25260,25280,25300,25320,25340,25360,25380,25400,25420,25440,25460,25480,25500,25520,25540,25560,25580,25600,25620,25640,25660,25680,25700,25720,25740,25760,25780,25800,25820,25840,25860,25880,25900,25920,25940,25960,25980,26000,26020,26040,26060,26080,26100,26120,26140,26160,26180,26200,26220,26240,26260,26280,26300,26320,26340,26360,26380,26400,26420,26440,26460,26480,26500,26520,26540,26560,26580,26600,26620,26640,26660,26680,26700,26720,26740,26760,26780,26800,26820,26840,26860,26880,26900,26920,26940,26960,26980,27000,27020,27040,27060,27080,27100,27120,27140,27160,27180,27200,27220,27240,27260,27280,27300,27320,27340,27360,27380,27400,27420,27440,27460,27480,27500,27520,27540,27560,27580,27600,27620,27640,27660,27680,27700,27720,27740,27760,27780,27800,27820,27840,27860,27880,27900,27920,27940,27960,27980,28000,28020,28040,28060,28080,28100,28120,28140,28160,28180,28200,28220,28240,28260,28280,28300,28320,28340,28360,28380,28400,28420,28440,28460,28480,28500,28520,28540,28560,28580,28600,28620,28640,28660,28680,28700,28720,28740,28760,28780,28800,28820,28840,28860,28880,28900,28920,28940,28960,28980,29000,29020,29040,29060,29080,29100,29120,29140,29160,29180,29200,29220,29240,29260,29280,29300,29320,29340,29360,29380,29400,29420,29440,29460,29480,29500,29520,29540,29560,29580,29600,29620,29640,29660,29680,29700,29720,29740,29760,29780,29800,29820,29840,29860,29880,29900,29920,29940,29960,29980,30000,30020,30040,30060,30080,30100,30120,30140,30160,30180,30200,30220,30240,30260,30280,30300,30320,30340,30360,30380,30400,30420,30440,30460,30480,30500,30520,30540,30560,30580,30600,30620,30640,30660,30680,30700,30720,30740,30760,30780,30800,30820,30840,30860,30880,30900,30920,30940,30960,30980,31000,31020,31040,31060,31080,31100,31120,31140,31160,31180,31200,31220,31240,31260,31280,31300,31320,31340,31360,31380,31400,31420,31440,31460,31480,31500,31520,31540,31560,31580,31600,31620,31640,31660,31680,31700,31720,31740,31760,31780,31800,31820,31840,31860,31880,31900,31920,31940,31960,31980,32000,32020,32040,32060,32080,32100,32120,32140,32160,32180,32200,32220,32240,32260,32280,32300,32320,32340,32360,32380,32400,32420,32440,32460,32480,32500,32520,32540,32560,32580,32600,32620,32640,32660,32680,32700,32720,32740,32760,32780,32800,32820,32840,32860,32880,32900,32920,32940,32960,32980,33000,33020,33040,33060,33080,33100,33120,33140,33160,33180,33200,33220,33240,33260,33280,33300,33320,33340,33360,33380,33400,33420,33440,33460,33480,33500,33520,33540,33560,33580,33600,33620,33640,33660,33680,33700,33720,33740,33760,33780,33800,33820,33840,33860,33880,33900,33920,33940,33960,33980,34000,34020,34040,34060,34080,34100,34120,34140,34160,34180,34200,34220,34240,34260,34280,34300,34320,34340,34360,34380,34400,34420,34440,34460,34480,34500,34520,34540,34560,34580,34600,34620,34640,34660,34680,34700,34720,34740,34760,34780,34800,34820,34840,34860,34880,34900,34920,34940,34960,34980,35000,35020,35040,35060,35080,35100,35120,35140,35160,35180,35200,35220,35240,35260,35280,35300,35320,35340,35360,35380,35400,35420,35440,35460,35480,35500,35520,35540,35560,35580,35600,35620,35640,35660,35680,35700,35720,35740,35760,35780,35800,35820,35840,35860,35880,35900,35920,35940,35960,35980,36000,36020,36040,36060,36080,36100,36120,36140,36160,36180,36200,36220,36240,36260,36280,36300,36320,36340,36360,36380,36400,36420,36440,36460,36480,36500,36520,36540,36560,36580,36600,36620,36640,36660,36680,36700,36720,36740,36760,36780,36800,36820,36840,36860,36880,36900,36920,36940,36960,36980,37000,37020,37040,37060,37080,37100,37120,37140,37160,37180,37200,37220,37240,37260,37280,37300,37320,37340,37360,37380,37400,37420,37440,37460,37480,37500,37520,37540,37560,37580,37600,37620,37640,37660,37680,37700,37720,37740,37760,37780,37800,37820,37840,37860,37880,37900,37920,37940,37960,37980,38000,38020,38040,38060,38080,38100,38120,38140,38160,38180,38200,38220,38240,38260,38280,38300,38320,38340,38360,38380,38400,38420,38440,38460,38480,38500,38520,38540,38560,38580,38600,38620,38640,38660,38680,38700,38720,38740,38760,38780,38800,38820,38840,38860,38880,38900,38920,38940,38960,38980,39000,39020,39040,39060,39080,39100,39120,39140,39160,39180,39200,39220,39240,39260,39280,39300,39320,39340,39360,39380,39400,39420,39440,39460,39480,39500,39520,39540,39560,39580,39600,39620,39640,39660,39680,39700,39720,39740,39760,39780,39800,39820,39840,39860,39880,39900,39920,39940,39960,39980,40000,40020,40040,40060,40080,40100,40120,40140,40160,40180,40200,40220,40240,40260,40280,40300,40320,40340,40360,40380,40400,40420,40440,40460,40480,40500,40520,40540,40560,40580,40600,40620,40640,40660,40680,40700,40720,40740,40760,40780,40800,40820,40840,40860,40880,40900,40920,40940,40960,40980,41000,41020,41040,41060,41080,41100,41120,41140,41160,41180,41200,41220,41240,41260,41280,41300,41320,41340,41360,41380,41400,41420,41440,41460,41480,41500,41520,41540,41560,41580,41600,41620,41640,41660,41680,41700,41720,41740,41760,41780,41800,41820,41840,41860,41880,41900,41920,41940,41960,41980,42000,42020,42040,42060,42080,42100,42120,42140,42160,42180,42200,42220,42240,42260,42280,42300,42320,42340,42360,42380,42400,42420,42440,42460,42480,42500,42520,42540,42560,42580,42600,42620,42640,42660,42680,42700,42720,42740,42760,42780,42800,42820,42840,42860,42880,42900,42920,42940,42960,42980,43000,43020,43040,43060,43080,43100,43120,43140,43160,43180,43200,43220,43240,43260,43280,43300,43320,43340,43360,43380,43400,43420,43440,43460,43480,43500,43520,43540,43560,43580,43600,43620,43640,43660,43680,43700,43720,43740,43760,43780,43800,43820,43840,43860,43880,43900,43920,43940,43960,43980,44000,44020,44040,44060,44080,44100,44120,44140,44160,44180,44200,44220,44240,44260,44280,44300,44320,44340,44360,44380,44400,44420,44440,44460,44480],"target":[[0,120],[26,80],[51,60],[76,40]]} diff --git a/doc/concept/index.md b/doc/concept/index.md index c8054c1e443..5dbe3880bff 100644 --- a/doc/concept/index.md +++ b/doc/concept/index.md @@ -36,5 +36,6 @@ watched at 100 ms by one viewer and 10 s by another. - [Transport](/concept/transport): why QUIC, and the WebTransport, WebSocket, raw QUIC, and iroh paths onto it. - [moq-lite](/concept/moq-lite): the pub/sub protocol, discovery, path patterns, subscriptions, and congestion behavior. - [hang](/concept/hang): the media catalog, containers, and how to extend both. +- [Audio jitter](/concept/audio-jitter): how a receiver sizes its audio playout target from arrival timing. - [Standards](/concept/standard): how this relates to the IETF moq-transport, MSF, LOC, and this project's own drafts, including [e2ee](/draft/moq-e2ee). - [Use cases](/concept/use-case/): MoQ compared with HLS/DASH, RTMP/SRT, WebRTC, and used for AI. diff --git a/doc/package.json b/doc/package.json index 53dc554a2bc..3c20cb96373 100644 --- a/doc/package.json +++ b/doc/package.json @@ -6,8 +6,8 @@ "scripts": { "dev": "vitepress dev --open", "build": "vitepress build", - "check": "tsc --noEmit && bun test ./.vitepress && vitepress build", - "test": "bun test ./.vitepress", + "check": "tsc --noEmit && bun test ./.vitepress ./concept/audio-jitter && vitepress build", + "test": "bun test ./.vitepress ./concept/audio-jitter", "preview": "vitepress preview", "deploy": "vitepress build && wrangler deploy" }, diff --git a/doc/tsconfig.json b/doc/tsconfig.json index 3d43d2b2e92..a8d16c35e22 100644 --- a/doc/tsconfig.json +++ b/doc/tsconfig.json @@ -6,5 +6,11 @@ }, // config.ts is not type-checked: VitePress's own nav types reject the // `link` + `items` combination the theme relies on. - "include": [".vitepress/drafts.ts", ".vitepress/drafts.test.ts"] + "include": [ + ".vitepress/drafts.ts", + ".vitepress/drafts.test.ts", + "concept/audio-jitter/reference.ts", + "concept/audio-jitter/corpus.ts", + "concept/audio-jitter/corpus.test.ts" + ] } diff --git a/quest/main/audio-jitter-target/README.md b/quest/main/audio-jitter-target/README.md index 3d0867ff789..6508d1e914e 100644 --- a/quest/main/audio-jitter-target/README.md +++ b/quest/main/audio-jitter-target/README.md @@ -22,31 +22,38 @@ clock](/quest/dev/plan-av-clock.md). Three quests: the survey and the written algorithm first, then one implementation per language against it. The two implementations are independent once the spec lands and may run in parallel. All three are -additive and target `main`: the spec is a document, the native knob is a new -field on a `#[non_exhaustive]` struct, and the browser estimator is a new +additive and target `main`: the algorithm is a document, the native knob is a +new field on a `#[non_exhaustive]` struct, and the browser estimator is a new module plus a new `spread` observation. -Neither `main` nor `dev` has a measured estimator. `js/watch/src/sync.ts:150` -still computes `max(MIN_JITTER, minRtt * 1.25)` from the connection's PROBE -(`sync.ts:36-39`, `:144-150`), and `js/watch/src/audio/latency.ts` still -exists. - -The prior art is the branch of PR #3517, `origin/quest/main/3477-watch-auto-latency`, -two commits ahead of `dev`. The PR is closed and never merged; the watch quest -starts from the branch rather than from `dev`. It already deletes the RTT term -(`latency.ts`, `MIN_JITTER`, `FALLBACK_JITTER`, `#minRtt`, and the `probe` -input are gone from `sync.ts`) and plumbs a per-track arrival `spread` through -`Container.Consumer`, measured at container frame arrival and before the age -budget can skip a group, which is the right observation point. Its estimator, -`js/hang/src/container/jitter.ts`, is a decaying histogram of 5 ms buckets, 200 -of them so the percentile saturates at one second, read at the 95th percentile -plus one frame, with the arrival minimum expiring over two 30 s windows, -`reanchor()` on a discontinuity, and the step down bounded to one frame per -second. `jitter.test.ts` and `js/watch/src/audio/replay.test.ts` cover it. What -the branch still gets wrong is recorded in -[Spec](/quest/main/audio-jitter-target/spec.md): the extra frame is learned from -the first gap between observed timestamps and the rise is immediate and -unclamped, so a tune-in across a stale group sets the target to seconds. +The algorithm is written down at `doc/concept/audio-jitter.md`, with a +conformance corpus beside it that both implementations will read. + +Neither `main` nor `dev` has a measured estimator. `js/watch/src/sync.ts:159` +still computes `max(MIN_JITTER, minRtt * 1.25)` from the connection's PROBE, +and `js/watch/src/audio/latency.ts` still exists. `sync.ts` also adds the +advertised jitter to that term, where the document settles on a maximum. + +The prior art is the branch of PR #3517, +`origin/quest/m0/3477-watch-auto-latency`, two commits ahead of `dev`. The PR +is closed and never merged; the watch quest starts from the branch rather than +from `dev`. It already deletes the RTT term +(`MIN_JITTER`, `FALLBACK_JITTER`, `#minRtt`, and the `probe` input are gone +from `sync.ts`; `latency.ts` survives, minus `reanchorFloor`) and plumbs a +per-track arrival `spread` through `Container.Consumer`, measured at container +frame arrival and before the age budget can skip a group, which is the right +observation point. Its estimator, `js/hang/src/container/jitter.ts`, is a +decaying histogram of 5 ms buckets, 200 of them so the percentile saturates at +one second, read at the 95th percentile plus one frame, with the arrival +minimum expiring over two 30 s windows, `reanchor()` on a discontinuity, and +the step down bounded to one frame per second. `jitter.test.ts` and +`js/watch/src/audio/replay.test.ts` cover it. What it gets wrong is the extra +frame, learned from the first gap between observed timestamps, and a rise that +is immediate and unclamped, so a tune-in across a stale group sets the target +to seconds. + +Note that `sync.ts` has since been refactored on `main` to a `register(jitter)` +list, so the branch does not rebase cleanly. Native has no jitter buffer at all. `rs/moq-audio`'s `decode::Options` (`rs/moq-audio/src/decode/consumer.rs`) carries `max_age`, how far @@ -56,7 +63,6 @@ buffer against uneven arrivals. ## Quests -- [Spec](/quest/main/audio-jitter-target/spec.md) - survey what already exists, then write the algorithm down once - [Watch](/quest/main/audio-jitter-target/watch.md) - js/watch and js/hang bring the #3517 branch's estimator into conformance - [Native](/quest/main/audio-jitter-target/native.md) - rs/moq-audio grows a measured jitter buffer from the same algorithm @@ -66,7 +72,7 @@ buffer against uneven arrivals. ## Related -- [Jitter clock](/quest/next/jitter-flush-clock.md) - the advertised jitter (#3513 landed the flush span), whose relationship to the measured target the spec settles +- [Jitter clock](/quest/next/jitter-flush-clock.md) - the advertised jitter (#3513 landed the flush span), which `doc/concept/audio-jitter.md` settles as a floor on the measured target - [Audio quality harness](/quest/next/audio-quality-harness/README.md) - the automated proof, built on its own schedule - [Time stretch](/quest/next/watch-audio-time-stretch.md) - inaudible convergence, on top of this - [Plan: A/V clock](/quest/dev/plan-av-clock.md) - the clock this target eventually feeds diff --git a/quest/main/audio-jitter-target/native.md b/quest/main/audio-jitter-target/native.md index 4713ee59887..11dfd4de367 100644 --- a/quest/main/audio-jitter-target/native.md +++ b/quest/main/audio-jitter-target/native.md @@ -2,9 +2,9 @@ ## Goal -Native playback holds a jitter buffer sized by the algorithm from -[Spec](/quest/main/audio-jitter-target/spec.md), and passes the same conformance -vector as the browser on the same trace. `moq play` on a path with uneven +Native playback holds a jitter buffer sized by the algorithm in +`doc/concept/audio-jitter.md`, and passes the same conformance corpus as the +browser on the same trace. `moq play` on a path with uneven arrivals plays through a flush without underrunning, where today it has nothing to absorb one. @@ -23,18 +23,18 @@ already that far ahead. - Measure arrivals at the same point the browser does, on the container consumer before the age budget can skip a group, so both languages estimate - from the same observation. + from the same observation. That is `container::Consumer::read()`, awaited at + `rs/moq-audio/src/decode/consumer.rs:224`, which is one-to-one with arrivals + and reads no clock today. - Add the knob to `decode::Options`, additive on the `#[non_exhaustive]` struct, - so it targets `main`. The spec quest settles the final name and shape before - this implementation starts; `delay` is the recommendation, matching the - browser while `max_age` remains the live-edge skip budget. Do not reopen or - independently choose the public spelling in this implementation. + so it targets `main`. The name is settled: `delay`, matching the browser, + while `max_age` remains the live-edge skip budget. Do not reopen it. - An explicit `Some(d)` fixes the receiver's jitter target and disables adaptation, matching the browser's numeric delay setting. `None` selects the shared automatic estimator. Publisher-declared buffering remains a - separate contribution, with the same composition in both implementations. - The spec must define precedence against `max_age` and retention; refuse an - impossible explicit target rather than silently changing it. + separate contribution, floored rather than added, with the same composition in + both implementations. Refuse an explicit target that is negative or beyond the + track's retention rather than silently changing it. - The estimator itself is internal. Only the config field and whatever the playback path needs to report its current target become public, and each one is argued for rather than exposed by default. @@ -43,10 +43,10 @@ already that far ahead. - The playback sink holds the target the way the browser's rings do: slack above it, land on it when skipping, re-stall when dry so the next insert refills to the target rather than playing on an empty cushion. -- Tests: the conformance vector from the spec, plus a decode-path test that - replays the same trimmed arrival trace the browser replays and asserts the - same target series. +- Tests: the conformance corpus at `doc/concept/audio-jitter/*.json`, read + directly from Rust, plus a decode-path test that replays the same trimmed + arrival trace the browser replays and asserts the same target series. +- The frame duration comes from the codec. `opus::packet_samples` already + parses the TOC byte in `rs/moq-mux/src/codec/opus/mod.rs`, but it is + `pub(crate)`, so reaching it means widening its visibility or moving it. -## Required - -- [Spec](/quest/main/audio-jitter-target/spec.md) - the algorithm this implements diff --git a/quest/main/audio-jitter-target/spec.md b/quest/main/audio-jitter-target/spec.md deleted file mode 100644 index ed21adc4b1c..00000000000 --- a/quest/main/audio-jitter-target/spec.md +++ /dev/null @@ -1,222 +0,0 @@ -# [S] The audio playout target algorithm is written down once - -## Goal - -One document under `doc/concept` describes how a receiver estimates its audio -playout target from arrival timing, in enough detail that two implementations -written from it agree on the same trace. Every constant has a stated origin. A -conformance corpus, arrival traces and the target series each must produce, -lives beside it as checked-in JSON so both languages test against the same -numbers rather than against each other. - -Boundaries: no production code. The implementations are the sibling quests, and -either may send a correction back here. - -## Plan - -The survey is done; it is recorded here so the implementations do not repeat -it. What remains is the writing and the corpus. - -### Settled receiver policy - -An explicit delay fixes the receiver jitter target and disables adaptation; -auto uses the estimator. Keep publisher buffering and backend render slack -separate from that target. Define their composition and retention limits once -for native and browser playback, including refusal of impossible fixed targets. -Settle the native config spelling with the maintainer (`delay` is the -recommendation) and document its mapping to the browser. Before completing -this planning quest, update both implementation quests and -include fixed-versus-auto cases in the shared conformance corpus. - -### What to implement against - -WebRTC's NetEq, but not the file the name suggests. `delay_manager.cc` on -current main is a 103-line composition; the algorithm lives in -`underrun_optimizer.{h,cc}`, `reorder_optimizer.{h,cc}`, `histogram.{h,cc}`, -and `packet_arrival_history.{h,cc}` under -`modules/audio_coding/neteq/`. In priority order: - -1. **Relative arrival delay**, the highest-value idea and the cheapest. - `delay(p) = max(0, (arrival(p) - arrival(ref)) - (rtp(p) - rtp(ref)))` where - `ref` is the packet in a 2 s window minimising `arrival - rtp`, that is, the - fastest recent packet, tracked with a monotonic deque. Delay against the - best-case path, not against the previous packet. An inter-arrival estimator - is structurally blind to a slow build-up: a hundred packets each 2 ms late - read as a hundred tiny observations, where this reads as a delay climbing to - 200 ms. Frame timestamps stand in for RTP timestamps and there are no - sequence numbers to unwrap. -2. **Reordered arrivals are excluded, not measured.** When a newer group - arrives before an older one, `arrival(p) - arrival(ref)` is positive while - the timestamp difference is negative, so the media-time gap between them is - *added* to the measured delay. That is the same failure this questline - exists to fix, a media-time distance leaking into a delay measurement, and it - arrives through the front door: `Container.Consumer` takes groups off - `recvGroup()` in delivery order and sorts afterwards, so out-of-order - observation is ordinary input rather than an edge case. WebRTC pairs the - formula with exactly this guard, which the description above omitted: - `DelayManager::Update` carries a `reordered` flag, `PacketArrivalHistory` - keeps reordered packets out of its min and max deques, and only the - `ReorderOptimizer` sees them, costed as delay against loss. Say what counts - as reordered here, keep those arrivals out of the reference and the - histogram, and put a reordering case in the conformance corpus. -3. **An empirical histogram with an exponential forget factor, read at a - quantile.** 20 ms buckets, 100 of them. Seed the cold start with the - decaying `0.5^(i+1)` prior. A quantile of an empirical distribution, not a - mean plus k deviations: network delay is heavy-tailed and one-sided, so a - Gaussian assumption sizes the tail wrong. -4. **Max-over-interval resampling**, 500 ms. Easy to miss and behaviourally - significant: the histogram takes one observation per interval, the maximum - in it. That decorrelates observations and turns the forget factor into a - wall-clock time constant, which is the only form worth documenting. -5. **A cold-start forget ramp**, WebRTC's `start_forget_weight`, so the first - seconds converge instead of crawling. -6. **Explicit delay-versus-loss cost minimisation** for the late tail. WebRTC's - `ReorderOptimizer` and SpeexDSP's `compute_opt_delay` reached the same shape - independently, which is decent evidence it is right. Defer it; ship the - underrun estimator first. - -Current defaults on main, for reference and not for copying blind: quantile -`0.95`, underrun forget factor `0.983`, resample interval `500ms`, start -forget weight `2`, reorder forget factor `0.9993`, `ms_per_loss_percent` `20`. -The widely repeated "0.97" is a transitional value, not head. - -Say explicitly that the forget factor decays once per *resampled observation*, -not once per arrival, and give the resulting wall-clock memory -(`500ms / (1 - 0.983)`, about 29 s). Applying a per-observation factor per -arrival is the mistake the #3517 branch makes, and a number that reads plausible either way -is the kind that survives review. - -Then settle what an interval with no arrival does. An empty interval produces no -observation and therefore no decay step, so the wall-clock memory above does not -survive a pause unless elapsed empty intervals decay the histogram too. Either -decay them and say so, or drop the wall-clock claim; the conformance corpus needs -a case with a gap in it either way. - -Define units once, for both the algorithm and the corpus: what clock arrival -times are on, what timescale frame timestamps use and how they convert, and -what a timestamp discontinuity does to the reference. Two implementations that -disagree on any of these produce different targets from the same trace while -both look correct. - -**What the #3517 branch still gets wrong, reproduced.** PR #3517 is closed, -but its branch (`origin/quest/main/3477-watch-auto-latency`) is where the watch -quest starts, and a viewer on it reads a -14.56 s jitter buffer in auto. The estimator cannot produce that from its -histogram: the percentile is clamped to `BUCKETS * BUCKET`, one second. The -unbounded term is the "plus one frame" on top of it. - -`Jitter` learns that frame duration as the running minimum of positive gaps -between consecutive observed media timestamps, so the *first* gap sets it with -nothing to validate against. A tune-in that observes a frame from a stale group -and then the live edge sets it to the distance between them, seconds rather -than milliseconds. `#publish` then raises the target instantly and -unconditionally to `percentile() + step`, and lowers it by one *corrected* -step per second afterwards. Inflation is immediate; deflation is 20 ms/s. -`reanchor()` clears `#latest` but not the spacing, so the bad value outlives -the discontinuity that caused it. - -Replaying two frames 14.5 s apart in media time, then twenty minutes of -perfectly paced audio with zero real jitter: - -``` -after 2 frames: spacing=14500ms target=14.50s - + 1s live, zero jitter: target=14.48s - + 60s live, zero jitter: target=13.30s - + 300s live, zero jitter: target=8.50s - + 600s live, zero jitter: target=2.50s - + 900s live, zero jitter: target=0.02s -``` - -Two lessons for the document, both structural rather than a constant to retune: - -- **Frame duration is a codec property, not an observation.** NetEq's - packet-time units come from the codec for the same reason. Deriving it from - arbitrary timestamp arithmetic makes a tune-in artifact indistinguishable - from a real frame duration. - - Where it comes from is an open question this quest answers, because the - catalog does not carry it: `AudioConfig` has `sampleRate` and `bitrate`, and - its own comment concedes the frame duration "depends on the codec, sample - rate, etc." Opus makes this sharp, since the encoder picks 2.5, 5, 10, 20, - 40, or 60 ms independently of both. Candidates, in order of how little they - cost: the Opus TOC byte, which self-describes the frame duration in band and - needs no schema change; the decoded frame's own sample count, exact but only - known below the container layer where the estimator currently sits; or a new - catalog field, which is the expensive option and would need the full - cross-package sync (`rs/hang`, `js/hang`, `doc/concept`, and the hang draft). - Pick one and say why; do not leave it to each implementation. - - There is prior art to reconcile rather than ignore. `js/watch/src/audio/config.ts` - already derives a per-codec frame duration and then adds `WORKLET_QUANTUM`, the - AudioWorklet's fixed 128-sample render block, so 48 kHz stereo Opus reads as - 23 ms rather than 20 ms. Native has no worklet and its device buffer is a - property of the backend, so if the shared step carries the browser's quantum - and native's does not, the two produce different target series from the same - trace and the conformance corpus cannot hold. Decide whether the render block - belongs in the estimator's step at all or in the ring's slack above it, and - give native's equivalent a name. Note also that this code assumes 20 ms Opus - frames, which is the same guess the catalog cannot settle. -- **The target needs a clamp and a bounded rise.** WebRTC clamps in - `DelayConstraints` (`delay_constraints.{h,cc}`), applied by `DecisionLogic` - rather than by the delay manager, with a hard ceiling at 75% of buffer - capacity. The #3517 branch clamps the percentile but not the frame term on - top of it, and has no rise limit, so any single bad - observation is permanent on the timescale a viewer will wait. - -The forget factor is a separate and smaller divergence: `0.9993` is NetEq's -*reorder* factor where the underrun path uses `0.983`, applied per arrival with -no 500 ms resampling. Worth fixing, but it is not what produces 14.56 s. - -### Licensing - -WebRTC is BSD-3 plus a PATENTS grant. Copying source means carrying a third -license and its disclaimer inside a `MIT OR Apache-2.0` repository. Implement -from the described algorithm instead, in `f64`, citing WebRTC in a comment as -the design's source. The Q15/Q30 fixed point exists for 2010-era DSPs; floating -point is simpler here and removes a whole class of cross-language parity bug. - -Do not read Asterisk's `main/jitterbuf.c` (GPLv2) or FreeSWITCH's -`switch_jitterbuffer.c` (MPL 1.1) while writing this. SpeexDSP's `jitter.c` is -BSD-3 and safe to read for the cost-minimisation idea. - -### Why not a dependency - -The `neteq` crate (`security-union/videocall-rs`, MIT OR Apache-2.0, actively -released, ships a WASM build) is the only viable candidate and was rejected: -its relative-arrival-delay step takes a percentile over per-packet deltas each -clamped at zero, which cannot see a build-up, the one property the design -exists for; its `ReorderOptimizer` is configured but never implemented; and it -is a whole NetEq, sample-rate-locked ring buffers and WSOLA and PLC, where this -needs a few hundred lines of estimator. Its shape would leak into our API. -Nothing else is close: `webrtc-rs` and `str0m` deliberately leave playout to -the application, GStreamer's `rtpjitterbuffer` solves clock skew rather than -target sizing and is LGPL, and no browser-usable JS port exists. - -### The document - -Write `doc/concept/`, covering the observation point, the estimator, rise and -fall, startup and re-anchoring, and the clamp. Specifically: - -- Measure at container frame arrival and before the age budget can skip a - group. The #3517 branch has this right, and it matters: a target derived from what - survives the budget only ever confirms the budget it was cut to. -- Rise and fall asymmetry is the "too aggressive or not aggressive enough" - dial, so it gets a justification rather than a number. -- The clamp reads the rendition's advertised flush span from [Jitter - clock](/quest/next/jitter-flush-clock.md), which #3513 landed as the - structural flush span. That field is a - publisher-declared floor and the estimate is a measurement of the network: - say plainly which is which, because the shared word "jitter" invites - confusion. The #3517 branch combines them with a max on the grounds they describe the - same quantity; that reasoning does not survive the distinction, so revisit it. -- The document is normative, not either implementation. Parity is held by the - conformance corpus, one JSON fixture set run by both test suites, the way - wire behaviour is held aligned today. A wasm core shared into the browser - audio path is a larger architectural commitment than this warrants. - -Not an IETF draft: nothing here is negotiated on the wire, and a receiver that -chooses differently is still conformant. - -## Related - -- [Jitter clock](/quest/next/jitter-flush-clock.md) - the advertised jitter the clamp reads; #3513 landed the flush span, this is its clock-based follow-on diff --git a/quest/main/audio-jitter-target/watch.md b/quest/main/audio-jitter-target/watch.md index ad283bacd71..0c097caa5e7 100644 --- a/quest/main/audio-jitter-target/watch.md +++ b/quest/main/audio-jitter-target/watch.md @@ -2,9 +2,9 @@ ## Goal -`js/watch` computes its auto target with the algorithm from -[Spec](/quest/main/audio-jitter-target/spec.md) and passes the conformance -vector. The "Real-time" preset plays clean audio on a LAN and against the +`js/watch` computes its auto target with the algorithm in +`doc/concept/audio-jitter.md` and passes the conformance corpus beside it. The +"Real-time" preset plays clean audio on a LAN and against the public relay: zero underruns after convergence and no skip-aheads in steady state, on both the isolated and the postMessage ring paths, confirmed by a manual run on Chrome and Safari with a real microphone and 40 ms or more of @@ -16,16 +16,19 @@ them. ## Plan -Start from `origin/quest/main/3477-watch-auto-latency`, the branch of the closed -PR #3517, two commits ahead of `dev`. Rebase it onto the base branch first. -Nothing on `main` or `dev` has any of it: `js/watch/src/sync.ts:150` still -sizes auto from `minRtt * 1.25`. +Start from `origin/quest/m0/3477-watch-auto-latency`, the branch of the closed +PR #3517, two commits ahead of `dev`. Rebase it onto the base branch first, and +expect conflicts: `sync.ts` on `main` has since replaced the `audio`/`video` +inputs with a `register(jitter)` list. Nothing on `main` or `dev` has any of +it: `js/watch/src/sync.ts:159` still sizes auto from `minRtt * 1.25`. What the branch already has, and this quest keeps: -- The RTT term is gone. `js/watch/src/audio/latency.ts` is deleted, and - `MIN_JITTER`, `FALLBACK_JITTER` and `#minRtt` are gone from `sync.ts`; auto - is the larger of the per-track spreads. +- The RTT term is gone. `MIN_JITTER`, `FALLBACK_JITTER` and `#minRtt` are gone + from `sync.ts` and auto is the larger of the per-track spreads. + `js/watch/src/audio/latency.ts` survives, minus `reanchorFloor`; `ringSamples` + and `RENDER_QUANTUM` stay, and `RENDER_QUANTUM` belongs to the ring's slack + rather than to the target. - The measurement point: `Container.Consumer` observes each frame at arrival, before the age budget can skip a group, and exposes it as a `spread` getter. - The estimator in `js/hang/src/container/jitter.ts`: a histogram of 5 ms @@ -39,24 +42,33 @@ What the branch already has, and this quest keeps: the stats panel and the buffering indicator. `replay.test.ts` drives both rings from a recorded arrival trace. -What remains is conformance to the spec: +What remains is conformance to `doc/concept/audio-jitter.md`. The +document's estimator is a different enough shape that rewriting `jitter.ts` +against it is likely cheaper than patching the branch's: - The "plus one frame" term. `jitter.ts` learns it as the running minimum of positive gaps between consecutive observed timestamps, so the first gap sets it with nothing to validate against, `#publish` raises the target to `percentile + step` immediately, and `reanchor()` clears `#latest` but not the - learned spacing. That is the 14.56 s reading reproduced in the spec, and it - still reproduces on the branch head. Write the regression first: two frames - whose media timestamps are far apart, then paced audio with zero real jitter, - asserting the target stays near the frame duration. Then take the frame - duration from the source the spec settles on rather than from observed - timestamps, and bound the rise. -- The forget factor: the spec's resampled 500 ms maximum with the underrun - factor, decayed per observation rather than per arrival, replacing the - per-arrival `0.9993`. -- Reordered arrivals excluded from the reference and the histogram, per the - spec. + learned spacing. That is the 14.56 s reading, and it still reproduces on the + branch head. Write the regression first: two frames whose media timestamps are + far apart, then paced audio with zero real jitter, asserting the target stays + near the frame duration. Then take the frame duration from the codec, which + for Opus means parsing the TOC byte at the container layer, since `js/` has no + parser today and `js/watch/src/audio/config.ts` guesses 20 ms. +- Delay measured against the fastest frame in a 2 s media-time window, not + against a 30 s arrival minimum. Pruning by media time is what makes a + timestamp jump self-correcting, so `reanchor()` goes away. +- The histogram: 20 ms buckets, 100 of them, the underrun forget factor decayed + once per resampled 500 ms maximum rather than per arrival, the cold-start + prior, and the startup ramp. No rise or fall limiter; the document explains + why the branch needed one and this does not. +- Reordered arrivals excluded from the reference and the histogram. +- The advertised jitter floors the target instead of being added to it. + `sync.ts` sums them today, which over-buffers a bursty publisher by its own + flush span. - Run the conformance corpus in `jitter.test.ts` alongside the existing cases. + `doc/concept/audio-jitter/*.json` is checked in and read directly. - Check what the viewer's saved preset does on load. The element defaults `delay` to `"auto"` and nothing in `demo/` overrides it, yet a fresh session came up on the 100 ms chip, so something is restoring or overriding it. Pin @@ -83,10 +95,6 @@ reading `probe`; removing it is part of the `SyncInput` reshape in [Plan: A/V clock](/quest/dev/plan-av-clock.md). Land the estimator so that quest can adopt it without a second estimator change. -## Required - -- [Spec](/quest/main/audio-jitter-target/spec.md) - the algorithm this implements - ## Related - [Plan: A/V clock](/quest/dev/plan-av-clock.md) - reshapes `SyncInput` around the per-track spread this quest produces