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

[BUG]: Loading a save state while video capture enabled causes a lock up #11940

Open
sestain opened this issue Oct 22, 2024 · 2 comments
Open
Labels

Comments

@sestain
Copy link
Contributor

sestain commented Oct 22, 2024

Describe the Bug

If video capture is on and save state is loaded emulator locks up, Qt interface still responds but all of the emulators functions halt.

Reproduction Steps

  1. Create a save state
  2. Start video capture
  3. Load the save state
  4. Enjoy halted emulation

Expected Behavior

Save state gets loaded and emulation continues as normal.

PCSX2 Revision

v2.1.217

Operating System

Windows 11

If Linux - Specify Distro

No response

CPU

Ryzen 9 7900X

GPU

RTX 2080 Ti

GS Settings

No response

Emulation Settings

No response

GS Window Screenshots

No response

Logs & Dumps

emulog.txt

@sestain sestain added the Bug label Oct 22, 2024
@Mrlinkwii
Copy link
Contributor

Can you find when this started to happen?

@F0bes
Copy link
Member

F0bes commented Oct 26, 2024

I can certainly reproduce it. I can't say for certain what the best fix would be.
I think an easy way to fix it would be to automatically stop capturing on savestate loads but we're so close to it not being an issue that I don't want to do that.

EDIT: Actually, this may be incorrect. It might be due to the acquisition of s_lock on both threads. Oops.

A summary of the issue is:
The core thread tries to wait for the GS capture thread to drain the audio buffer. In GSCapture::DeliverAudioPacket(const s16* frames) the s_frame_encoded_cv.wait(lock, []() {... portion.

The GS capture thread waits for a frame to be generated to encode. In GSCapture::EncoderThreadEntryPoint() the s_frame_ready_cv.wait(... line.

Because they are waiting for each other there is a deadlock.

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

No branches or pull requests

3 participants