Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Witch's Heart: Bad performance in Lime's minigame #1833

Closed
Ghabry opened this issue Jul 14, 2019 · 4 comments
Closed

Witch's Heart: Bad performance in Lime's minigame #1833

Ghabry opened this issue Jul 14, 2019 · 4 comments

Comments

@Ghabry
Copy link
Member

@Ghabry Ghabry commented Jul 14, 2019

Name of the game:

Witch's Heart (http://vgperson.com/games/witchheart.htm)

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

Save01.zip

Describe the issue in detail and how to reproduce it:

Enable the FPS counter.

Talk to Lime, and pay the 100 coins. Walk on one of the directional buttons, you will see a short hang and FPS drop. (best seen in debug build, goes down to 30 FPS here)

Thats a bug with the audio system, when using "--disable-audio" the lag is gone. Oh this maybe helps fixing the lag spikes in other games we never observed on PC, awesome.

@Ghabry

This comment has been minimized.

Copy link
Member Author

@Ghabry Ghabry commented Jul 14, 2019

SE files are completely decoded when being played and cached (the reason for this is to reduce CPU stress on slow systems, it e.g. solved stuttering when a game uses footstep sounds).
The problem here is basicly that the SE file played is very long, in that case we should fallback to streaming instead of caching I guess.
Determining when to stream instead of caching involved checking the length of the track which involves parsing the header as checking the filesize is misleading depending on the type of compression.

@Ghabry Ghabry added this to the 0.6.2 milestone Aug 15, 2019
@Ghabry

This comment has been minimized.

Copy link
Member Author

@Ghabry Ghabry commented Aug 20, 2019

Was just told this also happens in "charlotte first chase". I think I know where this is, pretty early in the game, but can't provide a savegame right now.

@fdelapena

This comment has been minimized.

Copy link
Contributor

@fdelapena fdelapena commented Sep 1, 2019

Same problem reported by Izzy at https://community.easyrpg.org/t/733
Also Pizus reported performance issues in his game (unreleased test case, available on request).

Probably does not affect, but apart of caching/streaming fixes I'd suggest to update SDL2 to the latest version, it uses OpenSL ES by default, and verify if we still need to use libsndfile, speexdsp and other libs with recent SDL2 versions or use it directly where possible.

@Ghabry

This comment has been minimized.

Copy link
Member Author

@Ghabry Ghabry commented Feb 20, 2020

I know where the problem is and at least for the audio systems that depend on GenericAudio I have a fix in the works.

Other performance observations:

  • Using the lowest quality for speexdsp is twice as fast compared to normal quality. By now I didn't hear a difference (guess the audio samples are already bad enough xD)
  • libsamplerate is much slower than speexdsp, should stick to speexdsp except when there is no other way (Aarch64).
Ghabry added a commit to Ghabry/easyrpg-player that referenced this issue Mar 30, 2020
… Otherwise there is a noticable lag when loading large samples for the first time.

With a cache hit the expensive IO operation is still prevented this way but this moves the CPU intensive part to the audio thread because it has to do the resampling now.

Fix EasyRPG#1833
Ghabry added a commit to Ghabry/easyrpg-player that referenced this issue Mar 30, 2020
… Otherwise there is a noticable lag when loading large samples for the first time.

With a cache hit the expensive IO operation is still prevented this way but this moves the CPU intensive part to the audio thread because it has to do the resampling now.

Fix EasyRPG#1833
Ghabry added a commit to Ghabry/easyrpg-player that referenced this issue Mar 31, 2020
… Otherwise there is a noticable lag when loading large samples for the first time.

With a cache hit the expensive IO operation is still prevented this way but this moves the CPU intensive part to the audio thread because it has to do the resampling now.

Fix EasyRPG#1833
Ghabry added a commit to Ghabry/easyrpg-player that referenced this issue Mar 31, 2020
… Otherwise there is a noticable lag when loading large samples for the first time.

With a cache hit the expensive IO operation is still prevented this way but this moves the CPU intensive part to the audio thread because it has to do the resampling now.

Fix EasyRPG#1833
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.