0.23.0 is missing three fixes that are on master (#872 queue channel shift, #886 Spatial L/R swap, ChannelVolume averaging)
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 46/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- rust
- Domain
- audio-video-rtc
Research direction
Read the listed fixes #872, #886, and commit 55c103fdf, then compare their changes with the v0.23.0 tag and the reproducer in the issue. Start by running the reproducer against v0.23.0 and master to confirm the three symptoms; done means a release or backport includes all three fixes and those comparisons pass. The issue describes the bugs clearly, but coordinating a release or backport spans several changes.
Written by the indexing model from the issue text.
Description
rodio 0.23.0 (published 2026-10-11) was cut from a line that diverged from master (GitHub compare: the v0.23.0 tag is behind each fix below), so three fixes already merged on master are not in the release. One program reproduces all three on 0.23.0 and shows each one fixed on master at 685e057.
Fix on master |
In v0.23.0? |
Symptom in 0.23.0 |
|---|---|---|
| #872 (8ca8cd0f4), channel shift when appending to an empty keep-alive queue | no (diverged, 45 behind) | Player::connect_new followed by append plays the first 512 samples of a stereo source as mono: each L and R sample is written to both channels, at half speed (10.7 ms at 48 kHz) |
#886 (6d31466ca), Spatial diff modifier swaps left and right (#884) |
no (diverged, 70 behind) | a source on the right plays louder in the left ear once the inverse-square term stops dominating (16 units right of ears at x = ±2) |
55c103fdf, ChannelVolume averaging |
no (diverged, 82 behind) | ChannelVolume::next computes the channel mean but discards it (self.current_sample.map(...) without assignment), so stereo input to Spatial is summed: exactly 2× (+6 dB) the level of the same signal as mono |
Output
0.23.0 (crates.io):
connect_new then append: first 8 samples [1.0, 1.0, -1.0, -1.0, 1.0, 1.0, -1.0, -1.0]; frames with wrong channels in first 2000: 512
Player::new, append, then mixer.add: first 8 samples [1.0, -1.0, 1.0, -1.0, 1.0, -1.0, 1.0, -1.0]; frames with wrong channels: 0
Spatial, source 16 m right: left 0.003086 right 0.002551 (right louder expected: false)
Spatial stereo-in (0.5,0.5): (0.742574,0.742574) vs mono-in 0.5: (0.371287,0.371287); ratio 2.000
master at 685e05765c2aff8fbb51e32cda5b18428d09ffbe:
connect_new then append: first 8 samples [1.0, -1.0, 1.0, -1.0, 1.0, -1.0, 1.0, -1.0]; frames with wrong channels in first 2000: 0
Player::new, append, then mixer.add: first 8 samples [1.0, -1.0, 1.0, -1.0, 1.0, -1.0, 1.0, -1.0]; frames with wrong channels: 0
Spatial, source 16 m right: left 0.001543 right 0.005102 (right louder expected: true)
Spatial stereo-in (0.5,0.5): (0.371287,0.371287) vs mono-in 0.5: (0.371287,0.371287); ratio 1.000
Reproduction
Cargo.toml: rodio = { version = "=0.23.0", default-features = false, features = ["playback"] } (or a git dependency on the master rev above).
src/main.rs
use rodio::{buffer::SamplesBuffer, mixer, source::Spatial, Player, Source};
use std::num::NonZero;
fn stereo(frames: usize) -> SamplesBuffer {
// left = +1.0, right = -1.0 on every frame
let samples: Vec<f32> = (0..frames * 2).map(|i| if i % 2 == 0 { 1.0 } else { -1.0 }).collect();
SamplesBuffer::new(NonZero::new(2).unwrap(), NonZero::new(48_000).unwrap(), samples)
}
fn bad_frames(out: &[f32]) -> usize {
out.chunks(2).filter(|f| !(f[0] == 1.0 && f[1] == -1.0)).count()
}
fn main() {
// 1. Player attached to the mixer before the first append.
let (mx, mut out) = mixer::mixer(NonZero::new(2).unwrap(), NonZero::new(48_000).unwrap());
let player = Player::connect_new(&mx);
player.append(stereo(4000));
let v: Vec<f32> = (&mut out).take(4000).collect();
println!("connect_new then append: first 8 samples {:?}; frames with wrong channels in first 2000: {}", &v[..8], bad_frames(&v));
// 2. Same, but append before attaching the queue.
let (mx, mut out) = mixer::mixer(NonZero::new(2).unwrap(), NonZero::new(48_000).unwrap());
let (player2, queue) = Player::new();
player2.append(stereo(4000));
mx.add(queue);
let v: Vec<f32> = (&mut out).take(4000).collect();
println!("Player::new, append, then mixer.add: first 8 samples {:?}; frames with wrong channels: {}", &v[..8], bad_frames(&v));
// 3. Spatial: source 16 m to the right of ears at x = -2 / +2.
let src = SamplesBuffer::new(NonZero::new(1).unwrap(), NonZero::new(48_000).unwrap(), vec![1.0; 4]);
let mut sp = Spatial::new(src, [16.0, 0.0, 0.0], [-2.0, 0.0, 0.0], [2.0, 0.0, 0.0]);
let (l, r) = (sp.next().unwrap(), sp.next().unwrap());
println!("Spatial, source 16 m right: left {l:.6} right {r:.6} (right louder expected: {})", r > l);
// 4. Spatial (ChannelVolume) with stereo input 0.5 in both channels vs mono 0.5, source centred.
let st = SamplesBuffer::new(NonZero::new(2).unwrap(), NonZero::new(48_000).unwrap(), vec![0.5, 0.5]);
let mut sp = Spatial::new(st, [0.0, 0.0, 1.0], [-0.1, 0.0, 0.0], [0.1, 0.0, 0.0]);
let (l, r) = (sp.next().unwrap(), sp.next().unwrap());
let mono = SamplesBuffer::new(NonZero::new(1).unwrap(), NonZero::new(48_000).unwrap(), vec![0.5]);
let mut spm = Spatial::new(mono, [0.0, 0.0, 1.0], [-0.1, 0.0, 0.0], [0.1, 0.0, 0.0]);
let (ml, mr) = (spm.next().unwrap(), spm.next().unwrap());
println!("Spatial stereo-in (0.5,0.5): ({l:.6},{r:.6}) vs mono-in 0.5: ({ml:.6},{mr:.6}); ratio {:.3}", l / ml);
drop((player, player2));
}
Suggestion
A 0.23.x release from master, or a backport of these three, would fix them for crates.io users. Until then, a workaround for the first one on 0.23.0 is to build the player with Player::new(), append the first source, and only then mixer.add(queue). Related: #898 (users asking for a release containing the cpal 0.18 line).
Found while integrating 0.23.0 into a game engine's ECS audio path (Windows Server 2025, rustc 1.101.0-nightly 2026-10-24; release profile).
- Dominant language
- Rust
- Stars
- 2.5k
- Forks
- 338
- PR merge metrics
- No merged PRs in 30d
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from RustAudio/rodio
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
Difficulty 1/5 Under an hour Newbie friendliness 73/100
-
Difficulty 3/5 1-2 days Newbie friendliness 45/100
-
Difficulty 3/5 1-2 days Newbie friendliness 67/100
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
Choochmeque/tauri-plugin-webdriver#134 ·
Maintainers usually reply within 17 days
-
bug rust SDK & CLI & REST API
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
boxlite-ai/boxlite#3292 ·
Maintainers usually reply within 1 day
-
Android bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
anefzaoui/misterdownloadmanager#2516 ·
Maintainers usually reply within 1 day
-
editor ui
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
state:triage tech-debt
Difficulty 2/5 1-3 hours Newbie friendliness 89/100
agent8-cash/ethpayserver#731 ·
Maintainers usually reply within 1 day