From e0aed6ddcb4e3c301b80aa26706b6052dab42c41 Mon Sep 17 00:00:00 2001 From: Eric Laurent Date: Fri, 10 Sep 2010 17:44:44 -0700 Subject: Fix volume problems with insert revert - Use a constant input level to the reverb engine and implement volume control in the insert reverb. This avoids the volume spikes when an effect that was inserted after the reverb is disabled or removed. - Fix clicks (one silent buffer) at the end of the reverb disable period. - Modified volume management in audioflinger so that the volume ramp is also done by the insert effect if present when the track is paused (avoids clicks). - Increased room level for all presets. Also fixed problems with output stage session (-1): - effect bundle wrapper was not designed to support session -1 - the permission check in audioflinger for using session -1 failed due to a wrong usage of getCallingPid() Change-Id: Id1ff51327263364bf71d3f2668fa5cde4311d84f --- media/libeffects/lvm/wrapper/Bundle/EffectBundle.cpp | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'media/libeffects/lvm/wrapper/Bundle/EffectBundle.cpp') diff --git a/media/libeffects/lvm/wrapper/Bundle/EffectBundle.cpp b/media/libeffects/lvm/wrapper/Bundle/EffectBundle.cpp index e86ed99..90756d0 100644 --- a/media/libeffects/lvm/wrapper/Bundle/EffectBundle.cpp +++ b/media/libeffects/lvm/wrapper/Bundle/EffectBundle.cpp @@ -65,6 +65,7 @@ namespace { int LvmInitFlag = LVM_FALSE; int LvmSessionsActive = 0; SessionContext GlobalSessionMemory[LVM_MAX_SESSIONS]; + int SessionIndex[LVM_MAX_SESSIONS]; // NXP SW BassBoost UUID @@ -199,11 +200,6 @@ extern "C" int EffectCreate(effect_uuid_t *uuid, return -EINVAL; } - if(sessionId < 0){ - LOGV("\tLVM_ERROR : EffectCreate sessionId is less than 0"); - return -EINVAL; - } - if(LvmInitFlag == LVM_FALSE){ LvmInitFlag = LVM_TRUE; LOGV("\tEffectCreate - Initializing all global memory"); @@ -214,7 +210,7 @@ extern "C" int EffectCreate(effect_uuid_t *uuid, // Find next available sessionNo for(i=0; ipBundledContext->SessionId){ - SessionIndex[i] = -1; + SessionIndex[i] = LVM_UNUSED_SESSION; LOGV("\tEffectRelease: Clearing SessionIndex SessionNo %d for SessionId %d\n", i, pContext->pBundledContext->SessionId); break; @@ -432,7 +428,7 @@ void LvmGlobalBundle_init(){ GlobalSessionMemory[i].bVirtualizerInstantiated = LVM_FALSE; GlobalSessionMemory[i].pBundledContext = LVM_NULL; - SessionIndex[i] = -1; + SessionIndex[i] = LVM_UNUSED_SESSION; } return; } -- cgit v1.1