YouTube - Network Change Freezes Playback
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
- Be on mobile data
- start a YouTube video
- 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
Is it possible that your mobile network has IPv6 support while the Wifi network has only IPv4?
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.
Well, does the error occur at home? Or only for those other Wifi spots?
Any WiFi network, including my home one.
Alright, so that idea didn't pan out. Thanks for testing.
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.
I also face the same issue. Going from wifi to mobile data works fine.
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
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+.
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?
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.
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.
I have this issue as well on my oneplus 12. video runs fine in wifi, I walk out the door. Lose wifi, it crashes. doesn't fallback to mobile data. restarting the video crashes, creates error (will post later). restarting app, cant open the video, can open any other video. So probably has something to do with caching.
Stopping the app, and clearing the cache, I can reopen the crashed video again.
Same here on v0.27.7