Closed Bug 1887774 Opened 8 months ago Closed 8 months ago

Set EchoCanceller3Config::echo_removal_control.has_clock_drift when clock drift is expected

Categories

(Core :: WebRTC: Audio/Video, enhancement)

enhancement

Tracking

()

RESOLVED FIXED
126 Branch
Tracking Status
firefox126 --- fixed

People

(Reporter: karlt, Assigned: karlt)

References

(Blocks 1 open bug)

Details

Attachments

(12 files)

48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review

Andreas pointed out the has_clock_drift configuration for AudioProcessing, which may help the echo canceller when it struggles due to clock drift with a secondary audio output or input.

This parameter was initially introduced because setups with clock-drift are generally difficult to handle for echo cancellers, but it had no effect at that time. It was later used, when echo suppression was reduced for dominant near end, so as not to reduce echo suppression when clock drift is expected. Calls with clock drift tend to have less accurate linear filters. The parameter forces limiting of the high frequency gains to avoid echo leakage due to an imperfect filter.

Even without this parameter set, aec3 attempts to detect clock drift and apply the same limiting if detected. The ClockdriftDetector, however, did not detect drift, even when the AudioProcessing successfully cancels echo at 1.002 drift.

The only API to set has_clock_drift for an AudioProcessing is an EchoCanceller3Factory, which must be set when constructing the AudioProcessing. The echo controller is always enabled regardless of Config::echo_canceller::enabled if echo_control_factory_ is set.

Without PREF_CUBEB_FORCE_SAMPLE_RATE in gInitCallbackPrefs, content processes
did not see the pref value unless the pref was changed during the lifetime of
the content process.

Depends on D206863

This clarifies that config, pass-through, and input channel count are all set
in the same way.

It will also facilitate delayed AudioProcessing construction in a subsequent
patch.

Depends on D206865

mPacketizerInput won't need to be re-created for every channel count change if
no processing is done for some channel counts.

More signficantly, this will facilitate delaying, in a subsequent patch,
AudioProcessing construction while its parameters may still be changing.

Depends on D206866

The benefit is that whether the DeviceInputTrack or reverse stream could be
affected by clock drift is more likely to be known, and so recreation of
mAudioProcessing will be less likely when, in a subsequent patch, the
AudioProcessing needs to be replaced when the possibility of drift changes.

mSkipProcessing and mRequestedInputChannelCount are now replaced by their
MediaEnginePrefs equivalents. The AudioInputProcessing now starts in
pass-through mode, consistent with its initial AEC, AGC, and noise suppression
settings.

Depends on D206867

from a secondary input or output device.

Depends on D206870

Attachment #9395468 - Attachment description: Bug 1887774 Set EchoCanceller3Config::echo_removal_control.has_clock_drift when clock drift is expected r?pehrsons → Bug 1887774 pass a track to EnsureAudioProcessing() r?pehrsons

from a secondary input or output device.

Depends on D206871

This change helps echo cancellation but drift still makes cancellation less effective than when there is no drift.

Keywords: leave-open
Pushed by ktomlinson@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/a0902541309d add prefs to simulate drift in audio streams r=padenot
Pushed by ktomlinson@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/679472e2bd34 apply a saved "media.cubeb.force_sample_rate" pref in content processes r=padenot
Pushed by ktomlinson@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/399bfc5051b2 skip sleeps to run AudioProcessingTrackDisabling GTest 6 seconds faster r=padenot
Pushed by ktomlinson@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/5d2d7dc377c8 convert from MediaEnginePrefs to AudioProcessing config in AudioInputProcessing r=pehrsons
Pushed by ktomlinson@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/deb37d76e032 remove unnecessary aPort parameter from GetInputSourceData() r=pehrsons
Pushed by ktomlinson@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/e9eb44aa2ffa rename ConnectToNativeDevice introspection function to ConnectedToNativeDevice r=pehrsons
Pushed by ktomlinson@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/bd2cdabcc883 delay mPacketizerInput initialization until required r=pehrsons
Pushed by ktomlinson@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/210dbccad6f2 delay AudioProcessing initialization until required r=pehrsons
Pushed by ktomlinson@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/29c59d5d9bee pass a track to EnsureAudioProcessing() r=pehrsons
Backout by csabou@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/bd8757fdd446 Backed out 2 changesets for causing gtest failures. CLOSED TREE
Pushed by ktomlinson@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/c06840f719aa delay AudioProcessing initialization until required r=pehrsons https://hg.mozilla.org/integration/autoland/rev/6c8ba616b1c4 pass a track to EnsureAudioProcessing() r=pehrsons https://hg.mozilla.org/integration/autoland/rev/df631cf3e2aa Set EchoCanceller3Config::echo_removal_control.has_clock_drift when clock drift is expected r=pehrsons
Pushed by ktomlinson@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/ebe948d4a99a GTest EchoCanceller3Config::echo_removal_control.has_clock_drift config r=pehrsons
Pushed by ktomlinson@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/b2da6f77d3ad add a preference to override EchoCanceller3Config::echo_removal_control.has_clock_drift r=pehrsons
Keywords: leave-open
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: