Skip to content

bug: libobs: audio monitoring goes silent after a Media Source with cover art restarts (upstream #9428) #2530

Closed

Description

@rdoupe

Upstream bug, same code on master here. On Windows, a Media Source playing a song with embedded cover art (an MP3 or FLAC with an album picture) plays to the stream but goes silent on the monitoring device after the source restarts: the scene is shown again with "Restart playback when source becomes active", visibility is toggled, or the file loops. Switching monitoring off and on brings it back until the next restart. Files without cover art are not affected.

Location

libobs/audio-monitoring/win32/wasapi-output.c.h, process_audio_delay(). The monitor holds a source's audio back while it runs ahead of the source's video, and stops syncing once the video timestamp (source->last_frame_ts) has stood still for 100 ms (time_since_prev > 100000000ULL). Cover art is one picture, so its timestamp stands still.

	if (!monitor->prev_video_ts) {
		monitor->prev_video_ts = last_frame_ts;

	} else if (monitor->prev_video_ts == last_frame_ts) {
		monitor->time_since_prev += util_mul_div64(*frames, 1000000000ULL, monitor->sample_rate);
	} else {
		monitor->time_since_prev = 0;
	}

The else branch resets the count on a new video timestamp but never stores it. A restart decodes the cover again with a new timestamp, so from then on every packet sees a "new" timestamp, the count stays at 0, and the audio, ever further ahead of the still cover, is held back for good ("rushing").

The PulseAudio and CoreAudio monitors have no such check, so Linux and macOS are not affected. The program audio (stream and recording) is not affected on any OS. A related cover-art bug (seeking ended playback, obsproject/obs-studio#11195) was fixed here by #313; this one is separate.

Reproduction on Linux

The WASAPI monitor itself only builds on Windows. Run on Linux, through real libobs and the real ffmpeg_source, with a generated MP3 and FLAC with a cover: the decision above runs in the source's audio capture callback (where the monitor runs it), with the real last_frame_ts. On master, after the program goes to another scene and back, the cover has a new timestamp, the monitor still holds the old one, and the still cover counts 0 ms (needs more than 100 ms), in 5 of 5 runs on hybrid libobs and on libobs-c-reference. First play counts 768 to 888 ms.

Fix

Store the new timestamp in the else branch (upstream #14091).

Activity

  1. rdoupe commented on Oct 26, 2026

    @rdoupe
    CollaboratorAuthor

    Claiming: #2530 (fix ready).

  2. added
    ready
    on Oct 26, 2026
  3. rdoupe commented on Oct 26, 2026

    @rdoupe
    CollaboratorAuthor

    Fixed by PR #2531 (merge commit e8bdfee): the Windows audio monitor now stores the new video timestamp, so a still cover that gets a new timestamp after a restart counts as stalled again and the audio is no longer held back. Tests: test_monitor_video_sync (every platform) and test_media_cover_art_monitor (real libobs and ffmpeg_source, Linux).

    What is left: nothing in the code. The WASAPI device path itself only builds on Windows, so it is covered by the Windows build in PR CI, not by a run. It is not in a named release yet (latest is v0.1.0-beta.20261023, from before the merge).

    Follow-up issue: none needed; there is nothing left to split out.

  4. rdoupe commented on Nov 1, 2026

    @rdoupe
    CollaboratorAuthor

    @Colonel-Crapshot A Media Source with embedded cover art going silent on the monitoring device after it restarts (upstream obs-studio issue 9428) is changed in obs-rust. On Windows the audio monitor now stores the new video timestamp, so a still cover image that gets a new timestamp after a restart counts as stalled again and the audio is no longer held back. This is a port of upstream PR 14091. The Windows audio device path itself only builds on Windows, so it is covered by the Windows build in CI rather than by a run on a Windows machine.

    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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

ready

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions