TeamNewPipe / NewPipe

A libre lightweight streaming front-end for Android.
https://newpipe.net
GNU General Public License v3.0
31.02k stars 3.02k forks source link

Video playback randomly "closed/crashed", and content loaded but stuck buffering #10750

Open MDP43140 opened 8 months ago

MDP43140 commented 8 months ago

Checklist

Affected version

0.26.1

Steps to reproduce the bug

  1. Play couple videos.
  2. At any moment, the video player might stuck buffering for couple seconds before it crash/close
  3. Replay the video, now it stuck buffering, but the frames and stuff is loaded (can be checked by seeking (double tap on one side), it will show different frames instead of static frames, indicating that the frame is loaded, also you cant force it to play in this stuck buffering case), and step 4 repeats.

Expected behavior

At least be able to play the video, even with force stop and clear cache

Actual behavior

The video player randomly "closed/crashed", and stuck buffering, EVEN With force stop and cleared cache, i checked it can only play 3 short videos (2m48s of 720p@30fps), and when the step 2 happened, the cache is at 17.51MB

Screenshots/Screen recordings

https://github.com/TeamNewPipe/NewPipe/assets/68391650/9172b7d0-911f-4400-8fb4-87f54bb03479

Sorry if the video quality is really bad, i forgot to change my screen recorder default orientation. in the recording, i loaded a playlist containing 7 short videos, at 00:13, i reached the end of 3rd video, and 4th video is buffering a bit then crashed, retried again, but now stuck buffering as you can see in the video

Logs

Exception

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(Handler.java:103)
    at android.os.Looper.loop(Looper.java:237)
    at android.os.HandlerThread.run(HandlerThread.java:67)
Caused by: com.google.android.exoplayer2.upstream.HttpDataSource$HttpDataSourceException: java.net.SocketTimeoutException: timeout
    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:1167)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
    at java.lang.Thread.run(Thread.java:919)
Caused by: java.net.SocketTimeoutException: timeout
    at com.android.okhttp.okio.Okio$3.newTimeoutException(Okio.java:225)
    at com.android.okhttp.okio.AsyncTimeout.exit(AsyncTimeout.java:263)
    at com.android.okhttp.okio.AsyncTimeout$2.read(AsyncTimeout.java:217)
    at com.android.okhttp.okio.RealBufferedSource.indexOf(RealBufferedSource.java:317)
    at com.android.okhttp.okio.RealBufferedSource.indexOf(RealBufferedSource.java:311)
    at com.android.okhttp.okio.RealBufferedSource.readUtf8LineStrict(RealBufferedSource.java:207)
    at com.android.okhttp.internal.http.Http1xStream.readResponse(Http1xStream.java:395)
    at com.android.okhttp.internal.http.Http1xStream.readResponseHeaders(Http1xStream.java:146)
    at com.android.okhttp.internal.http.HttpEngine.readNetworkResponse(HttpEngine.java:900)
    at com.android.okhttp.internal.http.HttpEngine.readResponse(HttpEngine.java:772)
    at com.android.okhttp.internal.huc.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:493)
    at com.android.okhttp.internal.huc.HttpURLConnectionImpl.getResponse(HttpURLConnectionImpl.java:429)
    at com.android.okhttp.internal.huc.HttpURLConnectionImpl.getResponseCode(HttpURLConnectionImpl.java:560)
    at com.android.okhttp.internal.huc.DelegatingHttpsURLConnection.getResponseCode(DelegatingHttpsURLConnection.java:106)
    at com.android.okhttp.internal.huc.HttpsURLConnectionImpl.getResponseCode(HttpsURLConnectionImpl.java:30)
    at org.schabi.newpipe.player.datasource.YoutubeHttpDataSource.open(YoutubeHttpDataSource.java:385)
    ... 10 more
Caused by: java.net.SocketException: socket is closed
    at com.android.org.conscrypt.ConscryptFileDescriptorSocket$SSLInputStream.read(ConscryptFileDescriptorSocket.java:588)
    at com.android.okhttp.okio.Okio$2.read(Okio.java:145)
    at com.android.okhttp.okio.AsyncTimeout$2.read(AsyncTimeout.java:213)
    ... 23 more


Affected Android/Custom ROM version

Android 10, OneUi 2.0

Affected device model

Samsung Galaxy A6, Samsung Galaxy J5 Prime

Additional information

This happens since couple weeks ago before 2024

