markusfisch / WaveLinesWallpaper

A simple, unobstrusive live wallpaper for Android showing slowly moving wave lines
https://play.google.com/store/apps/details?id=de.markusfisch.android.wavelines
MIT License
104 stars 14 forks source link

Frame drops while home screen is shown #10

Open Wilker-uwu opened 4 years ago

Wilker-uwu commented 4 years ago

while the performance seems fine while the wallpapers are shown in the selector, there is a large drop in the framerate while the home screen is shown. the overall performance of the app launcher remains untouched..

version 1.13.0 under Android 5.1.1
Wilker-uwu commented 4 years ago

i liked the new lines feature btw :3

markusfisch commented 4 years ago

This is actually happening intentionally to not slow down the launcher. Android restricts Live Wallpapers to a maximum frame rate of 30 fps to keep the launcher responsive.

Additionally, the app automatically throttles the frequency (only for the live wallpaper) as soon as rendering takes longer than it should (see https://github.com/markusfisch/WaveLinesWallpaper/commit/daaba0bf6fe20b3f8fe513e76aad9b476d73a955). This takes load off the CPU if it's busy doing background work (from other apps).

As much as I like my waving lines, I still think that rendering the live wallpaper should have the lowest priority as it's just visual sugar 😉

Wilker-uwu commented 4 years ago

i see ^^

it's still sad to see it drop to less than 4 frames per second in a few seconds after it starts ^^'

is there any way to set a target for when the launcher is open (e.g 12fps) and restrict it in every other case (i.e launcher not in foreground)?

edit:typo
markusfisch commented 4 years ago

Hm, I'm not sure I understand - if you see the live wallpaper, the launcher is always in the foreground 🤔

But I have to say that it's quite rare that I see such a heavy frame drop 🤔 This should be the exception, not the rule. Does it get better when you reduce the number of lines?

Wilker-uwu commented 4 years ago

i just tested here, it seems like yes. i also noticed that it also seems a bit heavier whenever the waves are at its peak.

for reference, my phone isn't the most high-end, and it often struggles to render highly detailed graphics (1.5GB of ram often with other stuff in the background), so i usually consider 10 to 16fps to be the point where i think it is running okay, and a few versions back it was running around that level
comicsansgreenki commented 1 year ago

i'm noticing a hard drop in frames as well, to the point where it's very noticeable when it slows down after opening the launcher. perhaps a framerate cap/adjustment setting would be more effective? (hw: Pixel 2 XL)

{"version":8,"coupled":false,"uniform":false,"shuffle":false,"lines":6,"waves":1,"amplitude":0.15000000596046448,"oscillation":0,"shift":0,"speed":0.05000000074505806,"growth":0.004000000189989805,"rotation":341,"colors":["#FF0041CF","#FF0F63FF","#FF1A98FF","#FF1AC9FF","#FF19E9F7","#FF1AFFFB"],"strokeWidths":[0,0,0,0,0,0]}