⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 284689 in webkit


Ignore:
Timestamp:
Oct 22, 2021, 9:31:34 AM (5 years ago)
Author:
youenn@apple.com
Message:

REGRESSION (Safari 15 - iOS15): [WebRTC] Increased audio latency while playing webrtc audio stream over audio element
https://bugs.webkit.org/show_bug.cgi?id=230903
<rdar://problem/83692944>

Reviewed by Eric Carlson.

We used to render audio tracks in process and are now doing rendering in GPU process.
Current implementation requests data with a fixed chunk size, that we were setting as the max of preferred buffer size and web audio chunk size.
If we are reading too close to the end of data in AudioSampleDataSource, we will delay reading the data by this buffer size. This triggers delay but allows getting a consistent rendering.
To reduce delay, we are now using the maximum of web audio chunk size and 10 ms chunk size, as WebRTC tracks are usually manipulating 10 ms chunks.

Manually tested.

  • GPUProcess/webrtc/RemoteAudioMediaStreamTrackRendererInternalUnitManager.cpp:
Location:
trunk/Source/WebKit
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/ChangeLog

    r284682 r284689  
     12021-10-22  Youenn Fablet  <youenn@apple.com>
     2
     3        REGRESSION (Safari 15 - iOS15): [WebRTC] Increased audio latency while playing webrtc audio stream over audio element
     4        https://bugs.webkit.org/show_bug.cgi?id=230903
     5        <rdar://problem/83692944>
     6
     7        Reviewed by Eric Carlson.
     8
     9        We used to render audio tracks in process and are now doing rendering in GPU process.
     10        Current implementation requests data with a fixed chunk size, that we were setting as the max of preferred buffer size and web audio chunk size.
     11        If we are reading too close to the end of data in AudioSampleDataSource, we will delay reading the data by this buffer size. This triggers delay but allows getting a consistent rendering.
     12        To reduce delay, we are now using the maximum of web audio chunk size and 10 ms chunk size, as WebRTC tracks are usually manipulating 10 ms chunks.
     13
     14        Manually tested.
     15
     16        * GPUProcess/webrtc/RemoteAudioMediaStreamTrackRendererInternalUnitManager.cpp:
     17
    1182021-10-22  Per Arne Vollan <pvollan@apple.com>
    219
  • trunk/Source/WebKit/GPUProcess/webrtc/RemoteAudioMediaStreamTrackRendererInternalUnitManager.cpp

    r284674 r284689  
    143143            return;
    144144        }
    145         m_frameChunkSize = std::max(WebCore::AudioUtilities::renderQuantumSize, WebCore::AudioSession::sharedSession().preferredBufferSize());
     145        size_t tenMsSampleSize = description->sampleRate() * 10 / 1000;
     146        m_frameChunkSize = std::max(WebCore::AudioUtilities::renderQuantumSize, tenMsSampleSize);
    146147        callback(*description, m_frameChunkSize);
    147148    });
Note: See TracChangeset for help on using the changeset viewer.