defold-fmod icon indicating copy to clipboard operation
defold-fmod copied to clipboard

Defold project doesnt load when building for HTML5 when using fmod

Open hayeduce opened this issue 1 year ago • 18 comments
trafficstars

image

This error is shown in console when the fmod dependecy is added to the project. I was told it could be caused by fmod not working with the latest Emscripten?

hayeduce avatar Jun 18 '24 10:06 hayeduce

I have same exact issue. Here`s my minimal reproducible example

ASM_CONST[code] = undefined

Kaiqgs avatar Jun 22 '24 18:06 Kaiqgs

Same here :-( The only solution I found so far is going back to Defolds version 1.7.0. Then, HTML5 builds work, with fmod added to the project. However, the Defold version is quite outdated. @dapetcu21, do you have any plans to dig deeper into this problem? Or do you have any ideas what might cause these errors? Mb i could dive into this if I find the time.

0xbeefbeef avatar Aug 20 '24 12:08 0xbeefbeef

Hi! It's most likely because the fmod library (provided by the fmod devs) is compiled for a older version of the emscripten ABI. Defold updated its emscripten version and the old lib probably doesn't work anymore.

The solution is an overall update of the fmod lib. Unfortunately life got in the way and I really didn't have the bandwidth to do the maintenance work. It's still on my list though.

dapetcu21 avatar Aug 28 '24 09:08 dapetcu21

Hi Marius, totally understand that you don't find the time for this. I will be patient and stick with the older Defold version at first. I would offer to help, but to be honest, I never did anything with emscripten at all neither do I have an idea where to start. Unfortunately. Anyway, thanks for your work so far on this project!

0xbeefbeef avatar Aug 28 '24 13:08 0xbeefbeef

I suggest the guys who need this to put up a cash bounty in the forum, you each can pitch in some $ and then give it to the person who makes a satisfactory update.

subsoap avatar Aug 31 '24 19:08 subsoap

@dapetcu21 Hey Marius, I'm interested in tackling this issue, can you help me? Are you sure it's Fmod's library Empscripten version?

here they mention it can be manually built to any Emscripten version

FMOD's ASM.JS and WASM builds are supplied, but to build from LLVM bitcode (.bc) to any target (and compatible Emscripten version) for FMOD, use the following command line.

I'm running linux ubuntu, without docker. I've built html5 defold-fmod with same Emscripten version as Defold's (3.1.55) in the environment. How can I proceed with resulting *.bc files or use the bundled libfmodbridge.a. I'm also trying to generate a studio lib archive, but I don't have a mac to run update or build scripts. My goal is to make a final fmodstudioapi for any fmod version, but latest Emscripten.


@subsoap Do you know of any bounty platform that rewards based in merges of PR for given task, something like that? I would like to start a bounty, but do not want to manage anyone's "investment/donation" money.

Kaiqgs avatar Sep 04 '24 11:09 Kaiqgs

@dapetcu21 random question, Defold's html5 uses lua 5.1, can you anticipate any issues from the luajit used in this repo?

Kaiqgs avatar Sep 04 '24 11:09 Kaiqgs

Hi! I'm not sure this was the case when last the library was updated. I think fmod bytecode distributions came at a later point.

I don't remember having compiled the bytecode into a library myself. You can check if there's a bytecode distribution for the version of fmod the library currently uses, if that's the case, it should be easier. You don't need to do a version upgrade, just compile that particular version from bytecode.

As for luajit headers being used for emscripten: Good catch! This could be solved with an ifdef, but I don't think the luajit and lua5.1 headers are significantly different enough in practice for it to cause issues.

dapetcu21 avatar Sep 04 '24 11:09 dapetcu21

Updating here, Fmod bytecode is "fastcomp" and that is deprecated tech. Emscripten removed fastcomp support around version 2.0 if I recall correctly. So I ask them(fmod) help on a similar thread on their forum.

https://qa.fmod.com/t/compiling-bitcode-to-wasm-html5/21141

Downgrading Defold broke my project, so Ill look for ways to upgrade fmod eventually, even though they don't have Emscripten 3.5(it's 2.0) on latest FMOD versions, so I'm afraid not even that could solve it.

Kaiqgs avatar Sep 06 '24 23:09 Kaiqgs

Hi everyone, I have just seen that the latest FMOD version (2.02.25) was built with Emscripten 3.1.67. FMOD Forum FMOD Revision history

This is good news, right? But how to proceed with that info? I would be happy to help, but to be honest, I don't know where to start. Any ideas?

0xbeefbeef avatar Nov 21 '24 19:11 0xbeefbeef

Hey @britzl would you know if the Defold foundation have any plans of starting to own this FMOD bindings?

@0xbeefbeef have you checked if OPENAL could replace your FMOD use case? https://github.com/Lerg/extension-openal

Kaiqgs avatar Dec 09 '24 12:12 Kaiqgs

@Kaiqgs: As far as I understand, OPENAL is not designed for adaptive audio as FMOD, which provides horizontal and vertical sequencing that can directly be controlled from the game. It would be really great if FMOD could be revived in the Defold world.

0xbeefbeef avatar Dec 09 '24 14:12 0xbeefbeef

if the Defold foundation have any plans of starting to own this FMOD bindings?

Yes we do have plans. I can't say exactly when, but hopefully fairly soon.

britzl avatar Dec 09 '24 14:12 britzl

That would be awesome 😀

0xbeefbeef avatar Dec 09 '24 15:12 0xbeefbeef

if the Defold foundation have any plans of starting to own this FMOD bindings?

Yes we do have plans. I can't say exactly when, but hopefully fairly soon.

@britzl Bjoern, are they any news on this topic? It would be so cool having Defold support adaptive audio in some way. OPENAL is great for some purpose, but making kind of adaptive, synchronized music is, as far as I know, unfortunately not possible right now (with recent Defold versions and HTML5). I would be happy if you could share your thoughts and maybe status of this topic :-)

0xbeefbeef avatar May 22 '25 07:05 0xbeefbeef

Hey guys @0xbeefbeef, @hayeduce , you might want to consider checking out the updated extension https://github.com/defold/extension-fmod/releases/tag/v0.1.0-alpha

Kaiqgs avatar Oct 26 '25 00:10 Kaiqgs

Hey guys @0xbeefbeef, @hayeduce , you might want to consider checking out the updated extension https://github.com/defold/extension-fmod/releases/tag/v0.1.0-alpha

Awesome, will do!

hayeduce avatar Oct 27 '25 18:10 hayeduce

Hey guys @0xbeefbeef, @hayeduce , you might want to consider checking out the updated extension https://github.com/defold/extension-fmod/releases/tag/v0.1.0-alpha

Great news, will check it out! Thanks!

0xbeefbeef avatar Nov 02 '25 16:11 0xbeefbeef