Bug 219797 - [GPUProcess] WebAudio rendering quantum is 15 instead of 128 when the GPU Process is enabled
Summary: [GPUProcess] WebAudio rendering quantum is 15 instead of 128 when the GPU Pro...
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-12-11 11:58 PST by Chris Dumez
Modified: 2020-12-11 13:05 PST (History)
10 users (show)

See Also:


Attachments
Patch (2.36 KB, patch)
2020-12-11 12:00 PST, 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-12-11 11:58:06 PST
WebAudio rendering quantum is 15 instead of 128 when the GPU Process is enabled. This generates a lot more IPC unnecessarily, not to mention how WebAudio code expects a rendering quantum of 128 and could potentially do bad things with a lower value.
Comment 1 Chris Dumez 2020-12-11 12:00:36 PST
Created attachment 416025 [details]
Patch
Comment 2 Peng Liu 2020-12-11 12:13:15 PST
Comment on attachment 416025 [details]
Patch

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

> Source/WebKit/GPUProcess/media/RemoteAudioSessionProxyManager.cpp:108
> +        if (otherProxy.preferredBufferSize() && otherProxy.preferredBufferSize() < preferredBufferSize)

Do we need to consider the case that "otherProxy.preferredBufferSize()" returns a different value such as -1 if not set? I mean potentially.
Comment 3 Chris Dumez 2020-12-11 12:14:32 PST
(In reply to Peng Liu from comment #2)
> Comment on attachment 416025 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=416025&action=review
> 
> > Source/WebKit/GPUProcess/media/RemoteAudioSessionProxyManager.cpp:108
> > +        if (otherProxy.preferredBufferSize() && otherProxy.preferredBufferSize() < preferredBufferSize)
> 
> Do we need to consider the case that "otherProxy.preferredBufferSize()"
> returns a different value such as -1 if not set? I mean potentially.

size_t m_preferredBufferSize { 0 };

It is initialized to 0 by default. Also, it is unsigned.
Comment 4 Peng Liu 2020-12-11 12:17:14 PST
Comment on attachment 416025 [details]
Patch

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

>>> Source/WebKit/GPUProcess/media/RemoteAudioSessionProxyManager.cpp:108
>>> +        if (otherProxy.preferredBufferSize() && otherProxy.preferredBufferSize() < preferredBufferSize)
>> 
>> Do we need to consider the case that "otherProxy.preferredBufferSize()" returns a different value such as -1 if not set? I mean potentially.
> 
> size_t m_preferredBufferSize { 0 };
> 
> It is initialized to 0 by default. Also, it is unsigned.

Oh that's right! I looked AudioSession::preferredBufferSize() by mistake. :-)
Comment 5 EWS 2020-12-11 13:04:48 PST
Committed r270705: <https://trac.webkit.org/changeset/270705>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 416025 [details].
Comment 6 Radar WebKit Bug Importer 2020-12-11 13:05:19 PST
<rdar://problem/72235555>