Repository navigation
fix(voice): stop rendering before releasing audio observers - #474
Draft
johnmatthewtennant wants to merge 1 commit into
Draft
johnmatthewtennant wants to merge 1 commit into
johnmatthewtennant wants to merge 1 commit into
Conversation
Signed-off-by: John Tennant <jtennant@block.xyz> Co-authored-by: Darcy <756b3e94a13d7979c09d32291e4fd4da46848bdaa53340021ac24fb843e28d57@buzz.block.builderlab.xyz>
This branch has not been deployed
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
Repeated voice replies can crash Berd on macOS in
_Block_copy, called byAUHALOutputUnit_RenderNotifyCallback. The PCM player removes its render observers before stopping the audio engine, so output can still copy an observer block while that block is being released. This reproduces in released 0.5.43.This bug fix stops the player and engine before unregistering render observers. An offline native regression checks that observer blocks remain registered throughout output shutdown and are released afterward, including an idempotent second stop.
Related issue
Fixes #473.
Testing
A native playback stress reproduction crashes the old bridge after about 30 playback lifetimes, with the same
0x8fault and render-notify stack as the released app. The fixed bridge completes 300 lifetimes. The offline regression fails on the original shutdown ordering and passes with the fix; existing render-error latching checks still pass.The packaged app comparison uses the same Mac, virtual microphone input and separate audio output, with Parakeet recognition, live agent turns and Pocket playback. The original candidate crashes on reply two of call cycle five. The fixed package completes ten three-reply cycles without crashing.