Title: [288521] branches/safari-613-branch/Source/WebCore
- Revision
- 288521
- Author
- [email protected]
- Date
- 2022-01-24 17:56:22 -0800 (Mon, 24 Jan 2022)
Log Message
Cherry-pick r288275. rdar://problem/87707090
AVAudioSessionCaptureDeviceManager is not always computing the right default input device
https://bugs.webkit.org/show_bug.cgi?id=235362
<rdar://87707090>
Reviewed by Eric Carlson.
Sometimes the defaultInput is not available, in which case it is good to resort to the previous default device if available.
This fix prevents the following case to happen:
- We start rendering WebRTC audio on some output, say AirPods
- We start capturing microphone, but the default microphone is not the AirPods one (while it probably should, this is not always the case).
- We migrate audio rendering to VPIO which will output audio to the same device as the input microphone if feasible (typically builtin speaker).
- Audio is now flowing on builtin speaker instead of AirPods.
Manually tested.
* platform/mediastream/ios/AVAudioSessionCaptureDeviceManager.h:
* platform/mediastream/ios/AVAudioSessionCaptureDeviceManager.mm:
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@288275 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Modified Paths
Diff
Modified: branches/safari-613-branch/Source/WebCore/ChangeLog (288520 => 288521)
--- branches/safari-613-branch/Source/WebCore/ChangeLog 2022-01-25 01:56:18 UTC (rev 288520)
+++ branches/safari-613-branch/Source/WebCore/ChangeLog 2022-01-25 01:56:22 UTC (rev 288521)
@@ -1,5 +1,50 @@
2022-01-24 Alan Coon <[email protected]>
+ Cherry-pick r288275. rdar://problem/87707090
+
+ AVAudioSessionCaptureDeviceManager is not always computing the right default input device
+ https://bugs.webkit.org/show_bug.cgi?id=235362
+ <rdar://87707090>
+
+ Reviewed by Eric Carlson.
+
+ Sometimes the defaultInput is not available, in which case it is good to resort to the previous default device if available.
+ This fix prevents the following case to happen:
+ - We start rendering WebRTC audio on some output, say AirPods
+ - We start capturing microphone, but the default microphone is not the AirPods one (while it probably should, this is not always the case).
+ - We migrate audio rendering to VPIO which will output audio to the same device as the input microphone if feasible (typically builtin speaker).
+ - Audio is now flowing on builtin speaker instead of AirPods.
+
+ Manually tested.
+
+ * platform/mediastream/ios/AVAudioSessionCaptureDeviceManager.h:
+ * platform/mediastream/ios/AVAudioSessionCaptureDeviceManager.mm:
+
+
+ git-svn-id: https://svn.webkit.org/repository/webkit/trunk@288275 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+ 2022-01-20 Youenn Fablet <[email protected]>
+
+ AVAudioSessionCaptureDeviceManager is not always computing the right default input device
+ https://bugs.webkit.org/show_bug.cgi?id=235362
+ <rdar://87707090>
+
+ Reviewed by Eric Carlson.
+
+ Sometimes the defaultInput is not available, in which case it is good to resort to the previous default device if available.
+ This fix prevents the following case to happen:
+ - We start rendering WebRTC audio on some output, say AirPods
+ - We start capturing microphone, but the default microphone is not the AirPods one (while it probably should, this is not always the case).
+ - We migrate audio rendering to VPIO which will output audio to the same device as the input microphone if feasible (typically builtin speaker).
+ - Audio is now flowing on builtin speaker instead of AirPods.
+
+ Manually tested.
+
+ * platform/mediastream/ios/AVAudioSessionCaptureDeviceManager.h:
+ * platform/mediastream/ios/AVAudioSessionCaptureDeviceManager.mm:
+
+2022-01-24 Alan Coon <[email protected]>
+
Cherry-pick r288264. rdar://problem/87745419
Align our qualified name validation with the specification
Modified: branches/safari-613-branch/Source/WebCore/platform/mediastream/ios/AVAudioSessionCaptureDeviceManager.h (288520 => 288521)
--- branches/safari-613-branch/Source/WebCore/platform/mediastream/ios/AVAudioSessionCaptureDeviceManager.h 2022-01-25 01:56:18 UTC (rev 288520)
+++ branches/safari-613-branch/Source/WebCore/platform/mediastream/ios/AVAudioSessionCaptureDeviceManager.h 2022-01-25 01:56:22 UTC (rev 288521)
@@ -33,6 +33,7 @@
#include <wtf/WorkQueue.h>
OBJC_CLASS AVAudioSession;
+OBJC_CLASS AVAudioSessionPortDescription;
OBJC_CLASS WebAVAudioSessionAvailableInputsListener;
namespace WebCore {
@@ -83,6 +84,7 @@
AudioSessionState m_audioSessionState { AudioSessionState::NotNeeded };
String m_preferredAudioDeviceUID;
bool m_recomputeDevices { true };
+ mutable RetainPtr<AVAudioSessionPortDescription> m_lastDefaultMicrophone;
};
} // namespace WebCore
Modified: branches/safari-613-branch/Source/WebCore/platform/mediastream/ios/AVAudioSessionCaptureDeviceManager.mm (288520 => 288521)
--- branches/safari-613-branch/Source/WebCore/platform/mediastream/ios/AVAudioSessionCaptureDeviceManager.mm 2022-01-25 01:56:18 UTC (rev 288520)
+++ branches/safari-613-branch/Source/WebCore/platform/mediastream/ios/AVAudioSessionCaptureDeviceManager.mm 2022-01-25 01:56:22 UTC (rev 288521)
@@ -237,6 +237,12 @@
Vector<AVAudioSessionCaptureDevice> AVAudioSessionCaptureDeviceManager::retrieveAudioSessionCaptureDevices() const
{
auto *defaultInput = [m_audioSession currentRoute].inputs.firstObject;
+ if (!defaultInput)
+ defaultInput = m_lastDefaultMicrophone.get();
+ else {
+ RELEASE_LOG_INFO(WebRTC, "AVAudioSessionCaptureDeviceManager using previous default input");
+ m_lastDefaultMicrophone = defaultInput;
+ }
auto availableInputs = [m_audioSession availableInputs];
Vector<AVAudioSessionCaptureDevice> newAudioDevices;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes