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

[3.x] [HTML5] Refactor audio drivers. Implement AudioWorklet w/o threads. #52650

Merged
merged 1 commit into from
Sep 21, 2021

Conversation

Faless
Copy link
Collaborator

@Faless Faless commented Sep 14, 2021

Same as #52649, for 3.x.

In this PR:

Performances are not great in general, bad on Firefox, on Chrome, well, it's an improvement compared to the way they broke ScriptProcessorNode.

Works by sending chunks via postMessage, which is really slow.
I'm actually surprised this works, it involves so many allocations, but there's no way around it when SharedArrayBuffer is not available :(.

Related to #47453

Performances are not great in general, bad on Firefox, on Chrome, well,
it's an improvement compared to the way they broke ScriptProcessorNode.

I'm actually surprised this works, it involves so many allocations, but
there's no way around it when SharedArrayBuffer is not available :(.
@Faless Faless force-pushed the js/3.x_audioworklet_nothreads_pr branch from 29f2445 to 2024200 Compare September 20, 2021 12:54
@akien-mga akien-mga merged commit 8a48be6 into godotengine:3.x Sep 21, 2021
@akien-mga
Copy link
Member

Thanks!

@simonschreibt-code
Copy link

I've make a tiny test-project but i've stuttering/crackling audio :( Do I need to enable this AudioWorklet manually somewhere?

@Calinou
Copy link
Member

Calinou commented Dec 13, 2021

I've make a tiny test-project but i've stuttering/crackling audio :( Do I need to enable this AudioWorklet manually somewhere?

Yes, you need to enable threads in the HTML5 export preset and ensure the web server sends the required cross-origin isolation headers (on top of using HTTPS).

@simonschreibt-code
Copy link

I've make a tiny test-project but i've stuttering/crackling audio :( Do I need to enable this AudioWorklet manually somewhere?

Yes, you need to enable threads in the HTML5 export preset and ensure the web server sends the required cross-origin isolation headers (on top of using HTTPS).

Thank you for the quick reply! Does this mean, that I'll never be able to test it by just pressing play? I always have to export first and then debug/play the game?

@Calinou
Copy link
Member

Calinou commented Dec 13, 2021

Thank you for the quick reply! Does this mean, that I'll never be able to test it by just pressing play? I always have to export first and then debug/play the game?

One-click deploy (the HTML5 logo at the top of the editor) will use threads if you have an HTML5 export preset marked as Runnable with threads enabled.

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

Successfully merging this pull request may close these issues.

4 participants