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

Add an option to prevent cpu stall on slow IO #7227

Merged
merged 6 commits into from
Dec 26, 2014

Conversation

unknownbrackets
Copy link
Collaborator

This is good for any slow storage, including:

  • Hard disk spinning up.
  • Generally slow (cheap) SD cards.
  • HTTP or Samba streaming.

May possibly cause bugs in some cases where timing is unrealistic. That being said, as long as the game is a UMD game, and there's caching (could enable memory caching for storage), it should not be a problem usually.

This significantly improves the gameplay experience when streaming games from HTTP, because you get natural loading screens or short stalls with backgroud music playing (as would happen on a PSP) rather than lag.

I'm also thinking to pull in my io-minor2 changes (potentially making it more accurate now/future) as a "realistic" timing option.

Since fast is probably the best compromise between safe and not having annoying loading screens, I'm not sure there's any good way to avoid an option. Would appreciate any suggestions on better phrasing.

-[Unknown]

enum IOTimingMethods {
IOTIMING_FAST = 0,
IOTIMING_HOST = 1,
IOTIMING_REALISTIC = 2,
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unused, but I understand you reserve this for your iominor2 changes? Ah you even addressed that in your pull request message, alright.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, I'll probably mess with it soon. I had found a bug in sceIo but hadn't really looked into it properly, and forgot:
unknownbrackets@815c0a3

Matters a lot more for longer delays... guess this needs it too, really.

-[Unknown]

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, rebased it in and option is used now. REALISTIC may be buggy but should be off by default.

-[Unknown]

This is good for any slow storage, including:
  * Hard disk spinning up.
  * Generally slow (cheap) SD cards.
  * HTTP or Samba streaming.

May possibly cause bugs in some cases where timing is unrealistic.  That
being said, as long as the game is a UMD game, and there's caching (could
enable memory caching for storage), it should not be a problem usually.
Oops, was waking threads but not bumping events.
This allows the filesystems to more accurately control timing.
But they're not actually doing it yet (same timing as before.)
@hrydgard
Copy link
Owner

Alright. Would be interesting if we could find a game that really, really needs SAFE, otherwise we could remove that option later..

hrydgard added a commit that referenced this pull request Dec 26, 2014
Add an option to prevent cpu stall on slow IO
@hrydgard hrydgard merged commit 442fe9c into hrydgard:master Dec 26, 2014
@unknownbrackets
Copy link
Collaborator Author

Well, it'll be really hard to tell, though. Like, it might be a bug that only manifests when your disk has to spin up or there's other disk activity / storage device activity happening.

-[Unknown]

@unknownbrackets unknownbrackets deleted the io-minor branch December 26, 2014 09:27
@daniel229
Copy link
Collaborator

fast and host break games: world neverland,ys7

@unknownbrackets
Copy link
Collaborator Author

Hmm, maybe I missed something in the option.

-[Unknown]

@daniel229
Copy link
Collaborator

Simulate UMD delays helps these
#2830
#6945
#4786
#6127
#5837
#5540
#6557

breaks
Radiant mythology2
world neverland

method Hsot helps
#5545

@unknownbrackets
Copy link
Collaborator Author

Hmm, interesting that Host timing helps one. Maybe we are simply underestimating too much for fast? All of the fast timing is way on the low end estimate wise.

Maybe we can add some logging to see when host is delaying things to find out what it's fixing in that game.

I'll have to look at World Neverland to see what's wrong, it's broken in the demo too, right?

It wouldn't happen to affect Radiant Mythology 1 would it?

-[Unknown]

@daniel229
Copy link
Collaborator

World Neverland demo is also affected,it's much laggy with Simulate UMD delays even press start button in the title,you can feel laggy.
Radiant Mythology 1 seems not affected.Radiant Mythology 2 would hang on entrying or exiting dungeons.

@unknownbrackets
Copy link
Collaborator Author

Does it seem any better if you change if (abs((int)lastReadBlock_ - (int)secNum) > 100) { to if (abs((int)lastReadBlock_ - (int)secNum) > 200) {? On this line also: if (abs((int)lastReadBlock_ - (int)e.seekPos) > 100) {. I should make those use a common constant or func or something...

For me, the Neverland demo especially at loading screens is a bit slow, but not really unbearable. It's possible that we'd be better off trying to also emulate the UMD cache that PSP-2000+ have. Right now, the speeds it's targetting are basically PSP-1000 speeds.

What do I do to get to the broken part in Neverland?

-[Unknown]

@daniel229
Copy link
Collaborator

Actually the slow is the broken part I mean in Neverland ,walking in the street may get weird fps like 23/23 48/48,get stuttering.

still not help Radiant Mythology 2,get Invalid address in loading save,characters missing in dungeon,and hangup when leaving dungeon.

@daniel229
Copy link
Collaborator

Simulate UMD delays breaks Ghost in the shell,it hangs on skipping cutscene.

@daniel229
Copy link
Collaborator

Simulate UMD delays breaks Prince Of Persia Revelations,hangup in loading
01

but debug build is fine.Seem like it's just get much luckly in debug build,it's still broken.
two debuglog here.(rename jpg to 7z)
ppsspplog_broken

ppsspplog_luckly

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.

3 participants