Open serkkz opened 2 years ago
I recently removed these headers from emscripten in #17704. Can you try ./emsdk install tot
to confirm the fix?
I haven't found this file, but where will Emscripten find it if needed when building.
Part of the OpenAL codebase.
#include "alcmain.h"
#include "alconfig.h"
#include "albyte.h"
#include "almalloc.h"
#include "alnumeric.h"
#include "aloptional.h"
#include "alu.h"
#include "core/logging.h"
#include "ringbuffer.h"
#include "threads.h"
#include "vector.h"
#include <sys/soundcard.h>
We see this include, the question is very simple, what to use instead in Emscripten?
Emscripten contains a openAL implemention in JavaScript so you probably want to be using that instead of whatever version you are building that is designed to target linux. You should simply be able to include and AL/al.h
and use it.
It's not that simple, just yesterday I talked to an expert on compiling popular engines for the web. The essence of the problem is that game engines usually have their own bindings, which sometimes do not work with the OpenAL version of the library, which is Emscripten.
https://discourse.panda3d.org/t/using-the-cmake-system-for-emscripten-panda-builds/28756/12?u=true
I think I need to try to put together an example with sound for an experiment.
With emscripten you can currently choose between using OpenAL, or writing your own JS bindings to talk to WebAudio. You can look at src/library_openal.js
for an example of how to do this.
What we don't support is emulating the linux sys/soundcard.h
interface, and I'm sure there would be much point is trying to emulate that... but I could be wrong about hat.
I've managed to get OpenAL compiled with Emscripten without -pthread
, so far so good.
Everything links fine, twice as good.
Too bad there is a runtime error, because of std::thread
in https://github.com/kcat/openal-soft/blob/8c3f111d8a7b5bc6093f483b49bf9ad64a1128b4/al/event.cpp#L157
After all, it was a nice investigation. I stick to shipped -lopenal
for now and hack my way around other issues :)
I am building the "OpenAL" library used windows using "Ninja. However, when compiling, I get the wrong header soundcard.h, which refers to Unix systems.
In short, the wrong header is supplied with Emscripten for Windows. I took the header from here and it worked.
Version: 3.1.20
Output: