Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to load second WebAudioModule #97

Open
yojeek opened this issue Jul 12, 2023 · 10 comments
Open

Failed to load second WebAudioModule #97

yojeek opened this issue Jul 12, 2023 · 10 comments

Comments

@yojeek
Copy link

yojeek commented Jul 12, 2023

Problem

Bundled WebAudioModule examples can be only loaded once. Attempt to load another module ends with

localhost/:1 Uncaught DOMException: Failed to execute 'registerProcessor' on 'AudioWorkletGlobalScope': An AudioWorkletProcessor with name:"com.webaudiomodule.default" is already registered.

Steps to reproduce

  1. Run yarn start
  2. Open browser
  3. Select "Synth101" and load it
  4. Select "OBXD" and load it

Enviorenment

Chrome Version 114.0.5735.198 (Official Build) (x86_64)
MacOS 12.3.1

Screenshot 2023-07-12 at 22 05 22
@micbuffa
Copy link
Member

Hmmm this seems to be a bug in the ObXd wam. When I try to load other WAMs the error never happens. It only happens when ObXd is loaded, then other wam fail. We investigate...

@micbuffa
Copy link
Member

Hmmm it seems that the error raised by Obxd should be caught and displayed as a warning...

@micbuffa
Copy link
Member

What are you trying to do? Thanks for notifying us the error with ObXd...

@yojeek
Copy link
Author

yojeek commented Jul 13, 2023

@micbuffa I've put together example yojeek@d0c11df

I've bundled simpleMidiKeyboard with Rollup and tried to use it together with synth101 and OBDX, and both times it failed.

Steps to reproduce:

  1. Run host
  2. Select "Simple MIDI Keyboard (packed)" from list
  3. Load
  4. Select "synth101" or "obdx" from list
  5. Load

I assumed that something wrong with bundling part.

@micbuffa
Copy link
Member

Hi! I'll try to see what's wrong in your example. In between, I quickly made a small example that might help, that requires no "building step at all": https://mega.nz/file/TtxS0KpS#ef1LI0T8lpFXbGwKvRD-cjuqlXnc5nzCOVWrWggkTXI

This examples has all the api, sdk, sdk-parammgr pre-built in a libs dir. It also uses two web components we wrote for simplifying the embedding if WAMs in a HTML page ( and ), you can edit the index.html file. What is interesting is that you have here an example of reuse of existing WAMs.
We really need to make a set of small examples, with and without build tools. I had to edit the paths that reference the sdk, sdk-parammgr and api in the index.js of the WAMs, and also I completed the descriptors with hasMidiInput, hasMidiOutput etc... we extended the descriptor recently and the wam-example repo is not up to date. WAMs are ok without this, but can't be loaded with our new wam-host and wam-plugin web components.
I'll look at your example this afternoon.

@yojeek
Copy link
Author

yojeek commented Jul 13, 2023

@micbuffa I've tried to replace synth101 from this repo with synth101 from https://github.com/boourns/wam-community and the later version works just fine with bundled simpleMidiKeyboard scenario. So looks like something wrong with version of Synth101 used in this repo .

Added it to my example for comparison : yojeek@be72c6a

@micbuffa
Copy link
Member

I also took synth101 from https://github.com/boourns/wam-community (after building it) for the example I shared. I just edited the paths to api, sdk and sdk-parammgr from the index.js of synth101.
So you say that the synth101 from wam-example is the one that does not work well, due to a bad versions of sdk, api, sdk-parammgr from the wam-examples repo? I'll check that too...
This repo is indeed a bit outdated (descriptors are not up to date), and maybe the embedded version of sdk, api and sdk-parammgr are not correct. Thanks for notifying.

@yojeek
Copy link
Author

yojeek commented Sep 26, 2023

I strongly believe that the reason of original issue is absence of identifiers (related PR): #94.

Also, it should be stated in readme/wiki that unique identifier is mandatory for a plugin.

Once you have two plugins without identifiers everything collapses.

@micbuffa
Copy link
Member

Thanks for this bug report. We'll try to update the repo rapidly. Indeed, missing ids make sense for this kind of bug.

@Fr0stbyteR
Copy link
Member

See #94

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants