Bug 216171

Summary: [GStreamer] REGRESSION(r266559): imported/w3c/web-platform-tests/webaudio/the-audio-api/the-destinationnode-interface/destination.html is failing
Product: WebKit Reporter: Diego Pino <dpino>
Component: Web AudioAssignee: Philippe Normand <pnormand>
Status: RESOLVED FIXED    
Severity: Normal CC: calvaris, cdumez, eric.carlson, ews-watchlist, glenn, jer.noble, peng.liu6, philipj, pnormand, sergio, vjaquez, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch
none
Patch calvaris: review+

Description Diego Pino 2020-09-04 01:26:34 PDT
The test started failing after r266559 (AudioDestinationNode.maxChannelCount always returns 0):

imported/w3c/web-platform-tests/webaudio/the-audio-api/the-destinationnode-interface/destination.html [ Failure ]

Diff: https://build.webkit.org/results/GTK%20Linux%2064-bit%20Release%20(Tests)/r266579%20(15632)/imported/w3c/web-platform-tests/webaudio/the-audio-api/the-destinationnode-interface/destination-diff.txt

--- /home/buildbot/worker/gtk-linux-64-release-tests/build/layout-test-results/imported/w3c/web-platform-tests/webaudio/the-audio-api/the-destinationnode-interface/destination-expected.txt
+++ /home/buildbot/worker/gtk-linux-64-release-tests/build/layout-test-results/imported/w3c/web-platform-tests/webaudio/the-audio-api/the-destinationnode-interface/destination-actual.txt
@@ -1,5 +1,5 @@
 
-PASS 
+FAIL 
       AudioDestinationNode
-     
+     assert_greater_than_equal: maxChannelCount should be >= 2 expected a number greater than or equal to 2 but got 0
Comment 1 Philippe Normand 2020-09-04 01:52:02 PDT
To fix this I suppose we should look for Audio/Sink GstDevices and check the channels range in the caps...
Comment 2 Philippe Normand 2020-10-19 05:30:25 PDT
Created attachment 411739 [details]
Patch
Comment 3 Philippe Normand 2020-10-19 05:30:53 PDT
*** Bug 217699 has been marked as a duplicate of this bug. ***
Comment 4 Peng Liu 2020-10-19 11:59:57 PDT
Comment on attachment 411739 [details]
Patch

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

> Source/WebCore/platform/audio/gstreamer/AudioDestinationGStreamer.cpp:103
> +        WTFLogAlways("AudioDestination::create(%u, %u, %f) - unhandled input channels", numberOfInputChannels, numberOfOutputChannels, sampleRate);

Nit. Is this change intended?

> Source/WebCore/platform/audio/gstreamer/AudioDestinationGStreamer.cpp:207
> +            // m_isPlaying = newState >= GST_STATE_PLAYING;

Nit. Is this comment useful?

> Source/WebCore/platform/audio/gstreamer/AudioSourceProviderGStreamer.cpp:266
> +        [](GstAppSink* sink, gpointer userData) -> GstFlowReturn {

Looks like a duplicated code block? Can we avoid it? Thanks!
Comment 5 Philippe Normand 2020-10-20 01:31:15 PDT
Created attachment 411848 [details]
Patch
Comment 6 Philippe Normand 2020-10-20 02:19:29 PDT
Created attachment 411850 [details]
Patch
Comment 7 Xabier Rodríguez Calvar 2020-10-20 03:01:34 PDT
Comment on attachment 411850 [details]
Patch

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

> Source/WebCore/platform/audio/gstreamer/AudioDestinationGStreamer.cpp:103
> +        WTFLogAlways("AudioDestination::create(%u, %u, %f) - unhandled input channels", numberOfInputChannels, numberOfOutputChannels, sampleRate);

As Peng Liu asked, is the change to always intentional?
Comment 8 Philippe Normand 2020-10-20 03:03:44 PDT
Comment on attachment 411850 [details]
Patch

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

>> Source/WebCore/platform/audio/gstreamer/AudioDestinationGStreamer.cpp:103
>> +        WTFLogAlways("AudioDestination::create(%u, %u, %f) - unhandled input channels", numberOfInputChannels, numberOfOutputChannels, sampleRate);
> 
> As Peng Liu asked, is the change to always intentional?

Yes, it's matching the cocoa implementation.
Comment 9 Philippe Normand 2020-10-20 06:20:10 PDT
Committed r268727: <https://trac.webkit.org/changeset/268727>
Comment 10 Radar WebKit Bug Importer 2020-10-20 06:21:15 PDT
<rdar://problem/70482643>