diff --git a/bun.lock b/bun.lock index f555971f..e4bea519 100644 --- a/bun.lock +++ b/bun.lock @@ -145,13 +145,13 @@ "@moq/signals": "workspace:^", "@moq/ui": "workspace:^", "@moq/video": "workspace:^", - "mediabunny": "^1.63.0", + "mediabunny": "^1.65.0", }, "devDependencies": { "@types/audioworklet": "^0.0.100", "@types/bun": "^1.4.4", "@typescript/lib-dom": "npm:@types/web@^0.0.358", - "rolldown": "^1.2.15", + "rolldown": "^1.2.16", "typescript": "7.0.2", "vite": "^8.3.5", }, @@ -203,7 +203,7 @@ "fast-check": "^4.10.2", "react": "^19.3.1", "react-dom": "^19.3.1", - "solid-js": "^1.9.17", + "solid-js": "^1.9.18", "typescript": "7.0.2", }, "peerDependencies": { @@ -261,7 +261,7 @@ "@types/audioworklet": "^0.0.100", "@types/bun": "^1.4.4", "@typescript/lib-dom": "npm:@types/web@^0.0.358", - "rolldown": "^1.2.15", + "rolldown": "^1.2.16", "typescript": "7.0.2", "vite": "^8.3.5", }, diff --git a/moq b/moq index 079a6460..79960a9d 160000 --- a/moq +++ b/moq @@ -1 +1 @@ -Subproject commit 079a6460fc6bff54ec48d98a8f0bbd509b69fc52 +Subproject commit 79960a9dd64e48a2fe51a06fc1a3e9b4692dfb22 diff --git a/quest/m0/pin-bus-positioned.md b/quest/m0/pin-bus-positioned.md deleted file mode 100644 index 5088f837..00000000 --- a/quest/m0/pin-bus-positioned.md +++ /dev/null @@ -1,26 +0,0 @@ -# [XS] moq-audio's positioned bus channel is pinned - -## Goal - -The `moq` submodule includes moq-audio's `Bus::positioned`, whose -`bus::Positioned::write(position, data)` plays a write at the bus position it -names, from [moq-dev/moq#8273](https://github.com/moq-dev/moq/pull/8273). That -PR also renamed `Bus::channel`/`bus::Channel` to `Bus::live`/`bus::Live`. - -## Plan - -Planned 2026-11-08 (maintainer, moq's /quest-complete), a follow-up of -moq-dev/moq#8273, which has merged on moq's `main`. - -Decided 2026-11-09 (maintainer, /quest-audit): ✅ pin exactly #8273, at -`79960a9dd` with `just upgrade-moq 79960a9dd` (rejected: bump to moq `main` -here, which crosses the playout clock's replacement below and resizes this -quest). - -Land it in its own PR, fixing whatever the new API breaks here: at least the -`Bus::live` rename at every `bus.channel(..)` call. -[moq-dev/moq#8272](https://github.com/moq-dev/moq/pull/8272) merged after -#8273, as `644d48996`. It replaces `moq_mux::timeline` with `moq_mux::sync` -and is not crossed here; [pin-sync](/quest/m0/pin-sync.md) crosses it. Move no -audio onto positioned writes here; that is -[Playout writes land on positioned bus channels](/quest/m0/playout-positioned.md). diff --git a/quest/m0/pin-sync.md b/quest/m0/pin-sync.md index d795cead..9456f3b1 100644 --- a/quest/m0/pin-sync.md +++ b/quest/m0/pin-sync.md @@ -14,8 +14,8 @@ stall does on it. Decided 2026-11-09 (maintainer, /quest-audit): ✅ crossing #8272 is this quest, after [Playout writes land on positioned bus channels](/quest/m0/playout-positioned.md) -(rejected: crossing it in -[pin-bus-positioned](/quest/m0/pin-bus-positioned.md)). Both rewrite +(rejected: crossing it in the +positioned bus pin). Both rewrite `playout.rs`, so the positioned work finishes on the API it was planned against, then this crosses. diff --git a/quest/m0/playout-positioned.md b/quest/m0/playout-positioned.md index f680879e..87f302e9 100644 --- a/quest/m0/playout-positioned.md +++ b/quest/m0/playout-positioned.md @@ -70,7 +70,3 @@ Recommendations, not settled: - Test on the scene's driver-stepped bus, as `a_write_sounds_when_placed` does: frames written ahead, late, and across a stall sound at the expected bus positions, sample-exact. - -## Required - -- [moq-audio's positioned bus channel is pinned](/quest/m0/pin-bus-positioned.md) - `Bus::positioned`, which the writer writes through diff --git a/rs/moq-scene/src/browser/run.rs b/rs/moq-scene/src/browser/run.rs index 791a01b5..35680c22 100644 --- a/rs/moq-scene/src/browser/run.rs +++ b/rs/moq-scene/src/browser/run.rs @@ -12,7 +12,7 @@ use std::sync::atomic::{AtomicU64, Ordering}; use std::sync::{Arc, Mutex}; use std::thread::JoinHandle; -use moq_audio::bus::Channel as Sound; +use moq_audio::bus::Live as Sound; use super::layers::{Gpu, Layers}; use super::outbox::Commands; diff --git a/rs/moq-scene/src/playout.rs b/rs/moq-scene/src/playout.rs index d1298673..86fcc0be 100644 --- a/rs/moq-scene/src/playout.rs +++ b/rs/moq-scene/src/playout.rs @@ -189,7 +189,7 @@ pub(crate) fn heard(schedule: &timeline::Consumer, timestamp: moq_net::Timestamp /// when what it wrote runs out, and puts silence ahead of a frame for however /// much of the latency has drained. pub(crate) struct Writer { - channel: bus::Channel, + channel: bus::Live, /// Bytes per sample frame of the channel's `f32` input. stride: usize, rate: u32, @@ -203,7 +203,7 @@ pub(crate) struct Writer { impl Writer { /// Write into a new `channel`, taking interleaved `f32` at `rate` in `channels`. - pub(crate) fn new(channel: bus::Channel, rate: u32, channels: u32) -> Self { + pub(crate) fn new(channel: bus::Live, rate: u32, channels: u32) -> Self { Self { channel, stride: channels as usize * size_of::(), @@ -403,7 +403,7 @@ mod tests { let strip = moq_audio::bus::Strip::default(); let mut input = moq_audio::encode::Input::new(config.sample_rate, config.layout); input.format = moq_audio::Format::F32; - let channel = bus.channel(input, strip.clone()).unwrap(); + let channel = bus.live(input, strip.clone()).unwrap(); let mut writer = Writer::new(channel, config.sample_rate, config.layout.channels()); let mix = bus.mix(); mix.route(&strip); diff --git a/rs/moq-scene/src/source.rs b/rs/moq-scene/src/source.rs index f67c0657..574b725a 100644 --- a/rs/moq-scene/src/source.rs +++ b/rs/moq-scene/src/source.rs @@ -1011,7 +1011,7 @@ impl Driver { let mut input = moq_audio::encode::Input::new(bus.sample_rate, bus.layout); input.format = moq_audio::Format::F32; let strip = self.strip.clone().expect("browser sources have a strip"); - let sound = self.context.bus.channel(input, strip)?; + let sound = self.context.bus.live(input, strip)?; crate::browser::run(helper, open, page, &self.picture, Some(sound), &self.status).await } @@ -1841,11 +1841,11 @@ impl Driver { /// A channel into the bus for decoded sound, as [`sounds`](Self::sounds) /// and broadcasts decode it, through `strip`. - fn channel(&self, strip: Strip) -> Result { + fn channel(&self, strip: Strip) -> Result { let bus = self.context.bus.config(); let mut input = moq_audio::encode::Input::new(bus.sample_rate, bus.layout); input.format = moq_audio::Format::F32; - Ok(self.context.bus.channel(input, strip)?) + Ok(self.context.bus.live(input, strip)?) } } diff --git a/rs/moq-studio/src/engine.rs b/rs/moq-studio/src/engine.rs index 4ccce316..e70be6ef 100644 --- a/rs/moq-studio/src/engine.rs +++ b/rs/moq-studio/src/engine.rs @@ -4502,10 +4502,8 @@ mod tests { .await .expect("the marker"); while let Some(event) = sources.try_next() { - if let RouteEvent::Start(announce) - | RouteEvent::Update(announce) - | RouteEvent::Restart(announce) - | RouteEvent::Takeover { announce, .. } = event + if let RouteEvent::Start(announce) | RouteEvent::Update(announce) | RouteEvent::Restart(announce) = + event { assert!( announce.prefix.as_str() != "show" || announce.route.instance() != &newer, @@ -4649,7 +4647,6 @@ mod tests { loop { let announce = match routes.next().await.expect("routes") { RouteEvent::Start(announce) | RouteEvent::Update(announce) | RouteEvent::Restart(announce) => announce, - RouteEvent::Takeover { announce, .. } => announce, RouteEvent::End(_) => continue, }; if announce.prefix.as_str() == "show" && announce.route.instance() == instance { diff --git a/rs/moq-studio/src/feed.rs b/rs/moq-studio/src/feed.rs index 763eeb6f..b3b058c4 100644 --- a/rs/moq-studio/src/feed.rs +++ b/rs/moq-studio/src/feed.rs @@ -265,7 +265,7 @@ async fn list( #[cfg(test)] mod tests { - use moq_audio::bus::{Bus, Channel}; + use moq_audio::bus::{Bus, Live}; use moq_scene::{History, Source}; use url::Url; @@ -334,14 +334,14 @@ mod tests { } /// A stereo channel into `bus` under the strip of the source `name`. - fn channel(bus: &Bus, sources: &Sources, name: &str) -> Channel { + fn channel(bus: &Bus, sources: &Sources, name: &str) -> Live { let strip = sources.get(name).unwrap().strip().unwrap().clone(); let mut input = moq_audio::encode::Input::new(48_000, moq_audio::Layout::Stereo); input.format = moq_audio::Format::F32; - bus.channel(input, strip).unwrap() + bus.live(input, strip).unwrap() } - fn feed(channel: &mut Channel, value: f32) { + fn feed(channel: &mut Live, value: f32) { let data: Vec = std::iter::repeat_n(value, BLOCK * 2) .flat_map(f32::to_le_bytes) .collect(); diff --git a/rs/moq-studio/src/mix.rs b/rs/moq-studio/src/mix.rs index 3252331b..65597184 100644 --- a/rs/moq-studio/src/mix.rs +++ b/rs/moq-studio/src/mix.rs @@ -366,7 +366,7 @@ async fn play(_follow: Follow, _speakers: tokio::sync::watch::Receiver (Channel, Strip) { + fn source(bus: &Bus) -> (Live, Strip) { let strip = Strip::default(); let mut input = moq_audio::encode::Input::new(48_000, moq_audio::Layout::Stereo); input.format = moq_audio::Format::F32; - (bus.channel(input, strip.clone()).unwrap(), strip) + (bus.live(input, strip.clone()).unwrap(), strip) } - fn feed(channel: &mut Channel, value: f32) { + fn feed(channel: &mut Live, value: f32) { let data: Vec = std::iter::repeat_n(value, BLOCK * 2) .flat_map(f32::to_le_bytes) .collect(); @@ -398,7 +398,7 @@ mod tests { /// Two mixes of one source each, `a` playing 0.25 and `b` 0.5, run past /// the bus's latency so each mix carries its source. - fn mixes() -> (Driver, Mix, Mix, [Channel; 2]) { + fn mixes() -> (Driver, Mix, Mix, [Live; 2]) { let (bus, mut driver) = Bus::new(Default::default()).unwrap(); let (mut quiet, quiet_strip) = source(&bus); let (mut loud, loud_strip) = source(&bus);