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

Execute savedata operations on a thread, notify of failure #6468

Merged
merged 4 commits into from
Jun 30, 2014

Conversation

unknownbrackets
Copy link
Collaborator

This may help #3039. It runs a separate thread to actually load/save data on, in all cases. The only observable change in behavior should be that each auto savedata operation now takes an extra Update() call (which I'm pretty sure everything is supposed to take several.)

Also, it's possible to end up with a perfectly writable savedata directory, but a file inside that is read-only or owned by another user. It's also possible to run out of disk and such. I think we check for some of these situations at least, but before, we silently failed. This now shows a message if saving/loading fails for any reason. Could probably be improved (why did it fail? testing that things do correctly fail, etc.)

-[Unknown]

@solarmystic
Copy link
Contributor

@unknownbrackets I can confirm that #3039 is completely resolved after applying this pull request.

@vnctdj?

EDIT:- Interestingly enough I thought it wasn't resolved with this branch until I realised I was using a modified build with d8cff45 reverted (in order to deal with the timing issues in Miku Extend (#6441 (comment))).

So apparently d8cff45 is part of the puzzle with the torn sound in this game and is required for the resolution of the issue too.

EDIT2:- And in Brave Story too.

@unknownbrackets
Copy link
Collaborator Author

Well, this only affects savedata. That commit makes a bunch of background threads not hog the cpu in several games, savedata or not.

-[Unknown]

hrydgard added a commit that referenced this pull request Jun 30, 2014
Execute savedata operations on a thread, notify of failure
@hrydgard hrydgard merged commit cca896b into hrydgard:master Jun 30, 2014
@unknownbrackets unknownbrackets deleted the savedata branch June 30, 2014 14:55
@vnctdj
Copy link
Contributor

vnctdj commented Jul 1, 2014

@solarmystic
Excuse me for the late reply, I didn't have the time to use my PC yesterday... :-/

I wouldn't say "completely resolved" because I have noticed some stutter sometimes when I have tested...
Moreover, I have found a crash that you can reproduce by the following way :
Press cross on "Continue" on the main menu then press Circle to go back to the main menu, and repeat this (cross then circle) multiple times.

Here is the stack trace :

>   msvcp120d.dll!std::_Debug_message(const wchar_t * message, const wchar_t * file, unsigned int line) Ligne 15    C++
    PPSSPPDebug64.exe!std::vector<AudioChannelWaitInfo,std::allocator<AudioChannelWaitInfo> >::erase(std::_Vector_const_iterator<std::_Vector_val<std::_Simple_types<AudioChannelWaitInfo> > > _Where) Ligne 1443   C++
    PPSSPPDebug64.exe!__AudioWakeThreads(AudioChannel & chan, int result, int step) Ligne 300   C++
    PPSSPPDebug64.exe!__AudioUpdate() Ligne 332 C++
    PPSSPPDebug64.exe!hleAudioUpdate(unsigned __int64 userdata, int cyclesLate) Ligne 90    C++
    PPSSPPDebug64.exe!CoreTiming::ProcessFifoWaitEvents() Ligne 523 C++
    PPSSPPDebug64.exe!CoreTiming::Advance() Ligne 577   C++
    [Code externe]  

@unknownbrackets
Copy link
Collaborator Author

I think this will fix that: e505655

If your disk is asleep, it will take time. Also, if the operation takes > 30 ms it may blip but it should not be too bad. That's a long time for an IO operation on a modern device.

-[Unknown]

@vnctdj
Copy link
Contributor

vnctdj commented Jul 1, 2014

From my testing, the crash is fixed, thanks :)

I have also noticed that the stutters are only here when PPSSPP window is fullscreen on my secondary monitor (yes, that secondary monitor strangeness like in #6462)...

@solarmystic
Copy link
Contributor

@vnctdj Thanks for the feedback. I was being honest when I said that the stutters are completely fixed because I cannot reproduce them anymore on my system.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants