Repository navigation
linux-alsa: Keep a stop that comes before the capture thread starts (Refs #1464) - #1559
Merged
Merged
Conversation
zackees
enabled auto-merge
October 20, 2026 20:22
github-merge-queue
Bot
removed this pull request from the merge queue due to a conflict with the base branch
Oct 20, 2026
zackees
force-pushed
the
fix/alsa-early-stop
branch
from
October 20, 2026 21:12
56d4ae0 to
698174f
Compare
zackees
enabled auto-merge
October 20, 2026 21:12
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.
Refs #1464 (split from it: one small PR per fix)
What and why
The capture thread set
data->listen = trueitself when it began to run, so a stop (_alsa_close():listen = false, then join) that came first was overwritten: the thread captured on forever and the join (destroy, source removal, shutdown) hung._alsa_open()now setslistenbeforepthread_create(and clears it if creation fails), and the thread loop checks it before the first read.RED → GREEN
12fe448abaddstest/cmocka/test_alsa_early_stop.c. The race is made deterministic:pthread_create/pthread_joinare wrapped (--wrap) and the capture thread is held at its start until the stopping thread has setlisten = falseand is joining it. Capture runs on ALSA's null PCM. On master destroy never returns ("destroy did not return within 2 s: the capture thread ignored the stop"); with the fix it returns at once.Checklist
masterdocs/features.mdis added (wording from fix: 20 bug fixes in libobs callbacks, muxer, audio and build #1464)./lintpasses