kbuffington / Georgia

Dynamic foobar2000 theme
284 stars 16 forks source link

Playlist Smooth Scrolling causes stuttering - 2.0.2 #90

Closed Artins90 closed 3 years ago

Artins90 commented 3 years ago

The new smooth scrolling feature is introducing stuttering on my system, basically achieving the opposite of what it aims to do. I tried to capture a video of the issue but the frame times are averaged together making it less apparent. It looks as if the playlist was running at 20 fps.

The monitor is running at 4K 60Hz, G-sync is enabled (disabling it doesn't fix the issue). The skin 4K mode is enabled and set to always use georgia-config.jsonc.txt .

kbuffington commented 3 years ago

Do you find it noticeably worse than the smooth scrolling which has always existed in the Library? Are you seeing spiking in CPU while scrolling?

My guess is that's just how it works/looks though. Your estimation of 20fps isn't far off. I'm telling the playlist to redraw every 40ms (which will average to somewhere between 20-25fps due to draw/repaint times). I'll play around with higher frame rates and see if that improves things though.

kbuffington commented 3 years ago

Actually I just did some further tests and I think it's the 4K resolution. Shrink foobar to half it's current size (disable 4k mode as well for this test so it's drawing roughly the same number of rows) and try the scrolling again. On my 4K display it is MUCH smoother in this way. I'm gonna try and do some profiling and see if I can't improve redraw speeds of the playlist, and if not I'll add a flag to the config file to disable smooth scrolling.

Artins90 commented 3 years ago

The previous implementation was better, it might not have been completely "smooth" but it was consistent and had better text readability while scrolling.

The CPU usage rises when scrolling, it reaches 50% usage on a single core when scrolling slowly with the mouse wheel and 70% usage when scrolling quickly with the scrollbar.
None of the cores ever reaches 100% usage while scrolling.

Resizing the window doesn't help much, it's a little bit smoother but still inferior compared to the previous implementation. I would be more than happy to use the old implementation.

Thank you for looking into this.

dwmartin0906 commented 3 years ago

I am also having issues with smooth scrolling in the playlist view using 4K resolution. Scrolling seems a little slower, but that's no biggie.

When I switch to a new playlist scrolling can be unresponsive, sometimes requiring several turns of the mouse wheel before actual scrolling begins. Also, when I 'Show now playing' and then scroll forwards or backwards from that point the playlist suddenly jumps several songs. I've even had it jump backwards when I scroll forwards. When scrolling, the increase in CPU load is about 10 to 12 percent higher than without smooth scrolling.

I haven't made any changes to Control_Scrollbar.js and I also tested it with a pure version of 2.0.2 so I don't think I screwed this one up. I don't have any issues with the library panel, but their functionality is somewhat different. I switched to Control_Scrollbar.js from 2.0.0 and it works fine. I can live with it indefinitely unless you make a change I really need.

As always, thank you very much for everything.

dwmartin0906 commented 3 years ago

Smooth scrolling works great after your changes from a few days ago. Thank you. However, with your most recent change to allow turning off smooth scrolling, the mouse wheel incorrect position after Show Now Playing issue is back if smooth scrolling is turned off. It still works fine if smooth scrolling is turned on. It's not an issue for me since I plan to leave smooth scrolling turned on, but I wanted to let you know since it might be an issue for others. Thanks again for all your hard work.

dwmartin0906 commented 3 years ago

This is in reference to noblesigma's email: "This is more of a minor bug I noticed testing this: If you grab the scrollbar, then scroll all the way down, then sneak your mouse outside of foobar, say to a browser to the left, then click around, then hover over foobar, you'll find it still is listening for the mousewheel movements.".

I'm not sure about the sneaking your mouse outside of foobar part. But I did find that if you drag the scrollbar all the way to the bottom, it's like turning on auto scroll. Just moving the mouse up and down will scroll until you click on the panel. And I found that the library panel does the same thing. It occurs to me that this may actually be a feature instead of a bug. I'm just curious. And FYI on the lyrics thing, I use DUI so I couldn't just create a hidden panel, but thank you for the suggestion.

kbuffington commented 3 years ago

Issue with scroll thumb still being down when releasing outside the bounds of library/playlist has been fixed.

kbuffington commented 3 years ago

Fixed in 2.0.3.