androidx / media

Jetpack Media3 support libraries for media use cases, including ExoPlayer, an extensible media player for Android
https://developer.android.com/media/media3
Apache License 2.0
1.64k stars 389 forks source link

ANR in com.google.android.exoplayer2.PlayerMessage.blockUntilDelivered #1799

Open vandana9813 opened 1 week ago

vandana9813 commented 1 week ago

Version

Older (unsupported)

More version details

We are observing ANR on devices. According to the stack trace it seems like the issue is happening when the surface is getting destroyed. The thread is getting blocked while waiting for the resources to be released by the thread. Mostly the issue is highest on Poco C61 and Redmi A3. The version of exoplayer that we are using is r2.9.6.

Devices that reproduce the issue

NA

Devices that do not reproduce the issue

No response

Reproducible in the demo app?

Yes

Reproduction steps

NA

Expected result

The media should play successfully.

Actual result

Playback crashes with following error:

  at java.lang.Object.wait (Native method)
  at java.lang.Object.wait (Object.java:405)
  at java.lang.Object.wait (Object.java:543)
  at com.google.android.exoplayer2.PlayerMessage.blockUntilDelivered (PlayerMessage.java:283)
  at com.google.android.exoplayer2.SimpleExoPlayer.setVideoSurfaceInternal (SimpleExoPlayer.java:1150)
  at com.google.android.exoplayer2.SimpleExoPlayer.access$1400 (SimpleExoPlayer.java:67)
  at com.google.android.exoplayer2.SimpleExoPlayer$ComponentListener.surfaceDestroyed (SimpleExoPlayer.java:1379)
  at android.view.SurfaceView.notifySurfaceDestroyed (SurfaceView.java:2132)
  at android.view.SurfaceView.updateSurface (SurfaceView.java:1230)
  at android.view.SurfaceView.onWindowVisibilityChanged (SurfaceView.java:439)
  at android.view.View.dispatchDetachedFromWindow (View.java:23289)
  at android.view.ViewGroup.dispatchDetachedFromWindow (ViewGroup.java:4195)
  at android.view.ViewGroup.dispatchDetachedFromWindow (ViewGroup.java:4195)
  at android.view.ViewGroup.dispatchDetachedFromWindow (ViewGroup.java:4195)
  at android.view.ViewGroup.endViewTransition (ViewGroup.java:7604)
  at androidx.fragment.app.FragmentAnim$EndViewTransitionAnimation.run (FragmentAnim.java:308)
  at android.os.Handler.handleCallback (Handler.java:958)
  at android.os.Handler.dispatchMessage (Handler.java:99)
  at android.os.Looper.loopOnce (Looper.java:230)
  at android.os.Looper.loop (Looper.java:319)
  at android.app.ActivityThread.main (ActivityThread.java:8919)
  at java.lang.reflect.Method.invoke (Native method)
  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:578)
  at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1103)

Media

Not applicable

Bug Report

MayuriKhinvasara commented 5 days ago

@vandana9813 Please add more details in the bug here as per discussion