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

Crashing due to audio loop offset! #58313

Open
Tracked by #76797
QatariDev opened this issue Feb 19, 2022 · 8 comments
Open
Tracked by #76797

Crashing due to audio loop offset! #58313

QatariDev opened this issue Feb 19, 2022 · 8 comments

Comments

@QatariDev
Copy link

Godot version

3.4 Stable

System information

Windows 11, GLES2/3

Issue description

In Godot 3.4

When you import an audio file (MP3) and then test play it in the editor, it works normally, but when you update the loop offset and return to test, Godot crashes and closes itself without warning, and oddly, when you reopen the project again, you will find the updated loop offset as expected, and if you do it again, it will do the same!

This was tested on my machine, and at first I thought it was only related to a specific project or my machine, but I can confirm that my friend tried to reproduce the issue on his machine as well, though my machine is Windows 11 and his is Windows 10. Godot crashed and closed on both of us!

Steps to reproduce

  1. Open Godot 3.4

  2. Create new project

  3. Import MP3 Audio File

  4. Play the file in the editor

  5. Pause the audio

  6. Change the loop_offset

  7. Reimport

  8. Play it again

  9. Godot will crash and close itself.

Godot.Loop.Offset.Bug.mp4

Minimal reproduction project

No response

@Torguen
Copy link

Torguen commented Dec 1, 2022

This does not happen in:
v3.5.1.stable.official [6fed1ff]

In my tests ( Win 10 ) it works fine but I don't know if it can be related to the length of the track that is used in that demo video, I think it should have a demo project attached.

@Calinou
Copy link
Member

Calinou commented Jan 12, 2023

@QatariDev Can you (or anyone else) still reproduce this bug in Godot 3.5.1 or any later release?

If yes, please ensure that an up-to-date Minimal Reproduction Project (MRP) is included in this report (a MRP is a zipped Godot project with the minimal elements necessary to reliably trigger the bug). You can upload ZIP files in an issue comment with a drag and drop.

@Calinou Calinou modified the milestones: 3.5, 3.x Jan 12, 2023
@QatariDev
Copy link
Author

Hello,

Unfortunately, the problem continues in my case; I am running Windows 11.

The only point of difference was that it happened after only 5 or 6 attempts, as opposed to the 3.4 release.

Godot - Loop Offset Bug.zip

@Torguen
Copy link

Torguen commented Jan 13, 2023

v3.5.2.rc2.official [1a2bf3e] - win10 64

The track is very long, it is very heavy to do this test.
You will have to wait more than 5 minutes listening to the music for the problem to happen, if it happens at all.
In my case the loop occurred 4 times and no crash occurred.

In my case another crash occurred for the following reason.
I had Godot open with the track selected but it wasn't playing.
I edited the track from an external editor to make it shorter.
I save the track in original format mp3.
Godot crash I guess due to audio track editing.

Ultimately, with the track still reduced to 20 seconds in order to play the loop more times, the crash never occurred.

@QatariDev
Copy link
Author

Thanks for the clarification.

@POWERUPT
Copy link

Can confirm that this exists, and happened to me, and the song is only 85 seconds. I set the loop_offset to 1000 at first, thinking it was measured in samples, and thought that was due to the loop size as previous stated, but setting the number to 1 causes a crash as well. I am on v3.5.2.stable.official [170ba33], Windows 10. It crashes when I change the value, then interact with the preview widget.

1 minute and 30 seconds is not considered very long as far as music is concerned, and I think this issue should be investigated further because of this. For the meantime, WAV files don't cause such an issue, as I had just been using them before changing to the .ogg format due to space issues. I don't want to have to resort to adding literally over 100 MB to my game because I can't loop common compressed audio formats, but I'll look into wav compression in the meantime.

I know it would take a bit to get this into the stable release, but if someone finds a solution that can be compiled from source, please let me know because I'm releasing a demo build in less than a month and I would like it to be as optimized as possible.

Thanks! Included is a project where the same issues occurs.

Soundtest.zip

@POWERUPT
Copy link

Just an addendum for my past post: I did manage to get it working. It seems that you cannot interact with the preview right after you change the loop offset. In order, what I did to when it worked was:

  1. Change the loop offset, not touching the preview
  2. Open scene with said song and save.
  3. Playing the song worked fine in the game.
  4. After closing the test, previewing the song worked fine.

So it's not as major as I thought where you can't change the loop offset at all, you just can't preview it right then and there. It's still something that should definitely be fixed, but seems workable if you are willing to work with the jank. I recommend using an external program to find loop points before setting them, like wavosaur, audacity, or some equivalent.

TL;DR Hope this gets fixed, but in the meantime just don't preview the music right away: click into another scene or asset, then back and then it should work fine.

@Calinou
Copy link
Member

Calinou commented Apr 18, 2023

Note that this is likely fixed in 4.0 since the audio loop point system was rewritten there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants