You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The wasm branch contains experimental forks of mixxx and vcpkg for targeting wasm32-emscripten.
You can try it out, there is a GitHub Pages-hosted build at https://fwcd.dev/m1xxx, but be warned: It may take a while to load (tne Wasm binary is ~300 MB, the assets are ~90 MB) and there is no audio (the experimental "Web Audio" backend is not functional yet, hence why it is disabled by default).
On the technical side, there are still some major roadblocks to be resolved:
Mixxx will crash when building with -sASSERTIONS, see
Given that we already have to build Mixxx without -sASSERTIONS, any multiple in-flight async operations are effectively undefined behavior and manifest themselves in hard-to-debug failures at runtime (e.g. "unreachable" errors in the console, freezes, etc.)
Loading a track when the "Web Audio" backend is selected seems to also freeze the application, therefore it is disabled-by-default for now: fwcd/mixxx@21e45c5
Something to investigate would be whether we could replace -sASYNCIFY entirely with -sPROXY_TO_PTHREAD, i.e. move the "main" thread to a Web Worker where we can block synchronously. Unfortunately, there seem to be some complexities involved in making this work with Qt:
We may have to check whether setting USE_PTHREADS=1 for Qt would help here (or whether that would be redundant because our vcpkg triplet already sets -pthread).
Another option would be the recently-added C++20 co_await integration, which uses native LLVM coroutines and thus hopefully shouldn't be bound to the same limitations as Asyncify: emscripten-core/emscripten#20413
Given that PortAudio exposes a C interface, I am not sure how well we could integrate C++ coroutines there, however.
Motivation
Being able to run Mixxx on the web would be pretty cool. Qt supports WebAssembly, we would however also have to compile all of the other dependencies. This would probably take some work, but should not be impossible.
We take a similar approach to the iOS port (#16) and use custom WASM branches for mixxx and vcpkg, along with an integration branch in m1xxx, then gradually upstream the required changes.
Porting the dependencies to WebAssembly
Configure Qt correctly with GL ES 3.0 and without dbus
Fix libflac, libmad and libmodplug
Fix sleef build by using fftw as an alternative FFT backend
Fix qttools build (or figure out how to remove non-host qttools dependency from qttranslations)
Fix undefined _qt_test_emscripten_version in Qt6WasmMacros.cmake during Mixxx configure
Patched out in fwcd/vcpkg@e80fbb4, though we may want to look for a better solution before we attempt to upstream this
Update Qt to 6.6.2
This provides WASM stack traces in log messages and exceptions, which is really useful for debugging
Porting Mixxx to WebAssembly
Figure out why WrapRt cannot be found when configuring Mixxx:
Qt6Core could not be found because dependency WrapRt could not be found.
Digging into FindWrapRt.cmake shows that the check_cxx_source_compiles failed, which (as build/CMakeFiles/CMakeConfigureLog.yaml revealed), failed due a missing clang-scan-deps binary:
Status
The
wasm
branch contains experimental forks ofmixxx
andvcpkg
for targetingwasm32-emscripten
.You can try it out, there is a GitHub Pages-hosted build at https://fwcd.dev/m1xxx, but be warned: It may take a while to load (tne Wasm binary is ~300 MB, the assets are ~90 MB) and there is no audio (the experimental "Web Audio" backend is not functional yet, hence why it is disabled by default).
On the technical side, there are still some major roadblocks to be resolved:
-sASSERTIONS
, see-sASSERTIONS
, any multiple in-flight async operations are effectively undefined behavior and manifest themselves in hard-to-debug failures at runtime (e.g. "unreachable" errors in the console, freezes, etc.)Something to investigate would be whether we could replace
-sASYNCIFY
entirely with-sPROXY_TO_PTHREAD
, i.e. move the "main" thread to a Web Worker where we can block synchronously. Unfortunately, there seem to be some complexities involved in making this work with Qt:We may have to check whether setting
USE_PTHREADS=1
for Qt would help here (or whether that would be redundant because our vcpkg triplet already sets-pthread
).Another option would be the recently-added C++20
co_await
integration, which uses native LLVM coroutines and thus hopefully shouldn't be bound to the same limitations as Asyncify: emscripten-core/emscripten#20413Given that PortAudio exposes a C interface, I am not sure how well we could integrate C++ coroutines there, however.
Motivation
Being able to run Mixxx on the web would be pretty cool. Qt supports WebAssembly, we would however also have to compile all of the other dependencies. This would probably take some work, but should not be impossible.
We take a similar approach to the iOS port (#16) and use custom WASM branches for
mixxx
andvcpkg
, along with an integration branch inm1xxx
, then gradually upstream the required changes.Porting the dependencies to WebAssembly
dbus
libflac
,libmad
andlibmodplug
sleef
build by usingfftw
as an alternative FFT backendqttools
build (or figure out how to remove non-hostqttools
dependency fromqttranslations
)qttools
_qt_test_emscripten_version
inQt6WasmMacros.cmake
during Mixxx configurePorting Mixxx to WebAssembly
WrapRt
cannot be found when configuring Mixxx:FindWrapRt.cmake
shows that thecheck_cxx_source_compiles
failed, which (asbuild/CMakeFiles/CMakeConfigureLog.yaml
revealed), failed due a missingclang-scan-deps
binary:FindWrapRt
check).-pthread
(as per this discussion). This should in principle be possible via the triplet, just settingVCPKG_C(XX)_FLAGS
does not work, however:How do I pass compiler/linker arguments to Emscripten? microsoft/vcpkg#30108
wasm32-emscripten-pthread(-release)
) and settingUpstreaming the Mixxx patches
PORTMIDI
flag for compiling with(out) PortMidi mixxxdj/mixxx#12913MUSICBRAINZ
flag for compiling with(out) MusicBrainz mixxxdj/mixxx#12914QWasmIntegrationPlugin
when targeting WebAssembly mixxxdj/mixxx#12915!defined(__EMSCRIPTEN__)
where intrinsics are unavailable on WASM mixxxdj/mixxx#12917WASM_ASSERTIONS
option mixxxdj/mixxx#12931--preload-file
mixxxdj/mixxx#12944Qt::FramelessWindowHint
mixxxdj/mixxx#12945Upstreaming the vcpkg patches
to
microsoft/vcpkg
wchar_t
check microsoft/vcpkg#37105asyncify
feature microsoft/vcpkg#37230to
mixxxdj/vcpkg
libid3tag
andlibmad
to!osx & !ios
(to fix Wasm MP3 support) mixxxdj/vcpkg#139TBD:
to upstream projects
Nice to have
IDBFS
to persist the.mixxx
directorycpack -G TGZ
is usedbin
etc.mixxx.{data,html,js,wasm,worker.js}
,qtloader.js
andqtlogo.svg
emrun mixxx.html
can be used to launch the web app locallyUseful resources
The text was updated successfully, but these errors were encountered: