Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Start in full screen" bug: Switching audio -> main player causes "unrecoverable error" on rotation #7302

Closed
4 tasks done
opusforlife2 opened this issue Oct 23, 2021 · 8 comments
Assignees
Labels
bug Issue is related to a bug player Issues related to any player (main, popup and background)

Comments

@opusforlife2
Copy link
Collaborator

opusforlife2 commented Oct 23, 2021

Checklist

Steps to reproduce the bug

  1. Turn on the "Start main player in fullscreen" toggle.
  2. Set "Autoplay" to Never.
  3. Open any video details in portrait mode.
  4. Start background playback.
  5. Tap on the thumbnail to switch to the main player.

Actual behavior

Newpipe rotates to landscape. The thumbnail keeps showing. After a short gap, the "Unrecoverable player error occurred" toast shows up. Nothing else happens.

If you tap on the thumbnail again, then the main player opens normally, resuming playback at the correct timestamp.

Expected behavior

The main player should start properly, without any error.

Device info

  • Android version/Custom ROM version: LOS 17.1
  • Device model: Mi 5
@opusforlife2 opusforlife2 added bug Issue is related to a bug player Issues related to any player (main, popup and background) labels Oct 23, 2021
@opusforlife2
Copy link
Collaborator Author

I've assigned you because you know the code here, @Stypox. If you're not free to fix this, you can remove your assignment.

@litetex
Copy link
Member

litetex commented Oct 23, 2021

#7142 might help finding the problem here 😉

@opusforlife2
Copy link
Collaborator Author

I knew I was missing something!

@opusforlife2
Copy link
Collaborator Author

Wew. This bug defeated even your APK, @litetex. Can you try it once yourself?

@litetex
Copy link
Member

litetex commented Oct 24, 2021

Wew. This bug defeated even your APK, @litetex. Can you try it once yourself?

Could reproduce the problem.

W/PlayerErrorHandler: Unable to report error:
    java.lang.RuntimeException: Parcelable encountered IOException writing serializable object (name = com.google.android.exoplayer2.ExoPlaybackException)
        at android.os.Parcel.writeSerializable(Parcel.java:2113)
        at org.schabi.newpipe.error.ErrorInfo.writeToParcel(Unknown Source:38)
        at android.os.Parcel.writeParcelable(Parcel.java:1904)
        at android.os.Parcel.writeValue(Parcel.java:1810)
        at android.os.Parcel.writeArrayMapInternal(Parcel.java:975)
        at android.os.BaseBundle.writeToParcelInner(BaseBundle.java:1620)
        at android.os.Bundle.writeToParcel(Bundle.java:1303)
        at android.os.Parcel.writeBundle(Parcel.java:1044)
        at android.content.Intent.writeToParcel(Intent.java:10855)
        at android.app.IActivityTaskManager$Stub$Proxy.startActivity(IActivityTaskManager.java:3668)
        at android.app.Instrumentation.execStartActivity(Instrumentation.java:1723)
        at android.app.ContextImpl.startActivity(ContextImpl.java:1023)
        at android.app.ContextImpl.startActivity(ContextImpl.java:994)
        at android.content.ContextWrapper.startActivity(ContextWrapper.java:403)
        at android.content.ContextWrapper.startActivity(ContextWrapper.java:403)
        at org.schabi.newpipe.error.ErrorActivity.reportError(ErrorActivity.java:84)
        at org.schabi.newpipe.player.playererror.PlayerErrorHandler.reportError(PlayerErrorHandler.java:69)
        at org.schabi.newpipe.player.playererror.PlayerErrorHandler.showPlayerError(PlayerErrorHandler.java:53)
        at org.schabi.newpipe.player.Player.onPlayerError(Player.java:2533)
        at com.google.android.exoplayer2.ExoPlayerImpl$PlaybackInfoUpdate.lambda$run$3$com-google-android-exoplayer2-ExoPlayerImpl$PlaybackInfoUpdate(ExoPlayerImpl.java:1425)
        at com.google.android.exoplayer2.ExoPlayerImpl$PlaybackInfoUpdate$$ExternalSyntheticLambda10.invokeListener(Unknown Source:2)
        at com.google.android.exoplayer2.BasePlayer$ListenerHolder.invoke(BasePlayer.java:279)
        at com.google.android.exoplayer2.ExoPlayerImpl.invokeAll(ExoPlayerImpl.java:1498)
        at com.google.android.exoplayer2.ExoPlayerImpl.access$100(ExoPlayerImpl.java:56)
        at com.google.android.exoplayer2.ExoPlayerImpl$PlaybackInfoUpdate.run(ExoPlayerImpl.java:1425)
        at com.google.android.exoplayer2.ExoPlayerImpl.notifyListeners(ExoPlayerImpl.java:1328)
        at com.google.android.exoplayer2.ExoPlayerImpl.updatePlaybackInfo(ExoPlayerImpl.java:956)
        at com.google.android.exoplayer2.ExoPlayerImpl.handlePlaybackInfo(ExoPlayerImpl.java:920)
        at com.google.android.exoplayer2.ExoPlayerImpl.lambda$new$0$com-google-android-exoplayer2-ExoPlayerImpl(ExoPlayerImpl.java:162)
        at com.google.android.exoplayer2.ExoPlayerImpl$$ExternalSyntheticLambda5.run(Unknown Source:4)
        at android.os.Handler.handleCallback(Handler.java:938)
        at android.os.Handler.dispatchMessage(Handler.java:99)
        at android.os.Looper.loop(Looper.java:223)
        at android.app.ActivityThread.main(ActivityThread.java:7656)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)
     Caused by: java.io.NotSerializableException: com.google.android.exoplayer2.mediacodec.MediaCodecInfo
        at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1240)
        at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1604)
        at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1565)
        at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1488)
        at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1234)
        at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1604)
        at java.io.ObjectOutputStream.defaultWriteObject(ObjectOutputStream.java:463)
        at java.lang.Throwable.writeObject(Throwable.java:1027)
        at java.lang.reflect.Method.invoke(Native Method)
        at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:1036)
        at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1552)
        at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1488)
        at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1234)
        at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:354)
        at android.os.Parcel.writeSerializable(Parcel.java:2108)
        	... 36 more

