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

Commit 8fbd0a66 authored by Andy Hung's avatar Andy Hung Committed by Automerger Merge Worker
Browse files

Merge "AudioFlinger: Unify spatializer behavior with normal mixer thread" into...

Merge "AudioFlinger: Unify spatializer behavior with normal mixer thread" into tm-dev am: 1fad7fe3

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/av/+/18085162



Change-Id: Ife2cf61ea3d3aa149cea931754947fad13cb9824
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 563313ac 1fad7fe3
Loading
Loading
Loading
Loading
+7 −5
Original line number Diff line number Diff line
@@ -3008,6 +3008,7 @@ void AudioFlinger::PlaybackThread::readOutputParameters_l()

    // 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)) {
        size_t minNormalFrameCount = (kMinNormalSinkBufferSizeMs * mSampleRate) / 1000;
@@ -3695,7 +3696,7 @@ bool AudioFlinger::PlaybackThread::threadLoop()
    cacheParameters_l();
    mSleepTimeUs = mIdleSleepTimeUs;

    if (mType == MIXER) {
    if (mType == MIXER || mType == SPATIALIZER) {
        sleepTimeShift = 0;
    }

@@ -3873,7 +3874,7 @@ bool AudioFlinger::PlaybackThread::threadLoop()

                    mStandbyTimeNs = systemTime() + mStandbyDelayNs;
                    mSleepTimeUs = mIdleSleepTimeUs;
                    if (mType == MIXER) {
                    if (mType == MIXER || mType == SPATIALIZER) {
                        sleepTimeShift = 0;
                    }

@@ -4150,7 +4151,8 @@ bool AudioFlinger::PlaybackThread::threadLoop()

                            // write blocked detection
                            const int64_t deltaWriteNs = lastIoEndNs - lastIoBeginNs;
                            if (mType == MIXER && deltaWriteNs > maxPeriod) {
                            if ((mType == MIXER || mType == SPATIALIZER)
                                    && deltaWriteNs > maxPeriod) {
                                mNumDelayedWrites++;
                                if ((lastIoEndNs - lastWarning) > kWarningThrottleNs) {
                                    ATRACE_NAME("underrun");
@@ -4171,7 +4173,7 @@ bool AudioFlinger::PlaybackThread::threadLoop()
                        (mMixerStatus == MIXER_DRAIN_ALL)) {
                    threadLoop_drain();
                }
                if (mType == MIXER && !mStandby) {
                if ((mType == MIXER || mType == SPATIALIZER) && !mStandby) {

                    if (mThreadThrottle
                            && mMixerStatus == MIXER_TRACKS_READY // we are mixing (active tracks)