Skip to content

libobs: keep the live PulseAudio monitor when reset fails (#486) - #713

Merged
zackees merged 3 commits into
masterfrom
fix/486-pulse-monitor-reset
Oct 14, 2026
Merged

zackees merged 3 commits into
masterfrom
fix/486-pulse-monitor-reset

Conversation

@zackees

@zackees zackees commented Oct 14, 2026

Copy link
Copy Markdown
Member

Fixes #486

Reuses @chriscoveries' RED test and fix from fix/pulse-monitor-reset-failure (https://github.com/chriscoveries/obsrust-fork/tree/fix/pulse-monitor-reset-failure), re-applied on current master. Credit to them (commits keep their authorship).

Fix

audio_monitor_reset now creates the replacement monitor first and frees/swaps the live one only on success; on failure the live monitor is kept (and torn down to an empty ignore monitor only if its pulse context is terminal). pulseaudio_init re-creates a terminal context instead of reusing it.

Commits

  • RED 68bf1ca46 test: new cmocka test_pulse_monitor_reset (libpulse interposed, no audio hardware). Alone it was SKIPPED in Tier 2 because obs_startup needs a display.
  • 6c7b478ba test: run it under xvfb-run (my addition) so it executes. This is the real RED.
  • GREEN 44cbdc4b0 fix.

RED (rust/tools/linux-validate/run.sh, at 6c7b478)

99% passed, 3 failed of 205: test_pulse_monitor_reset (line 283), ..._shared_failed_context_reset_recovers (line 369), ..._failed_context_replacement_failure_is_safe.

GREEN

run.sh OFF and ON: 100% passed, 0 failed of 205 (all 5 pulse_monitor_reset tests pass); exported symbols IDENTICAL (1766). ./lint ok. ci-lint local-gate run passed (lint, rust-test, cross, tier2-linux) and the head is stamped.

Pulse monitoring is not ported to Rust (no Rust pulse code), so only the C Tier 2 test applies.

chriscoveries and others added 3 commits October 14, 2026 01:01
Co-authored-by: chriscoveries <[email protected]>
Local-Gate: v1 tree=9577f965f47c9c8302750cd911be7d497b2ee0fb secs=392 lanes=lint:run,rust-test:run,cross:run,tier2-linux:run
Ci-Attestation: {"at":1791965935,"gate":"rust/all/fmt","host":"linux-x86_64","key":"408fbfcd91109c96144cf35e21783d351d7e69ed8c567cea6511196f44c28a0a","lane":"lint","parents":["6c7b478ba80038f332a459850585979c7dfa4384"],"secs":23,"stamp":"a61eac3a84f81c380f086d864a21f25e","tree":"9577f965f47c9c8302750cd911be7d497b2ee0fb","v":1,"via":"run"}
Ci-Attestation: {"at":1791965935,"gate":"rust/x86_64-unknown-linux-gnu/clippy","host":"linux-x86_64","key":"408fbfcd91109c96144cf35e21783d351d7e69ed8c567cea6511196f44c28a0a","lane":"lint","parents":["6c7b478ba80038f332a459850585979c7dfa4384"],"secs":23,"stamp":"e8f49c52f44af0c6347cb8254e708f60","tree":"9577f965f47c9c8302750cd911be7d497b2ee0fb","v":1,"via":"run"}
Ci-Attestation: {"at":1791965935,"gate":"rust/x86_64-unknown-linux-gnu/test","host":"linux-x86_64","key":"b21c9ee277e9aba40f050988d2d5a2ce3b51c2cbca46dc7b7ec59ef15c46263c","lane":"rust-test","parents":["6c7b478ba80038f332a459850585979c7dfa4384"],"secs":93,"stamp":"48799cd3f0ded1e20fe32583564c8faa","tree":"9577f965f47c9c8302750cd911be7d497b2ee0fb","v":1,"via":"run"}
Ci-Attestation: {"at":1791965935,"gate":"rust/x86_64-pc-windows-msvc/clippy","host":"linux-x86_64","key":"ddaaa338e9e15bec211ed055ad39b84236311c928dcb6cf992c464b17e997d83","lane":"cross","parents":["6c7b478ba80038f332a459850585979c7dfa4384"],"secs":75,"stamp":"628ff2a3e6908546e2561e0d1c4ee1d7","tree":"9577f965f47c9c8302750cd911be7d497b2ee0fb","v":1,"via":"run"}
Ci-Attestation: {"at":1791965935,"gate":"rust/x86_64-pc-windows-msvc/dylint","host":"linux-x86_64","key":"ddaaa338e9e15bec211ed055ad39b84236311c928dcb6cf992c464b17e997d83","lane":"cross","parents":["6c7b478ba80038f332a459850585979c7dfa4384"],"secs":75,"stamp":"1fb0e0df3d245489fbc96adda551043a","tree":"9577f965f47c9c8302750cd911be7d497b2ee0fb","v":1,"via":"run"}
Ci-Attestation: {"at":1791965935,"gate":"rust/aarch64-apple-darwin/clippy","host":"linux-x86_64","key":"ddaaa338e9e15bec211ed055ad39b84236311c928dcb6cf992c464b17e997d83","lane":"cross","parents":["6c7b478ba80038f332a459850585979c7dfa4384"],"secs":75,"stamp":"3b12ee919e81962accad3895716673c6","tree":"9577f965f47c9c8302750cd911be7d497b2ee0fb","v":1,"via":"run"}
Ci-Attestation: {"at":1791965935,"gate":"rust/aarch64-apple-darwin/dylint","host":"linux-x86_64","key":"ddaaa338e9e15bec211ed055ad39b84236311c928dcb6cf992c464b17e997d83","lane":"cross","parents":["6c7b478ba80038f332a459850585979c7dfa4384"],"secs":75,"stamp":"8e4a31700a6653a950088264e40f3796","tree":"9577f965f47c9c8302750cd911be7d497b2ee0fb","v":1,"via":"run"}
Ci-Attestation: {"at":1791965935,"gate":"rust/x86_64-apple-darwin/clippy","host":"linux-x86_64","key":"ddaaa338e9e15bec211ed055ad39b84236311c928dcb6cf992c464b17e997d83","lane":"cross","parents":["6c7b478ba80038f332a459850585979c7dfa4384"],"secs":75,"stamp":"c8058875a0af0c0fb2faaf6e1b2ecf4d","tree":"9577f965f47c9c8302750cd911be7d497b2ee0fb","v":1,"via":"run"}
Ci-Attestation: {"at":1791965935,"gate":"rust/x86_64-apple-darwin/dylint","host":"linux-x86_64","key":"ddaaa338e9e15bec211ed055ad39b84236311c928dcb6cf992c464b17e997d83","lane":"cross","parents":["6c7b478ba80038f332a459850585979c7dfa4384"],"secs":75,"stamp":"8a3cf1e3d65d004d3c4bf72af35df92f","tree":"9577f965f47c9c8302750cd911be7d497b2ee0fb","v":1,"via":"run"}
Ci-Attestation: {"at":1791965935,"gate":"cpp/linux-x64/tier2","host":"linux-x86_64","key":"c8725ba0c1d08c1bf96deff9ae4af618cac89ddbdf314914cfc9b1cfed091b95","lane":"tier2-linux","parents":["6c7b478ba80038f332a459850585979c7dfa4384"],"secs":202,"stamp":"3dfab77cb651101b66ecae7133fddc8f","tree":"9577f965f47c9c8302750cd911be7d497b2ee0fb","v":1,"via":"run"}
@zackees
zackees merged commit 82fdc46 into master Oct 14, 2026
21 checks passed
@zackees
zackees deleted the fix/486-pulse-monitor-reset branch October 26, 2026 15:44
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: a failed PulseAudio monitor reset frees the live monitor and leaves dangling state (Linux)

2 participants