Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: oboe crash by not stopping stream on error #2040

Merged
merged 1 commit into from
Mar 28, 2024

Conversation

Okabintaro
Copy link
Contributor

@Okabintaro Okabintaro commented Mar 25, 2024

This is a follow up to my PR #2025, where I encountered an audio crash that happened randomly after a couple of minutes or hours of using it(See #2025 (comment)).
I reverted the changes and could confirm the commits in the PR being the issue.

Then I looked further and found out that you shouldn't close the audio stream after an error occurred(see commit message) and was testing this fix in this PR for two days now(~6h of continued usage) without a crash.

I also found out when rebasing, that in a recent commit(005c4c7#diff-662ca07f68bbbec1317ab607076a66fa0daa81ae07df639d3588832f87c509d6R43) you upgraded the oboe crate to 0.6 even though it had a comment/warning on it, and I wonder if it is still relevant.
Couldn't test with the upgraded dependency yet, so I will do that and mark the PR as ready once I am confident everything is stable.

According to the documentation the stream will already be closed when
there was an error, so my theory is that referencing it again might
crash oboe.

See https://docs.rs/oboe/0.5.0/oboe/trait.AudioOutputCallback.html#method.on_error_after_close

> This will be called when an error occurs on a stream or when the stream is disconnected. The underlying AAudio or OpenSL ES stream will already be stopped AND closed by Oboe. So the underlying stream cannot be referenced. But you can still query most parameters.
@galister
Copy link
Collaborator

testing this now

@Okabintaro
Copy link
Contributor Author

Had no crashes or issues for 2 days of usage with both streamer and client built from the PR, so I think its fine.

@zmerp zmerp marked this pull request as ready for review March 28, 2024 03:29
@zmerp
Copy link
Member

zmerp commented Mar 28, 2024

Seems straightforward enough for me, merging

@zmerp zmerp merged commit 5b2fb85 into alvr-org:master Mar 28, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants