Repository navigation
Description
Report
Upstream obsproject/obs-studio#10586 (open since 2024): with "Control audio via OBS" on, a Browser Source (alert box) stops producing sound after 10 to 20 minutes, sometimes hours, while its video keeps playing. Toggling "Control audio via OBS" off and on brings the sound back. Reported again this month on Windows Server 2022, headless over RDP, 32.2.2, on two OBS instances. obsproject/obs-studio#8869 is likely the same: the meter goes flat.
Reproduction (Linux, obs-rust master, CEF 156)
- Browser source with "Control audio via OBS", showing a page that plays sounds through one shared
AudioContext(alerts: a 1 s tone every 5 s). - Kill the Chromium audio utility process (
obs-browser-page --type=utility --utility-sub-type=audio.mojom.AudioService) to simulate a crash or the hang monitor's termination. - Result: the OBS log gets
[obs-browser: '<name>'] Error: The AudioContext encountered an error from the audio device or the WebAudio renderer.From then on the source delivers zero audio packets: meter flat, monitor and output silent. The page keeps animating. - Toggle "Control audio via OBS", or press "Refresh cache of current page": audio is back immediately.
Pages that play with new Audio() recover by themselves; only WebAudio pages stay dead.
Harness: a headless libobs probe with private Xvfb, dbus and HOME, loopback-only network and no audio output. It measures the source's capture callback and the mix every second.
Root cause
- Chromium runs audio in a separate process. On Windows it terminates itself if its audio thread hangs for 3 min (
HangAction::kTerminateCurrentProcess,media/audio/audio_thread_hang_monitor.cc:37) and can crash on device changes (an RDP session connect/disconnect). - When it goes away, the page's
AudioContextfireserrorand becomessuspended, andcurrentTimefreezes. Chromium does not resume it. - The WebContents is never audible again, so CEF never starts a new loopback capturer and obs-browser gets no
OnAudioStreamPacket. - obs-browser ignores
OnAudioStreamError/OnAudioStreamStopped(plugins/obs-browser/browser-client.cpp:598,:603) and has no recovery. The toggle works only because it destroys and recreates the browser (obs-browser-source.cpp:529,:564).
Not yet confirmed from a reporter's log: the check is the "AudioContext encountered an error" line at the time the sound stops.
Plan
- RED: an obs-browser test in the same style as
plugins/obs-browser/tests/startup_shutdown.py. Headless, with a local WebAudio tone page andreroute_audio=true: wait for packets, SIGKILL the audio utility process, assert that packets resume within 5 s. Today: 0 packets for the rest of the run. - GREEN: in
BrowserApp::OnContextCreated(plugins/obs-browser/browser-app.cpp:187), before page scripts run, wrapAudioContext/webkitAudioContext: listen forerrorandresume()a context that wasrunningand was not suspended by the page. A page doing this by hand recovered 0.5 s after the kill. Covers rerouted and non-rerouted sources. - Edge cases to test: a page that calls
suspend()itself (must not be resumed);OfflineAudioContext(untouched); repeated kills; several sources sharing one renderer. - Separate follow-up: each new CEF loopback stream delivers its first packets late, so libobs global buffering ratchets to 960 ms within about a minute. File it as its own issue.
Metadata
Metadata
Assignees
Type
Projects
- StatusShow more project fieldsDone
Activity
rdoupe commentedon Oct 25, 2026
Claiming: #2328.
Resume WebAudio after the audio service dies (obs-rust#6)
obs-browser: Update to 4583599 (sandbox, fallback warning, audio fixe…
rdoupe commentedon Nov 1, 2026
@AcidicVoid A Browser Source with "Control audio via OBS" going silent for good after Chromium's audio service restarts (upstream obs-studio issue 10586) is changed in obs-rust. The fix came in a combined obs-browser update (PR 2378) that includes the audio fixes, so the source now recovers its sound after such a restart instead of staying silent.
obs-rust is an AI-assisted fork of OBS, based on current OBS master, with extra bug fixes like this one.
It ships in the OBS-Studio-Rust v1.0.0 release: https://github.com/obs-rust/obs-studio/releases