libretro / RetroArch

Cross-platform, sophisticated frontend for the libretro API. Licensed GPLv3.
http://www.libretro.com
GNU General Public License v3.0
10.09k stars 1.81k forks source link

Netplay crash Retroarch when auto savestate is enabled #15248

Closed schmurtzm closed 8 months ago

schmurtzm commented 1 year ago

Description

Running a game and then starting a Netplay session often crash or freeze Retroarch if auto savestate is enabled.

Running RA, starting netplay first AND THEN launching a game works better but it's not the most common way : often players are loading their game from a list and then start their Netplay session.

This behavior is similar on linux ARM and Windows x86.

Expected behavior

Whatever the save state settings Retroarch should not crash when starting a Netplay session after the game is launched.

Actual behavior

Depending your RA configuration you can expect different behavior when launching a Netplay host session :

always working : savestate_auto_save = "false"

Working (sometime):

savestate_auto_save = "true"
savestate_file_compression = "true"
savestate_thumbnail_enable = "false"

Freeze :

savestate_auto_save = "true"
savestate_file_compression = "false"
savestate_thumbnail_enable = "true" 

Freeze :

savestate_auto_save = "true"
savestate_file_compression = "false"
savestate_thumbnail_enable = "false"

crash :

savestate_auto_save = "true"
savestate_file_compression = "true"
savestate_thumbnail_enable = "true"

Edit: Interesting fact : with same settings (all at "true"), it's not crashing if you run the Netplay host from command line, for example : retroarch -H -v -L /cores/picodrive_libretro.so "$1" But if you stop and restart the Netplay host session then it crash again.

Traces

Traces from WinDGB and Time Travel Debugging (TTD.exe) : https://we.tl/t-gmULG5l0iq

Steps to reproduce the bug

  1. choose a configuration with auto save states enabled
  2. launch a game
  3. start a netplay session

Version/Commit

RetroArch: [version/commit]

Environment information

schmurtzm commented 1 year ago

One direct consequence here : as you can see in this "Retro Game Corps" Netplay guide, the first thing that is done to use Netplay is to put the "Auto Save States" feature OFF, which is a shame for all the numerous users who are using auto-save state on handhelds.

https://youtu.be/QxrfblFXLTY?t=818

Johnnylokz commented 1 year ago

I just installed the latest beta update which now has a hotspot feature. I went ahead and disabled autosave function on both devices & the netplay feature will now connect both devices together thru LAN & hotspot but it does not recognize a second player during gameplay. I am playing "streets of rage 2" on genesis platform powered by picodrive.

schmurtzm commented 1 year ago

As long as this bug exists, the best option is to disable the autosave feature (although you'll miss this feature for your other traditional gaming sessions!).

About your gamepad problem it's not related to this issue. But to help : You just have to enable the second gampepad. It has been fixed in last Onion OS beta. How to do is also exposed in "Retro Game Corps" Netplay guide at 18:04.

schmurtzm commented 1 year ago

Traces from WinDGB and Time Travel Debugging added 🤞.