Revert "Fix volume value and DPE range"
This reverts commit a5b45b11cfe1a918cc06b4a81fab58be84425888.
Reason for revert: b/310751043
Change-Id: Ib9cbb7fd267baad346a57fe1a3fa87d85cd004a9
diff --git a/media/libeffects/dynamicsproc/aidl/DynamicsProcessing.cpp b/media/libeffects/dynamicsproc/aidl/DynamicsProcessing.cpp
index 85ea53a..63cb48d 100644
--- a/media/libeffects/dynamicsproc/aidl/DynamicsProcessing.cpp
+++ b/media/libeffects/dynamicsproc/aidl/DynamicsProcessing.cpp
@@ -105,14 +105,14 @@
DynamicsProcessing::EqBandConfig({.channel = 0,
.band = 0,
.enable = false,
- .cutoffFrequencyHz = 0,
+ .cutoffFrequencyHz = 20,
.gainDb = -200});
static const DynamicsProcessing::EqBandConfig kEqBandConfigMax =
DynamicsProcessing::EqBandConfig({.channel = std::numeric_limits<int>::max(),
.band = std::numeric_limits<int>::max(),
.enable = true,
- .cutoffFrequencyHz = 192000,
+ .cutoffFrequencyHz = 20000.1,
.gainDb = 200});
static const Range::DynamicsProcessingRange kPreEqBandConfigRange = {
@@ -129,7 +129,7 @@
{.channel = 0,
.band = 0,
.enable = false,
- .cutoffFrequencyHz = 0,
+ .cutoffFrequencyHz = 20,
.attackTimeMs = 0,
.releaseTimeMs = 0,
.ratio = 1,
@@ -144,7 +144,7 @@
{.channel = std::numeric_limits<int>::max(),
.band = std::numeric_limits<int>::max(),
.enable = true,
- .cutoffFrequencyHz = 192000,
+ .cutoffFrequencyHz = 20000.1,
.attackTimeMs = 60000,
.releaseTimeMs = 60000,
.ratio = 50,
@@ -443,7 +443,7 @@
IEffect::Status DynamicsProcessingImpl::effectProcessImpl(float* in, float* out, int samples) {
IEffect::Status status = {EX_NULL_POINTER, 0, 0};
RETURN_VALUE_IF(!mContext, status, "nullContext");
- return mContext->dpeProcess(in, out, samples);
+ return mContext->lvmProcess(in, out, samples);
}
} // namespace aidl::android::hardware::audio::effect
diff --git a/media/libeffects/dynamicsproc/aidl/DynamicsProcessingContext.cpp b/media/libeffects/dynamicsproc/aidl/DynamicsProcessingContext.cpp
index e5e5368..57c873b 100644
--- a/media/libeffects/dynamicsproc/aidl/DynamicsProcessingContext.cpp
+++ b/media/libeffects/dynamicsproc/aidl/DynamicsProcessingContext.cpp
@@ -19,7 +19,6 @@
#include "DynamicsProcessingContext.h"
#include "DynamicsProcessing.h"
-#include <audio_utils/power.h>
#include <sys/param.h>
#include <functional>
#include <unordered_set>
@@ -69,23 +68,6 @@
return RetCode::SUCCESS;
}
-RetCode DynamicsProcessingContext::setVolumeStereo(const Parameter::VolumeStereo& volumeStereo) {
- std::lock_guard lg(mMutex);
- dp_fx::DPChannel* leftChannel = mDpFreq->getChannel(0);
- dp_fx::DPChannel* rightChannel = mDpFreq->getChannel(1);
- if (leftChannel != nullptr) {
- leftChannel->setOutputGain(audio_utils_power_from_amplitude(volumeStereo.left));
- }
- if (rightChannel != nullptr) {
- rightChannel->setOutputGain(audio_utils_power_from_amplitude(volumeStereo.right));
- }
- return RetCode::SUCCESS;
-}
-
-Parameter::VolumeStereo DynamicsProcessingContext::getVolumeStereo() {
- return {1.0f, 1.0f};
-}
-
void DynamicsProcessingContext::dpSetFreqDomainVariant_l(
const DynamicsProcessing::EngineArchitecture& engine) {
mDpFreq.reset(new dp_fx::DPFrequency());
@@ -291,7 +273,7 @@
return ret;
}
-IEffect::Status DynamicsProcessingContext::dpeProcess(float* in, float* out, int samples) {
+IEffect::Status DynamicsProcessingContext::lvmProcess(float* in, float* out, int samples) {
LOG(DEBUG) << __func__ << " in " << in << " out " << out << " sample " << samples;
IEffect::Status status = {EX_NULL_POINTER, 0, 0};
@@ -478,11 +460,6 @@
RetCode ret = RetCode::SUCCESS;
std::unordered_set<int> channelSet;
- if (!stageInUse) {
- LOG(WARNING) << __func__ << " not in use " << ::android::internal::ToString(channels);
- return RetCode::SUCCESS;
- }
-
RETURN_VALUE_IF(!stageInUse, RetCode::ERROR_ILLEGAL_PARAMETER, "stageNotInUse");
for (auto& it : channels) {
if (0 != channelSet.count(it.channel)) {
diff --git a/media/libeffects/dynamicsproc/aidl/DynamicsProcessingContext.h b/media/libeffects/dynamicsproc/aidl/DynamicsProcessingContext.h
index ced7f19..b8539f6 100644
--- a/media/libeffects/dynamicsproc/aidl/DynamicsProcessingContext.h
+++ b/media/libeffects/dynamicsproc/aidl/DynamicsProcessingContext.h
@@ -45,8 +45,6 @@
// override EffectContext::setCommon to update mChannelCount
RetCode setCommon(const Parameter::Common& common) override;
- RetCode setVolumeStereo(const Parameter::VolumeStereo& volumeStereo) override;
- Parameter::VolumeStereo getVolumeStereo() override;
RetCode setEngineArchitecture(const DynamicsProcessing::EngineArchitecture& engineArchitecture);
RetCode setPreEq(const std::vector<DynamicsProcessing::ChannelConfig>& eqChannels);
@@ -68,7 +66,7 @@
std::vector<DynamicsProcessing::LimiterConfig> getLimiter();
std::vector<DynamicsProcessing::InputGain> getInputGain();
- IEffect::Status dpeProcess(float* in, float* out, int samples);
+ IEffect::Status lvmProcess(float* in, float* out, int samples);
private:
static constexpr float kPreferredProcessingDurationMs = 10.0f;
diff --git a/media/libeffects/lvm/wrapper/Aidl/BundleContext.h b/media/libeffects/lvm/wrapper/Aidl/BundleContext.h
index 3f31b8b..62bb6e4 100644
--- a/media/libeffects/lvm/wrapper/Aidl/BundleContext.h
+++ b/media/libeffects/lvm/wrapper/Aidl/BundleContext.h
@@ -98,7 +98,7 @@
const Virtualizer::SpeakerAnglesPayload payload);
RetCode setVolumeStereo(const Parameter::VolumeStereo& volumeStereo) override;
- Parameter::VolumeStereo getVolumeStereo() override { return {1.0f, 1.0f}; }
+ Parameter::VolumeStereo getVolumeStereo() override { return mVolumeStereo; }
IEffect::Status lvmProcess(float* in, float* out, int samples);