libretro / gpsp

gpSP for libretro.
GNU General Public License v2.0
52 stars 52 forks source link

Erratic Behavior // Significant Issues with Save States #150

Closed MarioKartFan closed 2 years ago

MarioKartFan commented 3 years ago

Testing the latest nightlies on my N3DS, I have found save states with the GPSP are erratic at best. Sometimes they save and load flawlessly. Other times they load, but with a loss of user control. Other times they load, but with a loss of all sound. Still other times they crash with a fatal system error, requiring a reboot.

All other cores seem to have working save state support without these issues. I do not know whether these issues occurred prior to the PR that reworked save states on the 3DS.

davidgfnet commented 3 years ago

Can you provide some feedback on what kind of game you were playing? I haven't tested this as much but I'd need some reproducible games to test this.

MarioKartFan commented 3 years ago

Sure. It happened in (1) Super Mario Advance 4 and (2) Super Mario Advance 2.

On Sun, Sep 12, 2021 at 4:51 PM David G. F. @.***> wrote:

Can you provide some feedback on what kind of game you were playing? I haven't tested this as much but I'd need some reproducible games to test this.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/libretro/gpsp/issues/150#issuecomment-917651248, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJ2E6F5NR6DRXX6MS3VSLE3UBS5ABANCNFSM5D35YPQQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

davidgfnet commented 3 years ago

Could you perhaps provide the ROM hashes, which bios you use (official or built-in) and perhaps a few savestates (both working and nonworking)? So when the savestate load fails with the described behaviour, does it work if you reboot the system and try to load it again? I'm trying to understand whether the problem is loading the state or saving the state (ie. the saved state is broken somehow).

davidgfnet commented 3 years ago

Hey there! Would be great if you could provide a savestate that doesnt work for me to test locally :) I tried to reproduce the issue on an ARM device (I do not own a 3DS) and I could not. Thanks!

bulzipke commented 3 years ago

The same problem has occurred to me.

I ran it with the following rom. https://www.advanscene.com/html/Releases/dbrelpure.php?id=0167 MD5 5fe47355a33e3fabec2a1607af88a404

1. Load the contents.
2. Save-states with hot-key.
3. Sound is being output normally.
4. Load-states with hot-key.
5. Sound is not output.
1. Load the contents.
2. Load-states with hot-key.
3. Sound is not output.

The link to the states I made is as follows. https://cloud.bulzipke.com/s/37MzDGRmTsWaB3m/download

ShroomKing commented 3 years ago

This happens on PSVita too, no system crashes but sound always stops working when you load a state.

Sometimes the state will be broken and when you load it the game freezes/graphics disappear/etc. (Restarting does not help, the state stays broken. So i guess the problem is saving the state)

I also tested this on an iPhone but no problems there so i guess this doesn't affect arm64 only armv7 and below?

Tested tons of games and it happens in every single one of them, builtin bios or original makes no difference.

davidgfnet commented 3 years ago

Hey there, I inspected your savestate @bulzipke and you are using an older version of gpsp. This versions are known to have this bug, you should use builds after ~first week of september. This was tracked at issue #144 and was fixed. Can you please retest with a newer version? Also a suggestion/note that I think confuses a lot of people around Retroarch. In retroarch you have the main program (retroarch itself) and then a bunch of cores, each of them with their own version. However there are platforms known as "static builds" which include PSP, Vita, (N)3DS, PS2... etc. All the platforms that lack a proper OS (more or less) and cannot load shared libraries. In these platforms, you cannot combine RA + core, since they are built together, that means that you cannot update your core without updating RA, and vice versa. Hope this helps a bit to de-tangle these issues :)

bulzipke commented 3 years ago

I ran on the 3DS with the gpsp core of the retroarch 1.9.10 official release. The gpsp released in that version must not have been the latest build.

I just built it with 9abb3ef of gpsp and tested it on 3DS, and the same problem still occurs.

This is the state saved by the new build. https://cloud.bulzipke.com/s/XEEPXic2bPqR8xw/download

@davidgfnet Thank you always for your hard work :)

davidgfnet commented 3 years ago

I could just load the savestate you linked here on my PC. Could be some issue with Retroarch on 3DS though. Could you, just for sanity checking, try to load it on another device (that's not a 3DS I mean)? Unfortunately I have no 3DS myself, but I will ask some developers that have one, it might be something specific of the 3DS device.

bulzipke commented 3 years ago

I load save states created by 3DS from the PC (x64) and it was work well. After today's work, I will also test it on my Raspberry pi (arm).

bulzipke commented 3 years ago

I played the game using ludo with latest gpsp build in Raspberry pi. But I couldn't load my exists save-states. -> retro_unserialize failed

And I checked that save-states / load-states function is operating normally in Raspberry pi.

1. Load the contents.
2. Save-states with hot-key.
3. Sound is being output normally.
4. Load-states with hot-key.
5. Sound is being output normally.
bulzipke commented 2 years ago

@davidgfnet https://github.com/libretro/gpsp/commit/6a59c71d5516bfee3c2981f14dd5712b811f4ce1 solved the problem. Everything works well on 3DS.

Thank you!

davidgfnet commented 2 years ago

Got a few confirmations of the fix. Closing this then