NewPipe icon indicating copy to clipboard operation
NewPipe copied to clipboard

Video player crashes when in landscape mode

Open nicolascolla opened this issue 2 years ago • 9 comments

Checklist

  • [X] I am able to reproduce the bug with the latest version.
  • [X] I made sure that there are no existing issues - open or closed - which I could contribute my information to.
  • [X] I have read the FAQ and my problem isn't listed.
  • [x] I have taken the time to fill in all the required details. I understand that the bug report will be dismissed otherwise.
  • [X] This issue contains only one bug.
  • [X] I have read and understood the contribution guidelines.

Affected version

0.25.1

Steps to reproduce the bug

  1. Open any video
  2. Hit play
  3. Put phone in landscape mode

Expected behavior

Video should play

Actual behavior

The video player crashes instantly when the screen is put in landscape mode.

Screenshots/Screen recordings

No response

Logs

Xiaomi Redmi Note 9 running LineageOS 20. The video player crashes when the screen is in landscape mode. The video player works in portrait, but will instantly crash when the screen is rotated.

Exception

  • User Action: play stream
  • Request: Player error[type=ERROR_CODE_DECODING_FAILED] occurred while playing https://www.youtube.com/watch?v=zxCJJIsxDSA
  • Content Country: ES
  • Content Language: es-ES
  • App Language: es_ES
  • Service: YouTube
  • Version: 0.25.1
  • OS: Linux Android 13 - 33
Crash log

com.google.android.exoplayer2.ExoPlaybackException: MediaCodecVideoRenderer error, index=0, format=Format(137, null, null, video/avc, avc1.640028, 4578418, null, [1920, 1080, 30.0], [-1, -1]), format_supported=YES
	at com.google.android.exoplayer2.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:578)
	at android.os.Handler.dispatchMessage(Handler.java:102)
	at android.os.Looper.loopOnce(Looper.java:201)
	at android.os.Looper.loop(Looper.java:288)
	at android.os.HandlerThread.run(HandlerThread.java:67)
Caused by: com.google.android.exoplayer2.video.MediaCodecVideoDecoderException: Decoder failed: c2.android.avc.decoder
	at com.google.android.exoplayer2.video.MediaCodecVideoRenderer.createDecoderException(MediaCodecVideoRenderer.java:1639)
	at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.render(MediaCodecRenderer.java:795)
	at com.google.android.exoplayer2.ExoPlayerImplInternal.doSomeWork(ExoPlayerImplInternal.java:1007)
	at com.google.android.exoplayer2.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:502)
	... 4 more
Caused by: java.lang.IllegalStateException
	at android.media.MediaCodec.releaseOutputBuffer(Native Method)
	at android.media.MediaCodec.releaseOutputBufferInternal(MediaCodec.java:3688)
	at android.media.MediaCodec.releaseOutputBuffer(MediaCodec.java:3662)
	at com.google.android.exoplayer2.mediacodec.AsynchronousMediaCodecAdapter.releaseOutputBuffer(AsynchronousMediaCodecAdapter.java:189)
	at com.google.android.exoplayer2.video.MediaCodecVideoRenderer.renderOutputBufferV21(MediaCodecVideoRenderer.java:1374)
	at com.google.android.exoplayer2.video.MediaCodecVideoRenderer.processOutputBuffer(MediaCodecVideoRenderer.java:1137)
	at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.drainOutputBuffer(MediaCodecRenderer.java:1881)
	at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.render(MediaCodecRenderer.java:774)
	... 6 more


Affected Android/Custom ROM version

LineageOS 20

Affected device model

Xiaomi Redmi Note 9

Additional information

No response

nicolascolla avatar May 03 '23 16:05 nicolascolla

Download a debug APK of Newpipe from one of the PRs, and go into the Exoplayer settings menu under Video and audio. Try the toggles one by one to see if it changes things. Most likely the set_surface one.

opusforlife2 avatar May 04 '23 14:05 opusforlife2

Download a debug APK of Newpipe from one of the PRs, and go into the Exoplayer settings menu under Video and audio. Try the toggles one by one to see if it changes things. Most likely the set_surface one.

I have downloaded a debug APK from https://github.com/TeamNewPipe/NewPipe/pull/10062. Video rotation works as-is without having to try any of the toggles.

I have also downloaded the 0.25.0 release. It also works well.

But when I install the 0.25.1 release APK, both from F-Droid and Github, the issue persists.

Back to the debug APK, I can confirm that none of the three toggles under Video and audio -> Exoplayer settings make the app crash, at least when enabled individually. I remain available for further testing.

nicolascolla avatar May 04 '23 19:05 nicolascolla

After rolling back to 0.25.0, I have been able to reproduce this bug in it, too.

It seems to happen when video quality is set at 1080p or higher. 720p or less always runs fine. After realizing this, I have tried the debug APK again and the surface toggle does, in fact, solve the crashes, as you mentioned, although it introduces a three-second black screen when switching to full screen and video has pretty bad performance (lots of skipped frames).

I can also confirm that 1080p video works perfectly under MIUI on the same device.

nicolascolla avatar May 04 '23 19:05 nicolascolla

Hello, i have similary issue: Samsung a7 2018, android 10, newpipe 25.1

Exception

  • User Action: play stream
  • Request: Player error[type=ERROR_CODE_FAILED_RUNTIME_CHECK] occurred while playing https://www.youtube.com/watch?v=HtwMZCQc53M
  • Content Country: FR
  • Content Language: fr-
  • App Language: fr_CH
  • Service: YouTube
  • Version: 0.25.1
  • OS: Linux Android 10 - 29
Crash log

com.google.android.exoplayer2.ExoPlaybackException: Unexpected runtime error at com.google.android.exoplayer2.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:628) at android.os.Handler.dispatchMessage(Handler.java:103) at android.os.Looper.loop(Looper.java:237) at android.os.HandlerThread.run(HandlerThread.java:67) Caused by: java.lang.IllegalArgumentException at android.media.MediaCodec.native_setSurface(Native Method) at android.media.MediaCodec.setOutputSurface(MediaCodec.java:2042) at com.google.android.exoplayer2.mediacodec.AsynchronousMediaCodecAdapter$$ExternalSyntheticApiModelOutline0.m(R8$$SyntheticClass:0) at com.google.android.exoplayer2.mediacodec.SynchronousMediaCodecAdapter.setOutputSurface(SynchronousMediaCodecAdapter.java:189) at com.google.android.exoplayer2.video.MediaCodecVideoRenderer.setOutputSurfaceV23(MediaCodecVideoRenderer.java:1500) at com.google.android.exoplayer2.video.MediaCodecVideoRenderer.setOutput(MediaCodecVideoRenderer.java:694) at com.google.android.exoplayer2.video.MediaCodecVideoRenderer.handleMessage(MediaCodecVideoRenderer.java:632) at com.google.android.exoplayer2.ExoPlayerImplInternal.deliverMessage(ExoPlayerImplInternal.java:1565) at com.google.android.exoplayer2.ExoPlayerImplInternal.sendMessageToTarget(ExoPlayerImplInternal.java:1529) at com.google.android.exoplayer2.ExoPlayerImplInternal.sendMessageInternal(ExoPlayerImplInternal.java:1504) at com.google.android.exoplayer2.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:533) ... 3 more

philibeur avatar May 05 '23 05:05 philibeur

Exception

  • User Action: ui error
  • Request: ACRA report
  • Content Country: FR
  • Content Language: es-
  • App Language: fr
  • Service: none
  • Version: 0.25.1
  • OS: Linux Android 12 - 31
Crash log

android.app.ForegroundServiceDidNotStartInTimeException: Context.startForegroundService() did not then call Service.startForeground(): ServiceRecord{191039e u0 org.schabi.newpipe/.player.PlayerService}
	at android.app.ActivityThread.throwRemoteServiceException(ActivityThread.java:2053)
	at android.app.ActivityThread.access$2800(ActivityThread.java:253)
	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2282)
	at android.os.Handler.dispatchMessage(Handler.java:106)
	at android.os.Looper.loopOnce(Looper.java:233)
	at android.os.Looper.loop(Looper.java:344)
	at android.app.ActivityThread.main(ActivityThread.java:8191)
	at java.lang.reflect.Method.invoke(Native Method)
	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:584)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1034)


Gipsysoftware avatar May 10 '23 06:05 Gipsysoftware

This issue is still happening in a few apps on hyperos

ech0devv avatar Mar 22 '24 12:03 ech0devv

I do not get a crash (app is still running), but video to be played becomes forgotten:

  1. In non landscape: keep something played;
  2. Click on an unplayed item in playlist;
  3. Quickly rotate the screen;
  4. App switches to landscape with unexpected state:

A. No fullscreen B. Previous video is seen in exo, paused C. Requested video is not going to be loaded and played.

Expected: D. Player should be in full screen and started playing the video requested (as clicked in the playlist right before rotation)

Is this the same bug as in this issue or should I report new one?

WhiteChairFromIkea avatar Jul 14 '24 06:07 WhiteChairFromIkea

Did you try the three Exoplayer toggles mentioned above?

opusforlife2 avatar Jul 14 '24 21:07 opusforlife2

Did you try the three Exoplayer toggles mentioned above?

thanks, it seems middle toggle works (testing for two days). The third one caused black screen after rotation (reverted back to visible view by locking nd unlocking the phone). So far seems good with 2nd toggle switch, thanks :)

WhiteChairFromIkea avatar Jul 17 '24 19:07 WhiteChairFromIkea

Exception

  • User Action: play stream
  • Request: Player error[type=ERROR_CODE_IO_NETWORK_CONNECTION_TIMEOUT] occurred while playing https://www.youtube.com/watch?v=PIA02ALGYFA
  • Content Country: GB
  • Content Language: en-GB
  • App Language: en_GB
  • Service: YouTube
  • Version: 0.27.2
  • OS: Linux Android 14 - 34
Crash log

com.google.android.exoplayer2.ExoPlaybackException: Source error
	at com.google.android.exoplayer2.ExoPlayerImplInternal.handleIoException(ExoPlayerImplInternal.java:644)
	at com.google.android.exoplayer2.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:616)
	at android.os.Handler.dispatchMessage(Unknown Source:12)
	at android.os.Looper.loopOnce(Unknown Source:198)
	at android.os.Looper.loop(Unknown Source:83)
	at android.os.HandlerThread.run(Unknown Source:28)
Caused by: com.google.android.exoplayer2.upstream.HttpDataSource$HttpDataSourceException: java.net.SocketTimeoutException: Read timed out
	at org.schabi.newpipe.player.datasource.YoutubeHttpDataSource.open(YoutubeHttpDataSource.java:389)
	at com.google.android.exoplayer2.upstream.DefaultDataSource.open(DefaultDataSource.java:263)
	at com.google.android.exoplayer2.upstream.TeeDataSource.open(TeeDataSource.java:52)
	at com.google.android.exoplayer2.upstream.cache.CacheDataSource.openNextSource(CacheDataSource.java:796)
	at com.google.android.exoplayer2.upstream.cache.CacheDataSource.open(CacheDataSource.java:609)
	at com.google.android.exoplayer2.upstream.StatsDataSource.open(StatsDataSource.java:84)
	at com.google.android.exoplayer2.source.chunk.ContainerMediaChunk.load(ContainerMediaChunk.java:124)
	at com.google.android.exoplayer2.upstream.Loader$LoadTask.run(Loader.java:412)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644)
	at java.lang.Thread.run(Thread.java:1012)
Caused by: java.net.SocketTimeoutException: Read timed out
	at java.net.SocketInputStream.socketRead0(Native Method)
	at java.net.SocketInputStream.socketRead(SocketInputStream.java:118)
	at java.net.SocketInputStream.read(SocketInputStream.java:173)
	at java.net.SocketInputStream.read(SocketInputStream.java:143)
	at com.android.org.conscrypt.ConscryptEngineSocket$SSLInputStream.readFromSocket(ConscryptEngineSocket.java:983)
	at com.android.org.conscrypt.ConscryptEngineSocket$SSLInputStream.processDataFromSocket(ConscryptEngineSocket.java:947)
	at com.android.org.conscrypt.ConscryptEngineSocket$SSLInputStream.-$$Nest$mprocessDataFromSocket(Unknown Source:0)
	at com.android.org.conscrypt.ConscryptEngineSocket.doHandshake(ConscryptEngineSocket.java:236)
	at com.android.org.conscrypt.ConscryptEngineSocket.startHandshake(ConscryptEngineSocket.java:218)
	at com.android.okhttp.internal.io.RealConnection.connectTls(RealConnection.java:196)
	at com.android.okhttp.internal.io.RealConnection.connectSocket(RealConnection.java:153)
	at com.android.okhttp.internal.io.RealConnection.connect(RealConnection.java:116)
	at com.android.okhttp.internal.http.StreamAllocation.findConnection(StreamAllocation.java:186)
	at com.android.okhttp.internal.http.StreamAllocation.findHealthyConnection(StreamAllocation.java:128)
	at com.android.okhttp.internal.http.StreamAllocation.newStream(StreamAllocation.java:97)
	at com.android.okhttp.internal.http.HttpEngine.connect(HttpEngine.java:289)
	at com.android.okhttp.internal.http.HttpEngine.sendRequest(HttpEngine.java:232)
	at com.android.okhttp.internal.huc.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:465)
	at com.android.okhttp.internal.huc.HttpURLConnectionImpl.connect(HttpURLConnectionImpl.java:131)
	at com.android.okhttp.internal.huc.DelegatingHttpsURLConnection.connect(DelegatingHttpsURLConnection.java:90)
	at com.android.okhttp.internal.huc.HttpsURLConnectionImpl.connect(HttpsURLConnectionImpl.java:30)
	at org.schabi.newpipe.player.datasource.YoutubeHttpDataSource.makeConnection(YoutubeHttpDataSource.java:704)
	at org.schabi.newpipe.player.datasource.YoutubeHttpDataSource.makeConnection(YoutubeHttpDataSource.java:548)
	at org.schabi.newpipe.player.datasource.YoutubeHttpDataSource.open(YoutubeHttpDataSource.java:383)
	... 10 more


DNG79 avatar Sep 15 '24 07:09 DNG79

Exception

  • User Action: play stream
  • Request: Player error[type=ERROR_CODE_DECODER_INIT_FAILED] occurred while playing https://www.youtube.com/watch?v=rLfWey7sbg4
  • Content Country: GB
  • Content Language: en-GB
  • App Language: en_GB
  • Service: YouTube
  • Version: 0.27.2
  • OS: Linux Android 14 - 34
Crash log

com.google.android.exoplayer2.ExoPlaybackException: MediaCodecVideoRenderer error, index=0, format=Format(315, null, null, video/x-vnd.on2.vp9, vp09.00.51.08, 26826877, en, [3840, 2160, 60.0], [-1, -1]), format_supported=NO_EXCEEDS_CAPABILITIES
	at com.google.android.exoplayer2.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:578)
	at android.os.Handler.dispatchMessage(Unknown Source:12)
	at android.os.Looper.loopOnce(Unknown Source:198)
	at android.os.Looper.loop(Unknown Source:83)
	at android.os.HandlerThread.run(Unknown Source:28)
Caused by: com.google.android.exoplayer2.mediacodec.MediaCodecRenderer$DecoderInitializationException: Decoder init failed: OMX.qcom.video.decoder.vp9, Format(315, null, null, video/x-vnd.on2.vp9, vp09.00.51.08, 26826877, en, [3840, 2160, 60.0], [-1, -1])
	at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.maybeInitCodecWithFallback(MediaCodecRenderer.java:1021)
	at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.maybeInitCodecOrBypass(MediaCodecRenderer.java:537)
	at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.onInputFormatChanged(MediaCodecRenderer.java:1453)
	at com.google.android.exoplayer2.video.MediaCodecVideoRenderer.onInputFormatChanged(MediaCodecVideoRenderer.java:917)
	at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.readSourceOmittingSampleData(MediaCodecRenderer.java:954)
	at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.render(MediaCodecRenderer.java:769)
	at com.google.android.exoplayer2.ExoPlayerImplInternal.doSomeWork(ExoPlayerImplInternal.java:1007)
	at com.google.android.exoplayer2.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:502)
	... 4 more
Caused by: android.media.MediaCodec$CodecException: 
	at android.media.MediaCodec.native_configure(Native Method)
	at android.media.MediaCodec.configure(Unknown Source:164)
	at android.media.MediaCodec.configure(Unknown Source:6)
	at com.google.android.exoplayer2.mediacodec.AsynchronousMediaCodecAdapter.initialize(AsynchronousMediaCodecAdapter.java:156)
	at com.google.android.exoplayer2.mediacodec.AsynchronousMediaCodecAdapter.access$100(AsynchronousMediaCodecAdapter.java:50)
	at com.google.android.exoplayer2.mediacodec.AsynchronousMediaCodecAdapter$Factory.createAdapter(AsynchronousMediaCodecAdapter.java:103)
	at com.google.android.exoplayer2.mediacodec.DefaultMediaCodecAdapterFactory.createAdapter(DefaultMediaCodecAdapterFactory.java:111)
	at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.initCodec(MediaCodecRenderer.java:1099)
	at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.maybeInitCodecWithFallback(MediaCodecRenderer.java:1010)
	... 11 more


This Is another from a different video I tried playing

DNG79 avatar Sep 15 '24 08:09 DNG79

Same issue on Google pixel 8 with version 5.3.2

pmerlin avatar Mar 27 '25 20:03 pmerlin

Same issue on Google pixel 8 with version 5.3.2

@pmerlin From where you got this "version 5.3.2"?

ShareASmile avatar Mar 29 '25 02:03 ShareASmile