Audio effect aidl log reduce and level adjust
Bug: 329334917
Test: atest AudioEffectTest
Test: atest CtsMediaAudioTestCases
Test: atest CtsEffectTestCases
Test: audio use cases on pixel AIDL audio hal
Change-Id: I49876924b230f2ac834d3b0e494a03b814c4bb6e
Merged-In: I49876924b230f2ac834d3b0e494a03b814c4bb6e
diff --git a/audio/aidl/default/EffectImpl.cpp b/audio/aidl/default/EffectImpl.cpp
index 4d7b980..03de74f 100644
--- a/audio/aidl/default/EffectImpl.cpp
+++ b/audio/aidl/default/EffectImpl.cpp
@@ -35,7 +35,6 @@
<< " in state: " << toString(state) << ", status: " << status.getDescription();
return EX_ILLEGAL_STATE;
}
- LOG(DEBUG) << __func__ << " instance " << instanceSp.get() << " destroyed";
return EX_NONE;
}
@@ -91,7 +90,7 @@
}
RETURN_IF(notifyEventFlag(kEventFlagNotEmpty) != RetCode::SUCCESS, EX_ILLEGAL_STATE,
- "notifyEventFlagFailed");
+ "notifyEventFlagNotEmptyFailed");
// stop the worker thread, ignore the return code
RETURN_IF(destroyThread() != RetCode::SUCCESS, EX_UNSUPPORTED_OPERATION,
"FailedToDestroyWorker");
@@ -231,8 +230,6 @@
ndk::ScopedAStatus EffectImpl::command(CommandId command) {
std::lock_guard lg(mImplMutex);
RETURN_IF(mState == State::INIT, EX_ILLEGAL_STATE, "instanceNotOpen");
- LOG(DEBUG) << getEffectName() << __func__ << ": receive command: " << toString(command)
- << " at state " << toString(mState);
switch (command) {
case CommandId::START:
@@ -240,7 +237,7 @@
RETURN_IF_ASTATUS_NOT_OK(commandImpl(command), "commandImplFailed");
mState = State::PROCESSING;
RETURN_IF(notifyEventFlag(kEventFlagNotEmpty) != RetCode::SUCCESS, EX_ILLEGAL_STATE,
- "notifyEventFlagFailed");
+ "notifyEventFlagNotEmptyFailed");
startThread();
break;
case CommandId::STOP:
@@ -248,7 +245,7 @@
RETURN_OK_IF(mState == State::IDLE);
mState = State::IDLE;
RETURN_IF(notifyEventFlag(kEventFlagNotEmpty) != RetCode::SUCCESS, EX_ILLEGAL_STATE,
- "notifyEventFlagFailed");
+ "notifyEventFlagNotEmptyFailed");
stopThread();
RETURN_IF_ASTATUS_NOT_OK(commandImpl(command), "commandImplFailed");
break;
@@ -257,7 +254,7 @@
return ndk::ScopedAStatus::fromExceptionCodeWithMessage(EX_ILLEGAL_ARGUMENT,
"CommandIdNotSupported");
}
- LOG(DEBUG) << getEffectName() << __func__ << " transfer to state: " << toString(mState);
+ LOG(VERBOSE) << getEffectName() << __func__ << " transfer to state: " << toString(mState);
return ndk::ScopedAStatus::ok();
}
@@ -294,6 +291,7 @@
LOG(ERROR) << getEffectName() << __func__ << ": wake failure with ret " << ret;
return RetCode::ERROR_EVENT_FLAG_ERROR;
}
+ LOG(VERBOSE) << getEffectName() << __func__ << ": " << std::hex << mEventFlag;
return RetCode::SUCCESS;
}
@@ -306,7 +304,7 @@
}
void EffectImpl::process() {
- ATRACE_CALL();
+ ATRACE_NAME(getEffectName().c_str());
/**
* wait for the EventFlag without lock, it's ok because the mEfGroup pointer will not change
* in the life cycle of workerThread (threadLoop).
@@ -344,8 +342,6 @@
IEffect::Status status = effectProcessImpl(buffer, buffer, processSamples);
outputMQ->write(buffer, status.fmqProduced);
statusMQ->writeBlocking(&status, 1);
- LOG(VERBOSE) << getEffectName() << __func__ << ": done processing, effect consumed "
- << status.fmqConsumed << " produced " << status.fmqProduced;
}
}
}
@@ -355,7 +351,6 @@
for (int i = 0; i < samples; i++) {
*out++ = *in++;
}
- LOG(VERBOSE) << getEffectName() << __func__ << " done processing " << samples << " samples";
return {STATUS_OK, samples, samples};
}