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

Adding large WAV file causes freeze, looping Reimport #94718

Closed
Tracked by #76797
monk125 opened this issue Jul 25, 2024 · 2 comments · Fixed by #97711
Closed
Tracked by #76797

Adding large WAV file causes freeze, looping Reimport #94718

monk125 opened this issue Jul 25, 2024 · 2 comments · Fixed by #97711

Comments

@monk125
Copy link

monk125 commented Jul 25, 2024

Tested versions

Reproducible in 4.2.2.stable.official [15073af], 4.3.beta3.official [82cedc8]

System information

Godot v4.2.2.stable - Windows 10.0.19045 - Vulkan (Forward+) - dedicated NVIDIA GeForce GTX 1080 (NVIDIA; 32.0.15.6070) - Intel(R) Core(TM) i5-7600 CPU @ 3.50GHz (4 Threads)

Issue description

When adding WAV files of a certain size (>~10MB,) the editor will freeze on the "(Re)Importing Assets" dialog for 1-2 minutes. The import will fail, indicated by a X next to the file in the filesystem window. Attempting to do anything in the editor will cause Godot to attempt to import the file again, freezing again and failing to import again. This also makes it painful to remove the offending file from within the editor- technically possible, but much faster to force quit and delete from outside the editor.

I initially thought it was purely a filesize problem, but 2 of the 5 larger WAV files successfully imported, and quickly, without any freezes or notable delays. Both of those files were ~12MB. Reformatting the offending files to MP3 causes them to import correctly.

"How do you expect it to work instead?"

1- For the files to just import, or fail to import quickly and with a dialog explaining why
2- If the cause is predictable (e.g filesize) for a warning dialog to precede the import process
3- Once failed, for the editor to not constantly try to reimport the file so that it can be removed from the project from within the editor

Apologies if I've done any of this obviously wrong. Hi, I'm new here! Thanks for your time

Steps to reproduce

MRP is an empty project with just a WAV file that has failed to import. Opening the project should immediately make the editor attempt to import the file, causing the freeze.

Originally the MRP also included a larger WAV that successfully imported for comparison purposes, but that made the zip too big

Minimal reproduction project (MRP)

TestProject.zip

@AThousandShips
Copy link
Member

@EAinsley
Copy link
Contributor

EAinsley commented Sep 22, 2024

This is caused by ill-shaped .wav file.
mediainfo
The size in the header is much bigger than the actual size of the file. The importer loop on the size written in the header, and tries to extract all the data (that does not exist), causing long suspension.

The engine will not try to import it again after finished import (and failed) at least once.

There are four possible solutions:

  1. Check if the file size and the size in header before start. If mismatched, end the import process with err message. This might make the process less robust, and need will more testing.
  2. Check eof while reading, and end the import process once it reaches eof earlier than expected. This will include extra condition check and might have performance issue.
  3. Rewrite the header and try best to finish the import if size mismatched. Better add a dialog to ask the user if they want to rewrite the header. This is much more complex and will make this importer not consistent with the others.
  4. Pretend nothing happens and ignore the problematic header. Give a warning message and finish the import.

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

Successfully merging a pull request may close this issue.

3 participants