google / ExoPlayer

This project is deprecated and stale. The latest ExoPlayer code is available in https://github.com/androidx/media
https://developer.android.com/media/media3/exoplayer
Apache License 2.0
21.74k stars 6.03k forks source link

Widevine DASH streaming does not start #10620

Open ogawa-ma opened 2 years ago

ogawa-ma commented 2 years ago

■ Question I have publishing an application using ExoPlayer, but streaming playback does not start for some users. Playback does not start even after 1 minute after setMediaItem and player.prepare(). When this event occurs, if the user can't wait and ends playback, player.release() is called in onPause of the playback screen class, but an error occurs there. Can you tell from the log why playback is not possible?

■ ExoPlayer version used

■ Some of the devices that are occurring

■ Android version in which this is occurring

■ Playback Video Format

Non-fatal Exception: com.google.android.exoplayer2.ExoPlaybackException: Unexpected runtime error
       at com.google.android.exoplayer2.ExoPlayerImpl.lambda$release$5(ExoPlayerImpl.java:821)
       at com.google.android.exoplayer2.ExoPlayerImpl.$r8$lambda$eZVQ1P4AuRBXX3IBVzj-JmjEs8k(ExoPlayerImpl.java)
       at com.google.android.exoplayer2.ExoPlayerImpl$$InternalSyntheticLambda$0$e7ffeb13e821a9282812e9e43e2c6aded7c5c995ebae952391211e5ffe9c50ca$0.invoke(ExoPlayerImpl.java:2)
       at com.google.android.exoplayer2.util.ListenerSet$ListenerHolder.invoke(ListenerSet.java:261)
       at com.google.android.exoplayer2.util.ListenerSet.lambda$queueEvent$0(ListenerSet.java:170)
       at com.google.android.exoplayer2.util.ListenerSet.$r8$lambda$NbKDn9xtItiyMgYZmjIx_Sv1FFQ(ListenerSet.java)
       at com.google.android.exoplayer2.util.ListenerSet$$InternalSyntheticLambda$0$4aa6d67c50ced20c53fd0cecd314136314e77eb5e787a34f9137864aa48c8e5a$0.run(ListenerSet.java:6)
       at com.google.android.exoplayer2.util.ListenerSet.flushEvents(ListenerSet.java:191)
       at com.google.android.exoplayer2.util.ListenerSet.sendEvent(ListenerSet.java:206)
       at com.google.android.exoplayer2.ExoPlayerImpl.release(ExoPlayerImpl.java:818)
       at com.google.android.exoplayer2.SimpleExoPlayer.release(SimpleExoPlayer.java:1320)
       at jp.a.c.w.PlayerFragment.onPause(PlayerFragment.kt:361)
       at androidx.fragment.app.Fragment.performPause(Fragment.java:3309)
       at androidx.fragment.app.FragmentStateManager.pause(FragmentStateManager.java:631)
       at androidx.fragment.app.FragmentStateManager.moveToExpectedState(FragmentStateManager.java:293)
       at androidx.fragment.app.FragmentStore.moveToExpectedState(FragmentStore.java:113)
       at androidx.fragment.app.FragmentManager.moveToState(FragmentManager.java:1422)
       at androidx.fragment.app.FragmentManager.dispatchStateChange(FragmentManager.java:2951)
       at androidx.fragment.app.FragmentManager.dispatchPause(FragmentManager.java:2887)
       at androidx.fragment.app.FragmentController.dispatchPause(FragmentController.java:296)
       at androidx.fragment.app.FragmentActivity.onPause(FragmentActivity.java:285)
       at android.app.Activity.performPause(Activity.java:7978)
       at android.app.Instrumentation.callActivityOnPause(Instrumentation.java:1508)
       at android.app.ActivityThread.performPauseActivityIfNeeded(ActivityThread.java:4505)
       at android.app.ActivityThread.performPauseActivity(ActivityThread.java:4466)
       at android.app.ActivityThread.handlePauseActivity(ActivityThread.java:4418)
       at android.app.servertransaction.PauseActivityItem.execute(PauseActivityItem.java:46)
       at android.app.servertransaction.TransactionExecutor.executeLifecycleState(TransactionExecutor.java:176)
       at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:97)
       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2022)
       at android.os.Handler.dispatchMessage(Handler.java:107)
       at android.os.Looper.loop(Looper.java:359)
       at android.app.ActivityThread.main(ActivityThread.java:7418)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:935)
