Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 23bc4434 authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "No fast mixer for DEEP_BUFFER threads" into main am: e3813ad3 am: f0c7ba8a

parents cd67a648 f0c7ba8a
Loading
Loading
Loading
Loading
+13 −4
Original line number Diff line number Diff line
@@ -3252,9 +3252,9 @@ NO_THREAD_SAFETY_ANALYSIS

    // 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 ||
            kUseFastMixer == FastMixer_Dynamic)) {
    // Note: mType == SPATIALIZER does not support FastMixer and DEEP is by definition not "fast"
    if ((mType == MIXER && !(mOutput->flags & AUDIO_OUTPUT_FLAG_DEEP_BUFFER)) &&
            (kUseFastMixer == FastMixer_Static || kUseFastMixer == FastMixer_Dynamic)) {
        size_t minNormalFrameCount = (kMinNormalSinkBufferSizeMs * mSampleRate) / 1000;
        size_t maxNormalFrameCount = (kMaxNormalSinkBufferSizeMs * mSampleRate) / 1000;

@@ -5183,7 +5183,16 @@ MixerThread::MixerThread(const sp<IAfThreadCallback>& afThreadCallback, AudioStr
            break;
        case FastMixer_Static:
        case FastMixer_Dynamic:
            if (mType == MIXER && (output->flags & AUDIO_OUTPUT_FLAG_DEEP_BUFFER)) {
                /* Do not init fast mixer on deep buffer, warn if buffers are confed too small */
                initFastMixer = false;
                ALOGW_IF(mFrameCount * 1000 / mSampleRate < kMinNormalSinkBufferSizeMs,
                         "HAL DEEP BUFFER Buffer (%zu ms) is smaller than set minimal buffer "
                         "(%u ms), seems like a configuration error",
                         mFrameCount * 1000 / mSampleRate, kMinNormalSinkBufferSizeMs);
            } else {
                initFastMixer = mFrameCount < mNormalFrameCount;
            }
            break;
        }
        ALOGW_IF(initFastMixer == false && mFrameCount < mNormalFrameCount,