Skip to content

libobs: Mute 32.x Monitor Only sources on load - #2445

Merged
zackees merged 3 commits into
obs-rust:masterfrom
rdoupe:fix/monitor-only-migration
Oct 26, 2026
Merged

zackees merged 3 commits into
obs-rust:masterfrom
rdoupe:fix/monitor-only-migration

Conversation

@rdoupe

@rdoupe rdoupe commented Oct 26, 2026

Copy link
Copy Markdown
Collaborator

Fixes #2444

What and why

33.0 made audio monitoring an on/off switch where on means monitor and output, and the monitor now plays a source while it is muted, so "monitor only" in 33.0 is monitoring on + muted. The load migration (upstream obsproject/obs-studio@646836a, ported unchanged to obs-core::source_load) turns every saved type except off into monitoring on and leaves the mute alone. So an unmuted source set to "Monitor Only" before 33.0 started playing into the stream and recordings after the upgrade.

Now a source saved before 33.0.0 whose monitoring type is Monitor Only (after the 23.2.2 monitor-by-default migration) also loads muted. Monitor and Output and off load as before. A source saved by 33.0.0 or later is not touched (33.0 saves prev_ver 33 and type 2 or 0), so no scene that has already been saved by 33.0 sounds different. This restores the pre-33 behaviour; it adds no option.

  • obs_source_load_monitor_only_mutes(): a new hidden pure function in libobs/obs-source-load.c.h (declared without EXPORT, listed in rust-hidden.txt, rust-exports.map and rust-unexports-macos.txt). obs_load_source_type() calls obs_source_set_muted(source, true) when it returns true, after the monitoring setter.
  • Ported to obs-core::source_load::monitor_only_mutes with its C ABI shim. The oracle compiles the C function under the oracle_ prefix. The monitoring plan struct and its layout are unchanged, so no existing test changes.
  • No existing C test assertion is changed. test_source_load_migration_steps gains two new cases for the new function.

Not in this PR: the stinger transition's old three-way audio_monitoring setting is also lost on upgrade (#2444-stinger). Transitions are saved with no version, so a stinger cannot be migrated without changing stingers already saved by 33.0. That is held for a design decision.

RED → GREEN

  • RED commit: fbbaf6472 (test: Keep a 32.x Monitor Only source out of the mix), adding test_source_monitor_only_load (graphics suite, Linux, under xvfb). On master, legacy_monitor_only_stays_out_of_program fails on all three lanes (C, hybrid, libobs-c-reference): "32.2.2 Monitor Only, unmuted: monitoring on, muted no, 1024 program frames ... carry the tone". The other two cases pass: the other pre-33 types, and entries saved by 33.0.0.
  • GREEN: 79ba9cb69. test_source_monitor_only_load 3/3 on C, hybrid and libobs-c-reference: "32.2.2 Monitor Only, unmuted: monitoring on, muted yes, 0 program frames and 28800 monitor feed frames carry the tone". test_source_load_migration_steps, test_source_volume_mix, test_source_audio_ranges, test_deinterlace_mode_load, test_source_audio_render_steps and test_source_volume_apply_steps pass on C and hybrid. Rust obs_core::source_load*: 44/44, including the new step tests, the exhaustive parity test against the C (every caps bit × 30 types × 80 versions) and the proptest parity. The exported symbol sets are identical on C, hybrid and libobs-c-reference (1766 each); the new function is a local symbol.
  • Real app: not run. The change is the load migration only, and it is covered through the real libobs load path.

Checklist

  • Base is master
  • I claimed the issue, or no one else has an open PR for it
  • Characterization test (if the unit had none), then RED, then GREEN commits
  • User-visible change: its line in docs/features.md is added or updated
  • (Optional) Local gate passed and the pushed head is stamped; otherwise PR CI runs the full suite
  • Warning or flag changes (-W..., ratchets): not applicable
  • Intentional differences from C listed in the parity test header and rust/README.md (ports): none

A source saved before 33.0 with "Monitor Only" loads with monitoring
on, which 33.0 plays into every output, and it stays unmuted, so its
audio reaches the stream and recordings. Load scene collection entries
saved by 32.2.2 and 33.0.0 with each monitoring type, feed a tone, and
check the monitoring and mute state, the program mix and the monitor
feed.

Refs obs-rust#2444
33.0 turned monitoring into an on/off switch where on means monitor
and output, and the monitor now plays a source while it is muted. The
load migration turned every saved monitoring type but off into
monitoring on and left the mute alone, so an unmuted source set to
"Monitor Only" before 33.0 started playing into the stream and
recordings.

A source saved before 33.0.0 whose monitoring type (after the 23.2.2
monitor-by-default migration) is Monitor Only now also loads muted,
the 33.0 form of monitor-only. Monitor and Output and off load as
before, and a source saved by 33.0.0 or later is not touched.

obs_source_load_monitor_only_mutes() is a new hidden pure function in
obs-source-load.c, ported to obs-core::source_load with its shim,
oracle and parity tests; the monitoring plan struct is unchanged.

Fixes obs-rust#2444
@rdoupe
rdoupe requested a review from zackees as a code owner October 26, 2026 05:06
@zackees

zackees commented Oct 26, 2026

Copy link
Copy Markdown
Member

Coordinator review: the change is right. 33.0 turns pre-33 Monitor Only into monitoring on, unmuted, so those sources leak into the stream, and loading them muted restores the old behavior. It only applies to sources saved before 33.0.0, so 33.0 scenes don't change. RED fbbaf6472 then GREEN on C, hybrid and the libobs C reference. The C-vs-Rust parity tests cover the new function. The existing C test only gains cases, and the symbol is hidden and listed in the export maps. The ledger line is there.
One mechanical fix before I queue: 11 #TBD placeholders across 8 files (obs.c.h, obs-source-load.h, source_load.rs and its two tests, test_source_load_migration_steps.c, test_source_monitor_only_load.c/.cmake) should read #2444. I couldn't push to your fork from here; sed -i 's/#TBD/#2444/g' on those files does it. I'll queue once CI is green after that.

@zackees
zackees enabled auto-merge October 26, 2026 05:22
@zackees

zackees commented Oct 26, 2026

Copy link
Copy Markdown
Member

The placeholders are fixed (752faee). Queued; it merges when CI is green.

@zackees
zackees added this pull request to the merge queue Oct 26, 2026
Merged via the queue into obs-rust:master with commit 497c68b Oct 26, 2026
36 checks passed
rdoupe added a commit to rdoupe/obs-studio that referenced this pull request Oct 26, 2026
…2447)

Since 33.0, monitoring is on or off, on means monitor and output, and
the monitor ignores mute, so Monitor Only is monitoring on plus muted
(obs-rust#2445 loads old scene collections that way). The deprecated
obs_source_set_monitoring_type() turns every type but none into
monitoring on and leaves the mute alone, so a source set to Monitor Only
by a plugin, a script or obs-websocket's SetInputAudioMonitorType plays
into the stream and recordings. obs_source_get_monitoring_type(),
GetInputAudioMonitorType and the "audio_monitoring" signal report
Monitor and Output for it.

test_source_monitoring_type calls the libobs setter and getter;
test_ws_monitor_only goes through the unchanged obs-websocket input
requests, compiled against libobs. Both play a tone from a source on the
program and check the mixed audio libobs hands to outputs and the
monitor feed after each step: Monitor Only must keep the tone out of the
mix and read back as Monitor Only; the other types must round-trip;
leaving Monitor Only must undo its mute but keep any other mute; a
monitored, muted source must read back as Monitor Only.

Refs obs-rust#2447
rdoupe added a commit to rdoupe/obs-studio that referenced this pull request Oct 26, 2026
…st#2450)

* test/cmocka: Add failing tests for Monitor Only monitoring (obs-rust#2447)

Since 33.0, monitoring is on or off, on means monitor and output, and
the monitor ignores mute, so Monitor Only is monitoring on plus muted
(obs-rust#2445 loads old scene collections that way). The deprecated
obs_source_set_monitoring_type() turns every type but none into
monitoring on and leaves the mute alone, so a source set to Monitor Only
by a plugin, a script or obs-websocket's SetInputAudioMonitorType plays
into the stream and recordings. obs_source_get_monitoring_type(),
GetInputAudioMonitorType and the "audio_monitoring" signal report
Monitor and Output for it.

test_source_monitoring_type calls the libobs setter and getter;
test_ws_monitor_only goes through the unchanged obs-websocket input
requests, compiled against libobs. Both play a tone from a source on the
program and check the mixed audio libobs hands to outputs and the
monitor feed after each step: Monitor Only must keep the tone out of the
mix and read back as Monitor Only; the other types must round-trip;
leaving Monitor Only must undo its mute but keep any other mute; a
monitored, muted source must read back as Monitor Only.

Refs obs-rust#2447

* libobs: Keep Monitor Only out of the outputs when set by type

Since 33.0, monitoring is on or off, on means monitor and output, and
the monitor plays a source even when it is muted. The deprecated
obs_source_set_monitoring_type() turned Monitor Only into monitoring on
and left the mute alone, so a source that a plugin, a script or
obs-websocket's SetInputAudioMonitorType set to Monitor Only played into
the stream and recordings.

Monitor Only now mutes the source, then turns monitoring on, as a
pre-33.0 Monitor Only source loads (obs-rust#2444). Monitor and Output unmutes
it and turns monitoring on. None turns monitoring off and keeps the
mute, except that it undoes the mute Monitor Only set when nothing has
set the mute since, so the source plays into the outputs as None did
before 33.0. obs_source_set_muted() clears that mark. The getter and
the "audio_monitoring" signal report a monitored, muted source as
Monitor Only; the stored type and the saved scene collection are
unchanged.

Fixes obs-rust#2447

* docs: Note that Monitor and Output unmutes a source

Refs obs-rust#2447
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

bug: libobs: 32.x "Monitor Only" sources play into the stream after the 33.0 upgrade

2 participants