Repository navigation
Drain released audio buffers on notification in the suspend/resume test - #1008
Closed
thehobbit85 wants to merge 1 commit into
Closed
thehobbit85 wants to merge 1 commit into
thehobbit85 wants to merge 1 commit into
Conversation
thehobbit85
force-pushed
the
codex/audio-release-event-test
branch
2 times, most recently
from
November 3, 2026 03:12
d8a6cef to
e0bfe51
Compare
seedds
added a commit
that referenced
this pull request
Nov 3, 2026
… finish several buffers and the notifier can combine wakes, so the suspend / resume case no longer fails under TSan with 5 of 6 notifications (#1008) Co-authored-by: thehobbit85 <[email protected]>
Owner
|
Landed on main as 82246bd, with you credited as co-author. |
Know-It-All-Brother
pushed a commit
to Know-It-All-Brother/nxnative
that referenced
this pull request
Nov 9, 2026
… finish several buffers and the notifier can combine wakes, so the suspend / resume case no longer fails under TSan with 5 of 6 notifications (seedds#1008) Co-authored-by: thehobbit85 <[email protected]>
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.
What and why
The suspend/resume AudioOut test failed under ThreadSanitizer after reclaiming all six PCM buffers in order and within its pacing bounds. It counted five release notifications and expected six. The affected PR changes contributor documentation and inherits the test unchanged from main. Failed job on #691
Current head
e0bfe51d62016f804951a5c550f6c5dfd2cdba35.python3 -m unittest dm.tools.tests.test_docspassed on this revision (11 tests). The feature sources, tests and documentation match the previously validated revisiond8a6cefd641fbyte for byte.This PR includes main
6136418bcd564f086cf57cb0a59e8f997d36445e. Main’s standalone audio test still counts one notification per buffer. This PR drains all released buffers on a wake while preserving release order and the requirement for real notification.Local validation on
d8a6cefd641f.python3 -m unittest dm.tools.tests.test_docs— 11 tests passed.The native audio suspend/resume fixture and the repository’s full threaded TSan target passed. A separate probe initially used raw TSan flags and reported two races across uninstrumented CoreAudio calls. The passing target uses the repository’s pre-existing no-inline and runtime settings.
The notification-draining regression is commit
e0bfe51d6201. Shared AudioOut testGitHub checks for this revision
One audio callback can finish several buffers, and the notifier can combine pending wakes. The old test polled the released queue independently of the event, then compared the number of signals with the number of buffers. The silent-sink and suspend/resume scenarios now read the queue only after observing a notification, drain it, and check every buffer’s identity and order. Both keep the original deadline. The suspend/resume case also checks that both transitions ran and the 520 ms playback lower bound held.
Original repair validation
make -C dm/host/tests GAME=010015100B514000 tsan-threadsandmake -C dm/host/tests GAME=010015100B514000 asanpassed on the submitted sources. LLVM 23.1.4 checked all 217 sources and matched the existing 271-finding C lint baseline.