Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
5e5b614
chore(quest): claim quest/m1/push-to-talk/dtx.md
kixelated Nov 5, 2026
766cb0a
feat(publish): muting suppresses audio instead of disabling the rendi…
kixelated Nov 5, 2026
ecdb7f9
feat(watch)!: play a declared silence as comfort noise and stop holdi…
kixelated Nov 5, 2026
0b48964
feat!: retire the disabled-rendition hold in Rust consumers, bindings…
kixelated Nov 5, 2026
d1a8284
feat(audio): the jitter estimator ignores a declared silence
kixelated Nov 5, 2026
28da212
quest: finish push-to-talk silence suppression
kixelated Nov 5, 2026
e66a0c2
Merge remote-tracking branch 'origin/main' into quest/m1/push-to-talk…
kixelated Nov 5, 2026
e8dcc5d
chore: format and refresh the @moq/publish API report
kixelated Nov 5, 2026
ae9a9e1
test(audio-quality): cover the push-to-talk catalog and playback fail…
kixelated Nov 5, 2026
4b465f7
fix(watch): play the next utterance after a declared end without flus…
kixelated Nov 5, 2026
6fce9e5
fix(watch): keep an utterance's tail when the next one starts after a…
kixelated Nov 5, 2026
787d3c8
Merge remote-tracking branch 'origin/main' into quest/m1/push-to-talk…
kixelated Nov 5, 2026
2c4237c
fix: merge main and address push-to-talk browser review findings
kixelated Nov 5, 2026
5866146
style(watch): format buffering indicator
kixelated Nov 5, 2026
f52bc24
test(watch): distinguish utterance and timeline resets
kixelated Nov 5, 2026
4323f4b
Merge origin/main; play declared pauses as comfort noise
kixelated Nov 5, 2026
55b489d
fix(gst)!: a disabled moqsrc rendition ends its pad
kixelated Nov 5, 2026
1a98486
style(gst): rustfmt
kixelated Nov 5, 2026
1adb09a
fix(watch): drop declared silences the overflow skips
kixelated Nov 5, 2026
c0dee9c
Merge remote-tracking branch 'origin/main' into HEAD
kixelated Nov 5, 2026
992fd8b
Merge remote-tracking branch 'origin/main' into HEAD
kixelated Nov 5, 2026
b62d2e5
fix(moq-gst): a disable ends its pad even when re-enabled during a bl…
kixelated Nov 5, 2026
ff44f48
fix(moq-gst): a disable cuts the play on its pad even when its reader…
kixelated Nov 5, 2026
f106663
Merge remote-tracking branch 'origin/main' into HEAD
kixelated Nov 5, 2026
1c770a8
fix(moq-audio): a declared end survives a lost group
kixelated Nov 5, 2026
a9085c9
fix(watch): a listener that joins during a mute plays declared silence
kixelated Nov 5, 2026
500b606
Merge remote-tracking branch 'origin/main' into HEAD
kixelated Nov 5, 2026
68f8750
Merge origin/main into quest/m1/push-to-talk/dtx
kixelated Nov 5, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 9 additions & 18 deletions cpp/obs/src/moq-source.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -611,18 +611,15 @@ moq_source_ranked_audio(const std::unordered_map<std::string, moq::Audio> &rendi
});
}

// The ranked renditions to try in turn: the enabled ones. With none enabled, a consumer
// should not select a rendition but holds the one it has, so only those `held` accepts.
template<typename Rendition, typename Held>
// The ranked renditions to try in turn: the enabled ones, since a consumer must not select a
// disabled rendition.
template<typename Rendition>
static std::vector<const CatalogEntry<Rendition> *>
moq_source_candidates(std::vector<const CatalogEntry<Rendition> *> ranked, Held held)
moq_source_candidates(std::vector<const CatalogEntry<Rendition> *> ranked)
{
const bool any_enabled =
std::any_of(ranked.begin(), ranked.end(), [](const auto *entry) { return entry->second.enabled; });
ranked.erase(
std::remove_if(ranked.begin(), ranked.end(),
[&](const auto *entry) { return any_enabled ? !entry->second.enabled : !held(*entry); }),
ranked.end());
ranked.erase(std::remove_if(ranked.begin(), ranked.end(),
[](const auto *entry) { return !entry->second.enabled; }),
ranked.end());
return ranked;
}

Expand Down Expand Up @@ -976,10 +973,7 @@ static void moq_source_subscribe_track(struct moq_source *ctx, const std::shared
static void moq_source_subscribe_video(struct moq_source *ctx, const std::shared_ptr<Connection> &conn,
const moq::Catalog &catalog)
{
const auto candidates = moq_source_candidates(moq_source_ranked_video(catalog.video), [&](const auto &entry) {
return moq_source_same_video(conn->video.get(), entry.first, entry.second) ||
moq_source_same_video(conn->pending_video.get(), entry.first, entry.second);
});
const auto candidates = moq_source_candidates(moq_source_ranked_video(catalog.video));
if (candidates.empty()) {
LOG_INFO("Catalog has no enabled video rendition; audio only");
moq_source_clear_video_locked(ctx);
Expand Down Expand Up @@ -1021,10 +1015,7 @@ static void moq_source_subscribe_video(struct moq_source *ctx, const std::shared
static void moq_source_subscribe_audio(struct moq_source *ctx, const std::shared_ptr<Connection> &conn,
const moq::Catalog &catalog)
{
const auto candidates = moq_source_candidates(moq_source_ranked_audio(catalog.audio), [&](const auto &entry) {
return moq_source_same_audio(conn->audio.get(), entry.first, entry.second) ||
moq_source_same_audio(conn->pending_audio.get(), entry.first, entry.second);
});
const auto candidates = moq_source_candidates(moq_source_ranked_audio(catalog.audio));
if (candidates.empty()) {
LOG_INFO("Catalog has no enabled audio rendition; video only");
moq_source_clear_audio_locked(ctx);
Expand Down
43 changes: 6 additions & 37 deletions cpp/obs/test/moq-source-test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1187,24 +1187,12 @@ int main()
std::vector<std::string>{"f-stereo", "d-mono", "e-slow", "c-low", "b-unknown-bitrate",
"a-disabled"}));

// Only enabled renditions are candidates while any is, even one the source holds.
const auto all = [](const auto &) {
return true;
};
const auto none = [](const auto &) {
return false;
};
CHECK((names(moq_source_candidates(moq_source_ranked_audio(audios), all)) ==
// Only enabled renditions are candidates.
CHECK((names(moq_source_candidates(moq_source_ranked_audio(audios))) ==
std::vector<std::string>{"f-stereo", "d-mono", "e-slow", "c-low", "b-unknown-bitrate"}));
// With every rendition disabled, only a held one remains, and nothing when none is held.
for (auto &entry : audios)
entry.second.enabled = false;
const auto held = [](const auto &entry) {
return entry.first == "c-low";
};
CHECK((names(moq_source_candidates(moq_source_ranked_audio(audios), held)) ==
std::vector<std::string>{"c-low"}));
CHECK(moq_source_candidates(moq_source_ranked_audio(audios), none).empty());
CHECK(moq_source_candidates(moq_source_ranked_audio(audios)).empty());
}
report("renditions rank like hang");

Expand Down Expand Up @@ -1308,8 +1296,8 @@ int main()
}
report("disabled and undecodable renditions fall through");

// With every rendition disabled, the source holds the one it plays; with none of them
// held, the section is handled like an absent one.
// With every rendition disabled, the section is handled like an absent one, even the
// rendition the source plays.
{
TestRelay relay;
reset(relay.Url());
Expand All @@ -1318,29 +1306,10 @@ int main()
CHECK(publisher.WriteUntil([] { return g_output_frames > 0 && g_output_audio > 0; }));
auto snapshot = CatalogSnapshot(publisher);
auto *ctx = static_cast<moq_source *>(source);
std::weak_ptr<Track> video;
std::weak_ptr<Track> audio;
for (auto &entry : snapshot.video)
entry.second.enabled = false;
for (auto &entry : snapshot.audio)
entry.second.enabled = false;
{
std::lock_guard<std::mutex> lock(ctx->mutex);
const auto &conn = ctx->connection;
video = conn->video;
audio = conn->audio;
moq_source_subscribe_video(ctx, conn, snapshot);
moq_source_subscribe_audio(ctx, conn, snapshot);
CHECK(conn->video && conn->video == video.lock() && !conn->pending_video);
CHECK(conn->audio && conn->audio == audio.lock() && !conn->pending_audio);
}
const int frames = g_output_frames;
CHECK(publisher.WriteUntil([&] { return g_output_frames >= frames + 3; }));

// A disabled rendition the source does not play is not held.
auto &config = snapshot.video.begin()->second;
config.coded = moq::Dimensions{(config.coded ? config.coded->width : 0) + 16, 16};
snapshot.audio.begin()->second.sample_rate += 1;
const int blanks = g_blank_calls;
{
std::lock_guard<std::mutex> lock(ctx->mutex);
Expand All @@ -1353,7 +1322,7 @@ int main()
CHECK(g_blank_calls > blanks);
destroySource(source);
}
report("all-disabled section holds the playing rendition");
report("an all-disabled section clears the playing rendition");

// A rendition's stream instance is part of what names it, for the active and the pending
// track alike: a sibling publisher restarting behind a stable catalog resubscribes.
Expand Down
4 changes: 2 additions & 2 deletions dart/moq_ffi/lib/src/moq.dart
Original file line number Diff line number Diff line change
Expand Up @@ -23989,7 +23989,7 @@ void _checkApiChecksums() {
throw UniffiInternalError.panicked("UniFFI API checksum mismatch");
}
if (uniffi_moq_ffi_checksum_constructor_moqaudioconsumer_subscribe() !=
42847) {
37967) {
throw UniffiInternalError.panicked("UniFFI API checksum mismatch");
}
if (uniffi_moq_ffi_checksum_constructor_moqaudioencoder_new() != 52616) {
Expand Down Expand Up @@ -24075,7 +24075,7 @@ void _checkApiChecksums() {
throw UniffiInternalError.panicked("UniFFI API checksum mismatch");
}
if (uniffi_moq_ffi_checksum_constructor_moqvideoconsumer_subscribe() !=
59752) {
7811) {
throw UniffiInternalError.panicked("UniFFI API checksum mismatch");
}
if (uniffi_moq_ffi_checksum_constructor_moqvideoencoder_new() != 22531) {
Expand Down
6 changes: 1 addition & 5 deletions doc/bin/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -277,11 +277,7 @@ audio-device dependencies:
cargo install moq-cli --no-default-features --features "quic,websocket,play,openh264"
```

`moq play` skips disabled renditions when it picks one. If no enabled rendition
matches its name and codec filters, it waits for a later catalog. Disabling the
current rendition switches to an enabled one of its kind that matches the
filters; with none, it stays subscribed, so re-enabling it (an unmute) plays at
once.
`moq play` skips disabled renditions. If none are enabled, it waits for a later catalog. Disabling the current rendition stops it and selects an enabled replacement.

## Capture

Expand Down
7 changes: 1 addition & 6 deletions doc/bin/gstreamer.md
Original file line number Diff line number Diff line change
Expand Up @@ -185,9 +185,4 @@ To decrypt a capture, set `quic-keylog=true` on either element along with
`SSLKEYLOGFILE`; the variable alone writes nothing, and the flag without it fails
the start. Existing Unix log files must be private (mode 0600); files accessible to group or others are refused.

`moqsrc` initially selects only enabled renditions. When a selected rendition is
disabled, it keeps reading on the same pad while no rendition of its kind is
enabled, so media arriving before the re-enable catalog update still plays. An
enabled alternative stops the disabled reader but keeps its pad idle without EOS;
enabling it again resumes on that pad. Removing a rendition drains its track and
ends its pad.
`moqsrc` creates source pads only for enabled renditions. Disabling a rendition stops its media and ends its pad with EOS; enabling it again adds a new pad, which starts at the live edge like any added rendition. Removing a rendition drains its track and ends its pad.
2 changes: 1 addition & 1 deletion doc/bin/obs.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ reconnects keep the same instance. A
stop/start, or an OBS auto-reconnect after the client gives up, republishes
the broadcast under a new instance, which viewers see as a new stream.

MoQ Source plays the best enabled audio and video rendition it can decode and place. It follows catalog changes while keeping the current audio and video playing until a replacement produces decoded output. A decoder setup refusal tries the next ranked rendition, including when a supported codec name carries a description the decoder cannot use. A later peer or decode failure leaves the current rendition playing. Disabling every rendition of a media kind keeps the one already playing; removing the media kind from the catalog clears it. It also follows a restarted or replaced publisher, including a sibling broadcast the catalog points at, playing the new one from its first keyframe.
MoQ Source plays the best enabled audio and video rendition it can decode and place. It follows catalog changes while keeping the current audio and video playing until a replacement produces decoded output. A decoder setup refusal tries the next ranked rendition, including when a supported codec name carries a description the decoder cannot use. A later peer or decode failure leaves the current rendition playing. Disabling or removing every rendition of a media kind clears it. It also follows a restarted or replaced publisher, including a sibling broadcast the catalog points at, playing the new one from its first keyframe.

The source plays Opus, AAC-LC (mono or stereo), and PCM audio. A channel count names its speakers by the WAVE convention: 1, 2, 3 (2.1), 6 (5.1), and 8 (7.1) play on the matching OBS layout, while quad and 5.0 are upmixed to 5.1 and 6.1 to 7.1, which OBS lacks. Other counts are refused.

Expand Down
32 changes: 30 additions & 2 deletions doc/concept/audio-jitter.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,13 +103,20 @@ observe(arrival, media):
origin = arrival; interval = 0; peak = delay; return

index = floor((arrival - origin) / RESAMPLE)
resumed = ended; ended = false
if index <= interval:
peak = max(peak, delay); return

fold(bucket of peak)
fold(nothing) for each elapsed empty interval, at most IDLE_MAX
if resumed: # a declared silence folds nothing
origin = arrival; index = 0
else:
fold(nothing) for each elapsed empty interval, at most IDLE_MAX
interval = index; peak = delay

end(): # a declared end precedes the next observation
if not first observation: ended = true

fold(bucket): # prior starts at 1
rest = 1 - FORGET * (1 - prior) # what the decayed evidence leaves
fresh = min(FRESH_MAX, rest) if bucket else 0
Expand Down Expand Up @@ -474,6 +481,25 @@ keeps decaying at the base rate. Only the weight the prior regained is replaced
quickly, the same way it is at cold start, since it stands for no evidence at
all.

### Declared silence

A publisher that stops sending on purpose, such as a muted push-to-talk
speaker, marks the stop with a declared end. The silence after it says
nothing about the path, so relaxing toward the prior would only make a
listener who sat through a long mute come back over-buffered. `end()` tells
the estimator that a declared end lies between the previous observation and
the next. The next measured observation then folds the pending interval as
usual and starts a fresh interval at its own arrival instead of folding the
intervals in between. If it lands in the pending interval it is merged as
usual, since there is nothing to skip. Either way the end is spent, so a
later gap the publisher did not declare still relaxes the estimate. The
reference history, the histogram, and the prior are untouched, and an end
before the first observation, or under a fixed target, does nothing.

The receiver calls `end()` before observing the first frame from a group later
than the declared end's own: the stopped encoder's final packets may follow the
marker in its group, and they belong to the speech before the silence, not after it.

## Fixed targets

An explicit delay **fixes the target and disables adaptation**. It is taken
Expand Down Expand Up @@ -552,7 +578,8 @@ directly, so neither is graded against the other.
`arrival` and `media` are parallel arrays in **delivery order**, the order the
receiver observes them, so `media` is deliberately out of order in the
`reorder` and `backlog` cases. `advertised` and `delay` are present only where the case uses
them. `target` lists `[frame index, target]` at every frame where the target
them, as is `ends`: the indices, ascending, of the frames observed right after a
[declared end](#declared-silence), each of which calls `end()` before it is observed. `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.
Expand All @@ -566,6 +593,7 @@ index. Tolerance is 1e-6 ms, which the `f64` rules above make generous.
| `reorder` | A run delivered after a newer one is measured against the frames before it, so the target covers waiting for it |
| `backlog` | A backlog delivered newest first behind the live edge is not measured, so its media span never reaches the target |
| `idle` | A 30 s gap relaxes the histogram toward the prior |
| `silence` | A declared 60 s silence and a declared pause leave the target where it was, and a later undeclared gap still relaxes it |
| `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 |
| `straggler` | One late interval after the prior is spent leaves the target where it was |
Expand Down
16 changes: 15 additions & 1 deletion doc/concept/audio-jitter/corpus.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ export interface Case {
arrival: number[];
/** Each frame's container timestamp in milliseconds, in the same order. */
media: number[];
/** Indices of the frames observed right after a declared end, in ascending order. */
ends?: number[];
/** `[frame index, target]` wherever the target differs from the previous frame's. */
target: [number, number][];
}
Expand Down Expand Up @@ -87,14 +89,19 @@ function paced(frames: number, frame: number, base: number): Trace {
}

/** 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][] {
function run(
trace: Trace & { ends?: number[] },
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;

const ends = new Set(trace.ends);
for (let i = 0; i < trace.arrival.length; i++) {
if (ends.has(i)) estimator.end();
estimator.observe({ arrival: trace.arrival[i], media: trace.media[i] });
const value = estimator.target;
if (value !== previous) target.push([i, value]);
Expand Down Expand Up @@ -171,6 +178,13 @@ const traces: Omit<Case, "target">[] = [
frame: FRAME,
...gap(paced(1000, FRAME, 50), 500, 30_000),
},
{
name: "silence",
about: "Even audio, a declared end and 60 s of silence, 5 s more, a declared 100 ms pause inside one interval, 5 s more, then an undeclared 30 s gap. Unlike `idle`, a declared silence is not evidence, so the target holds through both; the undeclared gap still relaxes it, since an end covers only the silence it declares.",
frame: FRAME,
...gap(gap(gap(paced(1500, FRAME, 50), 500, 60_000), 760, 100), 1000, 30_000),
ends: [500, 760],
},
{
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.",
Expand Down
26 changes: 21 additions & 5 deletions doc/concept/audio-jitter/reference.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ export class Estimator {
#interval = 0;
/** The largest delay seen in that interval. */
#peak = 0;
/** A declared end precedes the next measured observation, so the silence before it is not idle. */
#ended = false;

#histogram = prior();
/** How much of the histogram is still the prior's rather than evidence. */
Expand Down Expand Up @@ -119,22 +121,36 @@ export class Estimator {
}

const interval = Math.floor((arrival - this.#origin) / RESAMPLE);
const resumed = this.#ended;
this.#ended = false;
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);
if (resumed) {
// The publisher declared the silence, so it is not evidence of anything: the
// estimate keeps what it had and a fresh interval starts at this arrival.
this.#origin = arrival;
this.#interval = 0;
} else {
const idle = Math.min(interval - this.#interval - 1, IDLE_MAX);
for (let i = 0; i < idle; i++) {
this.#fold(undefined);
}
this.#interval = interval;
}

this.#interval = interval;
this.#peak = delay;
}

/** A declared end lies between the previous observation and the next. */
end(): void {
// Before any observation there is no interval for the silence to stretch.
if (this.#origin !== undefined) this.#ended = true;
}

/** The target the receiver holds, in milliseconds. */
get target(): number {
let cumulative = 0;
Expand Down
1 change: 1 addition & 0 deletions doc/concept/audio-jitter/silence.json

Large diffs are not rendered by default.

Loading
Loading