+ All Categories
Home > Documents > Porting Wwise to the web - World Wide Web Consortium · 2021. 1. 8. · Attempt #1: Deadlock galore...

Porting Wwise to the web - World Wide Web Consortium · 2021. 1. 8. · Attempt #1: Deadlock galore...

Date post: 06-Mar-2021
Category:
Upload: others
View: 1 times
Download: 0 times
Share this document with a friend
8
Porting Wwise to the web June 28, 2019 Audiokinetic confidential
Transcript
Page 1: Porting Wwise to the web - World Wide Web Consortium · 2021. 1. 8. · Attempt #1: Deadlock galore 5 • Threads don’t actually start before main() returns • Only the main thread

Porting Wwise to the web

June 28, 2019

Audiokinetic confidential

Page 2: Porting Wwise to the web - World Wide Web Consortium · 2021. 1. 8. · Attempt #1: Deadlock galore 5 • Threads don’t actually start before main() returns • Only the main thread

What is Wwise?

Game + Sound Engine

Sound Banks

Authoring Tool

Page 3: Porting Wwise to the web - World Wide Web Consortium · 2021. 1. 8. · Attempt #1: Deadlock galore 5 • Threads don’t actually start before main() returns • Only the main thread

Why is Wwise important?

3

Page 4: Porting Wwise to the web - World Wide Web Consortium · 2021. 1. 8. · Attempt #1: Deadlock galore 5 • Threads don’t actually start before main() returns • Only the main thread

Attempt #1: Just make it play a sound!

Hurdles:• Architecture that is neither

x86 nor ARM• SSE emulation did not work• Atomics: some compiler

intrinsics were not supported• pthreads implementation is a

leaky abstraction

4

Page 5: Porting Wwise to the web - World Wide Web Consortium · 2021. 1. 8. · Attempt #1: Deadlock galore 5 • Threads don’t actually start before main() returns • Only the main thread

Attempt #1: Deadlock galore

5

• Threads don’t actually start before main() returns

• Only the main thread can initialize SDL2

• SDL2 Audio is implemented using ScriptProcessorNode… AudioThread==Main thread!

Page 6: Porting Wwise to the web - World Wide Web Consortium · 2021. 1. 8. · Attempt #1: Deadlock galore 5 • Threads don’t actually start before main() returns • Only the main thread

Attempt #2: Enter AudioWorklet

6

Page 7: Porting Wwise to the web - World Wide Web Consortium · 2021. 1. 8. · Attempt #1: Deadlock galore 5 • Threads don’t actually start before main() returns • Only the main thread

In retrospect

The bad:• Threading is difficult to get right• Debugging “experience”• Too far from the hardware

The ugly:• SharedArrayBuffer’s future seems

uncertain• Slow adoption by browsers other

than Chrome• What about mobile browsers?

7

The good:• AudioWorklet: a major

improvement• Didn’t have actual audio issues,

just needed to learn the APIs

Page 8: Porting Wwise to the web - World Wide Web Consortium · 2021. 1. 8. · Attempt #1: Deadlock galore 5 • Threads don’t actually start before main() returns • Only the main thread

Thank you!


Recommended