-
Notifications
You must be signed in to change notification settings - Fork 343
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
Fix stuttering when starting to scroll a Game List #755
Conversation
I have this set to a draft because I want to run through some more test cases to make sure I didn't break anything else... I also have before/after change videos demonstrating the noticeable improvement that will upload later. |
@@ -212,15 +212,19 @@ void DetailedGameListView::initMDValues() | |||
|
|||
void DetailedGameListView::updateInfoPanel() | |||
{ | |||
FileData* file = (mList.size() == 0 || mList.isScrolling()) ? NULL : mList.getSelected(); | |||
FileData* file = (mList.size() == 0 || (mList.getScrollingVelocity() != 0)) ? NULL : mList.getSelected(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why this change? "isScrolling" seems to return a similar result - shouldn't we probably fix it at the isScrolling definition if there's an issue?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
isScrolling
also checks if ScrollTier is >0. What this means is that the user has held down the button and has now scrolled by at least 2 items. This is what was causing the stutter you begin to scroll, because it would load the the info.
I am considering add another function isSingleScrolling
(or a better name)... (notice that mScrollTier is check to be == 0)
bool isSingleScrolling(void)
{
return (mScrollVelocity != 0 && mScrollTier == 0);
}
Right now the current implementation, will blank the info panel momentarily even if the user is just scrolling by one. Another option would be to have it just to do an instant transition (and not blank), but just not update the info panel retain what was there previously, and only update when the user has let go of the button.
It would only blank the info panel if the user has scrolled by at least 2.
Thoughts??
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What happens if you remove the mScrollTier check? If it needs to be there, I'd probably rather have isScrolling to receive an argument to distinguish whether you want to check mScrollTier or not as well.
@@ -302,7 +298,7 @@ class IList : public GuiComponent | |||
onScroll(absAmt); | |||
|
|||
mCursor = cursor; | |||
onCursorChanged((mScrollTier > 0) ? CURSOR_SCROLLING : CURSOR_STOPPED); | |||
onCursorChanged((amt != 0) ? CURSOR_SCROLLING : CURSOR_STOPPED); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tell us more about this change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe the intent of mScrollTier
was to control and watch the speed of how much the user has scrolled. However mScrollTier is still 0 when the user has just scrolled by 1, and only increments to 1 after the user has scrolled by 2. It is a better indicator that check that amt is not 0 to indicate that the user is scrolling. As this function is also called when the user has stopped scrolling with amt == 0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks.
@@ -191,10 +191,6 @@ class IList : public GuiComponent | |||
{ | |||
PowerSaver::setState(velocity == 0); | |||
|
|||
// generate an onCursorChanged event in the stopped state when the user lets go of the key | |||
if(velocity == 0 && mScrollVelocity != 0) | |||
onCursorChanged(CURSOR_STOPPED); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I want to make sure that removing this didn't break anything else.
The call to stopScrolling()
would also call onCursorChanged()
so that is where it would be called once, but believe there are other places that only call listInput(0);
First: Second: Large gamelist (> 1 Screen): Short list (< 1 Screen): These are ok: The introduced fadeout/fadein for single actions make the ES feel less snappy IMHO. |
Thanks for testing this out!
Again, Thanks for testing this out!
There is a bug I noticed in master with the Continuous scrolling, and then hitting the very end of the list. When it hits the very end of the list, It will load the info panel, even if the user hasn't let go of the button. But then once the user lets go of the button, it will reload the info panel again. You can notice this if you have a long description, and you hold the button until it begins scrolling after a brief moment. When you let go of it, the description will reset back to beginning indicateing it reloaded. But this is very minor bug IMO...
I thought this at first, and I did experiment with this using that I press down a button, I see the next item selected... then I see the previous item still on the screen (albeit very briefly) wondering what's going on asking myself "Why am I still seeing old information on the screen, I already see the game selected?", and then I release the button, I finally see the update info after very brief moment again (hitting the file system). All of this happens in less than quarter a second... For the case I have implemented, my thought went like this... I press down a button, I see the info panel fade out (and I think to myself it must be doing something and I feel like it's moving), and then I finally release the button, I see the update info (which hits the file system) after very brief moment again. Again, all of this happens in less than quarter a second... This is just IMHO as well, but if there is consensus from the maintainers/reviewers of this project, then I can easily make it perform the former action. |
1a0775b
to
083547c
Compare
updateInfoPanel() is an expensive function due to access to file system for reading screenshots, videos, etc. Record what is already up there and if another request comes in for the same thing, then return early.
083547c
to
9f2ff94
Compare
I decided to go a simpler route which did no introduce blank in between single scrolling. All this does is record what it just wrote to the info panel, so that when it gets called again (for example, on a button release). it won't waste time updating the panel. I found that in my system this function can take a while by adding in my own timers ( with Logs of my timing are below... |
I tried the suggested change on a installation with the ProfilingUtil (#716).
Could you @XenuIsWatching pls try on your setup with the NAS? And: Are you using a wired or wireless connection to your NAS? To use the profile, in a nutshell: |
Emulations station would stutter a lot when scorlling through game lists that had artwork with. This was due to it performing multiple reads of the screenshots, marquees, video, etc... For example, even if you were scrolling by 1, it would read these data 3 times. Each time it was calling the function
updateInfoPanel
which can kick of some File I/O which can be expensive (especially when you have the data on a NAS)This gets it down to just 1 read. It also changes the behavior a little (for the better). There are three states in an input for scolling through a list: a rising edge where the button is pressed, a held high state where the button is held, and a falling edge where the button is released.
In the case where it was just press quickly, it was doing a read when the button was first pressed of the next item in the list. Then when it was released it would do another read of the next item in the list TWICE! The behavior now is to blank the info panel when the button is pressed, and then perform ONE read of the screenshot, etc. when the button is released.
Fixes #753