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

Adventure map, there is a slowdown before the window opens in some places #8376

Open
2 tasks done
LeHerosInconnu opened this issue Feb 8, 2024 · 8 comments
Open
2 tasks done
Labels
audio Sound and music related stuff bug Something doesn't work

Comments

@LeHerosInconnu
Copy link

Preliminary checks

Platform

Windows

Describe the bug

Windows 7 SP1 - 64 bits

In fheroes2, there is a slowdown before the window opens in some places.
In fheroes2:

2024-02-08.12-43-54.mp4
2024-02-08.12-44-24.mp4

Save file

Here are the save files:
Before shrine 01.zip

Additional info

Windows 7 SP1 - 64 bits

@LeHerosInconnu LeHerosInconnu added the bug Something doesn't work label Feb 8, 2024
@oleg-derevenetz
Copy link
Collaborator

oleg-derevenetz commented Feb 8, 2024

Although I can't reproduce this problem on any of my devices, it seems to be due to the fact that for some reason the start of MP3/OGG/FLAC music effect playback on this PC is so slow that it causes a noticeable delay. What happens if you switch the music from External to MIDI in the game settings?

@LeHerosInconnu
Copy link
Author

Hello @oleg-derevenetz,

Although I can't reproduce this problem on any of my devices, it seems to be due to the fact that for some reason the start of MP3/OGG/FLAC music effect playback on this PC is so slow that it causes a noticeable delay. What happens if you switch the music from External to MIDI in the game settings?

The "Music Type" setting is set to "MIDI" with the default fheroes2 soundfonts, and there are no MP3/OGG/FLAC files present when the problem described was detected.

@zenseii
Copy link
Collaborator

zenseii commented Feb 8, 2024

Hello @oleg-derevenetz,

Although I can't reproduce this problem on any of my devices, it seems to be due to the fact that for some reason the start of MP3/OGG/FLAC music effect playback on this PC is so slow that it causes a noticeable delay. What happens if you switch the music from External to MIDI in the game settings?

The "Music Type" setting is set to "MIDI" with the default fheroes2 soundfonts, and there are no MP3/OGG/FLAC files present when the problem described was detected.

Hi @LeHerosInconnu. How about setting the volume to zero? I believe that should skip playing any sounds so that we can verify if that is the issue.

@oleg-derevenetz
Copy link
Collaborator

oleg-derevenetz commented Feb 8, 2024

How about setting the volume to zero? I believe that should skip playing any sounds so that we can verify if that is the issue.

IIRC WAV sound effects are played independently of audio effects volume settings (if volume is set to 0, they just play with volume 0). WAV playback itself is very cheap in comparison with MP3, not to mention MIDI.

@LeHerosInconnu
Copy link
Author

Hello @zenseii,

Hello @oleg-derevenetz,

Although I can't reproduce this problem on any of my devices, it seems to be due to the fact that for some reason the start of MP3/OGG/FLAC music effect playback on this PC is so slow that it causes a noticeable delay. What happens if you switch the music from External to MIDI in the game settings?

The "Music Type" setting is set to "MIDI" with the default fheroes2 soundfonts, and there are no MP3/OGG/FLAC files present when the problem described was detected.

Hi @LeHerosInconnu. How about setting the volume to zero? I believe that should skip playing any sounds so that we can verify if that is the issue.

I've turned all the settings to "off" and the problem can still be observed.

In fheroes2:

All audio off 01

@oleg-derevenetz
Copy link
Collaborator

oleg-derevenetz commented Feb 8, 2024

Probably WAV sound effects playback on this Windows 7 PC is now started with a noticeable delay for some reason, which is bad, because WAV playback is very cheap, it doesn't need soundfonts or any complex decoding, like compressed audio formats (MP3 etc). Probably #8375 is observed due to the same reason - WAV sounds of horse steps are started with delay and still not finished when animation is already finished. Don't know why, probably it's some SDL-related issue or maybe even OS-related. I can't reproduce this so far, but I don't have Windows 7.

@oleg-derevenetz
Copy link
Collaborator

Marking this as an audio-related issue but it's just a guess because I cannot reproduce this on my devices.

@LeHerosInconnu
Copy link
Author

LeHerosInconnu commented Feb 10, 2024

Hello @Branikolog,

Hi, @LeHerosInconnu Are you using MIDI? I believe this issue is valid only for MIDI sound, while for external music I cannot reproduce this problem.

Yes, MIDI is used when the problem is detected. I did a test with .ogg files in the MUSIC folder and "Music Type" set to "External" and the problem is no longer present. There must have been a change in MIDI management at some point.

Originally posted by @LeHerosInconnu in #8375 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
audio Sound and music related stuff bug Something doesn't work
Projects
None yet
Development

No branches or pull requests

3 participants