Project

General

Profile

Actions

Emulator Issues #8719

closed

Dolphin hard freezes while saving/loading savestates with the TAS input window open

Added by marwinmisselhorn almost 9 years ago.

Status:
Fixed
Priority:
Normal
Assignee:
-
% Done:

0%

Operating system:
N/A
Issue type:
Bug
Milestone:
Regression:
No
Relates to usability:
No
Relates to performance:
No
Easy:
No
Relates to maintainability:
No
Regression start:
Fixed in:

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?

  1. Start the game
  2. Open the TAS input window
  3. 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:

  1. Windows 7 64 bit. Intel i5, 4 GB RAM, Radeon HD 7970 (PC)
  2. Windows 8 64 bit. Intel i7, 4 GB RAM, Intel HD Graphics 4000 (Laptop)
  3. 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 :)


Related issues 1 (0 open1 closed)

Has duplicate Emulator - Emulator Issues #8722: Loading a savestate with TAS Input opened makes dolphin crashDuplicate

Actions
Actions #1

Updated by JMC4789 almost 9 years ago

Issue 8722 has been merged into this issue.

Actions #2

Updated by Fog almost 9 years ago

Does the same thing occur if you do it without the TAS window open?

Actions #3

Updated by JMC4789 almost 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.

Actions #4

Updated by Mafia1300 almost 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

Actions #6

Updated by marwinmisselhorn almost 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.

Actions #7

Updated by marwinmisselhorn almost 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

Actions #8

Updated by Mafia1300 almost 9 years ago

Thanks for posting the dump, now we'll see how it turns out! :D

Actions #9

Updated by marwinmisselhorn almost 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 :)

Actions #10

Updated by Fog almost 9 years ago

will get a PR out there ASAP

Actions #12

Updated by Mafia1300 almost 9 years ago

I tested this from Fog, and yeah, it works completely, thanks Fog! :)

Actions #13

Updated by Fog almost 9 years ago

PR has been merged

Actions #14

Updated by JMC4789 almost 9 years ago

  • Status changed from New to Fixed
Actions

Also available in: Atom PDF