utopia-rise / fmod-gdextension

FMOD Studio GDExtension bindings for the Godot game engine
MIT License
439 stars 48 forks source link

Godot sometimes freezes when an Fmod event is created #158

Closed Tombomhom closed 6 months ago

Tombomhom commented 1 year ago

Hi,

We have been using fmod-gdnative for our game but sometimes the game will crash after triggering a sound. There's no real reason that we can discern, it just seems random. Have you experienced this before?

We even tried the demo out and the same problem occurred.

We added code to the FmodTest.gd script in the demo project to have the music event created and released quickly on repeat and there was no pattern to how long it took to crash.

This was the code we added:

func _ready(): genNew()

func genNew(): var id = Fmod.create_event_instance("event:/Music/Level 02") Fmod.start_event(id) Fmod.attach_instance_to_node(id, self) yield(get_tree().create_timer(0.3), "timeout") Fmod.detach_instance_from_node(id) Fmod.stop_event(id, Fmod.FMOD_STUDIO_STOP_IMMEDIATE) Fmod.release_event(id) genNew()

Is this a problem you have encountered before? Any help would be really appreciated!

We're using Godot Engine v3.5.2 and the FMOD API 2.02.09

CedNaru commented 1 year ago

Hello, that's not really a problem I am aware of. I have met a few issues that could happen when an instance is attached to an event and then the instance released before being detached, causing possibly some memory access error. But it seems your test is not releasing the instance anyway, so it can't be that. Can you provide the error you can when it crashes ?

Tombomhom commented 1 year ago

Thanks for getting back so quick.

There is no information in the debugging panel when it freezes unfortunately. The scene just freezes and in my applications panel (I'm on mac) it says it's not responding, so I have to force quit. My friend uses windows and gets the same problem so It's not a mac thing.

schweller commented 7 months ago

@Tombomhom did you ever figure this out? I'm having the same, as of today 😢

piiertho commented 7 months ago

@schweller you have it with Godot 4 ?

schweller commented 7 months ago

@piiertho no! Godot 3.5 and the extension version is 3.2.0

schweller commented 7 months ago

Downgrading to the version just previously released worked for me! If someone is also stuck.