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

Commit cfb68134 authored by Tomoharu Kasahara's avatar Tomoharu Kasahara Committed by Andy Hung
Browse files

Ignore config error if non-offloadable effect is on offload thread

Return NO_ERROR if a non-offloadable effect is created on an offload thread
(since the sampling rate of offload output can be different from
the one supported by a software effect). Enabling the non-offloadable
effect will cause the track to move to a non-offload thread.

Bug: 70912361
Test: Create AudioEffect during 24kHz mp3 playback
Change-Id: Ie5bf264a9790d936c24476ea127bc6da9eefde73
parent e54461ae
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -589,6 +589,13 @@ status_t AudioFlinger::EffectModule::configure()
        status = cmdStatus;
    }

    // Ignore error if non-offloadable effect is created on an offload thread.
    // Will be switched to non-offload thread when the effect is enabled.
    if (status != NO_ERROR && thread->type() == ThreadBase::OFFLOAD && !isOffloaded()) {
        ALOGV("Ignore error %d on non-offloadable effect on offload thread", status);
        status = NO_ERROR;
    }

#ifdef MULTICHANNEL_EFFECT_CHAIN
    if (status != NO_ERROR &&
            (mConfig.inputCfg.channels != AUDIO_CHANNEL_OUT_STEREO