-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Fix audio playback crashes #6817
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
Conversation
|
I think I managed to reproduce it. There's a crash without any information in the launch screen. If I find more info I'll edit the post.
|
|
@dbemke is with or without the PR changes? |
I reproduced it on the master and the store version. I just checked this form on the PR and the issue hasn't occurred. |
audio-clips/src/main/java/org/odk/collect/audioclips/AudioClipViewModel.kt
Show resolved
Hide resolved
|
@dbemke that looks like a different bug. Could you file it separately? |
Ok. I'll file an issue when I figure out a way to reproduce it. |
|
Tested with Success! Verified on a device with Android 10 Verified cases:
|
|
Tested with success Verified on device with Android 15 |
Fix audio playback crashes
Closes #6085
Why is this the best possible solution? Were any other approaches considered?
Our only theory for why the crash happens is that
MediaPlayeris able to get into weird states because we set it up on a background thread. The fix here is just to wrapMediaPlayerin a simplified interfaced that only allows one thread at a time to call methods that mutate the internal state.How does this change affect users? Describe intentional changes to behavior and behavior that could have accidentally been affected by code changes. In other words, what are the regression risks?
We don't have reproduction steps for the crash, so the main focus here is just to check that audio playback in the app still works as expected.
Before submitting this PR, please make sure you have:
./gradlew connectedAndroidTest(or./gradlew testLab) and confirmed all checks still passDateFormatsTest