utopia-rise / fmod-gdextension

FMOD Studio GDExtension bindings for the Godot game engine
MIT License
485 stars 52 forks source link

FMod with Godot 3.5 on Linux & Windows - no audio in exported game #134

Open loteque opened 2 years ago

loteque commented 2 years ago

Discussed in https://github.com/utopia-rise/fmod-gdnative/discussions/133

Originally posted by **loteque** August 30, 2022 Godot 3.5 on Linux, fmod-gdnative plugin works in the editor. I can hear the sounds when I test the game through the Godot editor. When I export the game it has no sound. Any help much appreciated. Update: Just tested on windows and it is the same result. banks work in the editor but no sound on export.
piiertho commented 2 years ago

Did you added bank and sound files to exported resources in your export settings ? A log would be easier to understand what’s happening.

BTW, it makes me think we can maybe make an export plugin in order to make export of banks automatic.

loteque commented 2 years ago

I'm just headed to sleep. I will get a log when I wake up. I did added the file extensions in export settings. I am helping someone with their sound and I would guess they did not include the sound files anywhere in the "res://" path, and only included banks. I will check on all this when I wake up. thank you for the reply. I am new to fmod so everything helps.

loteque commented 2 years ago

Ok - here is the logfile: It looks like it isn't finding the fmod api module?

Screenshot from 2022-08-30 19-44-28 Screenshot from 2022-08-30 19-24-53

Godot Engine v3.5.stable.official.991bb6ac7 - https://godotengine.org OpenGL ES 3.0 Renderer: NVIDIA GeForce GTX 970/PCIe/SSE2 Async. shader compilation: OFF

ERROR: Can't open dynamic library: addons/fmod/libs/linux/libGodotFmod.linux.release.64.so. Error: libfmod.so.13: cannot open shared object file: No such file or directory at: open_dynamic_library (drivers/unix/os_unix.cpp:412) - Condition "!p_library_handle" is true. Returned: ERR_CANT_OPEN ERROR: No valid library handle, can't get symbol from GDNative object at: get_symbol (modules/gdnative/gdnative.cpp:510) - No valid library handle, can't get symbol from GDNative object ERROR: No nativescript_init in "res://addons/fmod/libs/linux/libGodotFmod.linux.release.64.so" found at: init_library (modules/gdnative/nativescript/nativescript.cpp:1503) - No nativescript_init in "res://addons/fmod/libs/linux/libGodotFmod.linux.release.64.so" found SCRIPT ERROR: Attempt to call function 'new' in base 'NativeScript' on a null instance. at: _init (res://addons/fmod/Fmod.gdc:123) - Attempt to call function 'new' in base 'NativeScript' on a null instance. ERROR: (Node not found: "CanvasLayer/ColorRect/GodotSplashScreen/AnimationPlayer" (relative to "/root/BumperScene").) at: get_node (scene/main/node.cpp:1465) - Method failed. Returning: nullptr ERROR: On Animation: 'Scene', couldn't resolve track: 'CanvasLayer/ColorRect/GodotSplashScreen/AnimationPlayer'. at: _ensure_node_caches (scene/animation/animation_player.cpp:251) - Condition "!child" is true. Continuing. ERROR: (Node not found: "CanvasLayer/ColorRect/GodotSplashScreen:visible" (relative to "/root/BumperScene").) at: get_node (scene/main/node.cpp:1465) - Method failed. Returning: nullptr ERROR: On Animation: 'Scene', couldn't resolve track: 'CanvasLayer/ColorRect/GodotSplashScreen:visible'. at: _ensure_node_caches (scene/animation/animation_player.cpp:251) - Condition "!child" is true. Continuing. WARNING: Octahedral compression cannot be used to compress a zero-length vector, please use normalized normal values or disable octahedral compression at: norm_to_oct (servers/visual_server.cpp:346) - Octahedral compression cannot be used to compress a zero-length vector, please use normalized normal values or disable octahedral compression WARNING: World already has an environment (Another WorldEnvironment?), overriding. at: _notification (scene/3d/world_environment.cpp:38) - World already has an environment (Another WorldEnvironment?), overriding. WARNING: World already has an environment (Another WorldEnvironment?), overriding. at: _notification (scene/3d/world_environment.cpp:38) - World already has an environment (Another WorldEnvironment?), overriding. SCRIPT ERROR: Invalid call. Nonexistent function 'set_software_format' in base 'Nil'. at: set_software_format (res://addons/fmod/Fmod.gdc:156) - Invalid call. Nonexistent function 'set_software_format' in base 'Nil'. SCRIPT ERROR: Invalid call. Nonexistent function 'init' in base 'Nil'. at: init (res://addons/fmod/Fmod.gdc:143) - Invalid call. Nonexistent function 'init' in base 'Nil'. SCRIPT ERROR: Invalid call. Nonexistent function 'load_bank' in base 'Nil'. at: load_bank (res://addons/fmod/Fmod.gdc:259) - Invalid call. Nonexistent function 'load_bank' in base 'Nil'. SCRIPT ERROR: Invalid call. Nonexistent function 'load_bank' in base 'Nil'. at: load_bank (res://addons/fmod/Fmod.gdc:259) - Invalid call. Nonexistent function 'load_bank' in base 'Nil'. SCRIPT ERROR: Invalid call. Nonexistent function 'load_bank' in base 'Nil'. at: load_bank (res://addons/fmod/Fmod.gdc:259) - Invalid call. Nonexistent function 'load_bank' in base 'Nil'. SCRIPT ERROR: Invalid call. Nonexistent function 'load_bank' in base 'Nil'. at: load_bank (res://addons/fmod/Fmod.gdc:259) - Invalid call. Nonexistent function 'load_bank' in base 'Nil'. SCRIPT ERROR: Invalid call. Nonexistent function 'load_bank' in base 'Nil'. at: load_bank (res://addons/fmod/Fmod.gdc:259) - Invalid call. Nonexistent function 'load_bank' in base 'Nil'. SCRIPT ERROR: Invalid call. Nonexistent function 'add_listener' in base 'Nil'. at: add_listener (res://addons/fmod/Fmod.gdc:218) - Invalid call. Nonexistent function 'add_listener' in base 'Nil'. SCRIPT ERROR: Invalid call. Nonexistent function 'create_event_instance' in base 'Nil'. at: create_event_instance (res://addons/fmod/Fmod.gdc:299) - Invalid call. Nonexistent function 'create_event_instance' in base 'Nil'. SCRIPT ERROR: Invalid type in function 'start_event' in base 'Node (Fmod.gd)'. Cannot convert argument 1 from Nil to int. at: arnold_start_battle_vo_call (res://src/Main.gdc:23) - Invalid type in function 'start_event' in base 'Node (Fmod.gd)'. Cannot convert argument 1 from Nil to int. SCRIPT ERROR: Invalid call. Nonexistent function 'create_event_instance' in base 'Nil'. at: create_event_instance (res://addons/fmod/Fmod.gdc:299) - Invalid call. Nonexistent function 'create_event_instance' in base 'Nil'. SCRIPT ERROR: Invalid type in function 'start_event' in base 'Node (Fmod.gd)'. Cannot convert argument 1 from Nil to int. at: arnold_anticipate_vo_call (res://src/player/PlayerTemplate.gdc:266) - Invalid type in function 'start_event' in base 'Node (Fmod.gd)'. Cannot convert argument 1 from Nil to int. WARNING: 'Navigation' node and 'Navigation.get_simple_path()' are deprecated and will be removed in a future version. Use 'NavigationServer.map_get_path()' instead. at: get_simple_path (scene/3d/navigation.cpp:36) - This method has been deprecated and will be removed in the future. SCRIPT ERROR: Invalid call. Nonexistent function 'create_event_instance' in base 'Nil'. at: create_event_instance (res://addons/fmod/Fmod.gdc:299) - Invalid call. Nonexistent function 'create_event_instance' in base 'Nil'. SCRIPT ERROR: Invalid type in function 'start_event' in base 'Node (Fmod.gd)'. Cannot convert argument 1 from Nil to int. at: punch_audio_call (res://src/player/PlayerTemplate.gdc:247) - Invalid type in function 'start_event' in base 'Node (Fmod.gd)'. Cannot convert argument 1 from Nil to int. SCRIPT ERROR: Invalid call. Nonexistent function 'create_event_instance' in base 'Nil'. at: create_event_instance (res://addons/fmod/Fmod.gdc:299) - Invalid call. Nonexistent function 'create_event_instance' in base 'Nil'. SCRIPT ERROR: Invalid type in function 'start_event' in base 'Node (Fmod.gd)'. Cannot convert argument 1 from Nil to int. at: arnold_anticipate_vo_call (res://src/player/PlayerTemplate.gdc:266) - Invalid type in function 'start_event' in base 'Node (Fmod.gd)'. Cannot convert argument 1 from Nil to int. SCRIPT ERROR: Invalid call. Nonexistent function 'create_event_instance' in base 'Nil'. at: create_event_instance (res://addons/fmod/Fmod.gdc:299) - Invalid call. Nonexistent function 'create_event_instance' in base 'Nil'. SCRIPT ERROR: Invalid type in function 'start_event' in base 'Node (Fmod.gd)'. Cannot convert argument 1 from Nil to int. at: punch_audio_call (res://src/player/PlayerTemplate.gdc:247) - Invalid type in function 'start_event' in base 'Node (Fmod.gd)'. Cannot convert argument 1 from Nil to int. SCRIPT ERROR: Invalid call. Nonexistent function 'create_event_instance' in base 'Nil'. at: create_event_instance (res://addons/fmod/Fmod.gdc:299) - Invalid call. Nonexistent function 'create_event_instance' in base 'Nil'. SCRIPT ERROR: Invalid type in function 'start_event' in base 'Node (Fmod.gd)'. Cannot convert argument 1 from Nil to int. at: arnold_anticipate_vo_call (res://src/player/PlayerTemplate.gdc:266) - Invalid type in function 'start_event' in base 'Node (Fmod.gd)'. Cannot convert argument 1 from Nil to int. SCRIPT ERROR: Invalid call. Nonexistent function 'create_event_instance' in base 'Nil'. at: create_event_instance (res://addons/fmod/Fmod.gdc:299) - Invalid call. Nonexistent function 'create_event_instance' in base 'Nil'. SCRIPT ERROR: Invalid type in function 'start_event' in base 'Node (Fmod.gd)'. Cannot convert argument 1 from Nil to int. at: punch_audio_call (res://src/player/PlayerTemplate.gdc:247) - Invalid type in function 'start_event' in base 'Node (Fmod.gd)'. Cannot convert argument 1 from Nil to int. SCRIPT ERROR: Invalid call. Nonexistent function 'create_event_instance' in base 'Nil'. at: create_event_instance (res://addons/fmod/Fmod.gdc:299) - Invalid call. Nonexistent function 'create_event_instance' in base 'Nil'. SCRIPT ERROR: Invalid type in function 'start_event' in base 'Node (Fmod.gd)'. Cannot convert argument 1 from Nil to int. at: sfx_call (res://src/issac/issac.gdc:212) - Invalid type in function 'start_event' in base 'Node (Fmod.gd)'. Cannot convert argument 1 from Nil to int. SCRIPT ERROR: Invalid call. Nonexistent function 'free' in base 'Nil'. at: _notification (res://addons/fmod/Fmod.gdc:134) - Invalid call. Nonexistent function 'free' in base 'Nil'. ERROR: No valid library handle, can't terminate GDNative object at: terminate (modules/gdnative/gdnative.cpp:417) - No valid library handle, can't terminate GDNative object

