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

Commit c89aa581 authored by wjiang's avatar wjiang Committed by Gerrit - the friendly Code Review server
Browse files

audioflinger: exclude channel check for offload thread

When moving effect chain between two playback threads, there's a
channel count check for stereo only. Such check only applies for deep
buffer playback where we upmix or downmix all channel count to stereo.

However, this constraint is not applicable for offload threads.

CRs-Fixed: 745226
Change-Id: Iaa16ddef1c19bf8b1c600e8bdb1ee1568a3a45db
parent d9b04af0
Loading
Loading
Loading
Loading
+6 −5
Original line number Diff line number Diff line
@@ -2602,12 +2602,13 @@ status_t AudioFlinger::moveEffectChain_l(int sessionId,
        return INVALID_OPERATION;
    }

    // Check whether the destination thread has a channel count of FCC_2, which is
    // currently required for (most) effects. Prevent moving the effect chain here rather
    // than disabling the addEffect_l() call in dstThread below.
    if (dstThread->mChannelCount != FCC_2) {
    // Check whether the destination thread has a channel count more than FCC_2, which is
    // currently required for (most) effects in deep buffer path. Prevent moving the effect
    // chain here rather than disabling the addEffect_l() call in dstThread below.
    if ((dstThread->mType == ThreadBase::MIXER || dstThread->mType == ThreadBase::DUPLICATING)
            && (dstThread->mChannelCount > FCC_2)) {
        ALOGW("moveEffectChain_l() effect chain failed because"
                " destination thread %p channel count(%u) != %u",
                " destination thread %p channel count(%u) > %u",
                dstThread, dstThread->mChannelCount, FCC_2);
        return INVALID_OPERATION;
    }