Emulator Issues #8719
closedDolphin hard freezes while saving/loading savestates with the TAS input window open
0%
Description
Game Name?
Twilight Princess (GCN). Unable to test if other games are affected
Game ID?
GZ2E01
What's the problem? Describe what went wrong in few words.
Dolphin freezes when saving and/or loading savestates while the TAS input window is open. There is no exception message generated nor does Dolphin crash. It just hangs indefinitely until windows tells me Dolphin is not responding.
What did you expect to happen instead?
Dolphin to not freeze
What steps will reproduce the problem?
- Start the game
- Open the TAS input window
- Save and load savestates rapidly until Dolphin freezes. This can happen after a single savestate load/save, or after 20. It will always happen eventually and never happens if the TAS input window is closed
Note: A single controller connected in port 1. Using mouse and keyboard
Does using an older version of Dolphin solve your issue? If yes, which
versions of Dolphin used to work?
I tested Dolphin 4.0-6891 (latest as of today), Dolphin 4.0-6820, 4.0-5371, 4.0 stable. The freeze occurs on all of them.
What are your PC specifications? (including, but not limited to: Operating
System, CPU and GPU)
I tested this on 3 different configurations, all of which are affected:
- Windows 7 64 bit. Intel i5, 4 GB RAM, Radeon HD 7970 (PC)
- Windows 8 64 bit. Intel i7, 4 GB RAM, Intel HD Graphics 4000 (Laptop)
- Windows XP 32 bit (could only test 4.0 stable on this one). AMD Athlon II X3, 4 GB RAM, GeForce 8800GT
The following Dolphin settings were used:
Hyrule Field Speed Hack, No Dual Core, No Idle Skipping, No Cheats, LLE Audio, Direct3D Renderer (usual settings for TASing)
Is there any other relevant information? (e.g. logs, screenshots,
configuration files)
This issue has plaguing me for some time now across different PCs and Dolphin versions. I'm pretty sure most others aren't affected as my friends from the speedrunning community TAS just fine using these builds and, from my knowledge, never encounter these freezes, so I'm at a loss.
With my limited coding abilities I was able to deduce that it might be caused by a threading issue when you savestate while the function GetPadStatus() in SI_DeviceGCController.cpp is calling the TAS input window to update its status of the various virtual buttons/control sticks.
With a rather dirty hack that delays the savestate operation until the GetPadStatus() function is nearly finished DID fix the freeze completely, but introduced nasty side-effects such as the controller occasionally stopping to update/respond at all once you load/save a state making it impossible to control the game.
Fixing the source of the problem seems more helpful, but there my knowledge unfortunately ends. Hopefully this will help a bit to track the issue down.
Thanks in advance and I wish the awesome Dolphin team a wonderful weekend :)
Updated by Fog over 9 years ago
Does the same thing occur if you do it without the TAS window open?
Updated by JMC4789 over 9 years ago
Please get a core-dump from a crash in latest master. Download the latest build, get the crash to happen. Open task manager, processes, find Dolphin.exe, right click it. There should be an option like "Core Dump" or something. Copy the directory it says so you know where it's at. Compress that file, make note of what build it was created from, and then upload it somewhere so someone can download it and trace down the cause of the crash.
Updated by Mafia1300 over 9 years ago
I can't, it says "Waiting for writing of process into that file."
and no it doesn't occurs if I do it without TAS input opened
Updated by Mafia1300 over 9 years ago
wait, finally got one, just had to wait
https://www.wetransfer.com/downloads/06041d4f37a8be7a59b388653118f3ac20150627184745/c3eed2b88f817bf0301865358393b30020150627184745/5ab309
Updated by marwinmisselhorn over 9 years ago
I'm on a German Windows, but the equivalent function as far as I understand generated a 800 MB large DMP file. Hopefully that's the one you are looking for: https://mega.co.nz/#!NEcADBwQ!YBv_s7u7A0SQKprtWpaOEMcPgG0f9aWsJCPnagFelIs
Build 4.0-6891 was used for this. Also when I debug Dolphin it does not seem to crash, merely it gets stuck somewhere and does not continue on.
@chris
Never. It only occurs as soon as the TAS input window is opened. Otherwise it won't happen at all. I assume this is because the GetValues() function of the TAS input window immediately returns if it is not shown.
Updated by marwinmisselhorn over 9 years ago
It seems like Dolphin tries to lock the CPU thread for the savestate operation, but can't do so cause the TAS input window is still waiting for a message to be answered (getting the slider values) lol? Sounds like an interesting confliction to me, so hopefully that means it can be fixed :D
Updated by Mafia1300 over 9 years ago
Thanks for posting the dump, now we'll see how it turns out! :D
Updated by marwinmisselhorn over 9 years ago
Changing both "m_l_cont.slider->GetValue()" to "m_l_cont.value" in TASInputDlg.cpp line 779/780 fixes this issue completely. Hopefully someone can merge this into the master :)
Updated by Fog over 9 years ago
https://github.com/dolphin-emu/dolphin/pull/2696
can you test this?
Updated by Mafia1300 over 9 years ago
I tested this from Fog, and yeah, it works completely, thanks Fog! :)
Updated by JMC4789 over 9 years ago
- Status changed from New to Fixed
Fixed by 4.0-6940 -> https://dolphin-emu.org/download/dev/eb3c5a240f2510102d152baa53e7adf3099eebc1/