From 3701b2b79e49346ef56c259121dc93580979c28d Mon Sep 17 00:00:00 2001 From: Luke Curley Date: Sat, 7 Nov 2026 09:11:25 -0800 Subject: [PATCH 1/2] quest: plan a bus channel reporting what it holds Co-Authored-By: Claude Opus 5.5 --- quest/m3/README.md | 1 + quest/m3/audio-channel-fill.md | 23 +++++++++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 quest/m3/audio-channel-fill.md diff --git a/quest/m3/README.md b/quest/m3/README.md index 80980f02173..bff37cf5fc2 100644 --- a/quest/m3/README.md +++ b/quest/m3/README.md @@ -138,6 +138,7 @@ federation) land. - [Clean ALSA playback onset](/quest/m3/audio-alsa-onset.md) - no onset restarts or clicks over PulseAudio - [Read a bus source's own samples](/quest/m3/audio-strip-tap.md) - a tap reads one source's samples before its delay with their bus-clock positions, for the studio's clap sync - [Pan a bus source](/quest/m3/audio-strip-pan.md) - a strip's constant-power pan places its source between left and right in every mix, for the studio's Audio panel +- [A bus channel reports what it holds](/quest/m3/audio-channel-fill.md) - a writer leading the bus places a first write after silence to the sample, for the studio's A/V sync - [Interop audit](/quest/m3/audit-interop.md) - our interop runner entries match what we ship, and every red interop cell with a moq.dev side is fixed, reported, or noted as down or unsupported - [moq-hls exposes each rendition's bound source](/quest/m3/hls-rendition-source.md) - playlists and segments report the source path and instance they read, so a cache can key on the source - [The memory bench finishes at 1 MiB frames](/quest/m3/memory-bench-hang.md) - the allocation mode's park at `size=1048576` is root-caused and fixed diff --git a/quest/m3/audio-channel-fill.md b/quest/m3/audio-channel-fill.md new file mode 100644 index 00000000000..62d622b1eb0 --- /dev/null +++ b/quest/m3/audio-channel-fill.md @@ -0,0 +1,23 @@ +# [S] A bus channel reports what it holds + +## Goal + +A `moq_audio::bus` `Channel` reports how much PCM it holds and not yet mixed, +or where the bus will mix its next sample, so a writer that leads the bus by +a fixed latency places a first write after silence to the sample, not up to +a block early. + +## Plan + +From [moq-dev/studio#93](https://github.com/moq-dev/studio/pull/93), picked +2026-11-07 (maintainer away under /afk, recommended option). + +The studio's `playout::Writer` writes a source's sound one bus latency +ahead. After a silence it cannot tell how much its channel holds, so it +places the first write relative to the block the bus last mixed, which can +land it up to one block (10 ms in the studio) early. Broadcast and media +sources both hit this. Pick whichever of a fill count or a bus position +makes the writer simplest, and test that a first write after silence is +mixed at the sample it was meant for. + +Public API: one read-only addition to `Channel`. Wire: none. From 6be47347c1d1c5952715312714e8da5ad0212d1e Mon Sep 17 00:00:00 2001 From: Luke Curley Date: Sat, 7 Nov 2026 10:43:23 -0800 Subject: [PATCH 2/2] quest: add studio's first-write evidence to bus-positioned-write Co-Authored-By: Claude Opus 5.5 --- quest/m3/README.md | 1 - quest/m3/audio-channel-fill.md | 23 ----------------------- quest/m3/bus-positioned-write.md | 9 +++++++++ 3 files changed, 9 insertions(+), 24 deletions(-) delete mode 100644 quest/m3/audio-channel-fill.md diff --git a/quest/m3/README.md b/quest/m3/README.md index bff37cf5fc2..80980f02173 100644 --- a/quest/m3/README.md +++ b/quest/m3/README.md @@ -138,7 +138,6 @@ federation) land. - [Clean ALSA playback onset](/quest/m3/audio-alsa-onset.md) - no onset restarts or clicks over PulseAudio - [Read a bus source's own samples](/quest/m3/audio-strip-tap.md) - a tap reads one source's samples before its delay with their bus-clock positions, for the studio's clap sync - [Pan a bus source](/quest/m3/audio-strip-pan.md) - a strip's constant-power pan places its source between left and right in every mix, for the studio's Audio panel -- [A bus channel reports what it holds](/quest/m3/audio-channel-fill.md) - a writer leading the bus places a first write after silence to the sample, for the studio's A/V sync - [Interop audit](/quest/m3/audit-interop.md) - our interop runner entries match what we ship, and every red interop cell with a moq.dev side is fixed, reported, or noted as down or unsupported - [moq-hls exposes each rendition's bound source](/quest/m3/hls-rendition-source.md) - playlists and segments report the source path and instance they read, so a cache can key on the source - [The memory bench finishes at 1 MiB frames](/quest/m3/memory-bench-hang.md) - the allocation mode's park at `size=1048576` is root-caused and fixed diff --git a/quest/m3/audio-channel-fill.md b/quest/m3/audio-channel-fill.md deleted file mode 100644 index 62d622b1eb0..00000000000 --- a/quest/m3/audio-channel-fill.md +++ /dev/null @@ -1,23 +0,0 @@ -# [S] A bus channel reports what it holds - -## Goal - -A `moq_audio::bus` `Channel` reports how much PCM it holds and not yet mixed, -or where the bus will mix its next sample, so a writer that leads the bus by -a fixed latency places a first write after silence to the sample, not up to -a block early. - -## Plan - -From [moq-dev/studio#93](https://github.com/moq-dev/studio/pull/93), picked -2026-11-07 (maintainer away under /afk, recommended option). - -The studio's `playout::Writer` writes a source's sound one bus latency -ahead. After a silence it cannot tell how much its channel holds, so it -places the first write relative to the block the bus last mixed, which can -land it up to one block (10 ms in the studio) early. Broadcast and media -sources both hit this. Pick whichever of a fill count or a bus position -makes the writer simplest, and test that a first write after silence is -mixed at the sample it was meant for. - -Public API: one read-only addition to `Channel`. Wire: none. diff --git a/quest/m3/bus-positioned-write.md b/quest/m3/bus-positioned-write.md index aacfe606719..ccc19453911 100644 --- a/quest/m3/bus-positioned-write.md +++ b/quest/m3/bus-positioned-write.md @@ -21,3 +21,12 @@ output side (`Block::position`, `Driver::position`). Studio broadcast sync video by up to 37.5 ms after a channel runs dry. Decide what a write for a position already mixed or beyond the headroom does, and fail loudly rather than silently shifting it. + +[moq-dev/studio#93](https://github.com/moq-dev/studio/pull/93) adds a second +case: after a silence the studio's `playout::Writer` can't tell how much its +channel holds, so a first write lands up to one block (10 ms) early. Broadcast +and media sources both hit it. A positioned write fixes this too; test that a +first write after silence is mixed at the sample it was meant for. + +- ✅ **Fold studio#93 in here**, decided 2026-11-07 (maintainer, /quest-complete). + Rejected: an interim bus-position accessor quest, and dropping the plan.