RPCS3 / rpcs3

PlayStation 3 emulator and debugger
https://rpcs3.net/
GNU General Public License v2.0
15.41k stars 1.92k forks source link

Sleeping and Waking the Steam Deck Freezes Emulation #12123

Closed IBNobody closed 2 years ago

IBNobody commented 2 years ago

Quick summary

Putting the Steam Deck to sleep and waking it up freezes emulation without the ability to recover.

As sleep mode is a defining feature of the Steam Deck, it makes RPCS3 unusable.

Details

Issue is related to #12106, but that issue was the symptom and not the cause. PR #12111 corrected that issue, but that led to another issue with a RSX semaphore timeout. I resolved that by setting Driver Recovery Timeout: 0, and now I have no further error messages to report.

Here is how I reproduce the error.

  1. I start the RPCS3 AppImage.
  2. I start PERSONA 5 [BLUS31604].
  3. I wait to get to the first in-game screen.
  4. I put the Steam Deck to sleep via the power button.
  5. I wake the Steam Deck via the power button.
  6. Emulaton is frozen.

Here is my log.

RPCS3.log

Here is my config with timeout set to 0.

config.yml.timeout.0.txt

5. Please provide your system configuration:

Steam Deck 512 GB

image

image

Megamouse commented 2 years ago

Flatpack is not supported. Please use the official releases

chaorace commented 2 years ago

Flatpack is not supported. Please use the official releases

I've deleted my reproduction report. Thank you for the work you do on this project.

IBNobody commented 2 years ago

Flatpack is not supported. Please use the official releases

I've deleted my reproduction report. Thank you for the work you do on this project.

If you grab the latest AppImage file, copy your .var/app/net.rpcs3.whatever/config folder to .config/rpcs3, and .var/app/net.rpcs3.whatever/cache folder to .cache/rpcs3, you can replicate the issue with the AppImage. I think EmuDeck might switch to the AppImage at one point, so it's good to know.

elad335 commented 2 years ago

Hello, try #12205.

pvconrad commented 2 years ago

Hello, try #12205.

Still freezes without any accompanying message in the log (with Driver Recovery Timeout: 0.) Do you need any additional logging turned on?

elad335 commented 2 years ago

Does it fix the timeout error though?

IBNobody commented 2 years ago

12205 is still is freezing (on P5). I tried both GCC and CLang compiled AppImages.

Here is my log.

RPCS3.log

Here is my config.

config.yml.txt

Does it fix the timeout error though?

It fixes the semaphore timeout error when I reverted the config to have a 1M timeout up from 0.

kd-11 commented 2 years ago

Non-zero value means time out after X period of time vs no timeout at all which is suspicious.

IBNobody commented 2 years ago

Non-zero value means time out after X period of time vs no timeout at all which is suspicious.

Zeroing out the timeout for driver recovery allowed the semaphores to not be bound by a timeout. However, that is not relevant any more here, because with #12205, there is no semaphore timeout from sleeping.

@elad335

I was wrong. It IS unfreezing, but it takes an awful long time to unfreeze. I had it unfreeze with your initial PR build and the newer PR build from earlier today.

I the following attempt with Persona 5 at 7m30s. I put the Deck to sleep on the Thieves Guild screen you get when you first load the game. The time I listed started when I pushed the Deck power button to wake the deck.

RPCS3.log

I attempted to repeat this trial, but I'm at 11 minutes without resuming. I even tried to pause and resume the emulation.

Other useful information: I did a trial where I slept/woke from the main title screen. Upon waking, I could hear the background music playing. It eventually stopped. The title screen resumed though.

So... We're getting there!

msarchioto commented 2 years ago

Happens the same for me on God of War II HD. I set the steam deck to sleep and it freezes every time I turn it on again. Do you need logs? How do I do that?

Skyrimer3d commented 2 years ago

Same thing here, anything we can do to fix this? Steam Deck is already the most used Linux computer on Steam, but with this issue RPCS3 it's nearly useless on a portable device, let us help you fix this please if we can do anything.

mysteriousHerb commented 2 years ago

still having this issue with dragon's crown till today

elad335 commented 2 years ago

Does turning off RPCS3's frame limiter affect this?

Thaurin commented 2 years ago

I tried pausing emulation before sleep (Persona 5) by binding Control-P to a back button. Didn't help, emulation is still freezing upon wake.

elad335 commented 2 years ago

I assume you tried what I suggested to try?

Thaurin commented 2 years ago

I assume you tried what I suggested to try?

Sorry, tried it now. Frame limit was on Auto, I set it to Off. Tried again at they Thieves Guild first screen, also used Pause just to be sure.

Wake up did unfreeze emulation this time, both with and without Pause! Trying in-game now.

This seems to be a solution!

elad335 commented 2 years ago

Thanks, Investigating.

Thaurin commented 2 years ago

Couldn’t get it to work with Demon’s Souls, though. Keeps freezing on wake up. Update: it unfroze, but it took a few minutes.

Also tried disabling Steam Deck’s built-in frame limiter, but that didn’t seem to make any difference. Wake up to in-game in Persona 5 confirmed also working with Frame Limit to Off.

elad335 commented 2 years ago

Test #12777 @Thaurin

Thaurin commented 2 years ago

Test #12777 @Thaurin

@elad335, tested the Clang AppImage from #12777 CD and sleep/wake appears to work on default settings (frame limit auto), in Steam Deck desktop mode, with Persona 5 Thieves Guild screen.

Can anyone else confirm?

elad335 commented 2 years ago

@Thaurin I've updated the pull request, can you retest?

Thaurin commented 2 years ago

@elad335 Retested rpcs3-v0.0.24-14233-ac8ef664_linux64.AppImage on Steam Deck desktop mode. Default settings, besides changing Pads configuration and changing Audio Out to FAudio (Cubeb is silent for me).

Tried Persona 5 Thieves Guild first screen and Demon's Souls character creation screen. Confirmed sleep/wakeup worked on both for me.

elad335 commented 2 years ago

Nice 👍

Thaurin commented 2 years ago

Would be nice to have confirmation from @IBNobody

Thaurin commented 2 years ago

Strangely, Demon's Souls now freezing upon sleep/wake. Don't know what could be different, I didn't change anything. Persona 5 still doing okay. Scratch that, works now. Investigating, maybe I just need sleep.

elad335 commented 2 years ago

@Thaurin Updated the pull request, this time I try to break the fix in order to fix it.

Thaurin commented 2 years ago

Waiting for CI/CD to finish. Demon's Souls seems to intermittently work or not work, I don''t know what causes it. I haven't seen this with Persona 5.

Thaurin commented 2 years ago

@elad335

Tried with rpcs3-v0.0.24-14234-98445ef4_linux64.AppImage, same config as above, didn't change anything.

Demon's Souls: first time hangs at Linking PPU modules (154/233). But second time completed this step but freezes on sleep/wake up. Persona 5: freezes on sleep/wake up.

Thaurin commented 2 years ago

Reverted to default config (thus no sound with Cubeb), same result.

IBNobody commented 2 years ago

Would be nice to have confirmation from @IBNobody

I've since uninstalled the original title in preparation for P5R's release later this month. You'll have to take others' word for it.