fix: vision mixer compositor stall due to start-time-selection race#480
Merged
fix: vision mixer compositor stall due to start-time-selection race#480
Conversation
With start-time-selection=first, a race condition in GStreamer 1.26 causes the multiview compositor to stall indefinitely. When the aggregator srcpad task runs before any buffer arrives, it falls through to using the absolute monotonic clock time as start time. This makes the compositor wait for a deadline of 2× system uptime (base_time + start_time where both equal the monotonic clock), which is never reached in a reasonable time. The bug is intermittent: if a buffer arrives before the srcpad task's first iteration, the correct near-zero start time is selected. If the task runs first, the compositor is stuck forever. Switching to zero is correct for force-live compositors where all inputs start at running time 0, and works with all clock types (monotonic, PTP, pipeline default). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
mv_comp) would sometimes never produce output, causing the entire downstream chain (videoenc → WHEP output) to remain unnegotiatedstart-time-selection=firstrace condition — when the aggregator srcpad task runs before any buffer arrives, it selects the absolute monotonic clock time as start time instead of ~0, making the compositor wait for a deadline of 2× system uptimeRoot Cause Analysis
With
start-time-selection=first, the aggregator'swait_and_checkcallsgst_aggregator_get_first_buffer_start_time(). If no buffer is available yet (race with srcpad task startup), the code falls through and uses the absolute clock time as the start time. The deadline becomesbase_time + start_time ≈ 2× system_uptime, which is never reached.Intermittent because: if a buffer arrives before the srcpad task's first iteration → correct start time (~0). If the task runs first → broken start time (absolute clock).
Verified via GST_DEBUG logs:
mixer(PGM): start time =0:00:00.007✓mv_comp(MV): start time =1:14:40.730(= system uptime) ✗Fix
Changed
start-time-selectionfromfirsttozerofor vision mixer compositors. Withforce-live=true, running time always starts at 0 regardless of clock type (monotonic, PTP, pipeline default).Test plan
start-time-selection)🤖 Generated with Claude Code