[PR #3727] [MERGED] Splitscreen: share one audio output between local-player sound engines #5177

Closed
opened 2026-11-03 05:10:46 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/3727
Author: @martipops
Created: 10/29/2026
Status: ✅ Merged
Merged: 10/31/2026
Merged by: @rdbtCVS

Base: main ← Head: split/02-audio


📝 Commits (7)

  • 2966033 Allow sound engines to share one dimension-aware audio output
  • fbb1d24 Merge remote-tracking branch 'upstream/main' into split/02-audio
  • 63325c9 Audio: a shared output keeps the device name upstream added
  • d2ad22f Merge remote-tracking branch 'upstream/main' into split/02-audio
  • 10cc390 Audio: the mixer callback neither allocates nor copies world names
  • eff016f Splitscreen audio: say what the duplicate rule can merge
  • e8c951c Merge remote-tracking branch 'upstream/main' into split/02-audio

📊 Changes

2 files changed (+450 additions, -31 deletions)

View changed files

📝 crates/horizon-client-render/src/audio.rs (+426 -31)
➕ docs/design/shared-audio.md (+24 -0)

📄 Description

🤖 Opened by martipops's AI agent (Codex), not by martipops themselves.

Blocked by: none (independent)

What and why

Part 2 of the splitscreen series (#3541), independent of the compositor part (#3726). Allow several sound engines to share one output and decoded-sample cache. World sounds use the nearest camera in the same dimension; copies of the same sound heard by different engines are suppressed. Relative sounds and looping sources keep their own channels.

Dropping a shared engine removes its camera and sources. Replacement engines use fresh channel IDs so late decoder replies cannot attach to a replacement's sounds. Sources continue advancing at zero gain while no camera remains in their world, preventing old one-shots from resuming when a player returns.

This exposes Audio::share and set_world for later player-session integration. The game still creates one listener, with no new setting or launcher/account changes. Suggested label: skip-release.

Vanilla reference

Horizon-only local-multiplayer extension. Single-listener attenuation, panning and limiter behavior retain their existing tests.

Self-check

The quick gate passes. On macOS, TMPDIR=/private/tmp avoids the existing parity-runner fixture's unresolved /var versus /private/var path comparison. Parity harnesses were not run (--quick).

pr_ready (tools/pr_ready.py --quick --base upstream/main on Mac, against upstream/main at 9c15e18c6, 2 min 31 s)

Check Result
Scope ✅ 2 files, +397 −32
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 416 passed (29 s)
rustfmt ✅ (6 s)
clippy ✅ (1 min 16 s)
tests: horizon-client-render ✅ 527 passed (31 s)
doc tests ✅ 0 passed (9 s)
content root tests ➖ content root untouched
tokens.css up to date ➖ theme untouched
launcher rustfmt ➖ launcher untouched
launcher clippy ➖ launcher untouched
launcher tests ➖ launcher untouched
Parity ➖ not run (--quick): CI's parity job picks the affected harnesses
Label player-facing: feature if players get something new, no label for a fix (release-now if urgent)

The deterministic mixer tests cover nearest-camera selection, dimension isolation, deduplication, departure cleanup, reused owner IDs and inaudible playback progression without audio hardware or game resources. Audio-enabled all-target clippy and client library/binary cargo checks also pass. One bounded subagent review found the inaudible-timeline issue above; the fix has regression coverage. martipops reports Windows/Linux validation.

🤖 Generated with Codex.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/horizon-rust/horizon/pull/3727 **Author:** [@martipops](https://github.com/martipops) **Created:** 10/29/2026 **Status:** ✅ Merged **Merged:** 10/31/2026 **Merged by:** [@rdbtCVS](https://github.com/rdbtCVS) **Base:** `main` ← **Head:** `split/02-audio` --- ### 📝 Commits (7) - [`2966033`](https://github.com/horizon-rust/horizon/commit/296603342f78d4f0fb691ee54af0442a7bd89f80) Allow sound engines to share one dimension-aware audio output - [`fbb1d24`](https://github.com/horizon-rust/horizon/commit/fbb1d24b53ebbc587b7d1a52a5c905bcc117022c) Merge remote-tracking branch 'upstream/main' into split/02-audio - [`63325c9`](https://github.com/horizon-rust/horizon/commit/63325c9928006cef86b0340af9942378e06c7c6f) Audio: a shared output keeps the device name upstream added - [`d2ad22f`](https://github.com/horizon-rust/horizon/commit/d2ad22fe4c53080e4a88e891aecf414319f1863a) Merge remote-tracking branch 'upstream/main' into split/02-audio - [`10cc390`](https://github.com/horizon-rust/horizon/commit/10cc390c21e863f747499ce5857b569dc244865a) Audio: the mixer callback neither allocates nor copies world names - [`eff016f`](https://github.com/horizon-rust/horizon/commit/eff016f55d550bb7f4370d17d16390c1277780d7) Splitscreen audio: say what the duplicate rule can merge - [`e8c951c`](https://github.com/horizon-rust/horizon/commit/e8c951cb3aa6d99bb51aae69ab8789e086933132) Merge remote-tracking branch 'upstream/main' into split/02-audio ### 📊 Changes **2 files changed** (+450 additions, -31 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client-render/src/audio.rs` (+426 -31) ➕ `docs/design/shared-audio.md` (+24 -0) </details> ### 📄 Description > 🤖 Opened by martipops's AI agent (Codex), not by martipops themselves. **Blocked by:** none (independent) ## What and why Part 2 of the splitscreen series (#3541), independent of the compositor part (#3726). Allow several sound engines to share one output and decoded-sample cache. World sounds use the nearest camera in the same dimension; copies of the same sound heard by different engines are suppressed. Relative sounds and looping sources keep their own channels. Dropping a shared engine removes its camera and sources. Replacement engines use fresh channel IDs so late decoder replies cannot attach to a replacement's sounds. Sources continue advancing at zero gain while no camera remains in their world, preventing old one-shots from resuming when a player returns. This exposes `Audio::share` and `set_world` for later player-session integration. The game still creates one listener, with no new setting or launcher/account changes. Suggested label: `skip-release`. ## Vanilla reference Horizon-only local-multiplayer extension. Single-listener attenuation, panning and limiter behavior retain their existing tests. ## Self-check The quick gate passes. On macOS, `TMPDIR=/private/tmp` avoids the existing parity-runner fixture's unresolved `/var` versus `/private/var` path comparison. Parity harnesses were not run (`--quick`). **pr_ready** (`tools/pr_ready.py --quick --base upstream/main` on Mac, against upstream/main at 9c15e18c6, 2 min 31 s) | Check | Result | | --- | --- | | Scope | ✅ 2 files, +397 −32 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 416 passed (29 s) | | rustfmt | ✅ (6 s) | | clippy | ✅ (1 min 16 s) | | tests: horizon-client-render | ✅ 527 passed (31 s) | | doc tests | ✅ 0 passed (9 s) | | content root tests | ➖ content root untouched | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ➖ launcher untouched | | launcher clippy | ➖ launcher untouched | | launcher tests | ➖ launcher untouched | | Parity | ➖ not run (--quick): CI's parity job picks the affected harnesses | | Label | player-facing: `feature` if players get something new, no label for a fix (`release-now` if urgent) | The deterministic mixer tests cover nearest-camera selection, dimension isolation, deduplication, departure cleanup, reused owner IDs and inaudible playback progression without audio hardware or game resources. Audio-enabled all-target clippy and client library/binary cargo checks also pass. One bounded subagent review found the inaudible-timeline issue above; the fix has regression coverage. martipops reports Windows/Linux validation. 🤖 Generated with [Codex](https://openai.com/codex/). --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 05:10:46 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
horizon-rust/horizon#5177
No description provided.