NewPipe icon indicating copy to clipboard operation
NewPipe copied to clipboard

Decoding error when starting some videos on 2x tempo

Open amarzot opened this issue 2 years ago • 10 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.23.3

Steps to reproduce the bug

  1. Start playing a video.
  2. Change the tempo to 2x.
  3. Close the video.
  4. Try to open the video again.

Expected behavior

The video should start playing at 2x tempo

Actual behavior

The player encounters a decoder error and doesn't play the video.

Screenshots/Screen recordings

No response

Logs

Exception

  • User Action: play stream
  • Request: Player error[type=ERROR_CODE_DECODING_FAILED] occurred while playing https://www.youtube.com/watch?v=y-l0QZgRS14
  • Content Country: US
  • Content Language: en-US
  • App Language: en_US
  • Service: YouTube
  • Version: 0.23.3
  • OS: Linux lge/lv9n_att_us/lv9n:8.1.0/OPM1.171019.026/190661835bf85:user/release-keys 8.1.0 - 27
Crash log

com.google.android.exoplayer2.ExoPlaybackException: MediaCodecVideoRenderer error, index=0, format=Format(298, null, null, video/avc, avc1.640020, 3829995, null, [1280, 720, 60.0], [-1, -1]), format_supported=YES
	at com.google.android.exoplayer2.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:575)
	at android.os.Handler.dispatchMessage(Handler.java:102)
	at android.os.Looper.loop(Looper.java:175)
	at android.os.HandlerThread.run(HandlerThread.java:65)
Caused by: com.google.android.exoplayer2.video.MediaCodecVideoDecoderException: Decoder failed: OMX.qcom.video.decoder.avc
	at com.google.android.exoplayer2.video.MediaCodecVideoRenderer.createDecoderException(MediaCodecVideoRenderer.java:1512)
	at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.render(MediaCodecRenderer.java:813)
	at com.google.android.exoplayer2.ExoPlayerImplInternal.doSomeWork(ExoPlayerImplInternal.java:998)
	at com.google.android.exoplayer2.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:499)
	... 3 more
Caused by: java.lang.IllegalStateException
	at android.media.MediaCodec.native_dequeueOutputBuffer(Native Method)
	at android.media.MediaCodec.dequeueOutputBuffer(MediaCodec.java:2632)
	at com.google.android.exoplayer2.mediacodec.SynchronousMediaCodecAdapter.dequeueOutputBufferIndex(SynchronousMediaCodecAdapter.java:106)
	at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.drainOutputBuffer(MediaCodecRenderer.java:1806)
	at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.render(MediaCodecRenderer.java:792)
	... 5 more


Affected Android/Custom ROM version

Android 8.1.0

Affected device model

LG-H700

Additional information

This only effects some videos and usually all videos from their channel (encoding specific?). I can then close the stopped player open a different video (one from a different channel), which doesn't crash, change the tempo back to 1x, and then go back to the video which caused the crash and it will start playing.

A video which reproduces this behavior is linked in the logs.

amarzot avatar Sep 10 '22 16:09 amarzot

Actually after searching around, it looks like this is another #8016 bug. Guess I'll just do the workaround I described. Confirmation that it really is 8016 would be nice. Thanks!

amarzot avatar Sep 11 '22 17:09 amarzot

The way to be sure is to try #8875 and see if it works.

opusforlife2 avatar Nov 10 '22 19:11 opusforlife2

I get the following exception with the apk from that PR. Looks the same to me :/ . Looks from the wording of #8875 that it is not expected to solve all decoding errors. Let me know if you have any other ideas.

Exception

  • User Action: play stream
  • Request: Player error[type=ERROR_CODE_DECODING_FAILED] occurred while playing https://www.youtube.com/watch?v=y-l0QZgRS14
  • Content Country: US
  • Content Language: en-US
  • App Language: en_US
  • Service: YouTube
  • Version: 0.24.1
  • OS: Linux lge/lv9n_att_us/lv9n:8.1.0/OPM1.171019.026/190661835bf85:user/release-keys 8.1.0 - 27
Crash log

com.google.android.exoplayer2.ExoPlaybackException: MediaCodecVideoRenderer error, index=0, format=Format(298, null, null, video/avc, avc1.640020, 3829995, null, [1280, 720, 60.0], [-1, -1]), format_supported=YES
	at com.google.android.exoplayer2.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:566)
	at android.os.Handler.dispatchMessage(Handler.java:102)
	at android.os.Looper.loop(Looper.java:175)
	at android.os.HandlerThread.run(HandlerThread.java:65)
Caused by: com.google.android.exoplayer2.video.MediaCodecVideoDecoderException: Decoder failed: OMX.qcom.video.decoder.avc
	at com.google.android.exoplayer2.video.MediaCodecVideoRenderer.createDecoderException(MediaCodecVideoRenderer.java:1590)
	at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.render(MediaCodecRenderer.java:813)
	at com.google.android.exoplayer2.ExoPlayerImplInternal.doSomeWork(ExoPlayerImplInternal.java:989)
	at com.google.android.exoplayer2.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:490)
	... 3 more
Caused by: java.lang.IllegalStateException
	at android.media.MediaCodec.native_dequeueOutputBuffer(Native Method)
	at android.media.MediaCodec.dequeueOutputBuffer(MediaCodec.java:2632)
	at com.google.android.exoplayer2.mediacodec.SynchronousMediaCodecAdapter.dequeueOutputBufferIndex(SynchronousMediaCodecAdapter.java:106)
	at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.drainOutputBuffer(MediaCodecRenderer.java:1819)
	at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.render(MediaCodecRenderer.java:792)
	... 5 more


amarzot avatar Nov 10 '22 21:11 amarzot

Did you read the PR description and try the relevant toggle for offloading?

opusforlife2 avatar Nov 11 '22 16:11 opusforlife2

Thanks so much for helping out!

...try the relevant toggle for offloading?

I'm not sure what offloading means in this context. That word isn't mentioned in the PR, but I'm assuming you mean fallback as the second bullet point on the PR talks about enabling the "decoder fallback feature" to help with #8016. I enabled that toggle, made sure that the "use old codec selection" toggle was off, and then quit the app. After opening the app back up and making sure the fallback feature was still enabled I was able to reproduce the bug. That's how the error in my comment was generated.

amarzot avatar Nov 11 '22 20:11 amarzot

Oh! Media tunneling, the 3rd bullet. Sorry, I forgot its name. Try toggling that.

opusforlife2 avatar Nov 11 '22 20:11 opusforlife2

Dang, I tried "disable media tunneling", both with fallback and without, but same error. Let me know if you want those error reports as well.

amarzot avatar Nov 11 '22 20:11 amarzot

No, it's okay. Someone with more knowledge will have to see this, since I'm out of ideas.

opusforlife2 avatar Nov 11 '22 20:11 opusforlife2

This bug still exists in 0.25.0 and 0.25.1 (latest)

Another workaround I found:

  • press Background (audio only) and it will play at 2x speed
  • then (3 dots)
  • Switch to Main

After doing this, it can play the video at 2x speed, where it previously crashed. Resuming video playback of the same video also works fine.

Perhaps there is different behavior when playing (and selecting video format) through the usual interface vs playing video using Switch to Main

CBSkarmory avatar Apr 17 '23 02:04 CBSkarmory

Issue still here in 0.27.0, but I did find a workaround using the popout. After following the 4 repro steps from the initial comment, just click on the popup button under the video. It will start playing in the popup at the selected tempo.

Unfortunately you can't merge it back into the app without it crashing again (like you can with the background trick).

amarzot avatar Jun 23 '24 13:06 amarzot