Caused by com.google.android.exoplayer2.ExoTimeoutException: Player release timed out.
       at com.google.android.exoplayer2.ExoPlayerImpl.lambda$release$5(ExoPlayerImpl.java:821)
       at com.google.android.exoplayer2.ExoPlayerImpl.$r8$lambda$eZVQ1P4AuRBXX3IBVzj-JmjEs8k(ExoPlayerImpl.java)
       at com.google.android.exoplayer2.ExoPlayerImpl$$InternalSyntheticLambda$0$e7ffeb13e821a9282812e9e43e2c6aded7c5c995ebae952391211e5ffe9c50ca$0.invoke(ExoPlayerImpl.java:2)
       at com.google.android.exoplayer2.util.ListenerSet$ListenerHolder.invoke(ListenerSet.java:261)
       at com.google.android.exoplayer2.util.ListenerSet.lambda$queueEvent$0(ListenerSet.java:170)
       at com.google.android.exoplayer2.util.ListenerSet.$r8$lambda$NbKDn9xtItiyMgYZmjIx_Sv1FFQ(ListenerSet.java)
       at com.google.android.exoplayer2.util.ListenerSet$$InternalSyntheticLambda$0$4aa6d67c50ced20c53fd0cecd314136314e77eb5e787a34f9137864aa48c8e5a$0.run(ListenerSet.java:6)
       at com.google.android.exoplayer2.util.ListenerSet.flushEvents(ListenerSet.java:191)
       at com.google.android.exoplayer2.util.ListenerSet.sendEvent(ListenerSet.java:206)
       at com.google.android.exoplayer2.ExoPlayerImpl.release(ExoPlayerImpl.java:818)
       at com.google.android.exoplayer2.SimpleExoPlayer.release(SimpleExoPlayer.java:1320)
       at jp.a.c.w.PlayerFragment.onPause(PlayerFragment.kt:361)
       at androidx.fragment.app.Fragment.performPause(Fragment.java:3309)
       at androidx.fragment.app.FragmentStateManager.pause(FragmentStateManager.java:631)
       at androidx.fragment.app.FragmentStateManager.moveToExpectedState(FragmentStateManager.java:293)
       at androidx.fragment.app.FragmentStore.moveToExpectedState(FragmentStore.java:113)
       at androidx.fragment.app.FragmentManager.moveToState(FragmentManager.java:1422)
       at androidx.fragment.app.FragmentManager.dispatchStateChange(FragmentManager.java:2951)
       at androidx.fragment.app.FragmentManager.dispatchPause(FragmentManager.java:2887)
       at androidx.fragment.app.FragmentController.dispatchPause(FragmentController.java:296)
       at androidx.fragment.app.FragmentActivity.onPause(FragmentActivity.java:285)
       at android.app.Activity.performPause(Activity.java:8057)
       at android.app.Instrumentation.callActivityOnPause(Instrumentation.java:1507)
       at android.app.ActivityThread.performPauseActivityIfNeeded(ActivityThread.java:4590)
       at android.app.ActivityThread.performPauseActivity(ActivityThread.java:4551)
       at android.app.ActivityThread.handlePauseActivity(ActivityThread.java:4503)
       at android.app.servertransaction.PauseActivityItem.execute(PauseActivityItem.java:46)
       at android.app.servertransaction.TransactionExecutor.executeLifecycleState(TransactionExecutor.java:176)
       at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:97)
       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2039)
       at android.os.Handler.dispatchMessage(Handler.java:107)
       at android.os.Looper.loop(Looper.java:214)
       at android.app.ActivityThread.main(ActivityThread.java:7626)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:503)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:936)

crash

I have sent the media file URL and the license server URL to dev.exoplayer@gmail.com.

rohitjoins commented 2 years ago

@ogawa-ma I tried playing the media file sent via email and was able to play it successfully on Pixel 4a (5G) running Android 12.

This exception occurs when one of the renderers times out releasing its resources.

Without being able to reproduce I'm afraid there's not much more help we can offer.

ogawa-ma commented 2 years ago

@rohitjoins

This exception occurs when one of the renderers times out releasing its resources.

In what cases does the renderer time out on releasing resources?

rohitjoins commented 2 years ago

@ogawa-ma I believe #10621 and #10610 is related to this issue. I have closed the other two issues in favour of this.

So the main issue seems to be the MediaCodec exception that you get on the device, which in turns doesn't allow the player to release its resources properly as it is not in a defined / known state.

I'll try to find a way to recover from such exceptions and update you on this ticket.