Re: Building Javascript works, WASM not so much
Thanks jj, I'll try to get you a minimal case ASAP. On Thursday, March 8, 2018 at 1:05:04 AM UTC-8, jj wrote: > > The missing MIME application/wasm needs to be fixed to the web server > configuration that is hosting the site. If you are using e.g. python > SimpleHTTPServer for local development, try instead to switch to > emrun, which has the needed MIME Content-Type config. The message is > harmless in a sense that it's a performance warning. > > As for the embind side, try reducing the code down to a minimal test > case. Not sure if there were any bits in embind that would not work in > wasm, iirc after embind was updated to asm.js semantics it should also > adhere to be used with wasm, but perhaps there is some bug. > > 2018-03-07 20:17 GMT+02:00 Scott Watson: > > > Hi Guys, > > > > I have a project using embind that I have been able to compile to > javascript > > and test. When I compile with -s WASM=1, and run in Chrome I'm getting > a > > strange binding error: > > > > BindingError {name: "BindingError", message: "No dynCall invoker for > > signature: ", stack: "BindingError: No dynCall invoker for signature: > > > > > > The callstack looks like this: > > > > throwBindingError @ ATPlayer.js:5953 > > embind__requireFunction @ ATPlayer.js:6614 > > __embind_register_value_object @ ATPlayer.js:7498 > > __ZN46EmscriptenBindingInitializer_ATPlayer_BindingsC2Ev @ > > wasm-00a7c106-225:9 > > __GLOBAL__sub_I_Bindings_cpp @ wasm-00a7c106-262:3 > > Module.__GLOBAL__sub_I_Bindings_cpp @ ATPlayer.js:14777 > > func @ ATPlayer.js:1864 > > callRuntimeCallbacks @ ATPlayer.js:1313 > > ensureInitRuntime @ ATPlayer.js:1347 > > doRun @ ATPlayer.js:15104 > > (anonymous) @ ATPlayer.js:15120 > > setTimeout (async) > > run @ ATPlayer.js:15116 > > runCaller @ ATPlayer.js:15076 > > removeRunDependency @ ATPlayer.js:1507 > > (anonymous) @ ATPlayer.js:1521 > > worker.onmessage @ ATPlayer.js:2122 > > > > > > The interesting thing I noticed here was that It's trying to register a > > value object. If I move anything else to the front of my > > EMSCRIPTEN_BINDINGS it errors out there. Why can't I bind when I build > > WASM, Javascript works just fine? Here are my bindings if that helps: > > > > EMSCRIPTEN_BINDINGS(ATPlayer_Bindings) { > >// register_vector("VectorStrings"); > >// register_vector("VectorBitrates"); > > > >value_object("VersionInfo") > >.field("major", ::VersionInfo::major) > >.field("minor", ::VersionInfo::minor) > >.field("maintenance", ::VersionInfo::maintenance) > >.field("build", ::VersionInfo::build); > > > >class_("StatusInfo") > >.property("bitrate", ::StatusInfo::bitrate) > >.property("networkthroughput", ::StatusInfo::networkthroughput) > >.property("optimalbitrate", ::StatusInfo::optimalbitrate) > >.property("droppedframes", ::StatusInfo::droppedframes) > >.property("stalls", ::StatusInfo::stalls) > >.property("decodeFPS", ::StatusInfo::decodeFPS) > >.property("renderFPS", ::StatusInfo::renderFPS) > >.property("audiosegments", ::StatusInfo::audiosegments) > >.property("videosegments", ::StatusInfo::videosegments) > >.property("h264frames", ::StatusInfo::h264frames) > >.property("rgbframes", ::StatusInfo::rgbframes) > >.property("pcmframes", ::StatusInfo::pcmframes) > >.property("seconds", ::StatusInfo::seconds) > >.property("duration", ::StatusInfo::duration) > >.property("cacheduration", ::StatusInfo::cacheduration) > >.property("playerstate", ::StatusInfo::playerstate) > >.property("frontendrunning", ::StatusInfo::frontendrunning) > >.property("audiodemuxerrunning", > ::StatusInfo::audiodemuxerrunning) > >.property("videodemuxerrunning", > ::StatusInfo::videodemuxerrunning) > >.property("decoderrunning", ::StatusInfo::decoderrunning) > >.property("audiorendererrunning", > > ::StatusInfo::audiorendererrunning) > >.property("videorendererrunning", > > ::StatusInfo::videorendererrunning) > >.property("lasterror", ::StatusInfo::lasterror); > > > >value_object("ProgramInfo") > >.field("duration", ::ProgramInfo::duration) > >.field("startposition", ::ProgramInfo::startposition); > > > >class_("Color") > >.property("red", ::Color::red) > >.property("green", ::Color::green) > >.property("blue", ::Color::blue) > >.property("alpha", ::Color::alpha); > > > >enum_("PlayerState") > >.value("PlayerStateStopped", Arris::PlayerState::PlayerStateStopped) > >.value("PlayerStateReadyToPlay", > > Arris::PlayerState::PlayerStateReadyToPlay) > >.value("PlayerStatePlaying", Arris::PlayerState::PlayerStatePlaying) > >.value("PlayerStatePaused", Arris::PlayerState::PlayerStatePaused) > >.value("PlayerStateSeeking", Arris::PlayerState::PlayerStateSeeking) > >.value("PlayerStateResetting", >
Re: Building Javascript works, WASM not so much
The missing MIME application/wasm needs to be fixed to the web server configuration that is hosting the site. If you are using e.g. python SimpleHTTPServer for local development, try instead to switch to emrun, which has the needed MIME Content-Type config. The message is harmless in a sense that it's a performance warning. As for the embind side, try reducing the code down to a minimal test case. Not sure if there were any bits in embind that would not work in wasm, iirc after embind was updated to asm.js semantics it should also adhere to be used with wasm, but perhaps there is some bug. 2018-03-07 20:17 GMT+02:00 Scott Watson: > Hi Guys, > > I have a project using embind that I have been able to compile to javascript > and test. When I compile with -s WASM=1, and run in Chrome I'm getting a > strange binding error: > > BindingError {name: "BindingError", message: "No dynCall invoker for > signature: ", stack: "BindingError: No dynCall invoker for signature: > > > The callstack looks like this: > > throwBindingError @ ATPlayer.js:5953 > embind__requireFunction @ ATPlayer.js:6614 > __embind_register_value_object @ ATPlayer.js:7498 > __ZN46EmscriptenBindingInitializer_ATPlayer_BindingsC2Ev @ > wasm-00a7c106-225:9 > __GLOBAL__sub_I_Bindings_cpp @ wasm-00a7c106-262:3 > Module.__GLOBAL__sub_I_Bindings_cpp @ ATPlayer.js:14777 > func @ ATPlayer.js:1864 > callRuntimeCallbacks @ ATPlayer.js:1313 > ensureInitRuntime @ ATPlayer.js:1347 > doRun @ ATPlayer.js:15104 > (anonymous) @ ATPlayer.js:15120 > setTimeout (async) > run @ ATPlayer.js:15116 > runCaller @ ATPlayer.js:15076 > removeRunDependency @ ATPlayer.js:1507 > (anonymous) @ ATPlayer.js:1521 > worker.onmessage @ ATPlayer.js:2122 > > > The interesting thing I noticed here was that It's trying to register a > value object. If I move anything else to the front of my > EMSCRIPTEN_BINDINGS it errors out there. Why can't I bind when I build > WASM, Javascript works just fine? Here are my bindings if that helps: > > EMSCRIPTEN_BINDINGS(ATPlayer_Bindings) { >// register_vector("VectorStrings"); >// register_vector("VectorBitrates"); > >value_object("VersionInfo") >.field("major", ::VersionInfo::major) >.field("minor", ::VersionInfo::minor) >.field("maintenance", ::VersionInfo::maintenance) >.field("build", ::VersionInfo::build); > >class_("StatusInfo") >.property("bitrate", ::StatusInfo::bitrate) >.property("networkthroughput", ::StatusInfo::networkthroughput) >.property("optimalbitrate", ::StatusInfo::optimalbitrate) >.property("droppedframes", ::StatusInfo::droppedframes) >.property("stalls", ::StatusInfo::stalls) >.property("decodeFPS", ::StatusInfo::decodeFPS) >.property("renderFPS", ::StatusInfo::renderFPS) >.property("audiosegments", ::StatusInfo::audiosegments) >.property("videosegments", ::StatusInfo::videosegments) >.property("h264frames", ::StatusInfo::h264frames) >.property("rgbframes", ::StatusInfo::rgbframes) >.property("pcmframes", ::StatusInfo::pcmframes) >.property("seconds", ::StatusInfo::seconds) >.property("duration", ::StatusInfo::duration) >.property("cacheduration", ::StatusInfo::cacheduration) >.property("playerstate", ::StatusInfo::playerstate) >.property("frontendrunning", ::StatusInfo::frontendrunning) >.property("audiodemuxerrunning", ::StatusInfo::audiodemuxerrunning) >.property("videodemuxerrunning", ::StatusInfo::videodemuxerrunning) >.property("decoderrunning", ::StatusInfo::decoderrunning) >.property("audiorendererrunning", > ::StatusInfo::audiorendererrunning) >.property("videorendererrunning", > ::StatusInfo::videorendererrunning) >.property("lasterror", ::StatusInfo::lasterror); > >value_object("ProgramInfo") >.field("duration", ::ProgramInfo::duration) >.field("startposition", ::ProgramInfo::startposition); > >class_("Color") >.property("red", ::Color::red) >.property("green", ::Color::green) >.property("blue", ::Color::blue) >.property("alpha", ::Color::alpha); > >enum_("PlayerState") >.value("PlayerStateStopped", Arris::PlayerState::PlayerStateStopped) >.value("PlayerStateReadyToPlay", > Arris::PlayerState::PlayerStateReadyToPlay) >.value("PlayerStatePlaying", Arris::PlayerState::PlayerStatePlaying) >.value("PlayerStatePaused", Arris::PlayerState::PlayerStatePaused) >.value("PlayerStateSeeking", Arris::PlayerState::PlayerStateSeeking) >.value("PlayerStateResetting", Arris::PlayerState::PlayerStateResetting) >.value("PlayerStateChangingLanguage", > Arris::PlayerState::PlayerStateChangingLanguage) >.value("PlayerStateBuffering", Arris::PlayerState::PlayerStateBuffering) >.value("PlayerStateStopping", Arris::PlayerState::PlayerStateStopping) >.value("PlayerStateEndOfMovie", > Arris::PlayerState::PlayerStateEndOfMovie) >.value("PlayerStateError", Arris::PlayerState::PlayerStateError); > >
Re: Building Javascript works, WASM not so much
Yes, I get the same error in Firefox Nightly. On Wednesday, March 7, 2018 at 11:42:25 AM UTC-8, Alon Zakai wrote: > > Is this only on Chrome? Please try on some other browsers, that's a quick > way to see if it's a Chrome bug. > > The MIME error is because browsers require the proper MIME type for > streaming (I'm not sure why, precisely), see > https://github.com/kripken/emscripten/wiki/WebAssembly#web-server-setup > It's good to fix that, but things will work without it (but without the > benefits of streaming compilation). > > On Wed, Mar 7, 2018 at 10:17 AM, Scott Watson> wrote: > >> Hi Guys, >> >> I have a project using embind that I have been able to compile to >> javascript and test. When I compile with -s WASM=1, and run in Chrome I'm >> getting a strange binding error: >> >> BindingError {name: "BindingError", message: "No dynCall invoker for >> signature: ", stack: "BindingError: No dynCall invoker for signature: >> >> >> The callstack looks like this: >> >> throwBindingError @ ATPlayer.js:5953 >> embind__requireFunction @ ATPlayer.js:6614 >> __embind_register_value_object @ ATPlayer.js:7498 >> __ZN46EmscriptenBindingInitializer_ATPlayer_BindingsC2Ev @ >> wasm-00a7c106-225:9 >> __GLOBAL__sub_I_Bindings_cpp @ wasm-00a7c106-262:3 >> Module.__GLOBAL__sub_I_Bindings_cpp @ ATPlayer.js:14777 >> func @ ATPlayer.js:1864 >> callRuntimeCallbacks @ ATPlayer.js:1313 >> ensureInitRuntime @ ATPlayer.js:1347 >> doRun @ ATPlayer.js:15104 >> (anonymous) @ ATPlayer.js:15120 >> setTimeout (async) >> run @ ATPlayer.js:15116 >> runCaller @ ATPlayer.js:15076 >> removeRunDependency @ ATPlayer.js:1507 >> (anonymous) @ ATPlayer.js:1521 >> worker.onmessage @ ATPlayer.js:2122 >> >> >> The interesting thing I noticed here was that It's trying to register a >> value object. If I move anything else to the front of my >> EMSCRIPTEN_BINDINGS it errors out there. Why can't I bind when I build >> WASM, Javascript works just fine? Here are my bindings if that helps: >> >> EMSCRIPTEN_BINDINGS(ATPlayer_Bindings) { >>// register_vector("VectorStrings"); >>// register_vector("VectorBitrates"); >> >>value_object("VersionInfo") >>.field("major", ::VersionInfo::major) >>.field("minor", ::VersionInfo::minor) >>.field("maintenance", ::VersionInfo::maintenance) >>.field("build", ::VersionInfo::build); >> >>class_("StatusInfo") >>.property("bitrate", ::StatusInfo::bitrate) >>.property("networkthroughput", ::StatusInfo::networkthroughput) >>.property("optimalbitrate", ::StatusInfo::optimalbitrate) >>.property("droppedframes", ::StatusInfo::droppedframes) >>.property("stalls", ::StatusInfo::stalls) >>.property("decodeFPS", ::StatusInfo::decodeFPS) >>.property("renderFPS", ::StatusInfo::renderFPS) >>.property("audiosegments", ::StatusInfo::audiosegments) >>.property("videosegments", ::StatusInfo::videosegments) >>.property("h264frames", ::StatusInfo::h264frames) >>.property("rgbframes", ::StatusInfo::rgbframes) >>.property("pcmframes", ::StatusInfo::pcmframes) >>.property("seconds", ::StatusInfo::seconds) >>.property("duration", ::StatusInfo::duration) >>.property("cacheduration", ::StatusInfo::cacheduration) >>.property("playerstate", ::StatusInfo::playerstate) >>.property("frontendrunning", ::StatusInfo::frontendrunning) >>.property("audiodemuxerrunning", >> ::StatusInfo::audiodemuxerrunning) >>.property("videodemuxerrunning", >> ::StatusInfo::videodemuxerrunning) >>.property("decoderrunning", ::StatusInfo::decoderrunning) >>.property("audiorendererrunning", >> ::StatusInfo::audiorendererrunning) >>.property("videorendererrunning", >> ::StatusInfo::videorendererrunning) >>.property("lasterror", ::StatusInfo::lasterror); >> >>value_object("ProgramInfo") >>.field("duration", ::ProgramInfo::duration) >>.field("startposition", ::ProgramInfo::startposition); >> >>class_("Color") >>.property("red", ::Color::red) >>.property("green", ::Color::green) >>.property("blue", ::Color::blue) >>.property("alpha", ::Color::alpha); >> >>enum_("PlayerState") >>.value("PlayerStateStopped", Arris::PlayerState::PlayerStateStopped) >>.value("PlayerStateReadyToPlay", >> Arris::PlayerState::PlayerStateReadyToPlay) >>.value("PlayerStatePlaying", Arris::PlayerState::PlayerStatePlaying) >>.value("PlayerStatePaused", Arris::PlayerState::PlayerStatePaused) >>.value("PlayerStateSeeking", Arris::PlayerState::PlayerStateSeeking) >>.value("PlayerStateResetting", >> Arris::PlayerState::PlayerStateResetting) >>.value("PlayerStateChangingLanguage", >> Arris::PlayerState::PlayerStateChangingLanguage) >>.value("PlayerStateBuffering", >> Arris::PlayerState::PlayerStateBuffering) >>.value("PlayerStateStopping", Arris::PlayerState::PlayerStateStopping) >>.value("PlayerStateEndOfMovie", >>
Re: Building Javascript works, WASM not so much
Is this only on Chrome? Please try on some other browsers, that's a quick way to see if it's a Chrome bug. The MIME error is because browsers require the proper MIME type for streaming (I'm not sure why, precisely), see https://github.com/kripken/emscripten/wiki/WebAssembly#web-server-setup It's good to fix that, but things will work without it (but without the benefits of streaming compilation). On Wed, Mar 7, 2018 at 10:17 AM, Scott Watsonwrote: > Hi Guys, > > I have a project using embind that I have been able to compile to > javascript and test. When I compile with -s WASM=1, and run in Chrome I'm > getting a strange binding error: > > BindingError {name: "BindingError", message: "No dynCall invoker for > signature: ", stack: "BindingError: No dynCall invoker for signature: > > > The callstack looks like this: > > throwBindingError @ ATPlayer.js:5953 > embind__requireFunction @ ATPlayer.js:6614 > __embind_register_value_object @ ATPlayer.js:7498 > __ZN46EmscriptenBindingInitializer_ATPlayer_BindingsC2Ev @ > wasm-00a7c106-225:9 > __GLOBAL__sub_I_Bindings_cpp @ wasm-00a7c106-262:3 > Module.__GLOBAL__sub_I_Bindings_cpp @ ATPlayer.js:14777 > func @ ATPlayer.js:1864 > callRuntimeCallbacks @ ATPlayer.js:1313 > ensureInitRuntime @ ATPlayer.js:1347 > doRun @ ATPlayer.js:15104 > (anonymous) @ ATPlayer.js:15120 > setTimeout (async) > run @ ATPlayer.js:15116 > runCaller @ ATPlayer.js:15076 > removeRunDependency @ ATPlayer.js:1507 > (anonymous) @ ATPlayer.js:1521 > worker.onmessage @ ATPlayer.js:2122 > > > The interesting thing I noticed here was that It's trying to register a > value object. If I move anything else to the front of my > EMSCRIPTEN_BINDINGS it errors out there. Why can't I bind when I build > WASM, Javascript works just fine? Here are my bindings if that helps: > > EMSCRIPTEN_BINDINGS(ATPlayer_Bindings) { >// register_vector("VectorStrings"); >// register_vector("VectorBitrates"); > >value_object("VersionInfo") >.field("major", ::VersionInfo::major) >.field("minor", ::VersionInfo::minor) >.field("maintenance", ::VersionInfo::maintenance) >.field("build", ::VersionInfo::build); > >class_("StatusInfo") >.property("bitrate", ::StatusInfo::bitrate) >.property("networkthroughput", ::StatusInfo::networkthroughput) >.property("optimalbitrate", ::StatusInfo::optimalbitrate) >.property("droppedframes", ::StatusInfo::droppedframes) >.property("stalls", ::StatusInfo::stalls) >.property("decodeFPS", ::StatusInfo::decodeFPS) >.property("renderFPS", ::StatusInfo::renderFPS) >.property("audiosegments", ::StatusInfo::audiosegments) >.property("videosegments", ::StatusInfo::videosegments) >.property("h264frames", ::StatusInfo::h264frames) >.property("rgbframes", ::StatusInfo::rgbframes) >.property("pcmframes", ::StatusInfo::pcmframes) >.property("seconds", ::StatusInfo::seconds) >.property("duration", ::StatusInfo::duration) >.property("cacheduration", ::StatusInfo::cacheduration) >.property("playerstate", ::StatusInfo::playerstate) >.property("frontendrunning", ::StatusInfo::frontendrunning) >.property("audiodemuxerrunning", ::StatusInfo:: > audiodemuxerrunning) >.property("videodemuxerrunning", ::StatusInfo:: > videodemuxerrunning) >.property("decoderrunning", ::StatusInfo::decoderrunning) >.property("audiorendererrunning", ::StatusInfo:: > audiorendererrunning) >.property("videorendererrunning", ::StatusInfo:: > videorendererrunning) >.property("lasterror", ::StatusInfo::lasterror); > >value_object("ProgramInfo") >.field("duration", ::ProgramInfo::duration) >.field("startposition", ::ProgramInfo::startposition); > >class_("Color") >.property("red", ::Color::red) >.property("green", ::Color::green) >.property("blue", ::Color::blue) >.property("alpha", ::Color::alpha); > >enum_("PlayerState") >.value("PlayerStateStopped", Arris::PlayerState::PlayerStateStopped) >.value("PlayerStateReadyToPlay", Arris::PlayerState:: > PlayerStateReadyToPlay) >.value("PlayerStatePlaying", Arris::PlayerState::PlayerStatePlaying) >.value("PlayerStatePaused", Arris::PlayerState::PlayerStatePaused) >.value("PlayerStateSeeking", Arris::PlayerState::PlayerStateSeeking) >.value("PlayerStateResetting", Arris::PlayerState:: > PlayerStateResetting) >.value("PlayerStateChangingLanguage", Arris::PlayerState:: > PlayerStateChangingLanguage) >.value("PlayerStateBuffering", Arris::PlayerState:: > PlayerStateBuffering) >.value("PlayerStateStopping", Arris::PlayerState::PlayerStateStopping) >.value("PlayerStateEndOfMovie", Arris::PlayerState:: > PlayerStateEndOfMovie) >.value("PlayerStateError", Arris::PlayerState::PlayerStateError); > >enum_("PlayerError") >.value("PlayerErrorFontStorageFull", Arris::PlayerError:: > PlayerErrorFontStorageFull) >.value("PlayerErrorFontStorageFailed", Arris::PlayerError:: >