Newpipe: Reduced performance caused by playback position in list views

Created on 12 Aug 2019  Â·  25Comments  Â·  Source: TeamNewPipe/NewPipe

Just completely freezes..
Uploading Screenshot_2019-08-12-22-09-49.png…

ASAP bug

Most helpful comment

I did not have the historry issue on thr app you build :)

All 25 comments

Going to revert to previous version, until fixed. Background player crashes too. App freezes for no apparent reason.

Is a YouTube employee sabotaging this project?

Is a YouTube employee sabotaging this project?

No

Just completely freezes..

Which Android version are you using?

HTC ONE, Android 5.0.2
It looks as if the last played list is pretty long, which causes the freezing? Possibly because it has to check the last played time? ( noticed this new red bar below thumbnail )

Can you please clear the cache? Settings > history & cache

Another Android 5 user had problems after upgrading, too. See #2503

Cleared... still freezing on last played view

@theScrabi. If there are serious problems with Android 5, we might want to take down the new version from F-Droid.

Thanks for caring guys..

So clearing all data would resolve it? Really bad. Any fix without deleting everything?

Can you please disable history & cache > watch history > position in lists and tell me if the problem still exists?

That fixed it for me..

Cleared cached metadata and unchecked position in lists..

So it was because of the resume point feature.

Also noticed increased performance of the app.

Yes. We experienced some smaller lags with it on quite new hardware. As you are using Android 5, I assumed that your hardware isn't the newest which could enlarge the problem and cause more/longer lags.

My issue #2503 was also fixed after disabling position in lists. App is as fluent as before.

I guess it has to do with database conversion. Maybe we should take a look there.

Same for me. Completely freezes and NewPipe isn't responding. I am using android version 9. I disabled as you said, "Positions in lists" and now it works. Just to inform you a bit further. I was using 0.17.0 RC3 completely fine with the "Positions in lists" turned ON.

I was using 0.17.0 RC3 completely fine with the "Positions in lists" turned ON.

In this case, we need to take a closer look at https://github.com/TeamNewPipe/NewPipe/commit/a64f5206446edc396b99e23e2c213900b285480a, I guess.

@TobiGr @yausername At StateObjectsListAdapter::loadStates a blockingGet() is performed on a Single that was created using subscribeOn(Schedulers.io()) (see HistoryRecordManager::loadStreamStateBatch).

Javadocs for Schedulers.io() say that "this scheduler may create an unbounded number of worker threads that can result in system slowdowns". So this might be the problem.

Also see:

Maybe we should replace Schedulers.io() with Schedulers.computation() or Scheduler.from(Executors.newFixedThreadPool(n))?
https://stackoverflow.com/questions/31276164
https://proandroiddev.com/understanding-rxjava-subscribeon-and-observeon-744b0c6a41ea

I am able to reproduce the freeze on my Huawei p9 lite, so I will try the alternatives tomorrow.

The problem was there even before a64f5206446edc396b99e23e2c213900b285480a. That commit just made the app freeze, but in the end it takes the exact same time to load states into lists.
I don't think it is a good idea to load the state of every video at once... Just as (we do)/(Android does) with thumbnails, what about loading them when needed? What I mean is: loading the playback state of a stream only when the mini stream view is visible. I will try to implement this, but I'm not sure I am able to ;-/

@hp8wvvvgnj6asjm7 @ronidee @Gymcap could you please check if this apk works for you? On my end the freeze seems to be disappeared, but I am not sure if it has completely disappeared: it could just have become shorter. Anyway I am now able to load history istantaneously: it used to take 5-10 seconds.

EDIT: After some debugging I can confirm that in my apk the playback state of a stream is automatically loaded only when the mini stream view is visible. I'll open a pr after I'm finished cleaning up the code.

Testing apk:
app-debug.zip

I did not have the historry issue on thr app you build :)

I can test this later today

@Stypox I guess I'm late to party, but I tested your apk too and the issue was no longer present. :smiley:

@Stypox Maybe I'm referring to a different issue than others here, because I'm still experiencing it in the debug apk.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ghost picture ghost  Â·  3Comments

Wang-GY picture Wang-GY  Â·  3Comments

PanderMusubi picture PanderMusubi  Â·  3Comments

cavemandaveman picture cavemandaveman  Â·  3Comments

hassanseoul123 picture hassanseoul123  Â·  3Comments