ladxhd / projectz

HD Semi-Emu for Link's Awakening DX
29 stars 7 forks source link

End-of-dungeon instrument softlock #1

Open squiddingme opened 6 months ago

squiddingme commented 6 months ago

Description

Many players report a softlock during the cutscene when an instrument is collected: the cutscene plays out, but the last step where the player is teleported out of the dungeon never happens. The issue is sporadic, and seems to be the big showstopper for a lot of players, as they've had to edit their save files to be able to make progress.

squiddingme commented 6 months ago

I can't reproduce the issue on my system at all, but my current theory: the instrument cutscene checks that the GBS player has finished playing music using a hardcoded stop time value to determine when it should continue. I suspect that, since the GBS player runs on another thread, the softlock is caused by a race condition where the GBS player simply never reports that it's finished, so the cutscene can't continue.

jamescastells commented 6 months ago

Yes, this is the most common softlock that players have reported. If you need help reproducing it I can help.

StuckInLimbo commented 6 months ago

I can't reproduce the issue on my system at all, but my current theory: the instrument cutscene checks that the GBS player has finished playing music using a hardcoded stop time value to determine when it should continue. I suspect that, since the GBS player runs on another thread, the softlock is caused by a race condition where the GBS player simply never reports that it's finished, so the cutscene can't continue.

Could be a framerate dependent race condition, I think I have an inkling as to what code is potentially causes this. The music engine puts a lock on sound objects, which may never get unlocked.

squiddingme commented 6 months ago

Should be closed by #12 but I can't actually verify on my system.

StuckInLimbo commented 6 months ago

I'll attempt to verify the bug fix on a few different devices of varying power, see if that has any effect