Bug 220112

Summary: REGRESSION[r270947][GStreamer]: Deadlocks audio rendering
Product: WebKit Reporter: Philippe Normand <pnormand>
Component: Web AudioAssignee: Philippe Normand <pnormand>
Status: RESOLVED FIXED    
Severity: Normal CC: annulen, calvaris, cdumez, eric.carlson, ews-watchlist, ggaren, glenn, gyuyoung.kim, jer.noble, philipj, pnormand, ryuan.choi, sergio, vjaquez, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on: 219990    
Bug Blocks: 219245    
Attachments:
Description Flags
Patch cdumez: review+, cdumez: commit-queue-

Description Philippe Normand 2020-12-23 02:24:45 PST
+++ This bug was initially created as a clone of Bug #219990 +++

> Simplify code related to dispatchToRenderThread in WebAudio:
> 1. AudioDestination::start() now always gets called with a non-null dispatchToRenderThread lambda. In the case where there is no AudioWorkletThread to dispatch to, the lambda simply calls its task synchronously.

This is the cause of the regression in GStreamer ports, when there is no AudioWorklet, the dispatchCondition in WebKitWebAudioSourceGStreamer is fired synchronously before the corresponding wait call, introducing the infinite wait...
Comment 1 Philippe Normand 2020-12-24 07:18:43 PST
Created attachment 416749 [details]
Patch
Comment 2 Chris Dumez 2021-01-05 08:37:14 PST
Comment on attachment 416749 [details]
Patch

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

> Source/WebCore/platform/audio/gstreamer/AudioDestinationGStreamer.h:59
> +    Optional<CompletionHandler<void(bool)>> m_startupCompletionHandler;

Does not need to be Optional<>. CompletionHandler has a null state.

> Source/WebCore/platform/audio/gstreamer/AudioDestinationGStreamer.h:60
> +    Optional<CompletionHandler<void(bool)>> m_stopCompletionHandler;

Ditto.
Comment 3 Philippe Normand 2021-01-06 01:57:56 PST
Committed r271197: <https://trac.webkit.org/changeset/271197>