Skip to content

frontend: Mark audio sources in groups and nested scenes as Preview - #603

Merged
zackees merged 3 commits into
obs-rust:masterfrom
rdoupe:fix/mixer-preview-nested
Oct 13, 2026
Merged

zackees merged 3 commits into
obs-rust:masterfrom
rdoupe:fix/mixer-preview-nested

Conversation

@rdoupe

@rdoupe rdoupe commented Oct 13, 2026

Copy link
Copy Markdown
Collaborator

Description

In Studio Mode, the Audio Mixer now marks and shows as Preview the audio sources inside groups and nested scenes of the previewed scene, not only those directly in it. All three play the same way once the scene goes to Program, so the preview mixer now matches.

  1. frontend: Move the Audio Mixer preview source walk into a helper: moves the walk in AudioMixer::updatePreviewSources() into CollectPreviewAudioSources() (frontend/utility/preview-audio-sources.cpp, Qt Core only) so it can be tested without the mixer. No change in behaviour.

  2. test/cmocka: Audio Mixer preview misses sources in groups and nested scenes: test_preview_audio_sources builds real libobs scenes and groups with a dummy audio input (the reporter's layout) and asks the helper for the previewed scene. The cases are:

    • guard: an audio source directly in the scene;
    • an audio source in a group (a hidden one in the same group stays out);
    • an audio source in a nested scene;
    • a group inside a nested scene;
    • guard: a hidden group hides everything in it.

    3 of 5 fail today (the guards pass), the same way in every run.

  3. frontend: Mark audio sources in groups and nested scenes as Preview: the fix, a port of Warchamp7's frontend: Mark nested audio sources as previewed obsproject/obs-studio#13759 (credited as co-author): visible groups and nested scenes are walked too. 5 of 5 pass.

Motivation and Context

Fixes #602 (upstream obsproject/obs-studio#13297, reported by lperovskaya with a sample scene collection; confirmed upstream). Warchamp7's obsproject/obs-studio#13759 makes the same check recursive; it is not merged yet.

Reproduced in the current release (AppImage 33.0.0-beta6-799), headless, with a small test module that builds the reporter's layout (MUSIC: a looping Media Source; GROUP: another one inside a group; NESTED: the MUSIC scene as a source), turns Studio Mode on with an empty scene in Program and reads the mixer while previewing each scene:

  • MUSIC: "music direct" shown and marked Preview;
  • GROUP: "music grouped" hidden;
  • NESTED: "music direct" hidden.

Why this one: a confirmed user report with a sample collection; the mixer disagrees with what Program will play; small fix with an upstream author's design; reproduced in our release.

How Has This Been Tested?

Automated, in both libobs lanes (ENABLE_RUST_LIBOBS OFF and ON), rebased on current master:

  • test_preview_audio_sources: 3 of 5 cases fail at the RED commit and 5 of 5 pass at GREEN (3 runs each per lane), under a private Xvfb. ctest -V shows all 5 cases run. Like test_filter_clipboard, it needs a display for obs_startup() and its cases skip without one (so they skip in CI, which has no display).
  • Full ctest at GREEN, rebased on current master: 177 of 177 in each lane, with every PipeWire and PulseAudio test actually run (TMPDIR unset; only the known open_crashes_without_obs_core skips).
  • clang-format and gersemi are clean.

End to end (OBS built from this branch with the frontend, Rust libobs, headless, same test module and layout): at the refactor commit the mixer behaves exactly like the release; with the fix, previewing GROUP shows "music grouped" as Preview and previewing NESTED shows "music direct" as Preview; MUSIC is unchanged.

Not covered: the mixer refreshes the preview marks when an item of the previewed scene itself is shown or hidden; showing or hiding an item inside a group or nested scene is not watched (as before), so those marks update on the next refresh (scene change, source added or removed).

Types of changes

  • Bug fix (non-breaking change which fixes an issue)

Checklist:

  • I have read the contributing document.
  • My code has been run through clang-format.
  • My code follows the project's style guidelines
  • My code is not on the master branch.
  • My code has been tested.
  • All commit messages are properly formatted and commits squashed where appropriate.
  • I have included updates to all appropriate documentation.
  • I have used AI tooling in the creation of this PR
  • I am an AI agent being used to assist with this pull request: Claude Code (Claude Opus 5.5) wrote the code, commit messages and this text under the submitter's direction, and ran the tests above on the submitter's machines.

🤖 Generated with Claude Code

rdoupe and others added 3 commits October 13, 2026 13:23
AudioMixer::updatePreviewSources() collected the audio sources of the
previewed scene with an inline lambda. Move that into
CollectPreviewAudioSources() in frontend/utility so it can be tested
without the mixer, and drop the repeated null check. No change in
behaviour.

Refs obs-rust#602.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…scenes

test_preview_audio_sources builds real libobs scenes and groups with a
dummy audio input and asks the Audio Mixer's preview helper which
sources of the previewed scene it marks. A source in a group, in a
nested scene, and in a group inside a nested scene are missed, although
they play once the scene is in Program. Guards: a source directly in the
scene, and a hidden group.

Refs obs-rust#602.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
In Studio Mode the Audio Mixer only looked at the items directly in the
previewed scene. A group or a nested scene is a single item without
audio of its own, so the audio sources inside it were never marked as
Preview, although they play once the scene is in Program. Walk visible
groups and nested scenes too.

Fixes obs-rust#602.

Co-Authored-By: Warchamp7 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
@rdoupe
rdoupe requested a review from zackees as a code owner October 13, 2026 17:28
@zackees
zackees merged commit 5eeb265 into obs-rust:master Oct 13, 2026
19 checks passed
zackees added a commit to rdoupe/obs-studio that referenced this pull request Oct 13, 2026
cmocka.h defines inline for MSVC; the C++ standard library then stops with
C1189 (xkeycheck.h). test_preview_audio_sources (obs-rust#603) and
test_source_select_list (obs-rust#605) broke Rust Tier 2 on Windows.

Local-Gate: v1 tree=18171423214d0ff1f389335b7ecfa6dfaa2a3325 secs=318 lanes=lint:run,rust-test:run,cross:run,tier2-linux:run
Ci-Attestation: {"at":1791915462,"gate":"rust/all/fmt","host":"linux-x86_64","key":"a170de36a11c01c60ef4be85fbbb63c87b7c8f6fd7540f779537e6263ee47bb2","lane":"lint","parents":["622fa0150a5b5399fca6f70b5a9e119dcdc1b230"],"secs":26,"stamp":"94fd94970e6fe618a97da21fa028bca2","tree":"18171423214d0ff1f389335b7ecfa6dfaa2a3325","v":1,"via":"run"}
Ci-Attestation: {"at":1791915462,"gate":"rust/x86_64-unknown-linux-gnu/clippy","host":"linux-x86_64","key":"a170de36a11c01c60ef4be85fbbb63c87b7c8f6fd7540f779537e6263ee47bb2","lane":"lint","parents":["622fa0150a5b5399fca6f70b5a9e119dcdc1b230"],"secs":26,"stamp":"47fb7dc0fd63778a6c47af595688bd9c","tree":"18171423214d0ff1f389335b7ecfa6dfaa2a3325","v":1,"via":"run"}
Ci-Attestation: {"at":1791915462,"gate":"rust/x86_64-unknown-linux-gnu/test","host":"linux-x86_64","key":"a68a6419710723aa179271d9832becca610d83d890c16b635148e37896b4dd00","lane":"rust-test","parents":["622fa0150a5b5399fca6f70b5a9e119dcdc1b230"],"secs":80,"stamp":"26c6b571267af1df9c5fe47a801103bc","tree":"18171423214d0ff1f389335b7ecfa6dfaa2a3325","v":1,"via":"run"}
Ci-Attestation: {"at":1791915462,"gate":"rust/x86_64-pc-windows-msvc/clippy","host":"linux-x86_64","key":"8907a8740d6482a11a2d098769993caa1a477d63e36066a5cc4b8f7fa4cc8764","lane":"cross","parents":["622fa0150a5b5399fca6f70b5a9e119dcdc1b230"],"secs":62,"stamp":"53ab1315bef740a3ed55ca1e69334be8","tree":"18171423214d0ff1f389335b7ecfa6dfaa2a3325","v":1,"via":"run"}
Ci-Attestation: {"at":1791915462,"gate":"rust/x86_64-pc-windows-msvc/dylint","host":"linux-x86_64","key":"8907a8740d6482a11a2d098769993caa1a477d63e36066a5cc4b8f7fa4cc8764","lane":"cross","parents":["622fa0150a5b5399fca6f70b5a9e119dcdc1b230"],"secs":62,"stamp":"8d311426e90d4964c931bcfae1e81ef3","tree":"18171423214d0ff1f389335b7ecfa6dfaa2a3325","v":1,"via":"run"}
Ci-Attestation: {"at":1791915462,"gate":"rust/aarch64-apple-darwin/clippy","host":"linux-x86_64","key":"8907a8740d6482a11a2d098769993caa1a477d63e36066a5cc4b8f7fa4cc8764","lane":"cross","parents":["622fa0150a5b5399fca6f70b5a9e119dcdc1b230"],"secs":62,"stamp":"43d4fb522d7319c971b6724597570f28","tree":"18171423214d0ff1f389335b7ecfa6dfaa2a3325","v":1,"via":"run"}
Ci-Attestation: {"at":1791915462,"gate":"rust/aarch64-apple-darwin/dylint","host":"linux-x86_64","key":"8907a8740d6482a11a2d098769993caa1a477d63e36066a5cc4b8f7fa4cc8764","lane":"cross","parents":["622fa0150a5b5399fca6f70b5a9e119dcdc1b230"],"secs":62,"stamp":"aa343661a87b3008281e5a37b561926d","tree":"18171423214d0ff1f389335b7ecfa6dfaa2a3325","v":1,"via":"run"}
Ci-Attestation: {"at":1791915462,"gate":"rust/x86_64-apple-darwin/clippy","host":"linux-x86_64","key":"8907a8740d6482a11a2d098769993caa1a477d63e36066a5cc4b8f7fa4cc8764","lane":"cross","parents":["622fa0150a5b5399fca6f70b5a9e119dcdc1b230"],"secs":62,"stamp":"7497935565e024dddba340a5d2aa00c3","tree":"18171423214d0ff1f389335b7ecfa6dfaa2a3325","v":1,"via":"run"}
Ci-Attestation: {"at":1791915462,"gate":"rust/x86_64-apple-darwin/dylint","host":"linux-x86_64","key":"8907a8740d6482a11a2d098769993caa1a477d63e36066a5cc4b8f7fa4cc8764","lane":"cross","parents":["622fa0150a5b5399fca6f70b5a9e119dcdc1b230"],"secs":62,"stamp":"1a99834f286813ad454cf854cce18dd4","tree":"18171423214d0ff1f389335b7ecfa6dfaa2a3325","v":1,"via":"run"}
Ci-Attestation: {"at":1791915462,"gate":"cpp/linux-x64/tier2","host":"linux-x86_64","key":"3dd1f4a787d118314f3cbeeaf0de9dedcf34351f267585947d794ea676b66a6a","lane":"tier2-linux","parents":["622fa0150a5b5399fca6f70b5a9e119dcdc1b230"],"secs":150,"stamp":"d84556bb2dee1e55ea8cf6bcd8c5a2dc","tree":"18171423214d0ff1f389335b7ecfa6dfaa2a3325","v":1,"via":"run"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

2 participants