Comments (9)
Actually, I just tested the above program using a different savestate and it worked just fine. I don't know why it works with one savestate but not the other.
from dolphin.
Actually, I just tested the above program using a different savestate and it worked just fine. I don't know why it works with one savestate but not the other.
I found some potential clues to what causes these freezes. The savestate I mention here freezes on the second load when V-Sync is enabled, but it works fine again when V-Sync is disabled. I then found an easier fix which worked for all savestates I tested: setting the emulation speed limit to 10%.
I don't know much about how Dolphin or this branch works, but I have some guesses for what's going on here. I think the problem isn't with loading a savestate twice; it's with loading a savestate in the middle of emulation. It appears that somehow, giving Dolphin more time to fully load a savestate before it advances to the next frame fixes this problem. Therefore, this freeze may be caused by Dolphin trying to step to the next frame while savestate.load_from_file
is in the middle of loading a savestate. Perhaps the Python function is missing something that Dolphin's savestate implementation does to prevent this problem.
from dolphin.
Also, as @VIPTankz found out, adding time.sleep(1)
before loading the savestate fixes this.
from dolphin.
I use the savestate.load_from_file
function a lot myself and I haven't had any big problems with it (Emulation Speed is 200% most of the times). I assume the reason is that I load my savestates while dolphin is interrupted with the frameadvance()
event. The few times I seemed to have run into a problem I also assumed a timing misbehavior, but I haven't had any bigger issues that I could reproduce.
Looking at dolphins MainWindow::StateLoad()
implementation of its GUI I can't see any code that would make sure that the timing is right for the SaveState loading or halt the emulation.
from dolphin.
@JimB16 what's an example of a program that loads savestates properly?
from dolphin.
Yeah, it's possible there's a bunch of issues wrt race conditions. I'll have to make a stresstest and see if more rigorous synchronization between python code and emulation will fix it. Thanks for bringing it up, I'll leave this issue open for now.
from dolphin.
I'm also experiencing the same issue, only none of the workarounds here seem to fix it, disabling VSync, making new save states, slowing emulator speed, using time.sleep() before or after loading.
Throwing my own (much more convoluted) workaround in for anyone else with this issue:
from pynput.keyboard import Controller, Key
keyboard = Controller()
# some code
# then, replace your savestate.load_from_slot(1) with the following
keyboard.press(Key.f1)
time.sleep(0.1)
keyboard.release(Key.f1)
This workaround requires that the highlighted window is Dolphin, and requires external packages. But it's working for me, so I'm throwing it out for anyone that might have the same issue.
from dolphin.
This should work even if the window isn't highlighted after checking Background Input in controller settings. I'll check if this works for me tomorrow.
from dolphin.
Thanks, I didn't know about that setting! I will try that when I get the chance later this week.
from dolphin.
Related Issues (20)
- Add Support for get_frame() HOT 46
- Add Support for Classic Controller HOT 1
- Build error with new commits HOT 2
- Breakpoints HOT 3
- Build error on Ubuntu 22.04 HOT 7
- Add support for get_render_size() HOT 3
- Scene module
- savestate.load_from_slot() causes Dolphin to hang from within a loop HOT 1
- Copyright status of user python scripts. HOT 1
- Python Scripts Desyncing/"Freezing"
- Build issues with pch.h / Python.h HOT 4
- Support for Nunchuck and Accelerometer! HOT 13
- Build Issue on Windows HOT 6
- TAS input window breaks when running scripts and vice versa
- Build errors on windows HOT 8
- GameCube controller input not working as expected HOT 2
- Creating PyTorch Tensors hangs Dolphin HOT 3
- Emulator freezes when loading saveslot from created thread HOT 4
- Build crashing on Ubuntu 23.10 HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dolphin.