From dd32a4b84a4b7be49768e4adb61676313dab9b08 Mon Sep 17 00:00:00 2001 From: Luke Curley Date: Fri, 6 Nov 2026 21:42:06 -0800 Subject: [PATCH 1/4] quest: plan a bus strip pan for the studio's Audio panel Co-Authored-By: Claude Opus 5.5 --- quest/m3/README.md | 1 + quest/m3/audio-strip-pan.md | 37 +++++++++++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+) create mode 100644 quest/m3/audio-strip-pan.md diff --git a/quest/m3/README.md b/quest/m3/README.md index 4026818f465..c2572cdb9e4 100644 --- a/quest/m3/README.md +++ b/quest/m3/README.md @@ -136,6 +136,7 @@ federation) land. - [Lint override and deprecation audit](/quest/m3/audit-lints.md) - repeat the suppression and deprecation audit after the release ships, starting with clippy on the macOS and Windows targets - [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 - [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-strip-pan.md b/quest/m3/audio-strip-pan.md new file mode 100644 index 00000000000..260b1527b14 --- /dev/null +++ b/quest/m3/audio-strip-pan.md @@ -0,0 +1,37 @@ +# [S] Pan a bus source + +## Goal + +A `moq_audio::bus` `Strip` has a pan, set and read like its gain, that +places its source between left and right in every mix that plays it. +Setting a pan other than center on a bus that is not stereo is an error. + +## Plan + +Decided 2026-11-07 (maintainer, on moq-dev/studio's /quest-complete of +[moq-dev/studio#77](https://github.com/moq-dev/studio/pull/77)): + +- ✅ **Pan lives on the strip**, so it applies wherever the sound plays, + as gain, mute, and delay do. Rejected: a pan per mix the source is + routed to. +- ✅ **Constant power, -3 dB at center** (a sine/cosine law), so a sound + keeps its loudness as it moves. Rejected: linear (-6 dB) and 0 dB center. +- ✅ **A stereo source is balanced**: the far side is attenuated by the same + law and each channel stays where it is. Rejected: moving both channels + together. +- ✅ **Stereo buses only.** A non-center pan on a mono or surround bus is + refused with an error. Rejected: ignoring it, and a surround pan nobody + needs yet. +- ✅ **m3**: additive, with a named consumer. + +The consumer is the studio's Audio panel and its `[audio.]` scene +file settings, through +[the studio's pan quest](https://github.com/moq-dev/studio/blob/main/quest/m0/audio-pan.md); +the studio bumps its pin in +[its own quest](https://github.com/moq-dev/studio/blob/main/quest/m0/pin-audio-pan.md). + +Recommendation, not settled: store the pan atomically beside the gain and +apply both in the same per-frame loop, so a pan change is click-free in the +same way a gain change is. Test a mono impulse panned hard left, center, +and hard right, and a stereo source balanced, against the expected channel +levels. From 0bf0a82a9dc08b650fff84c649764ef78d713ef0 Mon Sep 17 00:00:00 2001 From: Luke Curley Date: Fri, 6 Nov 2026 22:37:22 -0800 Subject: [PATCH 2/4] quest: name where a non-stereo pan is refused Co-Authored-By: Claude Opus 5.5 --- quest/m3/audio-strip-pan.md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/quest/m3/audio-strip-pan.md b/quest/m3/audio-strip-pan.md index 260b1527b14..f4eac656b14 100644 --- a/quest/m3/audio-strip-pan.md +++ b/quest/m3/audio-strip-pan.md @@ -30,7 +30,14 @@ file settings, through the studio bumps its pin in [its own quest](https://github.com/moq-dev/studio/blob/main/quest/m0/pin-audio-pan.md). -Recommendation, not settled: store the pan atomically beside the gain and +A `Strip` holds no layout today and meets one only in `Bus::channel`, and +`Driver::advance` has no error path, so the refusal needs a call that +returns it. Recommendation, not settled: `Bus::channel` refuses a strip +already panned off center on a bus that is not stereo, and records on the +strip that it plays on such a bus, so a later `Strip::set_pan` off center +returns the error. The driver never sees a refused pan. + +Also recommended, not settled: store the pan atomically beside the gain and apply both in the same per-frame loop, so a pan change is click-free in the same way a gain change is. Test a mono impulse panned hard left, center, and hard right, and a stereo source balanced, against the expected channel From 3e703cd5d852c06526377d8b3848e3172a80cac1 Mon Sep 17 00:00:00 2001 From: Luke Curley Date: Fri, 6 Nov 2026 22:59:09 -0800 Subject: [PATCH 3/4] quest: count a strip's non-stereo channels rather than flag them Co-Authored-By: Claude Opus 5.5 --- quest/m3/audio-strip-pan.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/quest/m3/audio-strip-pan.md b/quest/m3/audio-strip-pan.md index f4eac656b14..795fb300b6f 100644 --- a/quest/m3/audio-strip-pan.md +++ b/quest/m3/audio-strip-pan.md @@ -33,9 +33,11 @@ the studio bumps its pin in A `Strip` holds no layout today and meets one only in `Bus::channel`, and `Driver::advance` has no error path, so the refusal needs a call that returns it. Recommendation, not settled: `Bus::channel` refuses a strip -already panned off center on a bus that is not stereo, and records on the -strip that it plays on such a bus, so a later `Strip::set_pan` off center -returns the error. The driver never sees a refused pan. +already panned off center on a bus that is not stereo, and the strip keeps +a count of its open channels on such buses (counted up in `Bus::channel`, +down when the channel drops), so a later `Strip::set_pan` off center returns +the error while any is open. A strip outlives its channels, so a flag would +keep refusing after the last one closes. The driver never sees a refused pan. Also recommended, not settled: store the pan atomically beside the gain and apply both in the same per-frame loop, so a pan change is click-free in the From 4d190fdaebccd92a74a07d4907164cd99fe82e8a Mon Sep 17 00:00:00 2001 From: Luke Curley Date: Fri, 6 Nov 2026 23:30:29 -0800 Subject: [PATCH 4/4] quest: say what balance does to one-sided stereo, and ramp pan like gain Co-Authored-By: Claude Opus 5.5 --- quest/m3/audio-strip-pan.md | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/quest/m3/audio-strip-pan.md b/quest/m3/audio-strip-pan.md index 795fb300b6f..876cb59d7e0 100644 --- a/quest/m3/audio-strip-pan.md +++ b/quest/m3/audio-strip-pan.md @@ -18,7 +18,9 @@ Decided 2026-11-07 (maintainer, on moq-dev/studio's /quest-complete of keeps its loudness as it moves. Rejected: linear (-6 dB) and 0 dB center. - ✅ **A stereo source is balanced**: the far side is attenuated by the same law and each channel stays where it is. Rejected: moving both channels - together. + together. The even loudness holds for a mono source; balance only turns a + side down, so a stereo source with sound on one side only goes silent when + balanced hard to the other, as a mixer's balance control does. - ✅ **Stereo buses only.** A non-center pan on a mono or surround bus is refused with an error. Rejected: ignoring it, and a surround pan nobody needs yet. @@ -40,7 +42,8 @@ the error while any is open. A strip outlives its channels, so a flag would keep refusing after the last one closes. The driver never sees a refused pan. Also recommended, not settled: store the pan atomically beside the gain and -apply both in the same per-frame loop, so a pan change is click-free in the -same way a gain change is. Test a mono impulse panned hard left, center, -and hard right, and a stereo source balanced, against the expected channel -levels. +ramp each channel's pan gain across the block as `Driver::advance` already +ramps the strip's gain (`rs/moq-audio/src/bus.rs`), so a pan move is +click-free. Test a mono impulse panned hard left, center, and hard right, a +stereo source balanced, and a hard-left to hard-right move during a +sustained tone, against the expected channel levels.