Java-Serialization at it again...

@litetex
Copy link
Member

litetex commented Oct 24, 2021

@opusforlife2
I applied a fix.

I now get the following report:


Exception

  • User Action: play stream
  • Request: Player error[type=1] occurred while playing: https://www.youtube.com/watch?v=xaQJbozY_Is
  • Content Country: US
  • Content Language: en-US
  • App Language: en_US
  • Service: YouTube
  • Version: 0.21.13
  • OS: Linux Android 11 - 30
Crash log

org.schabi.newpipe.error.EnsureExceptionSerializable$WorkaroundNotSerializableException: com.google.android.exoplayer2.ExoPlaybackException: MediaCodecVideoRenderer error, index=0, format=Format(1, null, null, video/avc, null, -1, null, [1280, 720, -1.0], [-1, -1]), format_supported=YES
	at com.google.android.exoplayer2.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:542)
	at android.os.Handler.dispatchMessage(Handler.java:102)
	at android.os.Looper.loop(Looper.java:223)
	at android.os.HandlerThread.run(HandlerThread.java:67)
Caused by: org.schabi.newpipe.error.EnsureExceptionSerializable$WorkaroundNotSerializableException: com.google.android.exoplayer2.mediacodec.MediaCodecRenderer$DecoderInitializationException: Decoder init failed: OMX.android.goldfish.h264.decoder, Format(1, null, null, video/avc, null, -1, null, [1280, 720, -1.0], [-1, -1])
	at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.maybeInitCodecWithFallback(MediaCodecRenderer.java:1052)
	at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.maybeInitCodecOrBypass(MediaCodecRenderer.java:609)
	at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.onInputFormatChanged(MediaCodecRenderer.java:1480)
	at com.google.android.exoplayer2.video.MediaCodecVideoRenderer.onInputFormatChanged(MediaCodecVideoRenderer.java:640)
	at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.readToFlagsOnlyBuffer(MediaCodecRenderer.java:999)
	at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.render(MediaCodecRenderer.java:849)
	at com.google.android.exoplayer2.ExoPlayerImplInternal.doSomeWork(ExoPlayerImplInternal.java:892)
	at com.google.android.exoplayer2.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:467)
	... 3 more
Caused by: org.schabi.newpipe.error.EnsureExceptionSerializable$WorkaroundNotSerializableException: java.lang.IllegalArgumentException: The surface has been released
	at android.media.MediaCodec.native_configure(Native Method)
	at android.media.MediaCodec.configure(MediaCodec.java:2127)
	at android.media.MediaCodec.configure(MediaCodec.java:2043)
	at com.google.android.exoplayer2.mediacodec.SynchronousMediaCodecAdapter.configure(SynchronousMediaCodecAdapter.java:43)
	at com.google.android.exoplayer2.video.MediaCodecVideoRenderer.configureCodec(MediaCodecVideoRenderer.java:580)
	at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.initCodec(MediaCodecRenderer.java:1148)
	at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.maybeInitCodecWithFallback(MediaCodecRenderer.java:1045)
	... 10 more

Player error[type=1] → TYPE_RENDERER: The error occurred in a Renderer.

@AudricV
Copy link
Member

AudricV commented Jul 26, 2022

Is it still an issue on the dev branch, especially since the player refactor PR?

@AudricV AudricV added the waiting for author If the author doesn't respond, the issue will be auto-closed. Otherwise the label will be removed. label Jul 26, 2022
@opusforlife2
Copy link
Collaborator Author

It's not even occurring on 0.23.1, actually! 🎉

@github-actions github-actions bot removed the waiting for author If the author doesn't respond, the issue will be auto-closed. Otherwise the label will be removed. label Jul 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue is related to a bug player Issues related to any player (main, popup and background)
Projects
None yet
Development

No branches or pull requests

4 participants