piiertho commented 2 years ago

This seems so. What I find weird is that normally there’s no need for files ending with .13. Can you check what libraries you have in export ?

piiertho commented 2 years ago

Btw: here you can find discord link, https://github.com/utopia-rise/fmod-gdnative/pull/130/files So that we can discuss easily.

loteque commented 2 years ago

image

loteque commented 2 years ago

Yeah I am not sure what the .13 extension is about either. Also caused an issue when I was setting up the plugin.

piiertho commented 2 years ago

Can you try to copy the .13 files in the export directory ?

loteque commented 2 years ago

Do I need to reexport, after copying?

piiertho commented 2 years ago

No, no need

loteque commented 2 years ago

ok I replaced all the fmod-api modules in export directory with the modules from the plugin directory and fmod managed audio works. Modules copied over from addons into the export directory: libfmod.so libfmod.so.13 libfmodstidio.so libfmodstidio.so.13

piiertho commented 2 years ago

Ok seems that’s a bug from long time. We assumed it was working like on other os, but that’s not.
I found an explanation here.
We need to add versioned libraries as well in gdnlib file.
Thanks for the bug report.

loteque commented 2 years ago

I updated the QA discussion board with the immediate workaround.

piiertho commented 2 years ago

Btw, what was the problem on windows ?

loteque commented 2 years ago

I have not tested windows yet. When I do I will report back.

loteque commented 2 years ago

Windows seems fine. As far as I can tell the audio person just didn't include the audio assets in the project path. Once I copied the assets over the build works.

GeorgeLGFreitas commented 1 year ago

I'm experiencing the same problem but on Windows. Everything works correctly in the editor, but when I try to export, FMOD stops working, even in the demo provided in the repository.

CedNaru commented 1 year ago

Hello. Are you sure you are not forgetting to properly export the banks files ? They are not exported by default by Godot, so you have to add them manually in the export menu. The code shouldn't behave differently being a debug or release build and so far most sound issues reported were because of a faulty export. Otherwise without more information, it will be hard to figure out the issue. Can you check if your exported game contains the bank files (and not the project itself)?