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

Defold project doesnt load when building for HTML5 when using fmod #32

Open
hayeduce opened this issue Jun 18, 2024 · 14 comments
Open

Defold project doesnt load when building for HTML5 when using fmod #32

hayeduce opened this issue Jun 18, 2024 · 14 comments

Comments

@hayeduce
Copy link

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?

@Kaiqgs
Copy link

Kaiqgs commented Jun 22, 2024

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

ASM_CONST[code] = undefined

@0xbeefbeef
Copy link

0xbeefbeef commented Aug 20, 2024

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.

@dapetcu21
Copy link
Owner

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.

@0xbeefbeef
Copy link

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!

@subsoap
Copy link

subsoap commented Aug 31, 2024

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.

@Kaiqgs
Copy link

Kaiqgs commented Sep 4, 2024

@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
Copy link

Kaiqgs commented Sep 4, 2024

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

@dapetcu21
Copy link
Owner

dapetcu21 commented Sep 4, 2024

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.

@Kaiqgs
Copy link

Kaiqgs commented Sep 6, 2024

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.

@0xbeefbeef
Copy link

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?

@Kaiqgs
Copy link

Kaiqgs commented Dec 9, 2024

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

@0xbeefbeef
Copy link

@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.

@britzl
Copy link

britzl commented Dec 9, 2024

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.

@0xbeefbeef
Copy link

That would be awesome 😀

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

No branches or pull requests

6 participants