Comments (6)
I build as described in instructions above (2.)
and it complains
[ 99%] Linking CXX executable vAmiga.html
wasm-ld: error: --shared-memory is disallowed by SDL_atomic.o because it was not compiled with 'atomics' or 'bulk-memory' features.
it seems that the SDL2 port is not build with compiler/linker flag -sWASM_WORKERS
how to patch / add the missing flag ? We have to find the build script
I searched the system and found this ... maybe it is the build script and we can add the missing flag in it ?
emsdk/upstream/emscripten/tools/ports/sdl2.py
from vamigaweb.
did a embuilder clear sdl2
to clear the sdl2 port
and patched the necessary flag into emsdk/upstream/emscripten/tools/ports/sdl2.py
command = [shared.EMCC,
'-sUSE_SDL=0',
'-c', os.path.join(ports.get_dir(), 'sdl2', SUBDIR, 'src', src),
'-o', o, '-I' + ports.get_include_dir('SDL2'),
'-O2', '-w','-sWASM_WORKERS']
now it compiles and links without error ...
when I run it says it doesn't know SharedArrayBuffer
vAmiga.js:566 Uncaught ReferenceError: SharedArrayBuffer is not defined
at vAmiga.js:566:40
maybe now it needs COOP and COEP response headers?
from vamigaweb.
I did the step 1) to add the needed headers in the service worker
now it knows SharedArrayBuffer !
Next complaint is
Uncaught ReferenceError: _eglWaitClient is not defined
at vAmiga.js:6100:20
something is wrong with SDL ... I guess it can not be compiled with -sWASM_WORKERS...
maybe we should go another way
i.e. remove all sdl2 stuff from c++ and rewrite it in javascript
from vamigaweb.
all sdl2 program logic has been removed ...
a new web worker thread has been created
the vAmigaCore seems to like its new home and runs fine in the separate worker thread see here
the main thread is doing nothing now because I have still to reimplement the SDL render logic in javascript...
For this result I had to set the Amiga RTC RealTimeClock to none ... because emscripten had problems to access the timezone of the browser when build with the -sWASM_WORKERS
option ... maybe a bug there we will see.
from vamigaweb.
meanwhile have it running with a native javascript rendering logic as a replacement for the sdl2 rendering API, which was not compatible with web workers.
being in the mood of improving performance by exploiting the new possibilities of shared array buffers ... I found an interesting article about our current implementation of audio worklet sound processor in vAmigaWeb which is feed by postMessage calls from the main thread.
https://blog.paul.cx/post/a-wait-free-spsc-ringbuffer-for-the-web/
he simply claims that with shared array buffers one can replace the postMessage method and rely on a shared array buffer based ringbuffer. This should save processing time which is currently spent for the amiga audio stream.
here is a also a sample implementation using that sab based ringbuffer
https://ringbuf-js.netlify.app/example/main-thread-to-audioworklet/
from vamigaweb.
There is now a parameter in the make file which decides whether the vAmigaCore will run in a separate web worker or on the main thread.
#to build a worker built
#1.set thread_type to "worker"
#2.go to the sw.js and set needs_shared_array_buffer=true
set(thread_type "worker")
from vamigaweb.
Related Issues (20)
- Serial port missing or not activated.. HOT 24
- directly boot from local storage via URL/JSON parameters HOT 4
- vamigaweb.github.io no longer boots certain ROMs after 3-4 update HOT 2
- BT Mouse - RMB (Secondary Button) Not Work iPadOS [FIXED: Update iPadOS to 16.5] HOT 5
- Incorrect Filename Save DF0 or DH0 If Both Mounted HOT 2
- LMB / Fire Btn Stuck On When Switch Between Apps
- 'Error: undefined' if a second HDF is mounted HOT 16
- Dark Bottom Bar not activated on launch... HOT 2
- Cannot load vAmigaWeb in iFrame if on same domain (Chromium specific?) HOT 18
- When using a HDF with WB the filedates are wrong HOT 3
- Onscreen Keyboard Issue HOT 3
- iPad Keyboard Issue HOT 9
- iPad Keyboard Issue HOT 1
- next to the INTL virtual keyboard support also the US version HOT 6
- Insert media eg DF0 popup touch also registers as LMB in emu... HOT 5
- vAmigaWeb runs on Apple Vision Pro HOT 13
- Warp button in the bottom player icon bar HOT 1
- action button enhancements HOT 15
- Active mouse and joystick signals stay open when bringing the app to background HOT 2
- add vAmiga activity monitors HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vamigaweb.