From 8463b73ccc3488bc52ad936980b99e5779acb1c1 Mon Sep 17 00:00:00 2001 From: Iscle Date: Thu, 3 Apr 2025 00:35:10 +0200 Subject: [PATCH] Improve log header and fix some includes --- CMakeLists.txt | 21 +- src/ViPER4Aidl.cpp | 2 +- src/ViPER4Android.cpp | 4 +- src/ViperContext.cpp | 245 ++++++++++++------------ src/ViperContext.h | 2 +- src/{viper => include}/constants.h | 2 +- src/include/log.h | 81 ++++++++ src/log.h | 9 - src/viper/ViPER.cpp | 16 +- src/viper/effects/AnalogX.cpp | 2 +- src/viper/effects/ColorfulMusic.cpp | 2 +- src/viper/effects/Convolver.cpp | 2 +- src/viper/effects/DiffSurround.cpp | 2 +- src/viper/effects/DynamicSystem.cpp | 2 +- src/viper/effects/FETCompressor.cpp | 2 +- src/viper/effects/IIRFilter.cpp | 2 +- src/viper/effects/PlaybackGain.cpp | 2 +- src/viper/effects/Reverberation.cpp | 1 - src/viper/effects/SpeakerCorrection.cpp | 2 +- src/viper/effects/SpectrumExtend.cpp | 2 +- src/viper/effects/VHE.cpp | 6 +- src/viper/effects/ViPERBass.cpp | 2 +- src/viper/effects/ViPERClarity.cpp | 2 +- src/viper/effects/ViPERDDC.cpp | 6 +- src/viper/utils/Crossfeed.cpp | 2 +- src/viper/utils/DepthSurround.cpp | 2 +- src/viper/utils/DynamicBass.cpp | 2 +- src/viper/utils/HiFi.cpp | 2 +- src/viper/utils/MinPhaseIIRCoeffs.cpp | 1 - src/viper/utils/NoiseSharpening.cpp | 2 +- src/viper/utils/PassFilter.cpp | 2 +- src/viper/utils/PolesFilter.cpp | 2 +- src/viper/utils/Polyphase.cpp | 2 +- src/viper/utils/Subwoofer.cpp | 2 +- 34 files changed, 246 insertions(+), 192 deletions(-) rename src/{viper => include}/constants.h (94%) create mode 100644 src/include/log.h delete mode 100644 src/log.h diff --git a/CMakeLists.txt b/CMakeLists.txt index fb4609f..868ab1c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,18 +1,10 @@ cmake_minimum_required(VERSION 3.16.3) -set(CMAKE_CXX_COMPILER_VERSION 20) -# NDK Settings -#add_compile_definitions(ANDROID_ABI=arm64-v8a) -#add_compile_definitions(ANDROID_ABI=armeabi-v7a) -#add_compile_definitions(ANDROID_ARM_NEON=true) -#add_compile_definitions(ANDROID_PLATFORM=android-24) +set(CMAKE_CXX_STANDARD 20) project("ViPER4Android") add_compile_definitions(VIPER_VERSION=20240314) -# FFTS -#add_subdirectory(src/viper/ffts) - # ViPERFX include_directories(src/include) @@ -70,16 +62,9 @@ set(FILES src/viper/utils/TimeConstDelay.cpp src/viper/utils/WaveBuffer.cpp) -add_library( - # Sets the name of the library. - v4a_re - - # Sets the library as a shared library. - SHARED - - # Provides a relative path to your source file(s). +add_library(v4a_re SHARED ${FILES}) -target_link_libraries(v4a_re log) # kissfft) +target_link_libraries(v4a_re log) target_compile_options(v4a_re PRIVATE -flto -O3 -DNDEBUG) #target_compile_options(v4afx_r PRIVATE -O2 -DNDEBUG -Wall -Wsign-conversion -Wno-unused-result -Wno-unneeded-internal-declaration -fstrict-aliasing -fvisibility=hidden -Wextra -Wno-unused-parameter) diff --git a/src/ViPER4Aidl.cpp b/src/ViPER4Aidl.cpp index 37bd188..c621762 100644 --- a/src/ViPER4Aidl.cpp +++ b/src/ViPER4Aidl.cpp @@ -26,7 +26,7 @@ #include #include -#include "viper/constants.h" +#include #include "ViPER4Aidl.h" using aidl::android::hardware::audio::effect::Descriptor; diff --git a/src/ViPER4Android.cpp b/src/ViPER4Android.cpp index e1a3fc1..07ab09e 100644 --- a/src/ViPER4Android.cpp +++ b/src/ViPER4Android.cpp @@ -3,11 +3,11 @@ #ifdef AOSP_SOONG_BUILD #include #else -#include "essential.h" +#include #endif #include "viper/ViPER.h" -#include "viper/constants.h" +#include #include "ViperContext.h" extern "C" { diff --git a/src/ViperContext.cpp b/src/ViperContext.cpp index 4de8efc..bbd265c 100644 --- a/src/ViperContext.cpp +++ b/src/ViperContext.cpp @@ -1,10 +1,9 @@ #include #include #include -#include #include "ViperContext.h" -#include "log.h" -#include "viper/constants.h" +#include +#include #define SET(type, ptr, value) (*(type *) (ptr) = (value)) @@ -14,7 +13,7 @@ ViperContext::ViperContext() : buffer(std::vector()), bufferFrameCount(0), enabled(false) { - VIPER_LOGI("ViperContext created"); + ALOGI("ViperContext created"); } void ViperContext::copyBufferConfig(buffer_config_t *dest, buffer_config_t *src) { @@ -46,20 +45,20 @@ void ViperContext::copyBufferConfig(buffer_config_t *dest, buffer_config_t *src) } void ViperContext::handleSetConfig(effect_config_t *newConfig) { - VIPER_LOGI("Checking input and output configuration ..."); + ALOGI("Checking input and output configuration ..."); - VIPER_LOGI("Input mask: 0x%04X", newConfig->inputCfg.mask); - VIPER_LOGI("Input buffer frame count: %zu", newConfig->inputCfg.buffer.frameCount); - VIPER_LOGI("Input sampling rate: %d", newConfig->inputCfg.samplingRate); - VIPER_LOGI("Input channels: %d", newConfig->inputCfg.channels); - VIPER_LOGI("Input format: %d", newConfig->inputCfg.format); - VIPER_LOGI("Input access mode: %d", newConfig->inputCfg.accessMode); - VIPER_LOGI("Output mask: 0x%04X", newConfig->outputCfg.mask); - VIPER_LOGI("Output buffer frame count: %zu", newConfig->outputCfg.buffer.frameCount); - VIPER_LOGI("Output sampling rate: %d", newConfig->outputCfg.samplingRate); - VIPER_LOGI("Output channels: %d", newConfig->outputCfg.channels); - VIPER_LOGI("Output format: %d", newConfig->outputCfg.format); - VIPER_LOGI("Output access mode: %d", newConfig->outputCfg.accessMode); + ALOGI("Input mask: 0x%04X", newConfig->inputCfg.mask); + ALOGI("Input buffer frame count: %zu", newConfig->inputCfg.buffer.frameCount); + ALOGI("Input sampling rate: %d", newConfig->inputCfg.samplingRate); + ALOGI("Input channels: %d", newConfig->inputCfg.channels); + ALOGI("Input format: %d", newConfig->inputCfg.format); + ALOGI("Input access mode: %d", newConfig->inputCfg.accessMode); + ALOGI("Output mask: 0x%04X", newConfig->outputCfg.mask); + ALOGI("Output buffer frame count: %zu", newConfig->outputCfg.buffer.frameCount); + ALOGI("Output sampling rate: %d", newConfig->outputCfg.samplingRate); + ALOGI("Output channels: %d", newConfig->outputCfg.channels); + ALOGI("Output format: %d", newConfig->outputCfg.format); + ALOGI("Output access mode: %d", newConfig->outputCfg.accessMode); setDisableReason(DisableReason::UNKNOWN); @@ -67,35 +66,35 @@ void ViperContext::handleSetConfig(effect_config_t *newConfig) { copyBufferConfig(&config.outputCfg, &newConfig->outputCfg); if (config.inputCfg.buffer.frameCount != config.outputCfg.buffer.frameCount) { - VIPER_LOGE("ViPER4Android disabled, reason [in.FC = %zu, out.FC = %zu]", + ALOGE("ViPER4Android disabled, reason [in.FC = %zu, out.FC = %zu]", config.inputCfg.buffer.frameCount, config.outputCfg.buffer.frameCount); setDisableReason(DisableReason::INVALID_FRAME_COUNT); return; } if (config.inputCfg.samplingRate != config.outputCfg.samplingRate) { - VIPER_LOGE("ViPER4Android disabled, reason [in.SR = %d, out.SR = %d]", + ALOGE("ViPER4Android disabled, reason [in.SR = %d, out.SR = %d]", config.inputCfg.samplingRate, config.outputCfg.samplingRate); setDisableReason(DisableReason::INVALID_SAMPLING_RATE); return; } // if (config.inputCfg.samplingRate > 48000) { -// VIPER_LOGE("ViPER4Android disabled, reason [SR out of range]"); +// ALOGE("ViPER4Android disabled, reason [SR out of range]"); // setDisableReason(DisableReason::INVALID_SAMPLING_RATE, "Sampling rate out of range: " + std::to_string(config.inputCfg.samplingRate)); // return; // } // TODO: this is wrong (AUDIO_CHANNEL_IN_STEREO != AUDIO_CHANNEL_OUT_STEREO) if (config.inputCfg.channels != config.outputCfg.channels) { - VIPER_LOGE("ViPER4Android disabled, reason [in.CH = %d, out.CH = %d]", + ALOGE("ViPER4Android disabled, reason [in.CH = %d, out.CH = %d]", config.inputCfg.channels, config.outputCfg.channels); setDisableReason(DisableReason::INVALID_CHANNEL_COUNT); return; } if (config.inputCfg.channels != AUDIO_CHANNEL_OUT_STEREO) { - VIPER_LOGE("ViPER4Android disabled, reason [CH != 2]"); + ALOGE("ViPER4Android disabled, reason [CH != 2]"); setDisableReason(DisableReason::INVALID_CHANNEL_COUNT); return; } @@ -103,8 +102,8 @@ void ViperContext::handleSetConfig(effect_config_t *newConfig) { if (config.inputCfg.format != AUDIO_FORMAT_PCM_16_BIT && config.inputCfg.format != AUDIO_FORMAT_PCM_32_BIT && config.inputCfg.format != AUDIO_FORMAT_PCM_FLOAT) { - VIPER_LOGE("ViPER4Android disabled, reason [in.FMT = %d]", config.inputCfg.format); - VIPER_LOGE("We only accept AUDIO_FORMAT_PCM_16_BIT, AUDIO_FORMAT_PCM_32_BIT and AUDIO_FORMAT_PCM_FLOAT input format!"); + ALOGE("ViPER4Android disabled, reason [in.FMT = %d]", config.inputCfg.format); + ALOGE("We only accept AUDIO_FORMAT_PCM_16_BIT, AUDIO_FORMAT_PCM_32_BIT and AUDIO_FORMAT_PCM_FLOAT input format!"); setDisableReason(DisableReason::INVALID_FORMAT); return; } @@ -112,13 +111,13 @@ void ViperContext::handleSetConfig(effect_config_t *newConfig) { if (config.outputCfg.format != AUDIO_FORMAT_PCM_16_BIT && config.outputCfg.format != AUDIO_FORMAT_PCM_32_BIT && config.outputCfg.format != AUDIO_FORMAT_PCM_FLOAT) { - VIPER_LOGE("ViPER4Android disabled, reason [out.FMT = %d]", config.outputCfg.format); - VIPER_LOGE("We only accept AUDIO_FORMAT_PCM_16_BIT, AUDIO_FORMAT_PCM_32_BIT and AUDIO_FORMAT_PCM_FLOAT output format!"); + ALOGE("ViPER4Android disabled, reason [out.FMT = %d]", config.outputCfg.format); + ALOGE("We only accept AUDIO_FORMAT_PCM_16_BIT, AUDIO_FORMAT_PCM_32_BIT and AUDIO_FORMAT_PCM_FLOAT output format!"); setDisableReason(DisableReason::INVALID_FORMAT); return; } - VIPER_LOGI("Input and output configuration checked."); + ALOGI("Input and output configuration checked."); setDisableReason(DisableReason::NONE); // Processing buffer @@ -136,7 +135,7 @@ int32_t ViperContext::handleSetParam(effect_param_t *pCmdParam, void *pReplyData uint32_t vOffset = ((pCmdParam->psize + sizeof(int32_t) - 1) / sizeof(int32_t)) * sizeof(int32_t); if (pCmdParam->psize != sizeof(uint32_t)) { - VIPER_LOGE("handleSetParam: EFFECT_CMD_SET_PARAM called with invalid psize = %d, expected psize = %zu", pCmdParam->vsize, sizeof(uint32_t)); + ALOGE("handleSetParam: EFFECT_CMD_SET_PARAM called with invalid psize = %d, expected psize = %zu", pCmdParam->vsize, sizeof(uint32_t)); return -EINVAL; } @@ -145,23 +144,23 @@ int32_t ViperContext::handleSetParam(effect_param_t *pCmdParam, void *pReplyData uint32_t key = *(uint32_t *) (pCmdParam->data); switch (key) { case PARAM_SET_RESET: { - VIPER_LOGD("handleSetParam: PARAM_SET_RESET called"); + ALOGD("handleSetParam: PARAM_SET_RESET called"); viper.reset(); return 0; } case PARAM_SET_VIPER_DDC_ENABLE: { if (pCmdParam->vsize != sizeof(uint8_t)) { - VIPER_LOGE("handleSetParam: PARAM_SET_VIPER_DDC_ENABLE called with invalid vsize = %d, expected vsize = %zu", pCmdParam->vsize, sizeof(uint8_t)); + ALOGE("handleSetParam: PARAM_SET_VIPER_DDC_ENABLE called with invalid vsize = %d, expected vsize = %zu", pCmdParam->vsize, sizeof(uint8_t)); return -EINVAL; } bool enable = *(uint8_t *) (pCmdParam->data + vOffset) != 0; - VIPER_LOGD("handleSetParam: PARAM_SET_VIPER_DDC_ENABLE called with enable = %d", enable); + ALOGD("handleSetParam: PARAM_SET_VIPER_DDC_ENABLE called with enable = %d", enable); viper.viperDdc.SetEnable(enable); return 0; } case PARAM_SET_VIPER_DDC_COEFFICIENTS: { if (pCmdParam->vsize < sizeof(uint32_t)) { - VIPER_LOGE("handleSetParam: PARAM_SET_VIPER_DDC_COEFFICIENTS called with invalid vsize = %d, expected vsize >= %zu", pCmdParam->vsize, sizeof(uint32_t)); + ALOGE("handleSetParam: PARAM_SET_VIPER_DDC_COEFFICIENTS called with invalid vsize = %d, expected vsize >= %zu", pCmdParam->vsize, sizeof(uint32_t)); return -EINVAL; } @@ -170,182 +169,182 @@ int32_t ViperContext::handleSetParam(effect_param_t *pCmdParam, void *pReplyData float *coeffs48000 = (float *) (pCmdParam->data + vOffset + sizeof(uint32_t) + sizeof(float) * size); if (pCmdParam->vsize != sizeof(uint32_t) + sizeof(float) * 2 * size) { - VIPER_LOGE("handleSetParam: PARAM_SET_VIPER_DDC_COEFFICIENTS called with invalid vsize = %d, expected vsize = %zu", pCmdParam->vsize, sizeof(uint32_t) + sizeof(float) * 2 * size); + ALOGE("handleSetParam: PARAM_SET_VIPER_DDC_COEFFICIENTS called with invalid vsize = %d, expected vsize = %zu", pCmdParam->vsize, sizeof(uint32_t) + sizeof(float) * 2 * size); return -EINVAL; } - VIPER_LOGD("handleSetParam: PARAM_SET_VIPER_DDC_COEFFICIENTS called with size = %d", size); + ALOGD("handleSetParam: PARAM_SET_VIPER_DDC_COEFFICIENTS called with size = %d", size); viper.viperDdc.SetCoeffs(size, coeffs44100, coeffs48000); return 0; } case PARAM_SET_VIPER_BASS_ENABLE: { if (pCmdParam->vsize != sizeof(uint8_t)) { - VIPER_LOGE("handleSetParam: PARAM_SET_VIPER_BASS_ENABLE called with invalid vsize = %d, expected vsize = %zu", pCmdParam->vsize, sizeof(uint8_t)); + ALOGE("handleSetParam: PARAM_SET_VIPER_BASS_ENABLE called with invalid vsize = %d, expected vsize = %zu", pCmdParam->vsize, sizeof(uint8_t)); return -EINVAL; } bool enable = *(uint8_t *) (pCmdParam->data + vOffset) != 0; - VIPER_LOGD("handleSetParam: PARAM_SET_VIPER_BASS_ENABLE called with enable = %d", enable); + ALOGD("handleSetParam: PARAM_SET_VIPER_BASS_ENABLE called with enable = %d", enable); viper.viperBass.SetEnable(enable); return 0; } case PARAM_SET_VIPER_BASS_MODE: { if (pCmdParam->vsize != sizeof(uint8_t)) { - VIPER_LOGE("handleSetParam: PARAM_SET_VIPER_BASS_MODE called with invalid vsize = %d, expected vsize = %zu", pCmdParam->vsize, sizeof(uint8_t)); + ALOGE("handleSetParam: PARAM_SET_VIPER_BASS_MODE called with invalid vsize = %d, expected vsize = %zu", pCmdParam->vsize, sizeof(uint8_t)); return -EINVAL; } uint8_t mode = *(uint8_t *) (pCmdParam->data + vOffset); if (mode > 2) { - VIPER_LOGE("handleSetParam: PARAM_SET_VIPER_BASS_MODE called with invalid mode = %d, expected mode = 0, 1 or 2", mode); + ALOGE("handleSetParam: PARAM_SET_VIPER_BASS_MODE called with invalid mode = %d, expected mode = 0, 1 or 2", mode); *(int32_t *) pReplyData = -EINVAL; return 0; } - VIPER_LOGD("handleSetParam: PARAM_SET_VIPER_BASS_MODE called with mode = %d", mode); + ALOGD("handleSetParam: PARAM_SET_VIPER_BASS_MODE called with mode = %d", mode); viper.viperBass.SetProcessMode(static_cast(mode)); return 0; } case PARAM_SET_VIPER_BASS_FREQUENCY: { if (pCmdParam->vsize != sizeof(uint8_t)) { - VIPER_LOGE("handleSetParam: PARAM_SET_VIPER_BASS_FREQUENCY called with invalid vsize = %d, expected vsize = %zu", pCmdParam->vsize, sizeof(uint8_t)); + ALOGE("handleSetParam: PARAM_SET_VIPER_BASS_FREQUENCY called with invalid vsize = %d, expected vsize = %zu", pCmdParam->vsize, sizeof(uint8_t)); return -EINVAL; } uint8_t frequency = *(uint8_t *) (pCmdParam->data + vOffset); - VIPER_LOGD("handleSetParam: PARAM_SET_VIPER_BASS_FREQUENCY called with frequency = %d", frequency); + ALOGD("handleSetParam: PARAM_SET_VIPER_BASS_FREQUENCY called with frequency = %d", frequency); viper.viperBass.SetSpeaker(frequency); return 0; } case PARAM_SET_VIPER_BASS_GAIN: { if (pCmdParam->vsize != sizeof(uint16_t)) { - VIPER_LOGE("handleSetParam: PARAM_SET_VIPER_BASS_GAIN called with invalid vsize = %d, expected vsize = %zu", pCmdParam->vsize, sizeof(uint16_t)); + ALOGE("handleSetParam: PARAM_SET_VIPER_BASS_GAIN called with invalid vsize = %d, expected vsize = %zu", pCmdParam->vsize, sizeof(uint16_t)); return -EINVAL; } uint16_t gain = *(uint16_t *) (pCmdParam->data + vOffset); - VIPER_LOGD("handleSetParam: PARAM_SET_VIPER_BASS_GAIN called with gain = %d", gain); + ALOGD("handleSetParam: PARAM_SET_VIPER_BASS_GAIN called with gain = %d", gain); viper.viperBass.SetBassFactor(static_cast(gain) / 100.0f); return 0; } case PARAM_SET_VIPER_CLARITY_ENABLE: { if (pCmdParam->vsize != sizeof(uint8_t)) { - VIPER_LOGE("handleSetParam: PARAM_SET_VIPER_CLARITY_ENABLE called with invalid vsize = %d, expected vsize = %zu", pCmdParam->vsize, sizeof(uint8_t)); + ALOGE("handleSetParam: PARAM_SET_VIPER_CLARITY_ENABLE called with invalid vsize = %d, expected vsize = %zu", pCmdParam->vsize, sizeof(uint8_t)); return -EINVAL; } bool enable = *(uint8_t *) (pCmdParam->data + vOffset) != 0; - VIPER_LOGD("handleSetParam: PARAM_SET_VIPER_CLARITY_ENABLE called with enable = %d", enable); + ALOGD("handleSetParam: PARAM_SET_VIPER_CLARITY_ENABLE called with enable = %d", enable); viper.viperClarity.SetEnable(enable); return 0; } case PARAM_SET_VIPER_CLARITY_MODE: { if (pCmdParam->vsize != sizeof(uint8_t)) { - VIPER_LOGE("handleSetParam: PARAM_SET_VIPER_CLARITY_MODE called with invalid vsize = %d, expected vsize = %zu", pCmdParam->vsize, sizeof(uint8_t)); + ALOGE("handleSetParam: PARAM_SET_VIPER_CLARITY_MODE called with invalid vsize = %d, expected vsize = %zu", pCmdParam->vsize, sizeof(uint8_t)); return -EINVAL; } uint8_t mode = *(uint8_t *) (pCmdParam->data + vOffset); if (mode > 2) { - VIPER_LOGE("handleSetParam: PARAM_SET_VIPER_CLARITY_MODE called with invalid mode = %d, expected mode = 0, 1 or 2", mode); + ALOGE("handleSetParam: PARAM_SET_VIPER_CLARITY_MODE called with invalid mode = %d, expected mode = 0, 1 or 2", mode); *(int32_t *) pReplyData = -EINVAL; return 0; } - VIPER_LOGD("handleSetParam: PARAM_SET_VIPER_CLARITY_MODE called with mode = %d", mode); + ALOGD("handleSetParam: PARAM_SET_VIPER_CLARITY_MODE called with mode = %d", mode); viper.viperClarity.SetProcessMode(static_cast(mode)); return 0; } case PARAM_SET_VIPER_CLARITY_GAIN: { if (pCmdParam->vsize != sizeof(uint16_t)) { - VIPER_LOGE("handleSetParam: PARAM_SET_VIPER_CLARITY_GAIN called with invalid vsize = %d, expected vsize = %zu", pCmdParam->vsize, sizeof(uint16_t)); + ALOGE("handleSetParam: PARAM_SET_VIPER_CLARITY_GAIN called with invalid vsize = %d, expected vsize = %zu", pCmdParam->vsize, sizeof(uint16_t)); return -EINVAL; } uint16_t gain = *(uint16_t *) (pCmdParam->data + vOffset); - VIPER_LOGD("handleSetParam: PARAM_SET_VIPER_CLARITY_GAIN called with gain = %d", gain); + ALOGD("handleSetParam: PARAM_SET_VIPER_CLARITY_GAIN called with gain = %d", gain); viper.viperClarity.SetClarity(static_cast(gain) / 100.0f); return 0; } case PARAM_SET_OUTPUT_GAIN: { // 0 - 255 if (pCmdParam->vsize != sizeof(uint8_t) * 2) { - VIPER_LOGE("handleSetParam: PARAM_SET_OUTPUT_GAIN called with invalid vsize = %d, expected vsize = %zu", pCmdParam->vsize, sizeof(uint8_t) * 2); + ALOGE("handleSetParam: PARAM_SET_OUTPUT_GAIN called with invalid vsize = %d, expected vsize = %zu", pCmdParam->vsize, sizeof(uint8_t) * 2); return -EINVAL; } uint8_t gainL = *(uint8_t *) (pCmdParam->data + vOffset); uint8_t gainR = *(uint8_t *) (pCmdParam->data + vOffset + sizeof(uint8_t)); - VIPER_LOGD("handleSetParam: PARAM_SET_OUTPUT_GAIN called with gainL = %d, gainR = %d", gainL, gainR); + ALOGD("handleSetParam: PARAM_SET_OUTPUT_GAIN called with gainL = %d, gainR = %d", gainL, gainR); viper.setGain(static_cast(gainL) / 100.0f, static_cast(gainR) / 100.0f); return 0; } case PARAM_SET_THRESHOLD_LIMIT: { // 0 - 100 (TODO: Check range) if (pCmdParam->vsize != sizeof(uint8_t)) { - VIPER_LOGE("handleSetParam: PARAM_SET_THRESHOLD_LIMIT called with invalid vsize = %d, expected vsize = %zu", pCmdParam->vsize, sizeof(uint8_t)); + ALOGE("handleSetParam: PARAM_SET_THRESHOLD_LIMIT called with invalid vsize = %d, expected vsize = %zu", pCmdParam->vsize, sizeof(uint8_t)); return -EINVAL; } uint8_t limit = *(uint8_t *) (pCmdParam->data + vOffset); - VIPER_LOGD("handleSetParam: PARAM_SET_THRESHOLD_LIMIT called with limit = %d", limit); + ALOGD("handleSetParam: PARAM_SET_THRESHOLD_LIMIT called with limit = %d", limit); viper.setThresholdLimit(static_cast(limit) / 100.0f); return 0; } case PARAM_SET_SPEAKER_OPTIMIZATION_ENABLE: { if (pCmdParam->vsize != sizeof(uint8_t)) { - VIPER_LOGE("handleSetParam: PARAM_SET_SPEAKER_OPTIMIZATION_ENABLE called with invalid vsize = %d, expected vsize = %zu", pCmdParam->vsize, sizeof(uint8_t)); + ALOGE("handleSetParam: PARAM_SET_SPEAKER_OPTIMIZATION_ENABLE called with invalid vsize = %d, expected vsize = %zu", pCmdParam->vsize, sizeof(uint8_t)); return -EINVAL; } bool enable = *(uint8_t *) (pCmdParam->data + vOffset) != 0; - VIPER_LOGD("handleSetParam: PARAM_SET_SPEAKER_OPTIMIZATION_ENABLE called with enable = %d", enable); + ALOGD("handleSetParam: PARAM_SET_SPEAKER_OPTIMIZATION_ENABLE called with enable = %d", enable); viper.speakerCorrection.SetEnable(enable); return 0; } case PARAM_SET_ANALOGX_ENABLE: { if (pCmdParam->vsize != sizeof(uint8_t)) { - VIPER_LOGE("handleSetParam: PARAM_SET_ANALOGX_ENABLE called with invalid vsize = %d, expected vsize = %zu", pCmdParam->vsize, sizeof(uint8_t)); + ALOGE("handleSetParam: PARAM_SET_ANALOGX_ENABLE called with invalid vsize = %d, expected vsize = %zu", pCmdParam->vsize, sizeof(uint8_t)); return -EINVAL; } bool enable = *(uint8_t *) (pCmdParam->data + vOffset) != 0; - VIPER_LOGD("handleSetParam: PARAM_SET_ANALOGX_ENABLE called with enable = %d", enable); + ALOGD("handleSetParam: PARAM_SET_ANALOGX_ENABLE called with enable = %d", enable); viper.analogX.SetEnable(enable); return 0; } case PARAM_SET_ANALOGX_LEVEL: { if (pCmdParam->vsize != sizeof(uint8_t)) { - VIPER_LOGE("handleSetParam: PARAM_SET_ANALOGX_LEVEL called with invalid vsize = %d, expected vsize = %zu", pCmdParam->vsize, sizeof(uint8_t)); + ALOGE("handleSetParam: PARAM_SET_ANALOGX_LEVEL called with invalid vsize = %d, expected vsize = %zu", pCmdParam->vsize, sizeof(uint8_t)); return -EINVAL; } uint8_t level = *(uint8_t *) (pCmdParam->data + vOffset); if (level > 2) { - VIPER_LOGE("handleSetParam: PARAM_SET_ANALOGX_LEVEL called with invalid level = %d, expected level = 0, 1 or 2", level); + ALOGE("handleSetParam: PARAM_SET_ANALOGX_LEVEL called with invalid level = %d, expected level = 0, 1 or 2", level); *(int32_t *) pReplyData = -EINVAL; return 0; } - VIPER_LOGD("handleSetParam: PARAM_SET_ANALOGX_LEVEL called with level = %d", level); + ALOGD("handleSetParam: PARAM_SET_ANALOGX_LEVEL called with level = %d", level); viper.analogX.SetProcessingModel(level); return 0; } case PARAM_SET_TUBE_SIMULATOR_ENABLE: { if (pCmdParam->vsize != sizeof(uint8_t)) { - VIPER_LOGE("handleSetParam: PARAM_SET_TUBE_SIMULATOR_ENABLE called with invalid vsize = %d, expected vsize = %zu", pCmdParam->vsize, sizeof(uint8_t)); + ALOGE("handleSetParam: PARAM_SET_TUBE_SIMULATOR_ENABLE called with invalid vsize = %d, expected vsize = %zu", pCmdParam->vsize, sizeof(uint8_t)); return -EINVAL; } bool enable = *(uint8_t *) (pCmdParam->data + vOffset) != 0; - VIPER_LOGD("handleSetParam: PARAM_SET_TUBE_SIMULATOR_ENABLE called with enable = %d", enable); + ALOGD("handleSetParam: PARAM_SET_TUBE_SIMULATOR_ENABLE called with enable = %d", enable); viper.tubeSimulator.SetEnable(enable); return 0; } case PARAM_SET_CURE_ENABLE: { if (pCmdParam->vsize != sizeof(uint8_t)) { - VIPER_LOGE("handleSetParam: PARAM_SET_CURE_ENABLE called with invalid vsize = %d, expected vsize = %zu", pCmdParam->vsize, sizeof(uint8_t)); + ALOGE("handleSetParam: PARAM_SET_CURE_ENABLE called with invalid vsize = %d, expected vsize = %zu", pCmdParam->vsize, sizeof(uint8_t)); return -EINVAL; } bool enable = *(uint8_t *) (pCmdParam->data + vOffset) != 0; - VIPER_LOGD("handleSetParam: PARAM_SET_CURE_ENABLE called with enable = %d", enable); + ALOGD("handleSetParam: PARAM_SET_CURE_ENABLE called with enable = %d", enable); viper.cure.SetEnable(enable); return 0; } case PARAM_SET_CURE_LEVEL: { if (pCmdParam->vsize != sizeof(uint8_t)) { - VIPER_LOGE("handleSetParam: PARAM_SET_CURE_LEVEL called with invalid vsize = %d, expected vsize = %zu", pCmdParam->vsize, sizeof(uint8_t)); + ALOGE("handleSetParam: PARAM_SET_CURE_LEVEL called with invalid vsize = %d, expected vsize = %zu", pCmdParam->vsize, sizeof(uint8_t)); return -EINVAL; } uint8_t level = *(uint8_t *) (pCmdParam->data + vOffset); - VIPER_LOGD("handleSetParam: PARAM_SET_CURE_LEVEL called with level = %d", level); + ALOGD("handleSetParam: PARAM_SET_CURE_LEVEL called with level = %d", level); switch (level) { case 0: { struct Crossfeed::Preset preset = { @@ -372,7 +371,7 @@ int32_t ViperContext::handleSetParam(effect_param_t *pCmdParam, void *pReplyData break; } default: - VIPER_LOGE("handleSetParam: PARAM_SET_CURE_LEVEL called with invalid level = %d, expected level = 0, 1 or 2", level); + ALOGE("handleSetParam: PARAM_SET_CURE_LEVEL called with invalid level = %d, expected level = 0, 1 or 2", level); *(int32_t *) pReplyData = -EINVAL; break; } @@ -380,230 +379,230 @@ int32_t ViperContext::handleSetParam(effect_param_t *pCmdParam, void *pReplyData } case PARAM_SET_REVERBERATION_ENABLE: { if (pCmdParam->vsize != sizeof(uint8_t)) { - VIPER_LOGE("handleSetParam: PARAM_SET_REVERBERATION_ENABLE called with invalid vsize = %d, expected vsize = %zu", pCmdParam->vsize, sizeof(uint8_t)); + ALOGE("handleSetParam: PARAM_SET_REVERBERATION_ENABLE called with invalid vsize = %d, expected vsize = %zu", pCmdParam->vsize, sizeof(uint8_t)); return -EINVAL; } bool enable = *(uint8_t *) (pCmdParam->data + vOffset) != 0; - VIPER_LOGD("handleSetParam: PARAM_SET_REVERBERATION_ENABLE called with enable = %d", enable); + ALOGD("handleSetParam: PARAM_SET_REVERBERATION_ENABLE called with enable = %d", enable); viper.reverberation.SetEnable(enable); return 0; } case PARAM_SET_REVERBERATION_ROOM_SIZE: { if (pCmdParam->vsize != sizeof(uint8_t)) { - VIPER_LOGE("handleSetParam: PARAM_SET_REVERBERATION_ROOM_SIZE called with invalid vsize = %d, expected vsize = %zu", pCmdParam->vsize, sizeof(uint8_t)); + ALOGE("handleSetParam: PARAM_SET_REVERBERATION_ROOM_SIZE called with invalid vsize = %d, expected vsize = %zu", pCmdParam->vsize, sizeof(uint8_t)); return -EINVAL; } uint8_t roomSize = *(uint8_t *) (pCmdParam->data + vOffset); - VIPER_LOGD("handleSetParam: PARAM_SET_REVERBERATION_ROOM_SIZE called with roomSize = %d", roomSize); + ALOGD("handleSetParam: PARAM_SET_REVERBERATION_ROOM_SIZE called with roomSize = %d", roomSize); viper.reverberation.SetRoomSize(static_cast(roomSize) / 100.0f); return 0; } case PARAM_SET_REVERBERATION_SOUND_FIELD: { if (pCmdParam->vsize != sizeof(uint8_t)) { - VIPER_LOGE("handleSetParam: PARAM_SET_REVERBERATION_SOUND_FIELD called with invalid vsize = %d, expected vsize = %zu", pCmdParam->vsize, sizeof(uint8_t)); + ALOGE("handleSetParam: PARAM_SET_REVERBERATION_SOUND_FIELD called with invalid vsize = %d, expected vsize = %zu", pCmdParam->vsize, sizeof(uint8_t)); return -EINVAL; } uint8_t soundField = *(uint8_t *) (pCmdParam->data + vOffset); - VIPER_LOGD("handleSetParam: PARAM_SET_REVERBERATION_SOUND_FIELD called with soundField = %d", soundField); + ALOGD("handleSetParam: PARAM_SET_REVERBERATION_SOUND_FIELD called with soundField = %d", soundField); viper.reverberation.SetWidth(static_cast(soundField) / 100.0f); return 0; } case PARAM_SET_REVERBERATION_DAMPING: { if (pCmdParam->vsize != sizeof(uint8_t)) { - VIPER_LOGE("handleSetParam: PARAM_SET_REVERBERATION_DAMPING called with invalid vsize = %d, expected vsize = %zu", pCmdParam->vsize, sizeof(uint8_t)); + ALOGE("handleSetParam: PARAM_SET_REVERBERATION_DAMPING called with invalid vsize = %d, expected vsize = %zu", pCmdParam->vsize, sizeof(uint8_t)); return -EINVAL; } uint8_t damping = *(uint8_t *) (pCmdParam->data + vOffset); - VIPER_LOGD("handleSetParam: PARAM_SET_REVERBERATION_DAMPING called with damping = %d", damping); + ALOGD("handleSetParam: PARAM_SET_REVERBERATION_DAMPING called with damping = %d", damping); viper.reverberation.SetDamp(static_cast(damping) / 100.0f); return 0; } case PARAM_SET_REVERBERATION_WET_SIGNAL: { if (pCmdParam->vsize != sizeof(uint8_t)) { - VIPER_LOGE("handleSetParam: PARAM_SET_REVERBERATION_WET_SIGNAL called with invalid vsize = %d, expected vsize = %zu", pCmdParam->vsize, sizeof(uint8_t)); + ALOGE("handleSetParam: PARAM_SET_REVERBERATION_WET_SIGNAL called with invalid vsize = %d, expected vsize = %zu", pCmdParam->vsize, sizeof(uint8_t)); return -EINVAL; } uint8_t wetSignal = *(uint8_t *) (pCmdParam->data + vOffset); - VIPER_LOGD("handleSetParam: PARAM_SET_REVERBERATION_WET_SIGNAL called with wetSignal = %d", wetSignal); + ALOGD("handleSetParam: PARAM_SET_REVERBERATION_WET_SIGNAL called with wetSignal = %d", wetSignal); viper.reverberation.SetWet(static_cast(wetSignal) / 100.0f); return 0; } case PARAM_SET_REVERBERATION_DRY_SIGNAL: { if (pCmdParam->vsize != sizeof(uint8_t)) { - VIPER_LOGE("handleSetParam: PARAM_SET_REVERBERATION_DRY_SIGNAL called with invalid vsize = %d, expected vsize = %zu", pCmdParam->vsize, sizeof(uint8_t)); + ALOGE("handleSetParam: PARAM_SET_REVERBERATION_DRY_SIGNAL called with invalid vsize = %d, expected vsize = %zu", pCmdParam->vsize, sizeof(uint8_t)); return -EINVAL; } uint8_t drySignal = *(uint8_t *) (pCmdParam->data + vOffset); - VIPER_LOGD("handleSetParam: PARAM_SET_REVERBERATION_DRY_SIGNAL called with drySignal = %d", drySignal); + ALOGD("handleSetParam: PARAM_SET_REVERBERATION_DRY_SIGNAL called with drySignal = %d", drySignal); viper.reverberation.SetDry(static_cast(drySignal) / 100.0f); return 0; } case PARAM_SET_DIFFERENTIAL_SURROUND_ENABLE: { if (pCmdParam->vsize != sizeof(uint8_t)) { - VIPER_LOGE("handleSetParam: PARAM_SET_DIFFERENTIAL_SURROUND_ENABLE called with invalid vsize = %d, expected vsize = %zu", pCmdParam->vsize, sizeof(uint8_t)); + ALOGE("handleSetParam: PARAM_SET_DIFFERENTIAL_SURROUND_ENABLE called with invalid vsize = %d, expected vsize = %zu", pCmdParam->vsize, sizeof(uint8_t)); return -EINVAL; } bool enable = *(uint8_t *) (pCmdParam->data + vOffset) != 0; - VIPER_LOGD("handleSetParam: PARAM_SET_DIFFERENTIAL_SURROUND_ENABLE called with enable = %d", enable); + ALOGD("handleSetParam: PARAM_SET_DIFFERENTIAL_SURROUND_ENABLE called with enable = %d", enable); viper.diffSurround.SetEnable(enable); return 0; } case PARAM_SET_DIFFERENTIAL_SURROUND_DELAY: { if (pCmdParam->vsize != sizeof(uint16_t)) { - VIPER_LOGE("handleSetParam: PARAM_SET_DIFFERENTIAL_SURROUND_DELAY called with invalid vsize = %d, expected vsize = %zu", pCmdParam->vsize, sizeof(uint16_t)); + ALOGE("handleSetParam: PARAM_SET_DIFFERENTIAL_SURROUND_DELAY called with invalid vsize = %d, expected vsize = %zu", pCmdParam->vsize, sizeof(uint16_t)); return -EINVAL; } uint16_t delay = *(uint16_t *) (pCmdParam->data + vOffset); - VIPER_LOGD("handleSetParam: PARAM_SET_DIFFERENTIAL_SURROUND_DELAY called with delay = %d", delay); + ALOGD("handleSetParam: PARAM_SET_DIFFERENTIAL_SURROUND_DELAY called with delay = %d", delay); viper.diffSurround.SetDelayTime(static_cast(delay) / 100.0f); return 0; } case PARAM_SET_FIELD_SURROUND_ENABLE: { if (pCmdParam->vsize != sizeof(uint8_t)) { - VIPER_LOGE("handleSetParam: PARAM_SET_FIELD_SURROUND_ENABLE called with invalid vsize = %d, expected vsize = %zu", pCmdParam->vsize, sizeof(uint8_t)); + ALOGE("handleSetParam: PARAM_SET_FIELD_SURROUND_ENABLE called with invalid vsize = %d, expected vsize = %zu", pCmdParam->vsize, sizeof(uint8_t)); return -EINVAL; } bool enable = *(uint8_t *) (pCmdParam->data + vOffset) != 0; - VIPER_LOGD("handleSetParam: PARAM_SET_FIELD_SURROUND_ENABLE called with enable = %d", enable); + ALOGD("handleSetParam: PARAM_SET_FIELD_SURROUND_ENABLE called with enable = %d", enable); viper.colorfulMusic.SetEnable(enable); return 0; } case PARAM_SET_FIELD_SURROUND_DEPTH: { if (pCmdParam->vsize != sizeof(uint16_t)) { - VIPER_LOGE("handleSetParam: PARAM_SET_FIELD_SURROUND_DEPTH called with invalid vsize = %d, expected vsize = %zu", pCmdParam->vsize, sizeof(uint16_t)); + ALOGE("handleSetParam: PARAM_SET_FIELD_SURROUND_DEPTH called with invalid vsize = %d, expected vsize = %zu", pCmdParam->vsize, sizeof(uint16_t)); return -EINVAL; } uint16_t depth = *(uint16_t *) (pCmdParam->data + vOffset); - VIPER_LOGD("handleSetParam: PARAM_SET_FIELD_SURROUND_DEPTH called with depth = %d", depth); + ALOGD("handleSetParam: PARAM_SET_FIELD_SURROUND_DEPTH called with depth = %d", depth); viper.colorfulMusic.SetDepthValue(depth); return 0; } case PARAM_SET_FIELD_SURROUND_MID_IMAGE: { if (pCmdParam->vsize != sizeof(uint8_t)) { - VIPER_LOGE("handleSetParam: PARAM_SET_FIELD_SURROUND_MID_IMAGE called with invalid vsize = %d, expected vsize = %zu", pCmdParam->vsize, sizeof(uint8_t)); + ALOGE("handleSetParam: PARAM_SET_FIELD_SURROUND_MID_IMAGE called with invalid vsize = %d, expected vsize = %zu", pCmdParam->vsize, sizeof(uint8_t)); return -EINVAL; } uint8_t midImage = *(uint8_t *) (pCmdParam->data + vOffset); - VIPER_LOGD("handleSetParam: PARAM_SET_FIELD_SURROUND_MID_IMAGE called with midImage = %d", midImage); + ALOGD("handleSetParam: PARAM_SET_FIELD_SURROUND_MID_IMAGE called with midImage = %d", midImage); viper.colorfulMusic.SetMidImageValue(static_cast(midImage) / 100.0f); return 0; } case PARAM_SET_IIR_EQUALIZER_ENABLE: { if (pCmdParam->vsize != sizeof(uint8_t)) { - VIPER_LOGE("handleSetParam: PARAM_SET_IIR_EQUALIZER_ENABLE called with invalid vsize = %d, expected vsize = %zu", pCmdParam->vsize, sizeof(uint8_t)); + ALOGE("handleSetParam: PARAM_SET_IIR_EQUALIZER_ENABLE called with invalid vsize = %d, expected vsize = %zu", pCmdParam->vsize, sizeof(uint8_t)); return -EINVAL; } bool enable = *(uint8_t *) (pCmdParam->data + vOffset) != 0; - VIPER_LOGD("handleSetParam: PARAM_SET_IIR_EQUALIZER_ENABLE called with enable = %d", enable); + ALOGD("handleSetParam: PARAM_SET_IIR_EQUALIZER_ENABLE called with enable = %d", enable); viper.iirFilter.SetEnable(enable); return 0; } case PARAM_SET_IIR_EQUALIZER_BAND_LEVEL: { if (pCmdParam->vsize != sizeof(uint8_t) + sizeof(int16_t)) { - VIPER_LOGE("handleSetParam: PARAM_SET_IIR_EQUALIZER_BAND_LEVEL called with invalid vsize = %d, expected vsize = %zu", pCmdParam->vsize, sizeof(uint8_t) + sizeof(int16_t)); + ALOGE("handleSetParam: PARAM_SET_IIR_EQUALIZER_BAND_LEVEL called with invalid vsize = %d, expected vsize = %zu", pCmdParam->vsize, sizeof(uint8_t) + sizeof(int16_t)); return -EINVAL; } uint8_t band = *(uint8_t *) (pCmdParam->data + vOffset); int16_t level = *(int16_t *) (pCmdParam->data + vOffset + sizeof(uint8_t)); - VIPER_LOGD("handleSetParam: PARAM_SET_IIR_EQUALIZER_BAND_LEVEL called with band = %d, level = %d", band, level); + ALOGD("handleSetParam: PARAM_SET_IIR_EQUALIZER_BAND_LEVEL called with band = %d, level = %d", band, level); viper.iirFilter.SetBandLevel(band, static_cast(level) / 100.0f); return 0; } case PARAM_SET_SPECTRUM_EXTENSION_ENABLE: { if (pCmdParam->vsize != sizeof(uint8_t)) { - VIPER_LOGE("handleSetParam: PARAM_SET_SPECTRUM_EXTENSION_ENABLE called with invalid vsize = %d, expected vsize = %zu", pCmdParam->vsize, sizeof(uint8_t)); + ALOGE("handleSetParam: PARAM_SET_SPECTRUM_EXTENSION_ENABLE called with invalid vsize = %d, expected vsize = %zu", pCmdParam->vsize, sizeof(uint8_t)); return -EINVAL; } bool enable = *(uint8_t *) (pCmdParam->data + vOffset) != 0; - VIPER_LOGD("handleSetParam: PARAM_SET_SPECTRUM_EXTENSION_ENABLE called with enable = %d", enable); + ALOGD("handleSetParam: PARAM_SET_SPECTRUM_EXTENSION_ENABLE called with enable = %d", enable); viper.spectrumExtend.SetEnable(enable); return 0; } case PARAM_SET_SPECTRUM_EXTENSION_STRENGTH: { if (pCmdParam->vsize != sizeof(uint8_t)) { - VIPER_LOGE("handleSetParam: PARAM_SET_SPECTRUM_EXTENSION_STRENGTH called with invalid vsize = %d, expected vsize = %zu", pCmdParam->vsize, sizeof(uint8_t)); + ALOGE("handleSetParam: PARAM_SET_SPECTRUM_EXTENSION_STRENGTH called with invalid vsize = %d, expected vsize = %zu", pCmdParam->vsize, sizeof(uint8_t)); return -EINVAL; } uint8_t strength = *(uint8_t *) (pCmdParam->data + vOffset); - VIPER_LOGD("handleSetParam: PARAM_SET_SPECTRUM_EXTENSION_STRENGTH called with strength = %d", strength); + ALOGD("handleSetParam: PARAM_SET_SPECTRUM_EXTENSION_STRENGTH called with strength = %d", strength); viper.spectrumExtend.SetExciter(static_cast(strength) / 100.0f); return 0; } case PARAM_SET_HEADPHONE_SURROUND_ENABLE: { if (pCmdParam->vsize != sizeof(uint8_t)) { - VIPER_LOGE("handleSetParam: PARAM_SET_HEADPHONE_SURROUND_ENABLE called with invalid vsize = %d, expected vsize = %zu", pCmdParam->vsize, sizeof(uint8_t)); + ALOGE("handleSetParam: PARAM_SET_HEADPHONE_SURROUND_ENABLE called with invalid vsize = %d, expected vsize = %zu", pCmdParam->vsize, sizeof(uint8_t)); return -EINVAL; } bool enable = *(uint8_t *) (pCmdParam->data + vOffset) != 0; - VIPER_LOGD("handleSetParam: PARAM_SET_HEADPHONE_SURROUND_ENABLE called with enable = %d", enable); + ALOGD("handleSetParam: PARAM_SET_HEADPHONE_SURROUND_ENABLE called with enable = %d", enable); viper.vhe.SetEnable(enable); return 0; } case PARAM_SET_HEADPHONE_SURROUND_LEVEL: { if (pCmdParam->vsize != sizeof(uint8_t)) { - VIPER_LOGE("handleSetParam: PARAM_SET_HEADPHONE_SURROUND_LEVEL called with invalid vsize = %d, expected vsize = %zu", pCmdParam->vsize, sizeof(uint8_t)); + ALOGE("handleSetParam: PARAM_SET_HEADPHONE_SURROUND_LEVEL called with invalid vsize = %d, expected vsize = %zu", pCmdParam->vsize, sizeof(uint8_t)); return -EINVAL; } uint8_t level = *(uint8_t *) (pCmdParam->data + vOffset); - VIPER_LOGD("handleSetParam: PARAM_SET_HEADPHONE_SURROUND_LEVEL called with level = %d", level); + ALOGD("handleSetParam: PARAM_SET_HEADPHONE_SURROUND_LEVEL called with level = %d", level); viper.vhe.SetEffectLevel(level); return 0; } case PARAM_SET_DYNAMIC_SYSTEM_ENABLE: { if (pCmdParam->vsize != sizeof(uint8_t)) { - VIPER_LOGE("handleSetParam: PARAM_SET_DYNAMIC_SYSTEM_ENABLE called with invalid vsize = %d, expected vsize = %zu", pCmdParam->vsize, sizeof(uint8_t)); + ALOGE("handleSetParam: PARAM_SET_DYNAMIC_SYSTEM_ENABLE called with invalid vsize = %d, expected vsize = %zu", pCmdParam->vsize, sizeof(uint8_t)); return -EINVAL; } bool enable = *(uint8_t *) (pCmdParam->data + vOffset) != 0; - VIPER_LOGD("handleSetParam: PARAM_SET_DYNAMIC_SYSTEM_ENABLE called with enable = %d", enable); + ALOGD("handleSetParam: PARAM_SET_DYNAMIC_SYSTEM_ENABLE called with enable = %d", enable); viper.dynamicSystem.SetEnable(enable); return 0; } case PARAM_SET_DYNAMIC_SYSTEM_X_COEFFICIENTS: { if (pCmdParam->vsize != sizeof(uint16_t) * 2) { - VIPER_LOGE("handleSetParam: PARAM_SET_DYNAMIC_SYSTEM_X_COEFFICIENTS called with invalid vsize = %d, expected vsize = %zu", pCmdParam->vsize, sizeof(uint16_t) * 2); + ALOGE("handleSetParam: PARAM_SET_DYNAMIC_SYSTEM_X_COEFFICIENTS called with invalid vsize = %d, expected vsize = %zu", pCmdParam->vsize, sizeof(uint16_t) * 2); return -EINVAL; } uint16_t low = *(uint16_t *) (pCmdParam->data + vOffset); uint16_t high = *(uint16_t *) (pCmdParam->data + vOffset + sizeof(uint16_t)); - VIPER_LOGD("handleSetParam: PARAM_SET_DYNAMIC_SYSTEM_X_COEFFICIENTS called with low = %d, high = %d", low, high); + ALOGD("handleSetParam: PARAM_SET_DYNAMIC_SYSTEM_X_COEFFICIENTS called with low = %d, high = %d", low, high); viper.dynamicSystem.SetXCoeffs(low, high); return 0; } case PARAM_SET_DYNAMIC_SYSTEM_Y_COEFFICIENTS: { if (pCmdParam->vsize != sizeof(uint16_t) * 2) { - VIPER_LOGE("handleSetParam: PARAM_SET_DYNAMIC_SYSTEM_Y_COEFFICIENTS called with invalid vsize = %d, expected vsize = %zu", pCmdParam->vsize, sizeof(uint16_t) * 2); + ALOGE("handleSetParam: PARAM_SET_DYNAMIC_SYSTEM_Y_COEFFICIENTS called with invalid vsize = %d, expected vsize = %zu", pCmdParam->vsize, sizeof(uint16_t) * 2); return -EINVAL; } uint16_t low = *(uint16_t *) (pCmdParam->data + vOffset); uint16_t high = *(uint16_t *) (pCmdParam->data + vOffset + sizeof(uint16_t)); - VIPER_LOGD("handleSetParam: PARAM_SET_DYNAMIC_SYSTEM_Y_COEFFICIENTS called with low = %d, high = %d", low, high); + ALOGD("handleSetParam: PARAM_SET_DYNAMIC_SYSTEM_Y_COEFFICIENTS called with low = %d, high = %d", low, high); viper.dynamicSystem.SetYCoeffs(low, high); return 0; } case PARAM_SET_DYNAMIC_SYSTEM_SIDE_GAIN: { if (pCmdParam->vsize != sizeof(uint8_t) * 2) { - VIPER_LOGE("handleSetParam: PARAM_SET_DYNAMIC_SYSTEM_SIDE_GAIN called with invalid vsize = %d, expected vsize = %zu", pCmdParam->vsize, sizeof(uint8_t) * 2); + ALOGE("handleSetParam: PARAM_SET_DYNAMIC_SYSTEM_SIDE_GAIN called with invalid vsize = %d, expected vsize = %zu", pCmdParam->vsize, sizeof(uint8_t) * 2); return -EINVAL; } uint8_t gainX = *(uint8_t *) (pCmdParam->data + vOffset); uint8_t gainY = *(uint8_t *) (pCmdParam->data + vOffset + sizeof(uint8_t)); - VIPER_LOGD("handleSetParam: PARAM_SET_DYNAMIC_SYSTEM_SIDE_GAIN called with gainX = %d, gainY = %d", gainX, gainY); + ALOGD("handleSetParam: PARAM_SET_DYNAMIC_SYSTEM_SIDE_GAIN called with gainX = %d, gainY = %d", gainX, gainY); viper.dynamicSystem.SetSideGain(static_cast(gainX) / 100.0f, static_cast(gainY) / 100.0f); return 0; } case PARAM_SET_DYNAMIC_SYSTEM_STRENGTH: { if (pCmdParam->vsize != sizeof(uint16_t)) { - VIPER_LOGE("handleSetParam: PARAM_SET_DYNAMIC_SYSTEM_STRENGTH called with invalid vsize = %d, expected vsize = %zu", pCmdParam->vsize, sizeof(uint16_t)); + ALOGE("handleSetParam: PARAM_SET_DYNAMIC_SYSTEM_STRENGTH called with invalid vsize = %d, expected vsize = %zu", pCmdParam->vsize, sizeof(uint16_t)); return -EINVAL; } uint16_t strength = *(uint16_t *) (pCmdParam->data + vOffset); - VIPER_LOGD("handleSetParam: PARAM_SET_DYNAMIC_SYSTEM_STRENGTH called with strength = %d", strength); + ALOGD("handleSetParam: PARAM_SET_DYNAMIC_SYSTEM_STRENGTH called with strength = %d", strength); viper.dynamicSystem.SetBassGain(static_cast(strength) / 100.0f); return 0; } default: { - VIPER_LOGE("handleSetParam: called with unknown key: %d", key); + ALOGE("handleSetParam: called with unknown key: %d", key); return -EINVAL; } } @@ -615,7 +614,7 @@ int32_t ViperContext::handleGetParam(effect_param_t *pCmdParam, effect_param_t * uint32_t vOffset = ((pCmdParam->psize + sizeof(int32_t) - 1) / sizeof(int32_t)) * sizeof(int32_t); if (pCmdParam->psize != sizeof(uint32_t)) { - VIPER_LOGE("handleGetParam() EFFECT_CMD_GET_PARAM called with invalid psize = %d, expected psize = %zu", pCmdParam->vsize, sizeof(uint32_t)); + ALOGE("handleGetParam() EFFECT_CMD_GET_PARAM called with invalid psize = %d, expected psize = %zu", pCmdParam->vsize, sizeof(uint32_t)); return -EINVAL; } @@ -679,7 +678,7 @@ int32_t ViperContext::handleGetParam(effect_param_t *pCmdParam, effect_param_t * return 0; } default: { - VIPER_LOGE("handleGetParam() called with unknown key: %d", key); + ALOGE("handleGetParam() called with unknown key: %d", key); return -EINVAL; } } @@ -690,7 +689,7 @@ int32_t ViperContext::handleCommand(uint32_t cmdCode, uint32_t cmdSize, void *pC switch (cmdCode) { case EFFECT_CMD_INIT: { if (replySize != sizeof(int32_t) || pReplyData == nullptr) { - VIPER_LOGE("EFFECT_CMD_INIT called with invalid replySize = %d, pReplyData = %p, expected replySize = %zu", replySize, pReplyData, sizeof(int32_t)); + ALOGE("EFFECT_CMD_INIT called with invalid replySize = %d, pReplyData = %p, expected replySize = %zu", replySize, pReplyData, sizeof(int32_t)); return -EINVAL; } SET(int32_t, pReplyData, 0); @@ -698,7 +697,7 @@ int32_t ViperContext::handleCommand(uint32_t cmdCode, uint32_t cmdSize, void *pC } case EFFECT_CMD_SET_CONFIG: { if (cmdSize != sizeof(effect_config_t) || pCmdData == nullptr || replySize != sizeof(int32_t) || pReplyData == nullptr) { - VIPER_LOGE("EFFECT_CMD_SET_CONFIG called with invalid cmdSize = %d, pCmdData = %p, replySize = %d, pReplyData = %p, expected cmdSize = %zu, expected replySize = %zu", cmdSize, pCmdData, replySize, pReplyData, sizeof(effect_config_t), sizeof(int32_t)); + ALOGE("EFFECT_CMD_SET_CONFIG called with invalid cmdSize = %d, pCmdData = %p, replySize = %d, pReplyData = %p, expected cmdSize = %zu, expected replySize = %zu", cmdSize, pCmdData, replySize, pReplyData, sizeof(effect_config_t), sizeof(int32_t)); return -EINVAL; } handleSetConfig((effect_config_t *) pCmdData); @@ -711,7 +710,7 @@ int32_t ViperContext::handleCommand(uint32_t cmdCode, uint32_t cmdSize, void *pC } case EFFECT_CMD_ENABLE: { if (replySize != sizeof(int32_t) || pReplyData == nullptr) { - VIPER_LOGE("EFFECT_CMD_ENABLE called with invalid replySize = %d, pReplyData = %p, expected replySize = %zu", replySize, pReplyData, sizeof(int32_t)); + ALOGE("EFFECT_CMD_ENABLE called with invalid replySize = %d, pReplyData = %p, expected replySize = %zu", replySize, pReplyData, sizeof(int32_t)); return -EINVAL; } enabled = true; @@ -720,7 +719,7 @@ int32_t ViperContext::handleCommand(uint32_t cmdCode, uint32_t cmdSize, void *pC } case EFFECT_CMD_DISABLE: { if (replySize != sizeof(int32_t) || pReplyData == nullptr) { - VIPER_LOGE("EFFECT_CMD_DISABLE called with invalid replySize = %d, pReplyData = %p, expected replySize = %zu", replySize, pReplyData, sizeof(int32_t)); + ALOGE("EFFECT_CMD_DISABLE called with invalid replySize = %d, pReplyData = %p, expected replySize = %zu", replySize, pReplyData, sizeof(int32_t)); return -EINVAL; } enabled = false; @@ -729,28 +728,28 @@ int32_t ViperContext::handleCommand(uint32_t cmdCode, uint32_t cmdSize, void *pC } case EFFECT_CMD_SET_PARAM: { if (cmdSize < sizeof(effect_param_t) || pCmdData == nullptr || replySize != sizeof(int32_t) || pReplyData == nullptr) { - VIPER_LOGE("EFFECT_CMD_SET_PARAM called with invalid cmdSize = %d, pCmdData = %p, replySize = %d, pReplyData = %p, expected cmdSize >= %zu, expected replySize >= %zu", cmdSize, pCmdData, replySize, pReplyData, sizeof(effect_param_t), sizeof(int32_t)); + ALOGE("EFFECT_CMD_SET_PARAM called with invalid cmdSize = %d, pCmdData = %p, replySize = %d, pReplyData = %p, expected cmdSize >= %zu, expected replySize >= %zu", cmdSize, pCmdData, replySize, pReplyData, sizeof(effect_param_t), sizeof(int32_t)); return -EINVAL; } return handleSetParam((effect_param_t *) pCmdData, pReplyData); } case EFFECT_CMD_GET_PARAM: { if (cmdSize < sizeof(effect_param_t) || pCmdData == nullptr || replySize < sizeof(effect_param_t) || pReplyData == nullptr) { - VIPER_LOGE("EFFECT_CMD_GET_PARAM called with invalid cmdSize = %d, pCmdData = %p, replySize = %d, pReplyData = %p, expected cmdSize >= %zu, expected replySize >= %zu", cmdSize, pCmdData, replySize, pReplyData, sizeof(effect_param_t), sizeof(effect_param_t)); + ALOGE("EFFECT_CMD_GET_PARAM called with invalid cmdSize = %d, pCmdData = %p, replySize = %d, pReplyData = %p, expected cmdSize >= %zu, expected replySize >= %zu", cmdSize, pCmdData, replySize, pReplyData, sizeof(effect_param_t), sizeof(effect_param_t)); return -EINVAL; } return handleGetParam((effect_param_t *) pCmdData, (effect_param_t *) pReplyData, pReplySize); } case EFFECT_CMD_GET_CONFIG: { if (replySize != sizeof(effect_config_t) || pReplyData == nullptr) { - VIPER_LOGE("EFFECT_CMD_GET_CONFIG called with invalid replySize = %d, pReplyData = %p, expected replySize = %zu", replySize, pReplyData, sizeof(effect_config_t)); + ALOGE("EFFECT_CMD_GET_CONFIG called with invalid replySize = %d, pReplyData = %p, expected replySize = %zu", replySize, pReplyData, sizeof(effect_config_t)); return -EINVAL; } *(effect_config_t *) pReplyData = config; return 0; } default: { - VIPER_LOGE("handleCommand called with unknown command: %d", cmdCode); + ALOGE("handleCommand called with unknown command: %d", cmdCode); return -EINVAL; } } diff --git a/src/ViperContext.h b/src/ViperContext.h index 16e60e4..f32ce6c 100644 --- a/src/ViperContext.h +++ b/src/ViperContext.h @@ -5,7 +5,7 @@ #ifdef AOSP_SOONG_BUILD #include #else -#include "essential.h" +#include #endif #include "viper/ViPER.h" #include diff --git a/src/viper/constants.h b/src/include/constants.h similarity index 94% rename from src/viper/constants.h rename to src/include/constants.h index 2b451d8..91bdd8e 100644 --- a/src/viper/constants.h +++ b/src/include/constants.h @@ -6,7 +6,7 @@ #include #endif -#include "../log.h" // TODO: Remove this dependency +#include // TODO: Remove this dependency enum class Architecture : uint8_t { UNKNOWN = 0, diff --git a/src/include/log.h b/src/include/log.h new file mode 100644 index 0000000..2f88b74 --- /dev/null +++ b/src/include/log.h @@ -0,0 +1,81 @@ +/* + * Copyright 2013 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include + +#ifndef LOG_TAG +#define LOG_TAG "ViPER4Android" +#endif + +#ifndef LOG_NDEBUG +#ifdef NDEBUG +#define LOG_NDEBUG 1 +#else +#define LOG_NDEBUG 0 +#endif +#endif + + +/* + * Basic log message macros intended to emulate the behavior of log/log.h + * in system core. This should be dependent only on ndk exposed logging + * functionality. + */ + +#ifndef ALOG +#define ALOG(priority, tag, ...) \ + __android_log_print(ANDROID_##priority, tag, __VA_ARGS__) +#endif + +#ifndef ALOGV +#if LOG_NDEBUG +#define ALOGV(...) ((void)0) +#else +#define ALOGV(...) ((void)ALOG(LOG_VERBOSE, LOG_TAG, __VA_ARGS__)) +#endif +#endif + +#ifndef ALOGD +#define ALOGD(...) ((void)ALOG(LOG_DEBUG, LOG_TAG, __VA_ARGS__)) +#endif + +#ifndef ALOGI +#define ALOGI(...) ((void)ALOG(LOG_INFO, LOG_TAG, __VA_ARGS__)) +#endif + +#ifndef ALOGW +#define ALOGW(...) ((void)ALOG(LOG_WARN, LOG_TAG, __VA_ARGS__)) +#endif + +#ifndef ALOGE +#define ALOGE(...) ((void)ALOG(LOG_ERROR, LOG_TAG, __VA_ARGS__)) +#endif + +#ifndef ALOGF +#define ALOGF(...) ((void)ALOG(LOG_FATAL, LOG_TAG, __VA_ARGS__)) +#endif + +/* + * Log a fatal error if cond is true. The condition test is inverted from + * assert(3) semantics. The test and message are not stripped from release + * builds + */ +#ifndef ALOG_ALWAYS_FATAL_IF +#define ALOG_ALWAYS_FATAL_IF(cond, ...) \ + if (cond) __android_log_assert(#cond, LOG_TAG, __VA_ARGS__) +#endif diff --git a/src/log.h b/src/log.h deleted file mode 100644 index 294fb50..0000000 --- a/src/log.h +++ /dev/null @@ -1,9 +0,0 @@ -#pragma once - -#include - -#define TAG "ViPER4Android" - -#define VIPER_LOGD(...) __android_log_print(ANDROID_LOG_DEBUG, TAG, __VA_ARGS__) -#define VIPER_LOGI(...) __android_log_print(ANDROID_LOG_INFO, TAG, __VA_ARGS__) -#define VIPER_LOGE(...) __android_log_print(ANDROID_LOG_ERROR, TAG, __VA_ARGS__) \ No newline at end of file diff --git a/src/viper/ViPER.cpp b/src/viper/ViPER.cpp index 1d0fdcc..775b572 100644 --- a/src/viper/ViPER.cpp +++ b/src/viper/ViPER.cpp @@ -1,7 +1,7 @@ #include "ViPER.h" #include -#include -#include "constants.h" +#include +#include ViPER::ViPER() : frameCount(0), @@ -11,8 +11,8 @@ ViPER::ViPER() : iirFilter(IIRFilter(10)), gainL(1.0), gainR(1.0) { - VIPER_LOGI("Welcome to ViPER FX"); - VIPER_LOGI("Current version is %d", VIPER_VERSION); + ALOGI("Welcome to ViPER FX"); + ALOGI("Current version is %d", VIPER_VERSION); this->convolver.SetEnable(false); this->convolver.SetSamplingRate(this->samplingRate); @@ -94,7 +94,7 @@ void ViPER::process(std::vector& buffer, uint32_t size) { uint32_t tmpBufSize; if (this->convolver.GetEnabled() || this->vhe.GetEnabled()) { -// VIPER_LOGD("Convolver or VHE is enable, use wave buffer"); +// ALOGD("Convolver or VHE is enable, use wave buffer"); if (!this->waveBuffer.PushSamples(buffer.data(), size)) { this->waveBuffer.Reset(); @@ -119,7 +119,7 @@ void ViPER::process(std::vector& buffer, uint32_t size) { tmpBuf = ptr; tmpBufSize = ret; } else { -// VIPER_LOGD("Convolver and VHE are disabled, use adaptive buffer"); +// ALOGD("Convolver and VHE are disabled, use adaptive buffer"); if (this->adaptiveBuffer.PushFrames(buffer.data(), size)) { this->adaptiveBuffer.SetBufferOffset(size); @@ -132,7 +132,7 @@ void ViPER::process(std::vector& buffer, uint32_t size) { } } -// VIPER_LOGD("Process buffer size: %d", tmpBufSize); +// ALOGD("Process buffer size: %d", tmpBufSize); if (tmpBufSize != 0) { this->viperDdc.Process(tmpBuf, size); this->spectrumExtend.Process(tmpBuf, size); @@ -175,7 +175,7 @@ void ViPER::process(std::vector& buffer, uint32_t size) { //void ViPER::DispatchCommand(int param, int val1, int val2, int val3, int val4, uint32_t arrSize, // signed char *arr) { -// VIPER_LOGD("Dispatch command: %d, %d, %d, %d, %d, %d, %p", param, val1, val2, val3, val4, arrSize, arr); +// ALOGD("Dispatch command: %d, %d, %d, %d, %d, %d, %p", param, val1, val2, val3, val4, arrSize, arr); // switch (param) { // case PARAM_SET_RESET_STATUS: { // this->reset(); diff --git a/src/viper/effects/AnalogX.cpp b/src/viper/effects/AnalogX.cpp index c2cb822..0f524b0 100644 --- a/src/viper/effects/AnalogX.cpp +++ b/src/viper/effects/AnalogX.cpp @@ -1,6 +1,6 @@ #include "AnalogX.h" #include -#include "../constants.h" +#include static const float ANALOGX_HARMONICS[] = { 0.01f, diff --git a/src/viper/effects/ColorfulMusic.cpp b/src/viper/effects/ColorfulMusic.cpp index ca09191..76b5ea2 100644 --- a/src/viper/effects/ColorfulMusic.cpp +++ b/src/viper/effects/ColorfulMusic.cpp @@ -1,5 +1,5 @@ #include "ColorfulMusic.h" -#include "../constants.h" +#include ColorfulMusic::ColorfulMusic() { this->samplingRate = VIPER_DEFAULT_SAMPLING_RATE; diff --git a/src/viper/effects/Convolver.cpp b/src/viper/effects/Convolver.cpp index be325e5..82e7ee0 100644 --- a/src/viper/effects/Convolver.cpp +++ b/src/viper/effects/Convolver.cpp @@ -1,5 +1,5 @@ #include "Convolver.h" -#include "../constants.h" +#include #include #include diff --git a/src/viper/effects/DiffSurround.cpp b/src/viper/effects/DiffSurround.cpp index d4d9583..e1b6583 100644 --- a/src/viper/effects/DiffSurround.cpp +++ b/src/viper/effects/DiffSurround.cpp @@ -1,6 +1,6 @@ #include #include "DiffSurround.h" -#include "../constants.h" +#include DiffSurround::DiffSurround() : buffers({ WaveBuffer(1, 0x1000), diff --git a/src/viper/effects/DynamicSystem.cpp b/src/viper/effects/DynamicSystem.cpp index c848a4a..baada55 100644 --- a/src/viper/effects/DynamicSystem.cpp +++ b/src/viper/effects/DynamicSystem.cpp @@ -1,5 +1,5 @@ #include "DynamicSystem.h" -#include "../constants.h" +#include DynamicSystem::DynamicSystem() { this->samplingRate = VIPER_DEFAULT_SAMPLING_RATE; diff --git a/src/viper/effects/FETCompressor.cpp b/src/viper/effects/FETCompressor.cpp index bc0a3d9..9b1e44a 100644 --- a/src/viper/effects/FETCompressor.cpp +++ b/src/viper/effects/FETCompressor.cpp @@ -1,6 +1,6 @@ #include #include "FETCompressor.h" -#include "../constants.h" +#include static const float DEFAULT_FETCOMP_PARAMETERS[] = { 1.000000, diff --git a/src/viper/effects/IIRFilter.cpp b/src/viper/effects/IIRFilter.cpp index e4a4d26..d6f1eb5 100644 --- a/src/viper/effects/IIRFilter.cpp +++ b/src/viper/effects/IIRFilter.cpp @@ -1,7 +1,7 @@ #include #include #include "IIRFilter.h" -#include "../constants.h" +#include // Iscle: Verified with the latest version at 13/12/2022 diff --git a/src/viper/effects/PlaybackGain.cpp b/src/viper/effects/PlaybackGain.cpp index 670dee8..3f92683 100644 --- a/src/viper/effects/PlaybackGain.cpp +++ b/src/viper/effects/PlaybackGain.cpp @@ -1,6 +1,6 @@ #include #include "PlaybackGain.h" -#include "../constants.h" +#include PlaybackGain::PlaybackGain() { this->enable = false; diff --git a/src/viper/effects/Reverberation.cpp b/src/viper/effects/Reverberation.cpp index 40d1a9a..7722e09 100644 --- a/src/viper/effects/Reverberation.cpp +++ b/src/viper/effects/Reverberation.cpp @@ -1,5 +1,4 @@ #include "Reverberation.h" -#include "../constants.h" Reverberation::Reverberation() { this->model.SetRoomSize(0.0); diff --git a/src/viper/effects/SpeakerCorrection.cpp b/src/viper/effects/SpeakerCorrection.cpp index 1fccbb6..0c7123d 100644 --- a/src/viper/effects/SpeakerCorrection.cpp +++ b/src/viper/effects/SpeakerCorrection.cpp @@ -1,5 +1,5 @@ #include "SpeakerCorrection.h" -#include "../constants.h" +#include // Iscle: Verified with the latest version at 13/12/2022 diff --git a/src/viper/effects/SpectrumExtend.cpp b/src/viper/effects/SpectrumExtend.cpp index bed768d..9bf99fd 100644 --- a/src/viper/effects/SpectrumExtend.cpp +++ b/src/viper/effects/SpectrumExtend.cpp @@ -1,5 +1,5 @@ #include "SpectrumExtend.h" -#include "../constants.h" +#include static const float SPECTRUM_HARMONICS[10] = { 0.02f, diff --git a/src/viper/effects/VHE.cpp b/src/viper/effects/VHE.cpp index a79ecd5..ee08527 100644 --- a/src/viper/effects/VHE.cpp +++ b/src/viper/effects/VHE.cpp @@ -1,5 +1,5 @@ #include "VHE.h" -#include "../constants.h" +#include #include "VHE_L0.h" #include "VHE_L1.h" #include "VHE_L2.h" @@ -48,12 +48,12 @@ void VHE::Reset() { this->convRight.UnloadKernel(); if (this->effectLevel > 4) { - VIPER_LOGD("Invalid effect level %d", this->effectLevel); + ALOGD("Invalid effect level %d", this->effectLevel); return; } if (this->samplingRate != 44100 && this->samplingRate != 48000) { - VIPER_LOGD("Invalid sampling rate %d", this->samplingRate); + ALOGD("Invalid sampling rate %d", this->samplingRate); return; } diff --git a/src/viper/effects/ViPERBass.cpp b/src/viper/effects/ViPERBass.cpp index 5c8e1dc..67d4d6a 100644 --- a/src/viper/effects/ViPERBass.cpp +++ b/src/viper/effects/ViPERBass.cpp @@ -1,5 +1,5 @@ #include "ViPERBass.h" -#include "../constants.h" +#include // Iscle: Verified with the latest version at 13/12/2022 diff --git a/src/viper/effects/ViPERClarity.cpp b/src/viper/effects/ViPERClarity.cpp index 27f4a6c..66da44a 100644 --- a/src/viper/effects/ViPERClarity.cpp +++ b/src/viper/effects/ViPERClarity.cpp @@ -1,5 +1,5 @@ #include "ViPERClarity.h" -#include "../constants.h" +#include // Iscle: Verified with the latest version at 13/12/2022 diff --git a/src/viper/effects/ViPERDDC.cpp b/src/viper/effects/ViPERDDC.cpp index f3d0362..090e6d9 100644 --- a/src/viper/effects/ViPERDDC.cpp +++ b/src/viper/effects/ViPERDDC.cpp @@ -1,6 +1,6 @@ #include "ViPERDDC.h" -#include "../../log.h" -#include "../constants.h" +#include +#include #include ViPERDDC::ViPERDDC() : @@ -146,7 +146,7 @@ void ViPERDDC::SetSamplingRate(uint32_t samplingRate) { if (this->samplingRate != samplingRate) { this->samplingRate = samplingRate; if (!isSamplingRateValid()) { - VIPER_LOGE("ViPERDDC::SetSamplingRate() -> Invalid sampling rate: %d", this->samplingRate); + ALOGE("ViPERDDC::SetSamplingRate() -> Invalid sampling rate: %d", this->samplingRate); } Reset(); } diff --git a/src/viper/utils/Crossfeed.cpp b/src/viper/utils/Crossfeed.cpp index dbcba65..b1fdfad 100644 --- a/src/viper/utils/Crossfeed.cpp +++ b/src/viper/utils/Crossfeed.cpp @@ -1,7 +1,7 @@ #include #include #include "Crossfeed.h" -#include "../constants.h" +#include // Basically Bauer-to-Stereophonic Binaural filter // See: http://bs2b.sourceforge.net/ diff --git a/src/viper/utils/DepthSurround.cpp b/src/viper/utils/DepthSurround.cpp index 108b1d9..3ad0f98 100644 --- a/src/viper/utils/DepthSurround.cpp +++ b/src/viper/utils/DepthSurround.cpp @@ -1,6 +1,6 @@ #include "DepthSurround.h" #include -#include "../constants.h" +#include DepthSurround::DepthSurround() { this->strength = 0; diff --git a/src/viper/utils/DynamicBass.cpp b/src/viper/utils/DynamicBass.cpp index c185a49..d604547 100644 --- a/src/viper/utils/DynamicBass.cpp +++ b/src/viper/utils/DynamicBass.cpp @@ -1,5 +1,5 @@ #include "DynamicBass.h" -#include "../constants.h" +#include DynamicBass::DynamicBass() { this->qPeak = 0; diff --git a/src/viper/utils/HiFi.cpp b/src/viper/utils/HiFi.cpp index 0935cd4..2a6e791 100644 --- a/src/viper/utils/HiFi.cpp +++ b/src/viper/utils/HiFi.cpp @@ -1,5 +1,5 @@ #include "HiFi.h" -#include "../constants.h" +#include HiFi::HiFi() { this->gain = 1.f; diff --git a/src/viper/utils/MinPhaseIIRCoeffs.cpp b/src/viper/utils/MinPhaseIIRCoeffs.cpp index 8819ce4..1d4da3b 100644 --- a/src/viper/utils/MinPhaseIIRCoeffs.cpp +++ b/src/viper/utils/MinPhaseIIRCoeffs.cpp @@ -1,5 +1,4 @@ #include "MinPhaseIIRCoeffs.h" -#include "../constants.h" #include // Iscle: Verified with the latest version at 13/12/2022 diff --git a/src/viper/utils/NoiseSharpening.cpp b/src/viper/utils/NoiseSharpening.cpp index b8ccd7e..a7468d8 100644 --- a/src/viper/utils/NoiseSharpening.cpp +++ b/src/viper/utils/NoiseSharpening.cpp @@ -1,5 +1,5 @@ #include "NoiseSharpening.h" -#include "../constants.h" +#include NoiseSharpening::NoiseSharpening() { this->samplingRate = VIPER_DEFAULT_SAMPLING_RATE; diff --git a/src/viper/utils/PassFilter.cpp b/src/viper/utils/PassFilter.cpp index f39fb9d..8da2584 100644 --- a/src/viper/utils/PassFilter.cpp +++ b/src/viper/utils/PassFilter.cpp @@ -1,5 +1,5 @@ #include "PassFilter.h" -#include "../constants.h" +#include PassFilter::PassFilter() : filters({ IIR_NOrder_BW_LH(3), diff --git a/src/viper/utils/PolesFilter.cpp b/src/viper/utils/PolesFilter.cpp index ba9eead..dc8e5b1 100644 --- a/src/viper/utils/PolesFilter.cpp +++ b/src/viper/utils/PolesFilter.cpp @@ -1,5 +1,5 @@ #include "PolesFilter.h" -#include "../constants.h" +#include #include #include diff --git a/src/viper/utils/Polyphase.cpp b/src/viper/utils/Polyphase.cpp index 32a550b..8d94e36 100644 --- a/src/viper/utils/Polyphase.cpp +++ b/src/viper/utils/Polyphase.cpp @@ -1,5 +1,5 @@ #include "Polyphase.h" -#include "../constants.h" +#include static const float POLYPHASE_COEFFICIENTS_2[] = { -0.002339, diff --git a/src/viper/utils/Subwoofer.cpp b/src/viper/utils/Subwoofer.cpp index 28e8768..3d5d93b 100644 --- a/src/viper/utils/Subwoofer.cpp +++ b/src/viper/utils/Subwoofer.cpp @@ -1,5 +1,5 @@ #include "Subwoofer.h" -#include "../constants.h" +#include #include Subwoofer::Subwoofer() {