Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 45b9cba6ef32c10965a7d3330d5a78951a9b0137
      
https://github.com/WebKit/WebKit/commit/45b9cba6ef32c10965a7d3330d5a78951a9b0137
  Author: Enrique Ocaña González <[email protected]>
  Date:   2025-01-10 (Fri, 10 Jan 2025)

  Changed paths:
    M Source/WebCore/platform/SourcesGStreamer.txt
    M Source/WebCore/platform/audio/gstreamer/WebKitWebAudioSourceGStreamer.cpp
    A Source/WebCore/platform/gstreamer/GStreamerQuirkOpenMAX.cpp
    A Source/WebCore/platform/gstreamer/GStreamerQuirkOpenMAX.h
    M Source/WebCore/platform/gstreamer/GStreamerQuirks.cpp
    M Source/WebCore/platform/gstreamer/GStreamerQuirks.h

  Log Message:
  -----------
  [GStreamer][WebAudio][Quirks] Fix initial WebAudio cut on Raspberry Pi
https://bugs.webkit.org/show_bug.cgi?id=285030

Reviewed by Philippe Normand.

WebAudio playback eats up a portion of the start of a sound after a
silence on Raspberry Pi when using OpenMAX. This is because the silence
buffers are marked with the GAP flag by WebKitWebAudioSourceGStreamer
and that causes them not to be rendered by the audio sink. This, in
turn, causes OpenMAX (the platform media framework used on Raspbery Pi
32 bit) to cool down and when the first audible buffer arrives, it takes
a fraction of a second to warm up again and play audio back.

This patch avoids marking the buffers as GAP on these platforms, fixing
the issue. Inserting non-gap buffers periodically (even with a frequency
of one non-gap per every gap) is not enough to solve the problem, so the
only alternative is to avoid gap buffers completely.

* Source/WebCore/platform/SourcesGStreamer.txt: Added new 
GStreamerQuirkOpenMAX.cpp file.
* Source/WebCore/platform/audio/gstreamer/WebKitWebAudioSourceGStreamer.cpp:
(webKitWebAudioSrcRenderAndPushFrames): Resort to quirks to process the buffers 
(marking them as gap and drop there or not). Do it in-place if quirks are 
disabled.
* Source/WebCore/platform/gstreamer/GStreamerQuirkOpenMAX.cpp: Added.
(WebCore::GStreamerQuirkOpenMAX::GStreamerQuirkOpenMAX): Constructor. 
Initialize debug category.
(WebCore::GStreamerQuirkOpenMAX::processWebAudioSilentBuffer const): Mark the 
buffers as no gap and no drop.
* Source/WebCore/platform/gstreamer/GStreamerQuirkOpenMAX.h: Added.
* Source/WebCore/platform/gstreamer/GStreamerQuirks.cpp:
(WebCore::GStreamerQuirksManager::GStreamerQuirksManager): Initialize OpenMAX 
quirk backend.
(WebCore::GStreamerQuirksManager::processWebAudioSilentBuffer const): Ask all 
backends to process the buffers. The backends will return true if they consider 
themselves as preferred, avoiding remaining backends after them to be queried.
* Source/WebCore/platform/gstreamer/GStreamerQuirks.h:
(WebCore::GStreamerQuirk::processWebAudioSilentBuffer const): Added default 
implementation that marks the buffers as gap and drop.

Canonical link: https://commits.webkit.org/288713@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to