Crash on playback in onAudioCapabilitiesChanged
Open
@tonihei is already working on this.
Since Mar 18, 2024.
bug: device specific
- Dominant language
- Java
- Stars
- 3k
- Forks
- 955
- Avg merge
- 12d 14h
- Merged PRs (30d)
- 2
Description
Version
Media3 1.3.0
More version details
No response
Devices that reproduce the issue
- Fire TV Stick 4K
Devices that do not reproduce the issue
- Nvidia Shield
- Android emulator (API 33)
Reproducible in the demo app?
Not tested
Reproduction steps
Steps To Reproduce:
- Install and launch the app
- Go through the app content and use the functionality as outlined in description
- Select Music Category
- Click on play button
Actual Result: Observe app force closes to launch page
Expected Result: App must not experience force close, crash, or soft/hard lock while in use, even when dealing with conflicting inputs.
(Via Amazon tester)
Expected result
The androidx.media3 library should not cause a crash due to invalid state.
Actual result
The check in onAudioCapabilitiesChanged() fails because it is not called from the main thread. This appears to be a regression introduced in 432cde60511db47a739973cff7c2da287380fa15, to be specific the newly introduced "OnRoutingChangedListenerApi24".
03-17 02:58:54.887: E/ACRA(10455): ACRA caught a IllegalStateException for org.jellyfin.androidtv
03-17 02:58:54.887: E/ACRA(10455): java.lang.IllegalStateException
03-17 02:58:54.887: E/ACRA(10455): at androidx.media3.common.util.Assertions.checkState(Assertions.java:85)
03-17 02:58:54.887: E/ACRA(10455): at androidx.media3.exoplayer.audio.DefaultAudioSink.onAudioCapabilitiesChanged(DefaultAudioSink.java:1527)
03-17 02:58:54.887: E/ACRA(10455): at androidx.media3.exoplayer.audio.DefaultAudioSink$$ExternalSyntheticLambda16.onAudioCapabilitiesChanged(D8$$SyntheticClass)
03-17 02:58:54.887: E/ACRA(10455): at androidx.media3.exoplayer.audio.AudioCapabilitiesReceiver.onNewAudioCapabilities(AudioCapabilitiesReceiver.java:205)
03-17 02:58:54.887: E/ACRA(10455): at androidx.media3.exoplayer.audio.AudioCapabilitiesReceiver.setRoutedDevice(AudioCapabilitiesReceiver.java:142)
03-17 02:58:54.887: E/ACRA(10455): at androidx.media3.exoplayer.audio.DefaultAudioSink$OnRoutingChangedListenerApi24.onRoutingChanged(DefaultAudioSink.java:1939)
03-17 02:58:54.887: E/ACRA(10455): at androidx.media3.exoplayer.audio.DefaultAudioSink$OnRoutingChangedListenerApi24.$r8$lambda$HRb3r58UkCrShJGoyBtN21Qgd6c(DefaultAudioSink.java)
03-17 02:58:54.887: E/ACRA(10455): at androidx.media3.exoplayer.audio.DefaultAudioSink$OnRoutingChangedListenerApi24$$ExternalSyntheticLambda4.onRoutingChanged(D8$$SyntheticClass)
03-17 02:58:54.887: E/ACRA(10455): at android.media.AudioTrack$NativeRoutingEventHandlerDelegate$1.handleMessage(AudioTrack.java:2764)
03-17 02:58:54.887: E/ACRA(10455): at android.os.Handler.dispatchMessage(Handler.java:102)
03-17 02:58:54.887: E/ACRA(10455): at android.os.Looper.loop(Looper.java:154)
03-17 02:58:54.887: E/ACRA(10455): at android.os.HandlerThread.run(HandlerThread.java:61)
Media
The Amazon tester used an MP3 file.
Bug Report
- You will email the zip file produced by
adb bugreportto android-media-github@google.com after filing this issue.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.