fix: AudioContext::resume reanimates the failed Oboe stream due to the change in AudioPlayer::resume - #1252
Draft
basiav wants to merge 4 commits into
Draft
fix: AudioContext::resume reanimates the failed Oboe stream due to the change in AudioPlayer::resume #1252basiav wants to merge 4 commits into
basiav wants to merge 4 commits into
Conversation
WPT non-regression comparisonERROR — the run produced no report. Workflow run · this comment is updated on every push. |
closetcaiman
requested changes
Aug 25, 2026
Comment on lines
+190
to
+195
| const bool wasRunning = isRunning_.load(std::memory_order_acquire); | ||
|
|
||
| if (!rebuildStream()) { | ||
| return; | ||
| } | ||
|
|
Member
There was a problem hiding this comment.
If rebuildStream fails, isRunning flag may stay true.
Comment on lines
-161
to
+171
| if (error != oboe::Result::ErrorDisconnected || driverMutex_ == nullptr) { | ||
| // error != oboe::Result::ErrorDisconnected condition is deleted to handle more cases of errors | ||
| if (driverMutex_ == nullptr) { |
Member
There was a problem hiding this comment.
Removing this guard seems really dangerous to me. Consider this: should all types of errors result in stream rebuild retry? What about some non-recoverable errors, won't that create an infinite loop? Maybe it is better to choose action in response to specific errors - oboe::Result is not that big of an enum.
Comment on lines
90
to
105
| if (mStream_ != nullptr) { | ||
| auto result = mStream_->requestStart() == oboe::Result::OK; | ||
| isRunning_.store(result, std::memory_order_release); | ||
| return result; | ||
| if (mStream_->requestStart() == oboe::Result::OK) { | ||
| isRunning_.store(true, std::memory_order_release); | ||
| return true; | ||
| } | ||
| } | ||
|
|
||
| if (rebuildStream()) { | ||
| if (mStream_ != nullptr && mStream_->requestStart() == oboe::Result::OK) { | ||
| isRunning_.store(true, std::memory_order_release); | ||
| return true; | ||
| } | ||
| } | ||
|
|
||
| isRunning_.store(false, std::memory_order_release); | ||
| return false; |
Member
There was a problem hiding this comment.
I'm not a fan of resume being responsible for rebuilding the stream. Seems like it tries to act both as resume and start.
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.
Closes #1230
Introduced changes
oboe::Result::ErrorDisconnectedis being handled inAudioPlayer::onErrorAfterClose, the author in the issue mentions other types of errors not being handled in their real life situations, e.g.ErrorNoService,ErrorTimeout-> they are being skipped by the "if" statement and the stream is not being rebuilt.AudioPlayer:onErrorAfterClosethe conditionerror != oboe::Result::ErrorDisconnectedwas deleted to enable handling more errors by a try to rebuild the stream.AudioContext::resumewas called,audioPlayer_->resumewas failing.AudioPlayer:resume.Checklist