WebKit Bugzilla
Attachment 361226 Details for
Bug 194303
: Disable audio ducking at Audio Unit setup time
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-194303-20190205151424.patch (text/plain), 3.65 KB, created by
youenn fablet
on 2019-02-05 15:14:29 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
youenn fablet
Created:
2019-02-05 15:14:29 PST
Size:
3.65 KB
patch
obsolete
>Subversion Revision: 240959 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index ce186a46b1ecae8384e3755d975126ee1888435b..a64c05f6dbbce624f7c6b325b8b435720fe30c00 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,31 @@ >+2019-02-05 Youenn Fablet <youenn@apple.com> >+ >+ Disable audio ducking at Audio Unit setup time >+ https://bugs.webkit.org/show_bug.cgi?id=194303 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ When creating a CoreAudioCaptureSource, the audio unit might be >+ reconfigured if a past audio capture was done. >+ This might trigger audio ducking which is undone in startInternal. >+ In some cases, startInternal will never call start. >+ In that case, the audio unit will continue ducking the other processing. >+ To ensure ducking is disabled, unduck in setupAudioUnit as well as startInternal. >+ >+ In addition to that, once a shared unit is created, it stays alive until the UIProcess exits. >+ This might affect all applications. >+ Instead, whenever the shared unit is stopped, clean it so as to restore the state as if no capture ever happened. >+ This has noticeable effects in the quality of audio being played on bluetooth devices. >+ >+ Covered by manual tests. >+ >+ * platform/mediastream/mac/CoreAudioCaptureSource.cpp: >+ (WebCore::CoreAudioSharedUnit::setupAudioUnit): >+ (WebCore::CoreAudioSharedUnit::unduck): >+ (WebCore::CoreAudioSharedUnit::startInternal): >+ (WebCore::CoreAudioSharedUnit::captureFailed): >+ (WebCore::CoreAudioSharedUnit::stopProducingData): >+ > 2019-02-05 Youenn Fablet <youenn@apple.com> > > Simplify applyConstraints callbacks >diff --git a/Source/WebCore/platform/mediastream/mac/CoreAudioCaptureSource.cpp b/Source/WebCore/platform/mediastream/mac/CoreAudioCaptureSource.cpp >index e8c646e7fb4062d64e7a574d39a77f5a06afe091..d985dcb5c1de450677658b837437a3dc4c527576 100644 >--- a/Source/WebCore/platform/mediastream/mac/CoreAudioCaptureSource.cpp >+++ b/Source/WebCore/platform/mediastream/mac/CoreAudioCaptureSource.cpp >@@ -122,6 +122,8 @@ private: > OSStatus startInternal(); > void stopInternal(); > >+ void unduck(); >+ > void verifyIsCapturing(); > void devicesChanged(); > void captureFailed(); >@@ -339,9 +341,18 @@ OSStatus CoreAudioSharedUnit::setupAudioUnit() > m_ioUnitInitialized = true; > m_suspended = false; > >+ unduck(); >+ > return err; > } > >+void CoreAudioSharedUnit::unduck() >+{ >+ uint32_t outputDevice; >+ if (!defaultOutputDevice(&outputDevice)) >+ AudioDeviceDuck(outputDevice, 1.0, nullptr, 0); >+} >+ > OSStatus CoreAudioSharedUnit::configureMicrophoneProc() > { > AURenderCallbackStruct callback = { microphoneCallback, this }; >@@ -612,9 +623,7 @@ OSStatus CoreAudioSharedUnit::startInternal() > ASSERT(m_ioUnit); > } > >- uint32_t outputDevice; >- if (!defaultOutputDevice(&outputDevice)) >- AudioDeviceDuck(outputDevice, 1.0, nullptr, 0); >+ unduck(); > > err = AudioOutputUnitStart(m_ioUnit); > if (err) { >@@ -643,11 +652,10 @@ void CoreAudioSharedUnit::verifyIsCapturing() > captureFailed(); > } > >- > void CoreAudioSharedUnit::captureFailed() > { > #if !RELEASE_LOG_DISABLED >- RELEASE_LOG_ERROR(Media, "CoreAudioSharedUnit::captureFailed - capture failed\n"); >+ RELEASE_LOG_ERROR(Media, "CoreAudioSharedUnit::captureFailed - capture failed"); > #endif > for (CoreAudioCaptureSource& client : m_clients) > client.captureFailed(); >@@ -667,6 +675,7 @@ void CoreAudioSharedUnit::stopProducingData() > return; > > stopInternal(); >+ cleanupAudioUnit(); > } > > OSStatus CoreAudioSharedUnit::suspend()
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 194303
: 361226 |
361251