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

Constantly getting "Newpipe isn't responding" popups randomly while watching Youtube videos #9390

Closed
6 tasks done
32423d opened this issue Nov 12, 2022 · 59 comments · Fixed by #10578
Closed
6 tasks done
Labels
bug Issue is related to a bug player Issues related to any player (main, popup and background)

Comments

@32423d
Copy link

32423d commented Nov 12, 2022

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

v0.24.1

Steps to reproduce the bug

This issue randomly occurs for me.
Steps to reproduce:

  1. Open and play a Youtube video or a few Youtube videos
  2. Watch videos until the popup occurs
  3. Popup occurs again a few seconds after closing it with the wait button and keeps occurring every time it is closed by the wait button

Expected behavior

The expected behavior is for the popup to show up when the app is actually unresponsive. The app is fully responsive right before the popup shows up and whenever I close the popup the app is still fully responsive after.

Actual behavior

The "Newpipe isn't responding" keeps appearing randomly whenever I am watching Youtube videos with Newpipe. I haven't found anyway to reliable reproduce the issue but it occurs randomly for me whenever I am just watching Youtube videos.

Screenshots/Screen recordings

image

Logs

No response

Affected Android/Custom ROM version

Android 13 stable

Affected device model

Google Pixel 5a

Additional information

I found this bug occurring in the official Newpipe app that is run by the Newpipe team.

@32423d 32423d added bug Issue is related to a bug needs triage Issue is not yet ready for PR authors to take up labels Nov 12, 2022
@killerrook
Copy link

Try clearing cache check it if it works
If not take a backup of database by settings> content> export database
Then reimport using settings> content> import database

@32423d
Copy link
Author

32423d commented Nov 13, 2022

Try clearing cache check it if it works If not take a backup of database by settings> content> export database Then reimport using settings> content> import database

I cleared the app cache and re-imported my Newpipe database file but the issue is still occurring for me.
image

@opusforlife2 opusforlife2 removed the needs triage Issue is not yet ready for PR authors to take up label Nov 13, 2022
@opusforlife2 opusforlife2 changed the title Constantly getting "Newpipe isn't responding" popups randomly while watching Youtube videos [v0.24.1] Constantly getting "Newpipe isn't responding" popups randomly while watching Youtube videos Nov 13, 2022
@killerrook
Copy link

If the database is not imported after clearing data does the problem still persist?

@32423d
Copy link
Author

32423d commented Nov 14, 2022

I tried again by clearing the app cache and not re-importing the Newpipe database file but the issue still occurred after watching some videos right after.

@xearonet
Copy link

Same for me. I also tried remove app completely and install again. Same result.

Spec:
Xiaomi mi 9se
Android 10
Miui 11

@Malachiel87
Copy link

Same here redmi note 11 eu
Android 11
Mii 13.0.14.0

@metbic
Copy link

metbic commented Nov 18, 2022

I was experiencing this bug, too. Most frequently. Upon the 'close/wait' message, I tapped 'report via email' already dozens of times. Clearing the cache had no effect. This bug persisted already since the last two updates of the app. Re-installing helped. Android 9, Sony xz1c.

@blaueente

This comment was marked as duplicate.

@metbic
Copy link

metbic commented Nov 18, 2022

Did anyone of you actually try to uninstall/reinstall?

@russdill
Copy link

Yes, I even got the same thing on a completely fresh install without any imported settings when trying out the pre 0.24.1 release.

Pixel 6 Pro
Android 13

@32423d
Copy link
Author

32423d commented Nov 22, 2022

I have uninstalled and reinstalled multiple times already and this issue persists.

@32423d
Copy link
Author

32423d commented Nov 23, 2022

One thing I have noticed is that when I downgraded to v0.23.3 the issue does not occur but when using v0.24.0 and v0.24.1 the issue occurs so I believe that whatever is causing the issue is something that was changed in version v0.24.0.

@IndigoJay

This comment was marked as duplicate.

@AudricV AudricV added the player Issues related to any player (main, popup and background) label Dec 4, 2022
@AudricV
Copy link
Member

AudricV commented Dec 4, 2022

As this issue is hard to reproduce, we can't reproduce it on our side and trace the origin of the ANR (Application Not Responding), even if we know that the issue comes from the player.

Collecting logs from ADB's logcat when this issue occur would be a great first step to debug this issue (remember to remove personal information in logcats before posting them publicly).

@opusforlife2
Copy link
Collaborator

remember to remove personal information in logcats before posting them publicly

If you have root, using App Manager's in-built Log Viewer lets you toggle a setting to do some of this automatically. It won't remove everything, but it will make it easier for you to do the rest.

@FrostKiwi
Copy link

Waited a bit before reporting it myself, but has been going on for over a month now, on roughly every 3rd Video I watch.
Google Pixel 6 Pro, Android 13

1000005648_1.mp4

Happens completely randomly. And the weird thing is, the App functions 100% fine. It's just the message...

@Coderdude112
Copy link

Just commented here but I may have found a way to reproduce this. Watch a video, minimize the player to where you can browse other videos and then click on another video without closing the first video. It will take a few minutes for the ANR dialogue to popup.

I have found that if you close the video player before clicking on another video, the ANR dialogue won't popup.

@b1k3rdude
Copy link

b1k3rdude commented Jan 9, 2023

I am getting the same issue, logged a tracker - #9652

Going back to NewPipe 0.23.3 for the time being.

@Coderdude112
Copy link

@b1k3rdude Does 23.3 still work? I thought a YT change broke it

@FrostKiwi
Copy link

Just commented here but I may have found a way to reproduce this. Watch a video, minimize the player to where you can browse other videos and then click on another video without closing the first video. It will take a few minutes for the ANR dialogue to popup.

I have found that if you close the video player before clicking on another video, the ANR dialogue won't popup.

Just wanted to clarify, that with my Pixel 6 Pro, it happens also randomly, without interaction. Like 5 mins into watching a video...

@kj
Copy link

kj commented Feb 5, 2023

This is still happening for me in version 0.25.0 RC2 #9712. Makes the app nearly unusable as even if you choose 'Wait', the dialog just comes up again a few seconds later.

@Stypox
Copy link
Member

Stypox commented Feb 7, 2023

I think this is related to "ForegroundServiceDidNotStartInTime" or something, #9358

@FrostKiwi
Copy link

FrostKiwi commented Feb 17, 2023

Updated to 0.25.0.
Still happening on my Pixel 6 Pro. Every 3rd or so video starts to display the app not repsonding dialog after 2 minutes or so of video run time, while the app itself runs fine. Have to then close the app -> reopen -> go to history -> continue video.

@ghost

This comment was marked as duplicate.

@AudricV AudricV added the help wanted Help is wanted in fixing this issue label Jun 11, 2023
@blauertee

This comment was marked as outdated.

@kj
Copy link

kj commented Jun 26, 2023

@blauertee It's definitely not just Pixel phones. It also happens on my OnePlus 8 with LineageOS 20. There was a time a few months ago maybe where it was happening on nearly every video I opened (I might have been on an older version of LineageOS back then too; edit: according to my last comment that was early February). It's far less frequent now but it does still come up occasionally and I have to restart the app.

@blauertee
Copy link

blauertee commented Jun 26, 2023

Okay managed to isolate the relevant logcat lines.

PID: 7460 is NewPipe here :)

The Output always generated when "Not Responding ..." pops up:

06-26 14:03:21.945  1793  2172 D CoreBackPreview: Window{744d57b u0 Application Not Responding: org.schabi.newpipe}: Setting back callback OnBackInvokedCallbackInfo{mCallback=android.window.WindowOnBackInvokedDispatcher$OnBackInvokedCallbackWrapper@fb36f62, mPriority=0}
06-26 14:03:21.973  1793  7460 E OpenGLRenderer: Unable to match the desired swap behavior.
06-26 14:03:22.019  1793  7460 W Parcel  : Expecting binder but got null!

When I press Close on the popup:

Newpipe is mentioned here a few times for not existing by a seemingly confused MediaPlayer. (Not sure whether this is relevant)

06-26 14:03:26.338  1058  6951 D C2BqBuffer: cannot dequeue buffer 0
06-26 14:03:26.338  1058  6951 E QC2Buf  : allocate: failed to alloc graphic block w(1280)/h(720)/f(7fa30c06)/usage(30010000)
06-26 14:03:26.339  1402 27949 D BufferPoolAccessor2.0: bufferpool2 0xb400007605c41ff8 : 4(16384 size) total buffers - 0(0 size) used buffers - 3023/3030 (recycle/alloc) - 17/3030 (fetch/transfer)
06-26 14:03:26.339  1793  2907 D MediaSessionService: Media button session is changed to null
06-26 14:03:26.340   998 11586 D msm8974_platform: platform_set_channel_map mixer_ctl_name:Playback Channel Map9
06-26 14:03:26.340   998 11586 D msm8974_platform: platform_set_channel_map: set mapping(1 2 0 0 0 0 0 0) for channel:2
06-26 14:03:26.340  1793  5028 I WindowManager: WIN DEATH: Window{868fc16 u0 org.schabi.newpipe/org.schabi.newpipe.MainActivity}
06-26 14:03:26.341   991   991 I Zygote  : Process 4580 exited due to signal 9 (Killed)
06-26 14:03:26.341  1793  5028 W InputManager-JNI: Input channel object '868fc16 org.schabi.newpipe/org.schabi.newpipe.MainActivity (client)' was disposed without first being removed with the input manager!
06-26 14:03:26.345 27793 27793 I MediaPlayerList: onMediaKeyEventSessionChanged: packageName=org.schabi.newpipe
06-26 14:03:26.348 27793 27793 W MediaPlayerList: org.schabi.newpipe is already the active player
06-26 14:03:26.348 27793 27793 V MediaPlayerList: onActiveSessionsChanged: number of controllers: 0
06-26 14:03:26.348 27793 27793 W AudioMediaPlayerWrapper: The session was destroyed org.schabi.newpipe
06-26 14:03:26.349  1058  6951 W QC2V4l2Codec: [avcD_227] Graphic output-buf allocation failed!
06-26 14:03:26.349  1058  6951 E QC2V4l2Codec: [avcD_227] Error during buffer allocation
06-26 14:03:26.350  1058  6951 D C2BqBuffer: cannot dequeue buffer 0
06-26 14:03:26.350  1058  6947 E QC2Comp : [avcD_227][ERROR] entered
06-26 14:03:26.350  1058  6951 E QC2Buf  : allocate: failed to alloc graphic block w(1280)/h(720)/f(7fa30c06)/usage(30010000)
06-26 14:03:26.350  1058  6951 W QC2V4l2Codec: [avcD_227] Graphic output-buf allocation failed!
06-26 14:03:26.350  1058  6951 E QC2V4l2Codec: [avcD_227] Error during buffer allocation
06-26 14:03:26.350  1058  6951 D C2BqBuffer: cannot dequeue buffer 0
06-26 14:03:26.350  1058  6951 E QC2Buf  : allocate: failed to alloc graphic block w(1280)/h(720)/f(7fa30c06)/usage(30010000)
06-26 14:03:26.350  1058  6951 W QC2V4l2Codec: [avcD_227] Graphic output-buf allocation failed!
06-26 14:03:26.350  1058  6951 E QC2V4l2Codec: [avcD_227] Error during buffer allocation
06-26 14:03:26.350  1058  6951 D C2BqBuffer: cannot dequeue buffer 0

The last three lines repeat for some more time.

@AudricV
Copy link
Member

AudricV commented Jun 26, 2023

Logcat logs doesn't seem to be useful for us. We need ANRs traces, which you can probably get on Android Studio using the profiler. Analysis of these ANRs would higly appreciated, as we are not able to identify precisely from where the issue comes from.

@blauertee
Copy link

@AudricV Alright here you are :)
anr_newpipe.txt

@AudricV
Copy link
Member

AudricV commented Jun 26, 2023

I don't see anything useful in the file you sent. Thanks anyway.

@blauertee
Copy link

Hmm sad tell me if you need anything else. This makes using the App really annoying. Oh and I forgot to include this from the ANR log:

--- CriticalEventLog ---
capacity: 20
events <
  timestamp_ms: 1687774577191
  anr <
    pid: 21685
    process: "org.schabi.newpipe"
    process_class: 1
    subject: "Context.startForegroundService() did not then call Service.startForeground(): ServiceRecord{3e712ce u0 org.schabi.newpipe/.player.PlayerService}"
    uid: 10351
  >
>
timestamp_ms: 1687774651595
window_ms: 300000

@blauertee
Copy link

blauertee commented Jun 26, 2023

Probably this is not news to anyone here, but just in case (everybody missed the obvious sometimes). The Google Diagnosing ANRs FAQ says:

  • The main thread is doing a synchronous binder call to another process, and that other process is taking a long time to return.

This seems to be coherent with the logcat data where a binder is expected but null received. I don't know any of the context but maybe there is a simple way to do this async. or to lower the timeout and handle null, so the UI is not blocked for so long? In case you even know which call is blocking the UI here.

@FrostKiwi
Copy link

Still happening constantly. Here is another symptom: When the not responding + wait loop starts, you can close the app in the android app drawer and the message still pops up.
Like here in the video: I clicked Wait the first time, closed newpipe in the app drawer and the message still appears.

screen-20230711-200634.mp4

@opusforlife2
Copy link
Collaborator

That's because removing the app from Recents doesn't necessarily terminate the app process.

@32423d
Copy link
Author

32423d commented Aug 6, 2023

This issue still persists on v0.25.2. My device has not changed since this issue was created (Android 13 stable, Pixel 5a). Since the app works fine and the issue is that the system error message is obscuring the screen I think a temporary solution, if possible, would be to have an option that you can enable or disable in the app settings that prevents the app from creating the system create error messages for it.

@major137
Copy link

I managed to fix the issue, but i'm not sure if it's the real cause... after i cleared all downloads from the list (i never did since a year of usage, it was pretty large), no more popups. Updated to version 0.25.2

@32423d
Copy link
Author

32423d commented Aug 17, 2023

I managed to fix the issue, but i'm not sure if it's the real cause... after i cleared all downloads from the list (i never did since a year of usage, it was pretty large), no more popups. Updated to version 0.25.2

Is your device also on android 13 stable?

@kj
Copy link

kj commented Aug 17, 2023

I have nothing in my downloads list and I still see this after watching a few videos (it's usually okay if I only watch one or two). LineageOS 20 (Android 13).

@major137
Copy link

On Android stable yes ; and always up to date (Pixel 6a)

@32423d
Copy link
Author

32423d commented Aug 17, 2023

It seems clearing my download history did not fix this issue. I also cleared the cache, did a reinstall, and loaded my save file back into the app but this did not resolve this issue either.

@Douile
Copy link
Contributor

Douile commented Aug 17, 2023

My theory is that the issue is caused by a large database causing some query that blocks startForegroundService to take too long.

I think this because if i remember correctly someone solved it for themselves by clearing the database, and it was solved for major by deleting a large amount of downloads.

Maybe we should try and get a flamegraph captured by someone experiencing the issue. I will look into getting one but i have a hard time replicating the issue on debug builds for some reason.

@FrostKiwi
Copy link

It seems clearing my download history did not fix this issue. I also cleared the cache, did a reinstall, and loaded my save file back into the app but this did not resolve this issue either.

Can confirm this on my Pixel 6 Pro. Clearing download History does not solve the infinite wait loop.

@AudricV
Copy link
Member

AudricV commented Sep 17, 2023

I think I found the origin of the presence of this Application Not Responding issue, could you look at #9358 (comment) and test the debug APK linked to see if the issue is fixed? Thanks in advance.

@kj
Copy link

kj commented Sep 18, 2023

Thanks @AudricV, I've been through a few videos with the debug version and so far no issues (although of course it's not always consistent). I'll report back if this comes up for me again, but so far so good.

Edit: No issues all day for me either.

@FrostKiwi
Copy link

@AudricV I have also tested the #9390 fix for a day now and same as @kj, have not observed a single hang, whereas I would have expected several yesterday.
So for me it's a clear 🎉 and I would consider this solved, once this hits the main release build.

Really awesome work fixing this one, I was slowly but surely losing my sanity.

@Rich700000000000

This comment was marked as spam.

@FrostKiwi
Copy link

@AudricV

could you look at #9358 (comment) and test the debug APK linked to see if the issue is fixed?

Ohh noooooo, it happened again 😭

Screen-20230921-195645.1.mp4

But the frequency of occurrence lower I think? Maybe a placebo? Either way, gonna try it out for a bit longer before coming to a definitive conclusion.
If I catch it again doing that thing, should I connect to the PC and pull an adb log cat while it's doing that loop stuck or something?

@kj
Copy link

kj commented Sep 21, 2023

It does seem less frequent at the very least. I still haven't run into it yet with this version, but it sounds like I may have just been lucky so far. I will definitely update if it does show up again for me too.

@kj
Copy link

kj commented Oct 1, 2023

Okay I finally ran into this again for the first time since installing the debug version. Still, it feels like a big improvement.

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