Bug 217663 - WebAudio tests are crashing in debug when enabling the GPU process
Summary: WebAudio tests are crashing in debug when enabling the GPU process
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Audio (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Chris Dumez
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2020-10-13 12:12 PDT by Chris Dumez
Modified: 2020-10-13 14:54 PDT (History)
15 users (show)

See Also:


Attachments
Patch (37.62 KB, patch)
2020-10-13 12:30 PDT, Chris Dumez
ews-feeder: commit-queue-
Details | Formatted Diff | Diff
Patch (38.36 KB, patch)
2020-10-13 12:39 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff
Patch (38.36 KB, patch)
2020-10-13 12:54 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff
Patch (38.36 KB, patch)
2020-10-13 13:24 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff
Patch (38.59 KB, patch)
2020-10-13 13:36 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Dumez 2020-10-13 12:12:55 PDT
WebAudio tests are crashing in debug when enabling the GPU process because it does audio processing on the WebContent process' main thread.
Comment 1 Chris Dumez 2020-10-13 12:30:47 PDT
Created attachment 411237 [details]
Patch
Comment 2 Chris Dumez 2020-10-13 12:39:44 PDT
Created attachment 411238 [details]
Patch
Comment 3 Chris Dumez 2020-10-13 12:54:27 PDT
Created attachment 411240 [details]
Patch
Comment 4 Geoffrey Garen 2020-10-13 13:19:56 PDT
Comment on attachment 411240 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=411240&action=review

r=me

> Source/WTF/ChangeLog:13
> +        deque (since the queue is empty).

dequeue

> Source/WebKit/GPUProcess/media/RemoteAudioDestinationManager.cpp:115
> +                    audioBus->setChannelMemory(i, (float*)buffers[i]->data(), framesToProcess);

static_cast<float*>
Comment 5 Chris Dumez 2020-10-13 13:24:32 PDT
Created attachment 411245 [details]
Patch
Comment 6 Peng Liu 2020-10-13 13:32:38 PDT
Comment on attachment 411245 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=411245&action=review

> Source/WebKit/GPUProcess/media/RemoteAudioDestinationManager.cpp:46
> +constexpr size_t fifoSize = 96 * WebCore::AudioUtilities::renderQuantumSize;

Could you explain how did you choose the number 96? Thanks!

> Source/WebKit/GPUProcess/media/RemoteAudioDestinationManager.cpp:87
>      void render(AudioBus* sourceBus, AudioBus* destinationBus, size_t framesToProcess, const WebCore::AudioIOPosition& outputPosition) override

Nit. Looks like "sourceBus" is not used?

> Source/WebKit/GPUProcess/media/RemoteAudioDestinationManager.cpp:140
> +    WebCore::PushPullFIFO m_fifo;

I like this change!
Comment 7 Chris Dumez 2020-10-13 13:33:48 PDT
(In reply to Peng Liu from comment #6)
> Comment on attachment 411245 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=411245&action=review
> 
> > Source/WebKit/GPUProcess/media/RemoteAudioDestinationManager.cpp:46
> > +constexpr size_t fifoSize = 96 * WebCore::AudioUtilities::renderQuantumSize;
> 
> Could you explain how did you choose the number 96? Thanks!

Oh, I used the same size as the fifo queue in AudioDestinationCocoa.mm. I will add a comment.

> 
> > Source/WebKit/GPUProcess/media/RemoteAudioDestinationManager.cpp:87
> >      void render(AudioBus* sourceBus, AudioBus* destinationBus, size_t framesToProcess, const WebCore::AudioIOPosition& outputPosition) override
> 
> Nit. Looks like "sourceBus" is not used?
> 
> > Source/WebKit/GPUProcess/media/RemoteAudioDestinationManager.cpp:140
> > +    WebCore::PushPullFIFO m_fifo;
> 
> I like this change!
Comment 8 Chris Dumez 2020-10-13 13:36:24 PDT
Created attachment 411247 [details]
Patch
Comment 9 EWS 2020-10-13 14:53:27 PDT
Committed r268423: <https://trac.webkit.org/changeset/268423>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 411247 [details].
Comment 10 Radar WebKit Bug Importer 2020-10-13 14:54:18 PDT
<rdar://problem/70267708>