IllegalStateException: Current looper (null) is not the playback looper when AudioCapabilities change (DefaultAudioSink)
@tianyif is already working on this.
Since Nov 26, 2025.
- Dominant language
- Java
- Stars
- 3k
- Forks
- 955
- Avg merge
- 12d 14h
- Merged PRs (30d)
- 2
Description
Version
Media3 1.8.0
More version details
No response
Devices that reproduce the issue
Android STB:
Platform:MStar curry
OS Version: android 7.1.2
Device RAM: 2G
Devices that do not reproduce the issue
No response
Reproducible in the demo app?
Yes
Reproduction steps
1.Download androixd-media3
2.Select Demo
3. Add a stopPlayButton button on xml and add stop function as following. public void onClick(View view) {
if (view == selectTracksButton
&& !isShowingTrackSelectionDialog
&& TrackSelectionDialog.willHaveContent(player)) {
.....
<---- add code --->
}else if (view ==stopPlayButton){
finish();
}
}
- use mouse to click H.264 HD video
- click stopPlayButton button to stop
- repeat 4~5
- it will crash after several repeats
Expected result
The media plays successfully.
Actual result
2025-11-26 09:44:29.679 13812-14028 AudioManager androidx.media3.demo.main I Terminate Thread
2025-11-26 09:44:29.682 13812-13812 ExoPlayerImplInternal androidx.media3.demo.main W Ignoring messages sent after release.
2025-11-26 09:44:29.707 13812-13812 EventLogger androidx.media3.demo.main D videoDisabled [eventTime=3.54, mediaPos=2.38, window=0, period=0]
2025-11-26 09:44:29.707 13812-13812 EventLogger androidx.media3.demo.main D rendererReady [eventTime=3.55, mediaPos=2.38, window=0, period=0, rendererIndex=0, video, false]
2025-11-26 09:44:29.708 13812-13812 EventLogger androidx.media3.demo.main D audioDisabled [eventTime=3.55, mediaPos=2.38, window=0, period=0]
2025-11-26 09:44:29.709 13812-13812 EventLogger androidx.media3.demo.main D rendererReady [eventTime=3.55, mediaPos=2.38, window=0, period=0, rendererIndex=1, audio, false]
2025-11-26 09:44:29.710 13812-13812 EventLogger androidx.media3.demo.main D videoDecoderReleased [eventTime=3.55, mediaPos=2.38, window=0, period=0, OMX.MS.AVC.Decoder]
2025-11-26 09:44:29.711 13812-13812 EventLogger androidx.media3.demo.main D audioDecoderReleased [eventTime=3.55, mediaPos=2.38, window=0, period=0, OMX.google.aac.decoder]
2025-11-26 09:44:30.262 13812-13812 EventLogger androidx.media3.demo.main D playWhenReady [eventTime=0.00, mediaPos=0.00, window=0, true, USER_REQUEST]
2025-11-26 09:44:30.265 13812-13812 EventLogger androidx.media3.demo.main D surfaceSize [eventTime=0.00, mediaPos=0.00, window=0, w=0, h=0]
2025-11-26 09:44:30.271 13812-13812 EventLogger androidx.media3.demo.main D timeline [eventTime=0.01, mediaPos=0.00, window=0, periodCount=1, windowCount=1, reason=PLAYLIST_CHANGED
2025-11-26 09:44:30.271 13812-13812 EventLogger androidx.media3.demo.main D period [?]
2025-11-26 09:44:30.272 13812-13812 EventLogger androidx.media3.demo.main D window [?, seekable=false, dynamic=true]
2025-11-26 09:44:30.272 13812-13812 EventLogger androidx.media3.demo.main D ]
2025-11-26 09:44:30.274 13812-13812 EventLogger androidx.media3.demo.main D mediaItem [eventTime=0.01, mediaPos=0.00, window=0, reason=PLAYLIST_CHANGED]
2025-11-26 09:44:30.279 13812-13812 EventLogger androidx.media3.demo.main D state [eventTime=0.01, mediaPos=0.00, window=0, BUFFERING]
2025-11-26 09:44:30.313 13812-14052 AudioManager androidx.media3.demo.main I create AudioMonitorHdmiThread
--------- beginning of crash
2025-11-26 09:44:30.314 13812-14054 AudioManager androidx.media3.demo.main D AudioMonitorHdmiThread run() :
2025-11-26 09:44:30.328 13812-14054 AndroidRuntime androidx.media3.demo.main E FATAL EXCEPTION: Thread-5
Process: androidx.media3.demo.main, PID: 13812
java.lang.IllegalStateException: Current looper (null) is not the playback looper (ExoPlayer:Playback)
at androidx.media3.common.util.Assertions.checkState(Assertions.java:100)
at androidx.media3.exoplayer.audio.DefaultAudioSink.onAudioCapabilitiesChanged(DefaultAudioSink.java:1675)
at androidx.media3.exoplayer.audio.DefaultAudioSink$$ExternalSyntheticLambda2.onAudioCapabilitiesChanged(D8$$SyntheticClass:0)
at androidx.media3.exoplayer.audio.AudioCapabilitiesReceiver.onNewAudioCapabilities(AudioCapabilitiesReceiver.java:210)
at androidx.media3.exoplayer.audio.AudioCapabilitiesReceiver.access$400(AudioCapabilitiesReceiver.java:45)
at androidx.media3.exoplayer.audio.AudioCapabilitiesReceiver$AudioDeviceCallbackV23.onAudioDevicesAdded(AudioCapabilitiesReceiver.java:257)
at android.media.AudioManager$AudioMonitorHdmiThread.run(AudioManager.java:4023)
2025-11-26 09:44:30.339 13812-13812 EventLogger androidx.media3.demo.main D surfaceSize [eventTime=0.08, mediaPos=0.00, window=0, w=1280, h=720]
2025-11-26 09:44:30.350 13812-13812 EventLogger androidx.media3.demo.main D audioSessionId [eventTime=0.09, mediaPos=0.00, window=0, 41]
Media
Use Demo app content, it usually occurs.
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.