Closed OldGuyInTheClub closed 9 months ago
Will do. Will get back to you in a couple of days.
@AudricV I am very encouraged! I've used your APK for 48+ hours and I can go from home wifi to the cellular network, drive around far enough to switch to multiple towers, go in and out of airplane mode, and so far no crashes.
I backed up my NewPipe data and imported it into this version.
If it's ok with you, I'd like to monitor it for a few more days just to be sure.
@AudricV I've installed your test build last night, and this morning I once again got the did not then call Service.startForeground()
error a minute into a video.
Actions taken:
Running GrapheneOS (Android 13) on a Pixel 6
Error:
type: ANR
osVersion: google/oriole/oriole:13/TQ3A.230901.001/2023091800:user/release-keys
package: org.schabi.newpipe.debug.fixplayerserviceforegroundstart:994
process: org.schabi.newpipe.debug.fixplayerserviceforegroundstart
installer: com.android.packageinstaller
activity: null
cause: ANR Context.startForegroundService() did not then call Service.startForeground(): ServiceRecord{414eac0 u0 org.schabi.newpipe.debug.fixplayerserviceforegroundstart/org.schabi.newpipe.player.PlayerService}
info: ANR in org.schabi.newpipe.debug.fixplayerserviceforegroundstart
PID: 14707
Reason: Context.startForegroundService() did not then call Service.startForeground(): ServiceRecord{414eac0 u0 org.schabi.newpipe.debug.fixplayerserviceforegroundstart/org.schabi.newpipe.player.PlayerService}
ErrorId: 8785639d-e495-4ff8-9185-45fa230a4771
Frozen: false
Load: 3.08 / 3.08 / 2.8
----- Output from /proc/pressure/memory -----
some avg10=0.00 avg60=0.00 avg300=0.00 total=8272761
full avg10=0.00 avg60=0.00 avg300=0.00 total=2905108
----- End output from /proc/pressure/memory -----
CPU usage from 0ms to 7574ms later (2023-09-21 07:37:36.329 to 2023-09-21 07:37:43.903):
52% 14707/org.schabi.newpipe.debug.fixplayerserviceforegroundstart: 39% user + 13% kernel / faults: 44173 minor 219 major
26% 1427/system_server: 13% user + 12% kernel / faults: 44817 minor 910 major
17% 2091/com.android.systemui: 10% user + 7.2% kernel / faults: 53517 minor 584 major
2.3% 2889/com.android.inputmethod.latin: 1.5% user + 0.8% kernel / faults: 12941 minor 3634 major
12% 1117/media.swcodec: 7.4% user + 5.1% kernel / faults: 6502 minor 99 major
11% 578/surfaceflinger: 7.7% user + 3.8% kernel / faults: 2340 minor 2 major
10% 908/samsung.hardware.media.c2@1.0-service: 6.3% user + 4.3% kernel / faults: 118 minor 6 major
3.1% 584/android.hardware.graphics.composer@2.4-service: 1.7% user + 1.4% kernel
0% 1056/media.extractor: 0% user + 0% kernel / faults: 2827 minor 53 major
0% 3574/com.android.nfc: 0% user + 0% kernel / faults: 3777 minor 3347 major
1.9% 932/audioserver: 0.1% user + 1.8% kernel / faults: 233 minor 16 major
0% 1067/media.codec: 0% user + 0% kernel / faults: 1267 minor 58 major
1.3% 6627/org.thoughtcrime.securesms: 1% user + 0.2% kernel / faults: 12 minor 4 major
1.1% 242/decon0_kthread: 0% user + 1.1% kernel
1.1% 850/android.hardware.audio.service: 0.2% user + 0.9% kernel
1.1% 2477/com.android.phone: 0.7% user + 0.3% kernel / faults: 1544 minor 731 major
0% 93/kswapd0: 0% user + 0% kernel
0% 2444/com.samsung.slsi.telephony.oemril: 0% user + 0% kernel / faults: 2147 minor 3212 major
0.9% 720/android.hardware.power-service.pixel-libperfmgr: 0.3% user + 0.5% kernel
0.1% 2295/com.shannon.qualifiednetworksservice: 0% user + 0% kernel / faults: 1958 minor 2111 major
0.9% 2313/com.android.networkstack.process: 0.3% user + 0.5% kernel / faults: 1817 minor 1907 major
0.1% 2324/com.samsung.slsi.telephony.oem.oemrilhookservice: 0% user + 0.1% kernel / faults: 1963 minor 2767 major
0% 2405/com.shannon.rcsservice: 0% user + 0% kernel / faults: 2145 minor 2981 major
0.1% 2426/com.shannon.imsservice: 0% user + 0.1% kernel / faults: 1707 minor 1623 major
0.1% 2368/com.android.se: 0% user + 0% kernel / faults: 2019 minor 2692 major
0.7% 20568/kworker/u16:1-BBD_1HZ_TICK: 0% user + 0.7% kernel
0.5% 236/irq/419-1c8d000: 0% user + 0.5% kernel
0.5% 538/sugov:0: 0% user + 0.5% kernel
0.3% 12/rcu_preempt: 0% user + 0.3% kernel
0.3% 13/rcuog/0: 0% user + 0.3% kernel
0.3% 49/rcuog/4: 0% user + 0.3% kernel
0% 727/tombstoned: 0% user + 0% kernel / faults: 135 minor 134 major
0.3% 833/statsd: 0% user + 0.3% kernel / faults: 19 minor 33 major
0% 834/netd: 0% user + 0% kernel / faults: 12 minor 15 major
0.3% 4042/org.mozilla.firefox: 0.2% user + 0.1% kernel / faults: 318 minor
0.3% 20349/kworker/u17:0-kbase_pm_poweroff_wait: 0% user + 0.3% kernel
0.2% 50/rcuop/4: 0% user + 0.2% kernel
0% 64/rcuop/6: 0% user + 0% kernel
0.2% 522/logd: 0% user + 0.2% kernel / faults: 49 minor 2 major
0.2% 539/sugov:4: 0% user + 0.2% kernel
0% 556/keystore2: 0% user + 0% kernel / faults: 12 minor 7 major
0% 1057/media.metrics: 0% user + 0% kernel / faults: 13 minor 12 major
0% 1061/mediaserver: 0% user + 0% kernel / faults: 12 minor 8 major
0.2% 17292/kworker/4:0-memlat_wq: 0% user + 0.2% kernel
0.2% 20833/kworker/0:0-memlat_wq: 0% user + 0.2% kernel
0.1% 11/ksoftirqd/0: 0% user + 0.1% kernel
0.1% 14/rcuop/0: 0% user + 0.1% kernel
0.1% 28/rcuop/1: 0% user + 0.1% kernel
0.1% 57/rcuop/5: 0% user + 0.1% kernel
0% 136/thermal_BIG: 0% user + 0% kernel
0.1% 540/sugov:6: 0% user + 0.1% kernel
0% 545/vold: 0% user + 0% kernel / faults: 14 minor 18 major
0% 748/loop10: 0% user + 0% kernel
0.1% 869/rlsservice: 0.1% user + 0% kernel
0.1% 895/android.hardware.sensors@2.1-service.multihal: 0% user + 0.1% kernel
0% 1008/drmserver: 0% user + 0% kernel / faults: 75 minor 62 major
0.1% 1098/rild_exynos: 0% user + 0.1% kernel
0.1% 1240/com.google.usf.: 0% user + 0.1% kernel
0.1% 3611/com.x8bit.bitwarden: 0.1% user + 0% kernel / faults: 2 minor
0.1% 5942/ch.protonmail.android: 0.1% user + 0% kernel / faults: 2 minor 1 major
0% 19826/org.mozilla.firefox:tab11: 0% user + 0% kernel / faults: 32 minor 26 major
0.1% 20396/kworker/2:0-memlat_wq: 0% user + 0.1% kernel
0.1% 20506/kworker/3:0-memlat_wq: 0% user + 0.1% kernel
0.1% 20560/kworker/1:3-memlat_wq: 0% user + 0.1% kernel
0% 20591/kworker/7:0H-kblockd: 0% user + 0% kernel
0% 20836/kworker/6:3H-kblockd: 0% user + 0% kernel
0.1% 20938/kworker/7:2-memlat_wq: 0% user + 0.1% kernel
0.1% 21007/kworker/u17:3-mfc_core/butler: 0% user + 0.1% kernel
0% 21107/kworker/4:1H-kblockd: 0% user + 0% kernel
0.1% 21457/kworker/5:1-memlat_wq: 0% user + 0.1% kernel
+0% 21562/kworker/0:0H-events_highpri: 0% user + 0% kernel
+0% 21563/kworker/6:2-memlat_wq: 0% user + 0% kernel
+0% 21566/kworker/5:1H-kblockd: 0% user + 0% kernel
23% TOTAL: 13% user + 9.1% kernel + 0.1% iowait + 0.5% irq + 0.3% softirq
CPU usage from 60ms to 462ms later (2023-09-21 07:37:36.389 to 2023-09-21 07:37:36.791):
77% 14707/org.schabi.newpipe.debug.fixplayerserviceforegroundstart: 61% user + 15% kernel / faults: 44 minor
19% 21502/ExoPlayer:Playb: 15% user + 3.8% kernel
11% 21538/MediaCodec_loop: 7.7% user + 3.8% kernel
7.7% 14707/foregroundstart: 7.7% user + 0% kernel
7.7% 21520/ExoPlayer:Loade: 7.7% user + 0% kernel
7.7% 21549/MediaCodec_loop: 3.8% user + 3.8% kernel
3.8% 14742/RenderThread: 3.8% user + 0% kernel
3.8% 14757/hwuiTask1: 3.8% user + 0% kernel
3.8% 14871/Okio Watchdog: 3.8% user + 0% kernel
3.8% 14877/HwBinder:14707_: 3.8% user + 0% kernel
3.8% 21519/ExoPlayer:Loade: 3.8% user + 0% kernel
3.8% 21543/ExoPlayer:Media: 3.8% user + 0% kernel
3.8% 21552/ExoPlayer:Media: 3.8% user + 0% kernel
39% 1427/system_server: 9% user + 30% kernel / faults: 504 minor
36% 21561/AnrConsumer: 12% user + 24% kernel
14% 908/samsung.hardware.media.c2@1.0-service: 8.7% user + 5.8% kernel / faults: 6 minor
2.9% 21540/HwBinder:908_7: 2.9% user + 0% kernel
2.9% 21545/HwBinder:908_7: 0% user + 2.9% kernel
2.9% 21547/HwBinder:908_7: 2.9% user + 0% kernel
2.9% 21548/HwBinder:908_7: 2.9% user + 0% kernel
10% 578/surfaceflinger: 8.1% user + 2.7% kernel
8.1% 578/surfaceflinger: 8.1% user + 0% kernel
2.7% 701/surfaceflinger: 0% user + 2.7% kernel
12% 1117/media.swcodec: 9% user + 3% kernel / faults: 12 minor
9% 21550/id.opus.decoder: 6% user + 3% kernel
3% 1210/HwBinder:1117_1: 3% user + 0% kernel
2.4% 12/rcu_preempt: 0% user + 2.4% kernel
2.5% 50/rcuop/4: 0% user + 2.5% kernel
2.7% 584/android.hardware.graphics.composer@2.4-service: 0% user + 2.7% kernel
2.7% 584/binder:584_2: 0% user + 2.7% kernel
2.8% 834/netd: 2.8% user + 0% kernel
2.9% 932/audioserver: 2.9% user + 0% kernel
2.9% 1395/AudioOut_15: 2.9% user + 0% kernel
4% 20568/kworker/u16:1-events_unbound: 0% user + 4% kernel
24% TOTAL: 14% user + 8.5% kernel + 0.3% iowait + 0.9% irq + 0.6% softirq
@annervisser Could you provide the complete stack trace of the corresponding crash which should happen when closing the player, according to similar reports?
@annervisser Could you provide the complete stack trace of the corresponding crash which should happen when closing the player, according to similar reports?
@AudricV ~Most of the time it never actually crashes and so I don't get a stacktrace.~ After trying a couple of times (I'm able to reproduce this quite easily), I got a trace:
I screen recorded it, in case that's of any help:
https://github.com/TeamNewPipe/NewPipe/assets/5613416/898a4cab-f8b0-4cc9-ad2c-7211e7e81572
android.app.RemoteServiceException$ForegroundServiceDidNotStartInTimeException: Context.startForegroundService() did not then call Service.startForeground(): ServiceRecord{57afda3 u0 org.schabi.newpipe.debug.fixplayerserviceforegroundstart/org.schabi.newpipe.player.PlayerService}
at android.app.ActivityThread.generateForegroundServiceDidNotStartInTimeException(ActivityThread.java:2011)
at android.app.ActivityThread.throwRemoteServiceException(ActivityThread.java:1985)
at android.app.ActivityThread.-$$Nest$mthrowRemoteServiceException(Unknown Source:0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2247)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loopOnce(Looper.java:201)
at android.os.Looper.loop(Looper.java:288)
at android.app.ActivityThread.main(ActivityThread.java:7940)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:952)
Caused by: android.app.StackTrace: Last startServiceCommon() call for this service was made here
at android.app.ContextImpl.startServiceCommon(ContextImpl.java:1935)
at android.app.ContextImpl.startForegroundService(ContextImpl.java:1890)
at android.content.ContextWrapper.startForegroundService(ContextWrapper.java:822)
at android.content.ContextWrapper.startForegroundService(ContextWrapper.java:822)
at androidx.core.content.ContextCompat$Api26Impl.startForegroundService(ContextCompat.java:1091)
at androidx.core.content.ContextCompat.startForegroundService(ContextCompat.java:749)
at org.schabi.newpipe.fragments.detail.VideoDetailFragment.openMainPlayer(VideoDetailFragment.java:1128)
at org.schabi.newpipe.fragments.detail.VideoDetailFragment.$r8$lambda$2AqzXzm7Dd_AK59LBgrtlNnr-I8(Unknown Source:0)
at org.schabi.newpipe.fragments.detail.VideoDetailFragment$$ExternalSyntheticLambda56.run(Unknown Source:2)
at org.schabi.newpipe.fragments.detail.VideoDetailFragment.replaceQueueIfUserConfirms(VideoDetailFragment.java:2081)
at org.schabi.newpipe.fragments.detail.VideoDetailFragment.openVideoPlayer(VideoDetailFragment.java:1083)
at org.schabi.newpipe.fragments.detail.VideoDetailFragment.openVideoPlayerAutoFullscreen(VideoDetailFragment.java:1096)
at org.schabi.newpipe.fragments.detail.VideoDetailFragment.lambda$runWorker$32(VideoDetailFragment.java:846)
at org.schabi.newpipe.fragments.detail.VideoDetailFragment.$r8$lambda$yO9w4bII-7LTl9F0EIApbmkEC3Q(Unknown Source:0)
at org.schabi.newpipe.fragments.detail.VideoDetailFragment$$ExternalSyntheticLambda58.accept(Unknown Source:8)
at io.reactivex.rxjava3.internal.observers.ConsumerSingleObserver.onSuccess(ConsumerSingleObserver.java:62)
at io.reactivex.rxjava3.internal.operators.single.SingleObserveOn$ObserveOnSingleObserver.run(SingleObserveOn.java:81)
at io.reactivex.rxjava3.android.schedulers.HandlerScheduler$ScheduledRunnable.run(HandlerScheduler.java:123)
at android.os.Handler.handleCallback(Handler.java:942)
at android.os.Handler.dispatchMessage(Handler.java:99)
... 6 more
@annervisser FWIW, I tried your steps several times but did not get any crashes although my config may be different from yours. I had to turn off screen rotate to get the fullscreen button to appear. The back gesture (swipe) didn't work so I used the back arrow at the bottom of the screen instead.
Galaxy S10+, OneUI, Android 12.4.14.190, last s/w update September 8, 2023
@AudricV No crashes after two more days. I think you've fixed it for me, at least.
If the patch is not accepted for whatever reason into the next release, is there anything I can do on the phone side to prevent this problem? Maybe there is a Developer setting, configuration change, or something else to set?
I was also having this issue. Looks like the build provided by @AudricV seems to solve the problem though. Hope now that it's solved it gets fixed in the next release.
The fix also resolved two other problems I was having: 1) Partially viewed videos would usually not restart. Now, they do. I can resume watching videos even after many days 2) Search terms are remembered. Newpipe search always worked but for a long time, my search terms would not appear in the history. Now, I have a complete record.
That lools like you've disabled search and watch history in the settings. Can you check that for us, please?
Settings -> History and Cache:
Watch history, Resume playback, Positions in lists, and Search history are enabled in both Newpipe 25.2 and @AudricV's Debug version.
Added thoughts: To clarify, I have had a long list of searches in my history for a while. At some point, my new searches didn't get saved to the history. I don't remember when it started happening but it was not a big deal so I ignored it. With the debug version, new searches are logged to the search history.
Speculation: When the software was crashing, perhaps things like new search entries got dropped because files that would have/should have gotten updated did not?
Regarding resuming playback, I filed this Feature Request a long time ago to get around the problem https://github.com/TeamNewPipe/NewPipe/issues/4574 The inability to resume was identified as a problem to be fixed vs. creating a workaround. This debug version appears to have addressed it.
Disconnecting a Bluetooth device (headphones) after killing the app while a video was playing may be a factor in this, not sure but it just happened to me (on 0.25.2)
android.app.ForegroundServiceDidNotStartInTimeException: Context.startForegroundService() did not then call Service.startForeground(): ServiceRecord{10c0b8 u0 org.schabi.newpipe/.player.PlayerService}
at android.app.ActivityThread.throwRemoteServiceException(ActivityThread.java:2147)
at android.app.ActivityThread.access$2900(ActivityThread.java:310)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2376)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loopOnce(Looper.java:226)
at android.os.Looper.loop(Looper.java:313)
at android.app.ActivityThread.main(ActivityThread.java:8663)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:567)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1135)
Checklist
Affected version
0.24.1 (but also saw in 0.24)
Steps to reproduce the bug
UPDATED 6 August 2023 with v0.25.2
or
Change in behavior: Guru Meditation error no longer goes into infinite loop. Still steals focus as always but it is possible to swipe dismiss the app and restart. Usually it will work for a while after one or two restarts and then the problem happens again
Expected behavior
App used to work great. Started having this problem with 0.24. Hoped 0.24.1 would fix it but didn't
Actual behavior
Regular crashes
Screenshots/Screen recordings
No response
Logs
Exception
Crash log
Affected Android/Custom ROM version
Android 12 4.14.190 - stock, no custom ROM, no root
Affected device model
Samsung Galaxy S10+, US T Mobile
Additional information
Closest relevant recent Open Issue is https://github.com/TeamNewPipe/NewPipe/issues/9163 but my problem doesn't happen immediately on startup.
Closest Closed Issue is https://github.com/TeamNewPipe/NewPipe/issues/9339 but afaik, there isn't a fix (looked at other referenced Issues)
Steps tried.
Delay between app start and crash not perfectly reproducible. Occasionally it will be stable for a few minutes but once a crash happens, it will repeat 10-15 seconds after every restart for some time after which it will be stable for a little while before starting the quick crash pattern
Problem is not affected by VPN state
Weak correlation with signal strength: Wifi connections appear to take longer between crashes relative to cellular network. Can't prove it. Just an observation.
I don't have the tools or skill to get any bug report beyond the Guru Meditation dump provided in the Logs box