Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: ada13b119831c938d4a5fbbd5c502c3d3ae6c667
      
https://github.com/WebKit/WebKit/commit/ada13b119831c938d4a5fbbd5c502c3d3ae6c667
  Author: Jer Noble <jer.no...@apple.com>
  Date:   2025-06-03 (Tue, 03 Jun 2025)

  Changed paths:
    M Source/WTF/wtf/Threading.h
    M Source/WebCore/Headers.cmake
    M Source/WebCore/Sources.txt
    M Source/WebCore/WebCore.xcodeproj/project.pbxproj
    A Source/WebCore/platform/audio/RealtimeAudioThread.cpp
    A Source/WebCore/platform/audio/RealtimeAudioThread.h
    M Source/WebCore/platform/audio/cocoa/AudioEncoderCocoa.cpp
    M Source/WebCore/platform/audio/cocoa/WebAudioBufferList.cpp
    M Source/WebCore/platform/graphics/GraphicsContextGLImageExtractor.h
    M Source/WebCore/platform/graphics/cg/GradientRendererCG.h
    M Source/WebCore/platform/graphics/cg/ImageBufferIOSurfaceBackend.cpp
    M Source/WebCore/platform/graphics/filters/FilterRenderingMode.cpp
    M Source/WebCore/platform/graphics/gbm/MemoryMappedGPUBuffer.cpp
    M Source/WebCore/platform/mediastream/mac/RealtimeIncomingAudioSourceCocoa.h
    M Source/WebKit/WebProcess/GPU/media/RemoteAudioDestinationProxy.cpp
    M Source/WebKit/WebProcess/GPU/media/RemoteAudioDestinationProxy.h
    M Source/WebKit/WebProcess/cocoa/RemoteCaptureSampleManager.cpp

  Log Message:
  -----------
  WebContent Process capture thread can become de-prioritized; leading to 
underruns
https://bugs.webkit.org/show_bug.cgi?id=293295
rdar://problem/151699897

Reviewed by Youenn Fablet.

The Audio IO thread in the GPU process is running at a realtime scheduling 
priority,
reading samples from a shared ring buffer for Web Audio, and storing samples 
into a
shared ring buffer for microphone capture. While the matching thread storing 
samples
for Web Audio in the Web Content process (owned by 
RemoteAudioDestinationManager) is
also running at a realtime priority, the matching thread reading microphone 
samples
from the shared ring buffer is running at a normal thread priority. This allows 
the
kernel to deprioritize and preempt that thread, which can lead to dropped 
microphone
samples when used as an input to Web Audio.

For now, the limit to the number of concurrent realtime audio threads is 3. 
Given
that its relatively unlikely to have three capture sessions running 
simultaneously
this is likely good enough, and in the future, we can and should coalesce all of
of these threads into a single audio thread.

* Source/WTF/wtf/Threading.h:
* Source/WebKit/GPUProcess/media/RemoteAudioDestinationManager.cpp:
* Source/WebKit/WebProcess/cocoa/RemoteCaptureSampleManager.cpp:
(WebKit::RemoteCaptureSampleManager::RemoteAudio::stopThread):
(WebKit::RemoteCaptureSampleManager::RemoteAudio::startThread):
* Source/WebKit/WebProcess/cocoa/RemoteCaptureSampleManager.h:

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



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

Reply via email to