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

YouTube - Network Change Freezes Playback #10097

Open
6 tasks done
locuturus opened this issue May 15, 2023 · 12 comments
Open
6 tasks done

YouTube - Network Change Freezes Playback #10097

locuturus opened this issue May 15, 2023 · 12 comments
Labels
bug Issue is related to a bug player Issues related to any player (main, popup and background) youtube Service, https://www.youtube.com/

Comments

@locuturus
Copy link

Checklist

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

Affected version

0.25.1

Steps to reproduce the bug

  1. Be on mobile data
  2. start a YouTube video
  3. join a WiFi connection

Expected behavior

I expect the video to continue playing after switching from mobile data to WiFi

Actual behavior

Video buffer stops loading and the player freezes once the buffer from mobile data runs out. The player will not recover from this and newpipe must be swiped away from recents and restarted to resume watching any videos.

Interestingly if I begin playback while on WiFi I can freely switch to mobile data and back to WiFi without trouble. The problem depends on beginning playback while on mobile data.

Screenshots/Screen recordings

No response

Logs

Exception

  • User Action: play stream
  • Request: Player error[type=ERROR_CODE_IO_NETWORK_CONNECTION_FAILED] occurred while playing https://www.youtube.com/watch?v=XFmBX0Uq0wY
  • Content Country: US
  • Content Language: en-US
  • App Language: en_US
  • Service: YouTube
  • Version: 0.25.1
  • OS: Linux Android 13 - 33
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(Handler.java:102)
	at android.os.Looper.loopOnce(Looper.java:346)
	at android.os.Looper.loop(Looper.java:475)
	at android.os.HandlerThread.run(HandlerThread.java:67)
Caused by: com.google.android.exoplayer2.upstream.HttpDataSource$HttpDataSourceException: java.net.UnknownHostException: Unable to resolve host "rr2---sn-uhvcpax0n5-25xe.googlevideo.com": No address associated with hostname
	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.InitializationChunk.load(InitializationChunk.java:99)
	at com.google.android.exoplayer2.upstream.Loader$LoadTask.run(Loader.java:412)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1137)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:637)
	at java.lang.Thread.run(Thread.java:1012)
Caused by: java.net.UnknownHostException: Unable to resolve host "rr2---sn-uhvcpax0n5-25xe.googlevideo.com": No address associated with hostname
	at java.net.Inet6AddressImpl.lookupHostByName(Inet6AddressImpl.java:156)
	at java.net.Inet6AddressImpl.lookupAllHostAddr(Inet6AddressImpl.java:103)
	at java.net.InetAddress.getAllByName(InetAddress.java:1152)
	at com.android.okhttp.Dns$1.lookup(Dns.java:41)
	at com.android.okhttp.internal.http.RouteSelector.resetNextInetSocketAddress(RouteSelector.java:178)
	at com.android.okhttp.internal.http.RouteSelector.nextProxy(RouteSelector.java:144)
	at com.android.okhttp.internal.http.RouteSelector.next(RouteSelector.java:86)
	at com.android.okhttp.internal.http.StreamAllocation.findConnection(StreamAllocation.java:176)
	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
Caused by: android.system.GaiException: android_getaddrinfo failed: EAI_NODATA (No address associated with hostname)
	at libcore.io.Linux.android_getaddrinfo(Native Method)
	at libcore.io.ForwardingOs.android_getaddrinfo(ForwardingOs.java:133)
	at libcore.io.BlockGuardOs.android_getaddrinfo(BlockGuardOs.java:222)
	at libcore.io.ForwardingOs.android_getaddrinfo(ForwardingOs.java:133)
	at java.net.Inet6AddressImpl.lookupHostByName(Inet6AddressImpl.java:135)
	... 28 more


Affected Android/Custom ROM version

Android 13

Affected device model

Pixel 4a, Xperia 5 iii

Additional information

No response

@locuturus locuturus added bug Issue is related to a bug needs triage Issue is not yet ready for PR authors to take up labels May 15, 2023
@SameenAhnaf SameenAhnaf added youtube Service, https://www.youtube.com/ player Issues related to any player (main, popup and background) and removed needs triage Issue is not yet ready for PR authors to take up labels May 16, 2023
@opusforlife2
Copy link
Collaborator

Is it possible that your mobile network has IPv6 support while the Wifi network has only IPv4?

@locuturus
Copy link
Author

My mobile network shows 1x IPv6 address. My home WiFi shows 1x IPv4 & 2x IPv6 addresses. I'm not sure about other WiFi spots I connect to throughout the day.

