Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
8 changes: 4 additions & 4 deletions bun.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion moq
Submodule moq updated 588 files
26 changes: 0 additions & 26 deletions quest/m0/pin-bus-positioned.md

This file was deleted.

4 changes: 2 additions & 2 deletions quest/m0/pin-sync.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
4 changes: 0 additions & 4 deletions quest/m0/playout-positioned.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion rs/moq-scene/src/browser/run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
6 changes: 3 additions & 3 deletions rs/moq-scene/src/playout.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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::<f32>(),
Expand Down Expand Up @@ -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);
Expand Down
6 changes: 3 additions & 3 deletions rs/moq-scene/src/source.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down Expand Up @@ -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<moq_audio::bus::Channel, Error> {
fn channel(&self, strip: Strip) -> Result<moq_audio::bus::Live, Error> {
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)?)
}
}

Expand Down
7 changes: 2 additions & 5 deletions rs/moq-studio/src/engine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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 {
Expand Down
8 changes: 4 additions & 4 deletions rs/moq-studio/src/feed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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<u8> = std::iter::repeat_n(value, BLOCK * 2)
.flat_map(f32::to_le_bytes)
.collect();
Expand Down
10 changes: 5 additions & 5 deletions rs/moq-studio/src/mix.rs
Original file line number Diff line number Diff line change
Expand Up @@ -366,22 +366,22 @@ async fn play(_follow: Follow, _speakers: tokio::sync::watch::Receiver<Option<St

#[cfg(test)]
mod tests {
use moq_audio::bus::{Bus, Channel, Driver, Strip};
use moq_audio::bus::{Bus, Driver, Live, Strip};

use super::*;

/// The default bus's 10 ms block.
const BLOCK: usize = 480;

/// A stereo source the test feeds `value` one block per advance.
fn source(bus: &Bus) -> (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<u8> = std::iter::repeat_n(value, BLOCK * 2)
.flat_map(f32::to_le_bytes)
.collect();
Expand All @@ -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);
Expand Down