Bug 218729

Summary: [GPUProcess] Regression(r268632) Garbage is rendered on speakers when using WebAudio
Product: WebKit Reporter: Chris Dumez <cdumez>
Component: Web AudioAssignee: Chris Dumez <cdumez>
Status: RESOLVED FIXED    
Severity: Normal CC: cdumez, eric.carlson, ews-watchlist, ggaren, glenn, jer.noble, peng.liu6, philipj, sergio, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 217715    
Attachments:
Description Flags
Patch
none
Patch none

Description Chris Dumez 2020-11-09 16:16:55 PST
garbage is rendered on speakers when using WebAudio and when enabling the GPU Process.

Easily testable with this demo:
https://webaudiodemos.appspot.com/MIDIDrums/index.html

This is a regression from using a CARingBuffer.
Comment 1 Chris Dumez 2020-11-09 16:43:23 PST
Created attachment 413644 [details]
Patch
Comment 2 Peng Liu 2020-11-09 19:40:41 PST
Comment on attachment 413644 [details]
Patch

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

> Source/WebKit/ChangeLog:14
> +        remain to processed (usually 0). As a result, RemoteAudioDestinationProxy::renderOnRenderingThead()

Good catch! I misunderstood the comment of PushPullFIFO::pull(). The return value of this function is the number of samples *left* in the FIFO, not the number of samples fetched from the FIFO.

> Source/WebKit/WebProcess/GPU/media/RemoteAudioDestinationProxy.cpp:140
>          completionHandler(0, 0);

Not a problem of this patch. But we have to early return here after calling completionHandler().
Comment 3 Chris Dumez 2020-11-10 08:26:52 PST
Created attachment 413697 [details]
Patch
Comment 4 EWS 2020-11-10 10:52:08 PST
Committed r269630: <https://trac.webkit.org/changeset/269630>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 413697 [details].
Comment 5 Radar WebKit Bug Importer 2020-11-10 10:53:16 PST
<rdar://problem/71245599>