grame-cncm / faust

Functional programming language for signal processing and sound synthesis
http://faust.grame.fr
Other
2.58k stars 322 forks source link

faust2wasm -emcc flag attempts to use missing webaudio-asm.cpp #465

Closed dxinteractive closed 4 years ago

dxinteractive commented 4 years ago

If I attempt to use the emscripten flag -emcc with faust2wasm, then faust2wasm attempts to use faust/webaudio/webaudio-asm.cpp (or webaudio-asm-poly.cpp if in poly mode), neither of which appear to exist in the latest stable release of the faust compiler (2.14.4), or on the master branch of the faust repo.

On my machine for instance I get this.

faust2wasm -emcc noteplayer.dsp

produces

Compiling with : -ftz 2
Compiled with 'emcc'
ERROR : can't open architecture file /usr/local/share/faust/webaudio/webaudio-asm.cpp

The contents of the *.dsp file do not matter in this case.

I only used the -emcc out of curiosity to see how it works, so if it continues to not work or is deprecated I do not mind personally but thought I'd better report it, if nothing else to see if I'm using it wrong.

dxinteractive commented 4 years ago

Hmm, there may be deeper issues (or unrelated issues). I've found that faust2wasm -worklet noteplayer.dsp doesn't produce a *.wasm file.

faust2wasm -worklet noteplayer.dsp

produces

Compiling with : -ftz 2
Compiled with 'wasm' backend in AudioWorklet mode
noteplayer.js, noteplayer-processor.js, testnoteplayer.html;

There doesn't seem to be a debug mode. I'll try a simpler *.dsp like the noise example.

sletz commented 4 years ago

faust2wasm work here:

faust2wasm -worklet noise.dsp 
Compiling with : -ftz 2
Compiled with 'wasm' backend in AudioWorklet mode
noise.js, noise-processor.js, noise.wasm;
sletz commented 4 years ago

-emccis indeed deprecated.

dxinteractive commented 4 years ago

Ok thanks, good to know, I'll ignore the -emcc flag.

Running the noise.dsp example I also don't get a .wasm file, but I found the issue. The faust2wasm script I'm running is doing a rm -f $name.wasm which removes the .wasm file after it's created, hence why I was not receiving it after the script completed. Up until now I was using the binaries from https://faust.grame.fr/downloads/index.html#macos "Latest pre-compiled binaries of the Faust compiler (Faust 2.14.4) for MaxOS (32/64 bits)". The code in that package has the behaviour I've been experiencing (Line 229, Faust-2.14.4/bin/faust2wasm)

Out of interest I've found the commit that at least removes that line. It means that 2.14.4 is older than I expected: https://github.com/grame-cncm/faust/commit/5bcfdfe76b2c6f37c7ccf5d5bae8ea3469517562#diff-a492dc53407c7f7534a492c808e44a78L223

Instead I cloned faust master branch from this repo and the issue is resolved.

Thanks for your help. Feel free to close, unless you'd like to repurpose this ticket to address the fact that this bug exists in the latest pre-compiled binary for OSX.