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

Livestream -> Background: unrecoverable player error #6989

Closed
4 tasks done
CBSkarmory opened this issue Aug 27, 2021 · 17 comments · Fixed by #8020
Closed
4 tasks done

Livestream -> Background: unrecoverable player error #6989

CBSkarmory opened this issue Aug 27, 2021 · 17 comments · Fixed by #8020
Labels
bug Issue is related to a bug player Issues related to any player (main, popup and background)

Comments

@CBSkarmory
Copy link
Contributor

CBSkarmory commented Aug 27, 2021

Checklist

Steps to reproduce the bug

  1. Go to a Youtube livestream (unfortunately I can't provide any links since they are no longer live)
  2. Press on Background button (icon of headphones)

Actual behavior

pop-up: "Unrecoverable player error occurred"

However, playing as video and then pressing the android home button allows it to play in the background (though tapping the notification will bring back the video rather than the usual audio-only control interface)

Expected behavior

It should play in the background (audio only)

Screenshots/Screen recordings

Logs

N/A, no crash/prompt to report bug

Device info

  • Android version/Custom ROM version: Android 11
  • Device model: Redmi Note 9S
@CBSkarmory CBSkarmory added the bug Issue is related to a bug label Aug 27, 2021
@DenisVFS
Copy link

Hi.
I have noticed exactly the same.
No crash log to report.
Device Model: LG Q6
Android 7

@triallax
Copy link
Contributor

triallax commented Aug 31, 2021

Are you facing the issue on a specific video? What services do you face the issue on (e.g. YouTube or SoundCloud)?

@triallax triallax added player Issues related to any player (main, popup and background) waiting for author If the author doesn't respond, the issue will be auto-closed. Otherwise the label will be removed. labels Aug 31, 2021
@DenisVFS
Copy link

DenisVFS commented Sep 1, 2021

Are you facing the issue on a specific video? What services do you face the issue on (e.g. YouTube or SoundCloud)?

It's happened again today. This time I was trying to listen to this livestream as background (https://youtu.be/6vTb5Tmg14g).
I just can run as background when I am playing the video and then I press the android home button.
Every time I try to run using the "background option" I got the error but without trace log.

@CBSkarmory
Copy link
Contributor Author

CBSkarmory commented Sep 6, 2021

Edited issue: the "steps to reproduce the bug" section was commented out

Additional finding

semi-related: #6232 (comment)

There is a certain phase after the end of a livestream during which you can re-open it (when the stream ends and maybe for 1 min afterwards, NewPipe can't play it, saying "end of stream") and you can seek throughout the livestream (During the stream, it just shows a progress bar a few seconds long and you can't seek backwards more than a few seconds).
If you wait longer, going back just opens the archive video (if accessible).
During this phase, this bug does not occur, and you can play in the background.

However, in this case, it doesn't show the current time out of the total time in the audio / Play Queue UI like it usually does
newpipe_stream_audio_ui_cropped
This screenshot was produced on a livestream approx 1 hour after the end of the stream (it did not change from public to private). Unsurprisingly the UI bug dissapears upon playing the stream archive video in the background -- that works like a normal video.

@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 Sep 6, 2021
@boringhexi
Copy link

boringhexi commented Sep 7, 2021

Seems to have been introduced by dfa941a, going by my testing. (Test APKs before that point will successfully background play streams without the need to foreground play first.)

My steps for testing were: add Lofi Girl stream (currently here) to a new playlist, then Background play the playlist and see if I get an unrecoverable player error.

@ghost
Copy link

ghost commented Sep 17, 2021

Same Error on Redmi Note 10 pro with Stock or Custom ROM, Android 11

@diyachan
Copy link

diyachan commented Oct 3, 2021

Reporting similar issue on Samsung M20 running LineageOS 18.1 (Android 11), still persists on the latest version (0.21.10 at the time of writing)

@AudricV
Copy link
Member

AudricV commented Oct 14, 2021

Here is the stack trace of the error which comes from adb:

E/ExoPlayerImplInternal: Playback error
      com.google.android.exoplayer2.ExoPlaybackException: MediaCodecVideoRenderer error, index=0, format=Format(5, null, null, video/avc, avc1.640028, 5420722, null, [1920, 1080, 30.0], [-1, -1]), format_supported=YES
        at com.google.android.exoplayer2.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:542)
        at android.os.Handler.dispatchMessage(Handler.java:103)
        at android.os.Looper.loop(Looper.java:213)
        at android.os.HandlerThread.run(HandlerThread.java:67)
     Caused by: com.google.android.exoplayer2.mediacodec.MediaCodecRenderer$DecoderInitializationException: Decoder init failed: OMX.hisi.video.decoder.avc, Format(5, null, null, video/avc, avc1.640028, 5420722, null, [1920, 1080, 30.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)
        at android.os.Handler.dispatchMessage(Handler.java:103) 
        at android.os.Looper.loop(Looper.java:213) 
        at android.os.HandlerThread.run(HandlerThread.java:67) 
     Caused by: java.lang.IllegalArgumentException: The surface has been released
        at android.media.MediaCodec.native_configure(Native Method)
        at android.media.MediaCodec.configure(MediaCodec.java:2023)
        at android.media.MediaCodec.configure(MediaCodec.java:1951)
        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)
        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) 
        at android.os.Handler.dispatchMessage(Handler.java:103) 
        at android.os.Looper.loop(Looper.java:213) 
        at android.os.HandlerThread.run(HandlerThread.java:67) 

It looks like the video surface needs to be not again released when using background player (because streams of most livestreams (like YouTube livestreams) that we can use are streams with audio and video in the same file).

@tidux
Copy link

tidux commented Oct 25, 2021

Oddly enough I found a condition where it works - start playing in the foreground and then switch to another app with the OS task switcher.

@xxxxme
Copy link

xxxxme commented Oct 30, 2021

Oddly enough I found a condition where it works - start playing in the foreground and then switch to another app with the OS task switcher.

This was mentioned earlier.

Issue still present in 0.21.13

@kavemang
Copy link

kavemang commented Dec 1, 2021

issue still present 0.21.13 S9+ but Im chiming in because im almost positive this this work around ^ causes the player to keep consuming a 480p video stream rather than switching to audio only stream as the background play would do

im burning through a lot of data while driving because of it :(

@kavemang
Copy link

kavemang commented Dec 1, 2021

Oddly enough I found a condition where it works - start playing in the foreground and then switch to another app with the OS task switcher.

ive been using this workaround for months but almost positive the phone keeps consuming a video stream based on the bandwidth use, during real audio only background play before this bug started the bandwidth use was around 1/6th what it is with the workaround

@etienne-85
Copy link

same issue here, I want to save bandwith while watching live stream but get this error while trying to play the live feed in background mode.
I'm on pixel 4a running grapheneOS based on android 12.

@nofishonfriday
Copy link

nofishonfriday commented Dec 29, 2021

Getting this too (Lineage OS/MicroG 18.1), however for me it works tapping on the Play button to play in background after the 'Unrecoverable Player error' occured (since noone seemed to mention it yet).
Here's a screencast, first showing the error this issue is about, then my 'workaround' in the end.

np_live_unrePl.mp4

@etienne-85
Copy link

I've tryied your tip but if you pay attention you see the video stream playing behind, which means it is not audio background only and as a result still consume normal video bandwidth

@Mr5quid
Copy link

Mr5quid commented Mar 14, 2022

I've noticed since 0.22.1 (haven't noticed it before so I can't tell if it's something new or not) that playing a live stream (Lofi) in background works fine when using wifi but not cellular data.
If using cellular data I get the same error as @TiA4f8R :

Exception

  • User Action: play stream
  • Request: Player error[type=1] occurred while playing https://www.youtube.com/watch?v=5qap5aO4i9A
  • Content Country: US
  • Content Language: en-US
  • App Language: en_US
  • Service: YouTube
  • Version: 0.22.1
  • OS: Linux Android 11 - 30 (LineageOS 18.1)
  • LOS Build number: lineage_fajita-userdebug 11 RQ3A.211001.001 10038629
  • Device: OnePlus 6T
Crash log

com.google.android.exoplayer2.ExoPlaybackException: MediaCodecVideoRenderer error, index=0, format=Format(3, null, null, video/avc, avc1.4D401F, 1568726, null, [854, 480, 30.0], [-1, -1]), format_supported=YES
    at com.google.android.exoplayer2.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:555)
    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: com.google.android.exoplayer2.mediacodec.MediaCodecRenderer$DecoderInitializationException: Decoder init failed: OMX.qcom.video.decoder.avc, Format(3, null, null, video/avc, avc1.4D401F, 1568726, null, [854, 480, 30.0], [-1, -1])
    at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.maybeInitCodecWithFallback(MediaCodecRenderer.java:1051)
    at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.maybeInitCodecOrBypass(MediaCodecRenderer.java:606)
    at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.onInputFormatChanged(MediaCodecRenderer.java:1465)
    at com.google.android.exoplayer2.video.MediaCodecVideoRenderer.onInputFormatChanged(MediaCodecVideoRenderer.java:713)
    at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.readSourceOmittingSampleData(MediaCodecRenderer.java:998)
    at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.render(MediaCodecRenderer.java:830)
    at com.google.android.exoplayer2.ExoPlayerImplInternal.doSomeWork(ExoPlayerImplInternal.java:945)
    at com.google.android.exoplayer2.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:478)
    ... 3 more
Caused by: 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$Factory.createAdapter(SynchronousMediaCodecAdapter.java:50)
    at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.initCodec(MediaCodecRenderer.java:1137)
    at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.maybeInitCodecWithFallback(MediaCodecRenderer.java:1044)
    ... 10 more


No error when using wifi and plays live stream in background as expected.
If switching from cellular to wifi, I need to completely close the app first (exit from notification drawer + remove from multitask view), otherwise the error still occurs. Interestingly, switching back and forth from wifi to cellular once the stream is playing properly in background does not break it, i.e live stream keeps playing in background (maybe up until a certain point? Only tried for a couple of minutes each time).

Edit: A word and formatting

Edit 2: : Hah, just noticed something else. If I set the Autoplay feature on Always instead of Only on Wi-Fi, sending the live stream in background works with cellular too. I don't know how to check bandwidth to see if the video's playing but it doesn't look like it is from my perspective: Video starts playing because of autoplay, I then press the background button at which point video stops playing (shows thumbnail with play button) and the sound's playing in background. This is different than sending the app into background from OS task switcher.

@triallax
Copy link
Contributor

triallax commented Apr 2, 2022

Fixed by #8020.

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

Successfully merging a pull request may close this issue.