diff options
author | Treehugger Robot <android-test-infra-autosubmit@system.gserviceaccount.com> | 2023-06-22 08:49:02 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2023-06-22 08:49:02 +0000 |
commit | 2cd1f615ca16f867d64cf5a01af9de374ff1bb27 (patch) | |
tree | 0862ca4ec49c1ebd99510637ed14167440ad3f3c | |
parent | 73fc75989d8aa23ea5990a98ef4a2a7188a44135 (diff) | |
parent | 30e6720ab95b4a25ac505f4868df67d6c09c6ac7 (diff) |
Merge "audioflinger: Normalize FrameCount for duplicating thread" into t-keystone-qcom-dev
-rw-r--r-- | services/audioflinger/Threads.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/services/audioflinger/Threads.cpp b/services/audioflinger/Threads.cpp index a52b766712..e9ff42815c 100644 --- a/services/audioflinger/Threads.cpp +++ b/services/audioflinger/Threads.cpp @@ -2968,6 +2968,7 @@ void AudioFlinger::PlaybackThread::readOutputParameters_l() { // unfortunately we have no way of recovering from errors here, hence the LOG_ALWAYS_FATAL const audio_config_base_t audioConfig = mOutput->getAudioProperties(); + bool isDup = false; mSampleRate = audioConfig.sample_rate; mChannelMask = audioConfig.channel_mask; if (!audio_is_output_channel(mChannelMask)) { @@ -3050,10 +3051,14 @@ void AudioFlinger::PlaybackThread::readOutputParameters_l() // This may need to be updated as MixerThread/OutputTracks are added and not here. } + if (property_get_bool("vendor.audio.gaming.enabled", false /* default_value */) && + mType == DUPLICATING) { + isDup = true; + } // Calculate size of normal sink buffer relative to the HAL output buffer size double multiplier = 1.0; // Note: mType == SPATIALIZER does not support FastMixer. - if (mType == MIXER && (kUseFastMixer == FastMixer_Static || + if (mType == MIXER || isDup && (kUseFastMixer == FastMixer_Static || kUseFastMixer == FastMixer_Dynamic)) { size_t minNormalFrameCount = (kMinNormalSinkBufferSizeMs * mSampleRate) / 1000; size_t maxNormalFrameCount = (kMaxNormalSinkBufferSizeMs * mSampleRate) / 1000; |