ringbuf.js icon indicating copy to clipboard operation
ringbuf.js copied to clipboard

main-thread-to-audioworklet doesn't work on Safari

Open ebekebe opened this issue 3 years ago • 4 comments

I tried to run main-thread-to-audioworklet on Safari 15.4 on macOS with __XPC_JSC_useSharedArrayBuffer=1, but it doesn't work. Is that a known limitation of Safari?

ebekebe avatar Mar 21 '22 20:03 ebekebe

Real strange, this used to work. console.log from the worklet doesn't work either.

padenot avatar Apr 04 '22 11:04 padenot

Real strange, this used to work. console.log from the worklet doesn't work either.

I got this problem too. Safari version 15.2

chaosprint avatar Apr 06 '22 21:04 chaosprint

to be able to work an class named "SharedArrayBuffer" should exist, which is nowhere to find.. means as it does not exist in Safari the ringbuff works starting Safari 15.2 and has no fallback

designerfuzzi avatar Jun 07 '22 16:06 designerfuzzi

@designerfuzzi If SharedArrayBuffer is missing it's because the file was served with the wrong headers (see here).

I'm seeing the everything get instantiated correctly, the AudioContext change status to "running", the AudioWorkletNode gets loaded (its script is loaded and shows up in the debugger), and Safari even shows a icon in the URL bar (e.g. 🔊) to indicate that the tab is making sound. Just... nothing comes out. The AudioWorkletNode is not pulling data from the ring buffer, so it gets full and then is never written to again.

I've only been doing web audio for a few weeks and I think it's aged me a year. AudioWorkletNode is the bleeding edge, latest and great addition to the API, and it has a hardcoded buffer size? I don't understand who's writing this stuff.

Your approach here is clearly the best way to feed audio to the thread, and it just magically stops working in Safari. The debugger tells you nothing.

EricTetz avatar Aug 14 '22 22:08 EricTetz