I have a good internet connection, so there is absolutely no way this is even related to that at all, if it was, it usually buffers a little bit then it continues playing, heck i can play 720p60 in yt web mobile (but i don't want to do that).

I tried clearing caches, force stop, and not using thumbnail, it still happens.

This issue affects all types of videos, and video/audio quality, even as basic as 144p or audio mode still experienced the same exact thing (but for audio there is no way to tell, except if you got fast internet, and couple seconds later player "closed"), and it happens so frequently that it annoys me so bad every time it happens

opusforlife2 commented 8 months ago

Try a different network (wifi vs mobile data).

MDP43140 commented 8 months ago

i use WiFi at home (decent 2MB Up/Down load speed, usually watching at 720p60), and i currently don't have cellular data plans right now, i'll try later if i got one.

opusforlife2 commented 8 months ago

You can ask someone for a hotspot for a couple minutes.

MDP43140 commented 8 months ago

I tried with hotspot, now it happens after the cache hits 69MB (with thumbnail turned off, with thumbnail set to low, it can hit anywhere 74/81MB), after the cache goes above that, the random player close, and stuck buffering comes up

opusforlife2 commented 8 months ago

How much free RAM/free storage do you have?

sseodate commented 8 months ago

please check some link cannot load or buffering forever....

MDP43140 commented 8 months ago

How much free RAM/free storage do you have?

3GB Total RAM, 1.5GB Used RAM, Maximum NewPipe RAM usage is 146MB (according to app info settings), and 3.6GB Free storage

opusforlife2 commented 8 months ago

If it's possible, could you try a different Wifi connection with lower latency or faster speed, or both?

MDP43140 commented 7 months ago

I only have cellular data (500kb/s up/down, decent latency), WiFi (1-2MB/s up/down, uploading have higher latency though), and other "public WiFi" (up to 3MB/s up/down when not busy, good latency), i don't know, I already tried WiFi, cellular data, with/without force stop/clear cache, with no/low thumbnail, its still ends up the same stuck buffering issue

sseodate commented 7 months ago

i am too, loading for a new link may up to 2 mins. Some cannot load link stream mix is loading for ever.

MDP43140 commented 7 months ago

I don't know if this was related or not, but i'm watching YouTube videos, some videos load just fine, and some videos will stuck loading infinitely, regardless of connection, cache size, or force-stop. in the case of this video, i can only stream 144p, or download, loading 240p and above won't load at all eventually "force-closing the player" with timeout errors, the same kept happening even when i force-stop, clear cache, and change connection

Screen recording

https://github.com/TeamNewPipe/NewPipe/assets/68391650/974321f5-f634-43b9-8bb6-6e25efa19605

Logs

* __User Action:__ play stream * __Request:__ Player error[type=ERROR_CODE_IO_NETWORK_CONNECTION_TIMEOUT] occurred while playing https://www.youtube.com/watch?v=5ZnOzAyjTJI ``` 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(Handler.java:103) at android.os.Looper.loop(Looper.java:237) at android.os.HandlerThread.run(HandlerThread.java:67) Caused by: com.google.android.exoplayer2.upstream.HttpDataSource$HttpDataSourceException: java.net.SocketTimeoutException: timeout at org.schabi.newpipe.player.datasource.YoutubeHttpDataSource.read(YoutubeHttpDataSource.java:502) at com.google.android.exoplayer2.upstream.DefaultDataSource.read(DefaultDataSource.java:268) at com.google.android.exoplayer2.upstream.TeeDataSource.read(TeeDataSource.java:70) at com.google.android.exoplayer2.upstream.cache.CacheDataSource.read(CacheDataSource.java:632) at com.google.android.exoplayer2.upstream.StatsDataSource.read(StatsDataSource.java:92) at com.google.android.exoplayer2.extractor.DefaultExtractorInput.readFromUpstream(DefaultExtractorInput.java:291) at com.google.android.exoplayer2.extractor.DefaultExtractorInput.readFully(DefaultExtractorInput.java:80) at com.google.android.exoplayer2.extractor.mp4.FragmentedMp4Extractor.readAtomHeader(FragmentedMp4Extractor.java:359) at com.google.android.exoplayer2.extractor.mp4.FragmentedMp4Extractor.read(FragmentedMp4Extractor.java:333) at com.google.android.exoplayer2.source.chunk.BundledChunkExtractor.read(BundledChunkExtractor.java:147) at com.google.android.exoplayer2.source.chunk.InitializationChunk.load(InitializationChunk.java:102) at com.google.android.exoplayer2.upstream.Loader$LoadTask.run(Loader.java:412) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) at java.lang.Thread.run(Thread.java:919) Caused by: java.net.SocketTimeoutException: timeout at com.android.okhttp.okio.Okio$3.newTimeoutException(Okio.java:225) at com.android.okhttp.okio.AsyncTimeout.exit(AsyncTimeout.java:263) at com.android.okhttp.okio.AsyncTimeout$2.read(AsyncTimeout.java:217) at com.android.okhttp.okio.RealBufferedSource.read(RealBufferedSource.java:61) at com.android.okhttp.internal.http.Http1xStream$FixedLengthSource.read(Http1xStream.java:602) at com.android.okhttp.okio.RealBufferedSource$1.read(RealBufferedSource.java:397) at org.schabi.newpipe.player.datasource.YoutubeHttpDataSource.readInternal(YoutubeHttpDataSource.java:841) at org.schabi.newpipe.player.datasource.YoutubeHttpDataSource.read(YoutubeHttpDataSource.java:500) ... 14 more Caused by: java.net.SocketException: socket is closed at com.android.org.conscrypt.ConscryptFileDescriptorSocket$SSLInputStream.read(ConscryptFileDescriptorSocket.java:588) at com.android.okhttp.okio.Okio$2.read(Okio.java:145) at com.android.okhttp.okio.AsyncTimeout$2.read(AsyncTimeout.java:213) ... 19 more ```

jpdoyle commented 7 months ago

I'm seeing a similar issue since a few days ago -- videos freeze or never load with a "Network Error" notification. It works fine on LTE mobile data connection and fails with that error on a random-seeming set of videos on wifi (verizon fios). I've restarted my router, my fiber connection, newpipe (and cleared cache). It only seems to depend on the video, not the resolution, but I'm not entirely sure.

sseodate commented 7 months ago

This video https://www.youtube.com/watch?v=ZvUKsY0Ln2U is an example , There are link stream that have sound is looped for ever. The video link is only for IOS not for Android. This have been 3 weeks i think. Some other video start to be like that. Is that a new thing from YT?

opusforlife2 commented 7 months ago

in the case of this video

It buffers and plays perfectly fine for me. YT caching is a major problem. Once you encounter an error on a video, it's very possible that it keeps bugging out regardless of any troubleshooting steps you may take.

Personally, I just completely switch to another device or Piped if I really need to watch that particular video right then. Otherwise the problem resolves itself after a few minutes or an hour.