audio flinger: add support for effects without process function
Add support for effects indicating they do not implement a process
function and do not consume CPU or add latency.
Enable those effects on RAW and FAST outputs and inputs.
Do not call the process function.
Bug: 31491112.
Change-Id: If020c8bb3b180568dec5138b087edec8c2524182
diff --git a/services/audioflinger/Threads.cpp b/services/audioflinger/Threads.cpp
index 6aedd29..a91fc26 100644
--- a/services/audioflinger/Threads.cpp
+++ b/services/audioflinger/Threads.cpp
@@ -1272,6 +1272,12 @@
desc->name, mThreadName);
return BAD_VALUE;
}
+
+ // always allow effects without processing load or latency
+ if ((desc->flags & EFFECT_FLAG_NO_PROCESS_MASK) == EFFECT_FLAG_NO_PROCESS) {
+ return NO_ERROR;
+ }
+
audio_input_flags_t flags = mInput->flags;
if (hasFastCapture() || (flags & AUDIO_INPUT_FLAG_FAST)) {
if (flags & AUDIO_INPUT_FLAG_RAW) {
@@ -1328,6 +1334,11 @@
break;
}
}
+
+ // always allow effects without processing load or latency
+ if ((desc->flags & EFFECT_FLAG_NO_PROCESS_MASK) == EFFECT_FLAG_NO_PROCESS) {
+ break;
+ }
if (flags & AUDIO_OUTPUT_FLAG_RAW) {
ALOGW("checkEffectCompatibility_l(): effect %s on playback thread in raw mode",
desc->name);