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
1 change: 0 additions & 1 deletion quest/m2/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,6 @@ quests that require them.
- [Small API fixes before the cut](/quest/m2/api-shape/README.md) - one path and one spelling per item, names by role, and no dead or wrong-role public surface across net, transport, media, native, apps, JS, and bindings
- [Public constructors spawn nothing, or say why](/quest/m2/spawn-constructors.md) - each public library entry point that spawns returns a driver its caller polls, or is listed as kept
- [moq-audio codecs return zero or more outputs](/quest/m2/audio-codec-seam.md) - `encode` and `decode` return any number of outputs and gain `flush`, as moq-video's do
- [Bus writes land at a bus position](/quest/m2/bus-positioned-write.md) - callers sync audio to video without copying the bus's private latency, before the cut first publishes `bus`
- [A mix-minus removes several sources](/quest/m2/bus-minus-several.md) - a guest's return feed drops every copy of their own sound
- [Drop moq-auth's iroh transport](/quest/m2/auth-drop-iroh.md) - this breaking moq-auth release drops `Transport::Iroh` and the JS `"iroh"` value
- [Plan: recovery boundaries](/quest/m2/intra-refresh-boundary.md) - the catalog's new `warmup` contract is settled before the cut publishes it
Expand Down
32 changes: 0 additions & 32 deletions quest/m2/bus-positioned-write.md

This file was deleted.

8 changes: 8 additions & 0 deletions rs/moq-audio/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

- **Breaking:** `Bus::channel` and `bus::Channel` are renamed `Bus::live` and
`bus::Live`, pairing with `Bus::positioned` and `bus::Positioned`. See
`MIGRATE.md`.
- `Bus::positioned` adds a bus source whose every write names the bus position
its first frame plays at, for audio scheduled against video on the bus's
clock. A write that would land where the bus already mixed, overlap the
channel's own audio, or end past `bus::REACH` (200 ms) fails whole instead of
moving. It takes the bus's sample rate.
- A bus `Strip` has a pan, `set_pan` and `pan`, that places its source between
left and right in every mix: constant power for a mono source, at -3 dB per
side when centered (so a mono source now plays 3 dB quieter by default), and
Expand Down
10 changes: 9 additions & 1 deletion rs/moq-audio/MIGRATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@ How to update your code for each breaking change, newest first.

## Unreleased

### `Bus::channel` is `Bus::live`

The bus has two kinds of source: a live one on its own clock, whose ring
absorbs jitter and drift, and a positioned one on the bus's clock, whose every
write names its bus position. `Bus::channel` and `bus::Channel` are renamed
`Bus::live` and `bus::Live` to pair with `Bus::positioned` and
`bus::Positioned`. Their behavior is unchanged: rename the calls and the type.

### Playback fills a declared silence with comfort noise

`Sink::end()` declares that the audio written so far is followed by a silence
Expand Down Expand Up @@ -88,7 +96,7 @@ Device channel counts above stereo are now consistently `Layout::Discrete`:
a microphone array does not declare surround-speaker positions. A stereo bus
refuses those inputs instead of guessing a surround downmix. Request mono or
stereo through `capture::Config::channels` when the device supports it, or map
the known channels explicitly before writing a `Bus::channel`. The encoder refuses
the known channels explicitly before writing a `Bus::live`. The encoder refuses
them too: `encode::Control::new` fails for such a consumer, since its default
stereo config (and Opus in any config) cannot take a discrete layout. Publish a
microphone array only when it delivers mono or stereo, or with an
Expand Down
8 changes: 4 additions & 4 deletions rs/moq-audio/benches/bus.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
use std::hint::black_box;

use criterion::{BenchmarkId, Criterion, Throughput, criterion_group, criterion_main};
use moq_audio::bus::{Bus, Channel, Config, Driver, Strip};
use moq_audio::bus::{Bus, Config, Driver, Live, Strip};
use moq_audio::encode::Input;
use moq_audio::{Format, Layout};

Expand All @@ -23,7 +23,7 @@ const BLOCK: usize = 480;

/// A bus with `count` stereo sources at `rate`, opened by a first advance, and
/// one block of PCM for each.
fn sources(count: usize, rate: u32) -> (Bus, Driver, Vec<(Channel, Strip)>, Vec<u8>) {
fn sources(count: usize, rate: u32) -> (Bus, Driver, Vec<(Live, Strip)>, Vec<u8>) {
let (bus, mut driver) = Bus::new(Config::default()).unwrap();
let frames = BLOCK * rate as usize / 48_000;
let block: Vec<u8> = std::iter::repeat_n(0.25f32, frames * 2)
Expand All @@ -34,15 +34,15 @@ fn sources(count: usize, rate: u32) -> (Bus, Driver, Vec<(Channel, Strip)>, Vec<
let mut input = Input::new(rate, Layout::Stereo);
input.format = Format::F32;
let strip = Strip::default();
(bus.channel(input, strip.clone()).unwrap(), strip)
(bus.live(input, strip.clone()).unwrap(), strip)
})
.collect();
// Writes before the first advance are dropped, so open the channels first.
driver.advance(BLOCK);
(bus, driver, sources, block)
}

fn run(driver: &mut Driver, sources: &mut [(Channel, Strip)], block: &[u8]) {
fn run(driver: &mut Driver, sources: &mut [(Live, Strip)], block: &[u8]) {
for (channel, _) in sources.iter_mut() {
channel.write(black_box(block)).unwrap();
}
Expand Down
Loading
Loading