@opusforlife2
Copy link
Collaborator

Well, does the error occur at home? Or only for those other Wifi spots?

@locuturus
Copy link
Author

Any WiFi network, including my home one.

@opusforlife2
Copy link
Collaborator

Alright, so that idea didn't pan out. Thanks for testing.

@locuturus
Copy link
Author

Just tested again and playback which began on LTE also stops when switching from LTE to Ethernet. And beginning on Ethernet, then switching to LTE and/or to WiFi works without issue.

@SrivatsanSenthilkumar
Copy link

I also face the same issue. Going from wifi to mobile data works fine.

@SrivatsanSenthilkumar
Copy link

Relevant logs

Exception

  • User Action: play stream
  • Request: Player error[type=ERROR_CODE_IO_NETWORK_CONNECTION_FAILED] occurred while playing https://www.youtube.com/watch?v=9WRF2bDl-u8
  • Content Country: IN
  • Content Language: en-IN
  • App Language: en_IN
  • Service: YouTube
  • Version: 0.25.2
  • OS: Linux Android 13 - 33
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(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.upstream.HttpDataSource$HttpDataSourceException: java.net.UnknownHostException: Unable to resolve host "rr4---sn-gwpa-o5bez.googlevideo.com": No address associated with hostname
	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.InitializationChunk.load(InitializationChunk.java:99)
	at com.google.android.exoplayer2.upstream.Loader$LoadTask.run(Loader.java:412)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1137)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:637)
	at java.lang.Thread.run(Thread.java:1012)
Caused by: java.net.UnknownHostException: Unable to resolve host "rr4---sn-gwpa-o5bez.googlevideo.com": No address associated with hostname
	at java.net.Inet6AddressImpl.lookupHostByName(Inet6AddressImpl.java:156)
	at java.net.Inet6AddressImpl.lookupAllHostAddr(Inet6AddressImpl.java:103)
	at java.net.InetAddress.getAllByName(InetAddress.java:1152)
	at com.android.okhttp.Dns$1.lookup(Dns.java:41)
	at com.android.okhttp.internal.http.RouteSelector.resetNextInetSocketAddress(RouteSelector.java:178)
	at com.android.okhttp.internal.http.RouteSelector.nextProxy(RouteSelector.java:144)
	at com.android.okhttp.internal.http.RouteSelector.next(RouteSelector.java:86)
	at com.android.okhttp.internal.http.StreamAllocation.findConnection(StreamAllocation.java:176)
	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
Caused by: android.system.GaiException: android_getaddrinfo failed: EAI_NODATA (No address associated with hostname)
	at libcore.io.Linux.android_getaddrinfo(Native Method)
	at libcore.io.ForwardingOs.android_getaddrinfo(ForwardingOs.java:133)
	at libcore.io.BlockGuardOs.android_getaddrinfo(BlockGuardOs.java:222)
	at libcore.io.ForwardingOs.android_getaddrinfo(ForwardingOs.java:133)
	at java.net.Inet6AddressImpl.lookupHostByName(Inet6AddressImpl.java:135)
	... 28 more


@karolkozik1
Copy link

I've encountered this error as well. Interestingly, it occurs not only when switching from WiFi to mobile data (5G), but also when the mobile data changes technology based on reception, e.g. from 5G to 4G, and to HSPA+.

@SrivatsanSenthilkumar
Copy link

SrivatsanSenthilkumar commented Jun 28, 2024

I've encountered this error as well. Interestingly, it occurs not only when switching from WiFi to mobile data (5G), but also when the mobile data changes technology based on reception, e.g. from 5G to 4G, and to HSPA+.

Does it occur when going from wifi to 5G or 5G to wifi or both?

@locuturus
Copy link
Author

I recently noticed that if I'm using a VPN (Private Internet Access) I can avoid the network switching issue. However any instability in the VPN connection (say, from switching networks) is likely to crash playback via a different bug so I don't recommend this as a workaround.

@dm17
Copy link

dm17 commented Aug 5, 2024

This has been the same for me for at least two years. So often I start a background YT for a song and leave the house, network switches to cell, and newpipe crashes. The annoying part is I need to go into settings and force quit it because it takes some tries to before it'll play again and that seems quickest. I also don't understand why they never get cached no matter how many times you play them. Network needs to be active or playback stops very quickly.

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) youtube Service, https://www.youtube.com/
Projects
None yet
Development

No branches or pull requests

6 participants