[Webkit-unassigned] [Bug 222098] Regression: Raw AudioBufferSourceNode playback causes repeated crackling sound

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri May 28 08:28:15 PDT 2021


https://bugs.webkit.org/show_bug.cgi?id=222098

--- Comment #17 from Chris Dumez <cdumez at apple.com> ---
(In reply to Chris Dumez from comment #16)
> It definitely seems there is a garbage collection issue here. When I start
> playing, I see some calls to
> AudioScheduledSourceNode::virtualHasPendingActivity(), which return false
> and I see JS wrappers getting garbage collection. HOWEVER, after this
> initial period, we go for an extended period of time without
> AudioScheduledSourceNode::virtualHasPendingActivity() getting called (which
> seems to indicate the JS wrapper aren't getting visited). Since the JS is
> constructing JS wrappers very aggressively and since we are not collecting
> them, the number of JS wrappers grows pretty quickly, once we reach ~12k-15k
> JS wrappers, the audio quality starts to deteriorate and craters very
> quickly. 
> 
> I could use some help from our GC experts here to understand why our nodes
> aren't getting visited in a timely fashion, allowing the number of wrappers
> to grow so quickly.

The visitor logic is in generated bindings code, here:
```
bool JSAudioScheduledSourceNodeOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, AbstractSlotVisitor& visitor, const char** reason)
{
    auto* jsAudioScheduledSourceNode = jsCast<JSAudioScheduledSourceNode*>(handle.slot()->asCell());
    auto& wrapped = jsAudioScheduledSourceNode->wrapped();
    if (!wrapped.isContextStopped() && wrapped.hasPendingActivity()) {
        if (UNLIKELY(reason))
            *reason = "ActiveDOMObject with pending activity";
        return true;
     }
    if (jsAudioScheduledSourceNode->wrapped().isFiringEventListeners()) {
        if (UNLIKELY(reason))
            *reason = "EventTarget firing event listeners";
        return true;
    }
    UNUSED_PARAM(visitor);
    UNUSED_PARAM(reason);
    return false;
}
```

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20210528/a32b251e/attachment.htm>


More information about the webkit-unassigned mailing list