Player: D銇啋闄衡叇: Hang after investigating the grave

Created on 5 Apr 2020  路  3Comments  路  Source: EasyRPG/Player

Name of the game:

D銇啋闄衡叇

https://viprpgkohaku2016.wixsite.com/kohaku2016/no-20
Direct DL link

Attach files (as a .zip archive or link them)

Save07.zip

Describe the issue in detail and how to reproduce it:

Investigate the grave directly above you. It fades to a scene where it says "Chapter 8" and then it hangs with "Event 2 reached execution limit"

Good news: Not a regression. Hangs in 0.5.4 and newer

EvenInterpreter Hang MIDI Patch available

All 3 comments

Same as #1733 : Needs proper MIDI Ticks support

This game only uses a ">=" measurement to decide if enough time has past. So implementing a not precise version of midi ticks would be enough to fix it. I was already able to implement a sloppy version of GetTicks for fmmidi. In my test it has around the same value as harmony, with an error of +-100. Will also try to get it working for Wildmidi.

There is another more interesting bug here: I'm lucky that I used SdlAudio instead of SdlMixerAudio otherwise wouldn't have noticed it:

The game quickly does 2 "BgmPlay" event calls after each other. Somehow the 2nd BgmPlay event is lost. When BgmStop is called we synchronize on a mutex with SDL_Lock/UnlockAudio and wait until it is safe to delete the bgm decoder.
It seems SDL_Lock/Unlock doesn't behave really like a mutex (maybe allows multiple locks?): It doesn't wait on the Lock, the Bgm is not destroyed and BgmPlay fails because there is no free channel and the Midi never starts playback.

tl;dr: std::mutex fixes this.

The observation was incorrect, SDL_Lock/UnlockAudio works as expected. Was another bug in the code.

Was this page helpful?
0 / 5 - 0 ratings