You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
87% Android 13 since start (but also some 9, 12, 14 so maybe it's just the devices that happen to have forms that trigger this)
Device used
91% Samsung since start, reported by a user with a fleet of Galaxy Tab S7 5G, 82% of occurrences are with Galaxy Tab Active3 (probably just happens to be those devices that have forms that trigger this)
Problem description
A user reports seemingly-random crashes while navigating through the section of a form that is many select questions with autoplay audio media. Users don't see any crash message when Collect restarts.
Crashlytics shows two stacktraces from crashes from `mediaplayer.prepare` and `mediaplayer.setDataSource`
```javarosa
Fatal Exception: java.lang.IllegalStateException:
at android.media.MediaPlayer._prepare(MediaPlayer.java)
at android.media.MediaPlayer.prepare(MediaPlayer.java:1435)
at org.odk.collect.audioclips.AudioClipViewModel.loadNewClip$lambda$3(AudioClipViewModel.kt:26)
at org.odk.collect.async.CoroutineScheduler$immediate$1$result$1.invokeSuspend(CoroutineScheduler.kt:12)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:11)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:98)
at kotlinx.coroutines.internal.LimitedDispatcher$Worker.run(LimitedDispatcher.kt:3)
at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:2)
at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:14)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:28)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt)
```
Fatal Exception: java.lang.IllegalStateException:
at android.media.MediaPlayer._setDataSource(MediaPlayer.java)
at android.media.MediaPlayer.setDataSource(MediaPlayer.java:1251)
at android.media.MediaPlayer.setDataSource(MediaPlayer.java:1234)
at android.media.MediaPlayer.setDataSource(MediaPlayer.java:1188)
at android.media.MediaPlayer.setDataSource(MediaPlayer.java:1164)
at android.media.MediaPlayer.setDataSource(MediaPlayer.java:1131)
at org.odk.collect.audioclips.AudioClipViewModel.loadNewClip$lambda$3(AudioClipViewModel.kt:23)
at org.odk.collect.async.CoroutineScheduler$immediate$1$result$1.invokeSuspend(CoroutineScheduler.kt:12)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:11)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:98)
at kotlinx.coroutines.internal.LimitedDispatcher$Worker.run(LimitedDispatcher.kt:3)
at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:2)
at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:14)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:28)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt)
I'm opening this issue to have a record of what we've considered/discovered here. I think it's likely there's some weird Samsung-Android 13 platform bug that we're hitting so I don't think we need to take immediate action.
Another idea is that mediaplayer is not threadsafe. Is there a way we could somehow be calling mediaplayer methods from different threads under some conditions?
The text was updated successfully, but these errors were encountered:
ODK Collect version
v2024.1.0 - v2024.1.3 (Crashlytics)
Android version
87% Android 13 since start (but also some 9, 12, 14 so maybe it's just the devices that happen to have forms that trigger this)
Device used
91% Samsung since start, reported by a user with a fleet of
Galaxy Tab S7 5G
, 82% of occurrences are withGalaxy Tab Active3
(probably just happens to be those devices that have forms that trigger this)Problem description
A user reports seemingly-random crashes while navigating through the section of a form that is many select questions with autoplay audio media. Users don't see any crash message when Collect restarts.
Crashlytics shows two stacktraces from crashes from `mediaplayer.prepare` and `mediaplayer.setDataSource`
```javarosa Fatal Exception: java.lang.IllegalStateException: at android.media.MediaPlayer._prepare(MediaPlayer.java) at android.media.MediaPlayer.prepare(MediaPlayer.java:1435) at org.odk.collect.audioclips.AudioClipViewModel.loadNewClip$lambda$3(AudioClipViewModel.kt:26) at org.odk.collect.async.CoroutineScheduler$immediate$1$result$1.invokeSuspend(CoroutineScheduler.kt:12) at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:11) at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:98) at kotlinx.coroutines.internal.LimitedDispatcher$Worker.run(LimitedDispatcher.kt:3) at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:2) at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:14) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:28) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt) ```We always call
which should put the player in the correct states according to the state diagram.
Steps to reproduce the problem
It can't be reproduced systematically.
I've used audio crash.zip to try to reproduce but can't.
Expected behavior
No crash.
Other information
Presumably introduced by https://github.com/getodk/collect/pull/5836/files#diff-dd7070cc2905fbf7e644eac39e7590ff53ccf92fc0dfb39512a55315099e9619
I'm opening this issue to have a record of what we've considered/discovered here. I think it's likely there's some weird Samsung-Android 13 platform bug that we're hitting so I don't think we need to take immediate action.
Another idea is that mediaplayer is not threadsafe. Is there a way we could somehow be calling mediaplayer methods from different threads under some conditions?
The text was updated successfully, but these errors were encountered: