Title: [289279] branches/safari-613-branch/Source/WebCore
Revision
289279
Author
[email protected]
Date
2022-02-07 18:53:33 -0800 (Mon, 07 Feb 2022)

Log Message

Cherry-pick r288124. rdar://problem/87721737

    Reduce failure timer in CoreAudioSharedUnit in the case we only render audio samples
    https://bugs.webkit.org/show_bug.cgi?id=235318

    Reviewed by Eric Carlson.

    As shown in https://bugs.webkit.org/show_bug.cgi?id=235317, it might be possible for a VPIO that is only used for
    audio rendering to fail sometimes. Waiting for 10 seconds in that case is very long, so we reduce the verification delay to 2 seconds.
    Manually tested.

    * platform/mediastream/mac/BaseAudioSharedUnit.cpp:
    * platform/mediastream/mac/BaseAudioSharedUnit.h:
    * platform/mediastream/mac/CoreAudioCaptureSource.cpp:

    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@288124 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Modified Paths

Diff

Modified: branches/safari-613-branch/Source/WebCore/ChangeLog (289278 => 289279)


--- branches/safari-613-branch/Source/WebCore/ChangeLog	2022-02-08 02:53:30 UTC (rev 289278)
+++ branches/safari-613-branch/Source/WebCore/ChangeLog	2022-02-08 02:53:33 UTC (rev 289279)
@@ -1,5 +1,40 @@
 2022-02-07  Russell Epstein  <[email protected]>
 
+        Cherry-pick r288124. rdar://problem/87721737
+
+    Reduce failure timer in CoreAudioSharedUnit in the case we only render audio samples
+    https://bugs.webkit.org/show_bug.cgi?id=235318
+    
+    Reviewed by Eric Carlson.
+    
+    As shown in https://bugs.webkit.org/show_bug.cgi?id=235317, it might be possible for a VPIO that is only used for
+    audio rendering to fail sometimes. Waiting for 10 seconds in that case is very long, so we reduce the verification delay to 2 seconds.
+    Manually tested.
+    
+    * platform/mediastream/mac/BaseAudioSharedUnit.cpp:
+    * platform/mediastream/mac/BaseAudioSharedUnit.h:
+    * platform/mediastream/mac/CoreAudioCaptureSource.cpp:
+    
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@288124 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2022-01-18  Youenn Fablet  <[email protected]>
+
+            Reduce failure timer in CoreAudioSharedUnit in the case we only render audio samples
+            https://bugs.webkit.org/show_bug.cgi?id=235318
+
+            Reviewed by Eric Carlson.
+
+            As shown in https://bugs.webkit.org/show_bug.cgi?id=235317, it might be possible for a VPIO that is only used for
+            audio rendering to fail sometimes. Waiting for 10 seconds in that case is very long, so we reduce the verification delay to 2 seconds.
+            Manually tested.
+
+            * platform/mediastream/mac/BaseAudioSharedUnit.cpp:
+            * platform/mediastream/mac/BaseAudioSharedUnit.h:
+            * platform/mediastream/mac/CoreAudioCaptureSource.cpp:
+
+2022-02-07  Russell Epstein  <[email protected]>
+
         Cherry-pick r288110. rdar://problem/87699178
 
     BaseAudioSharedUnit::devicesChanged is failing capture too much in GPUProcess

Modified: branches/safari-613-branch/Source/WebCore/platform/mediastream/mac/BaseAudioSharedUnit.cpp (289278 => 289279)


--- branches/safari-613-branch/Source/WebCore/platform/mediastream/mac/BaseAudioSharedUnit.cpp	2022-02-08 02:53:30 UTC (rev 289278)
+++ branches/safari-613-branch/Source/WebCore/platform/mediastream/mac/BaseAudioSharedUnit.cpp	2022-02-08 02:53:33 UTC (rev 289279)
@@ -188,6 +188,12 @@
     cleanupAudioUnit();
 }
 
+void BaseAudioSharedUnit::setIsProducingMicrophoneSamples(bool value)
+{
+    m_isProducingMicrophoneSamples = value;
+    isProducingMicrophoneSamplesChanged();
+}
+
 void BaseAudioSharedUnit::setIsRenderingAudio(bool value)
 {
     m_isRenderingAudio = value;

Modified: branches/safari-613-branch/Source/WebCore/platform/mediastream/mac/BaseAudioSharedUnit.h (289278 => 289279)


--- branches/safari-613-branch/Source/WebCore/platform/mediastream/mac/BaseAudioSharedUnit.h	2022-02-08 02:53:30 UTC (rev 289278)
+++ branches/safari-613-branch/Source/WebCore/platform/mediastream/mac/BaseAudioSharedUnit.h	2022-02-08 02:53:33 UTC (rev 289279)
@@ -102,8 +102,9 @@
     void setIsRenderingAudio(bool);
 
 protected:
-    void setIsProducingMicrophoneSamples(bool value) { m_isProducingMicrophoneSamples = value; }
+    void setIsProducingMicrophoneSamples(bool);
     bool isProducingMicrophoneSamples() const { return m_isProducingMicrophoneSamples; }
+    virtual void isProducingMicrophoneSamplesChanged() { }
 
 private:
     OSStatus startUnit();

Modified: branches/safari-613-branch/Source/WebCore/platform/mediastream/mac/CoreAudioCaptureSource.cpp (289278 => 289279)


--- branches/safari-613-branch/Source/WebCore/platform/mediastream/mac/CoreAudioCaptureSource.cpp	2022-02-08 02:53:30 UTC (rev 289278)
+++ branches/safari-613-branch/Source/WebCore/platform/mediastream/mac/CoreAudioCaptureSource.cpp	2022-02-08 02:53:33 UTC (rev 289279)
@@ -98,6 +98,7 @@
     OSStatus startInternal() final;
     void stopInternal() final;
     bool isProducingData() const final { return m_ioUnitStarted; }
+    void isProducingMicrophoneSamplesChanged() final;
 
     OSStatus configureSpeakerProc();
     OSStatus configureMicrophoneProc();
@@ -114,6 +115,8 @@
 
     void verifyIsCapturing();
 
+    Seconds verifyCaptureInterval() { return isProducingMicrophoneSamples() ? 10_s : 2_s; }
+
     AudioUnit m_ioUnit { nullptr };
 
     // Only read/modified from the IO thread.
@@ -142,7 +145,6 @@
     uint64_t m_microphoneProcsCalled { 0 };
     uint64_t m_microphoneProcsCalledLastTime { 0 };
     Timer m_verifyCapturingTimer;
-    static constexpr Seconds verifyCaptureInterval = 10_s;
 
     Lock m_speakerSamplesProducerLock;
     CoreAudioSpeakerSamplesProducer* m_speakerSamplesProducer WTF_GUARDED_BY_LOCK(m_speakerSamplesProducerLock) { nullptr };
@@ -507,7 +509,7 @@
 
     m_ioUnitStarted = true;
 
-    m_verifyCapturingTimer.startRepeating(verifyCaptureInterval);
+    m_verifyCapturingTimer.startRepeating(verifyCaptureInterval());
     m_microphoneProcsCalled = 0;
     m_microphoneProcsCalledLastTime = 0;
 
@@ -514,6 +516,13 @@
     return 0;
 }
 
+void CoreAudioSharedUnit::isProducingMicrophoneSamplesChanged()
+{
+    if (!isProducingData())
+        return;
+    m_verifyCapturingTimer.startRepeating(verifyCaptureInterval());
+}
+
 void CoreAudioSharedUnit::verifyIsCapturing()
 {
     if (m_microphoneProcsCalledLastTime != m_microphoneProcsCalled) {
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to