summaryrefslogtreecommitdiffstats
path: root/media/libeffects/lvm/wrapper/Bundle/EffectBundle.cpp
diff options
context:
space:
mode:
authorEric Laurent <elaurent@google.com>2010-09-10 17:44:44 -0700
committerEric Laurent <elaurent@google.com>2010-09-13 09:08:28 -0700
commite0aed6ddcb4e3c301b80aa26706b6052dab42c41 (patch)
tree4a85e38eefe3ad4ac70ca1b182660aefacc07658 /media/libeffects/lvm/wrapper/Bundle/EffectBundle.cpp
parenta1754133ee6640346b5fd6daa4666f5d2285379a (diff)
downloadframeworks_av-e0aed6ddcb4e3c301b80aa26706b6052dab42c41.zip
frameworks_av-e0aed6ddcb4e3c301b80aa26706b6052dab42c41.tar.gz
frameworks_av-e0aed6ddcb4e3c301b80aa26706b6052dab42c41.tar.bz2
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
Diffstat (limited to 'media/libeffects/lvm/wrapper/Bundle/EffectBundle.cpp')
-rw-r--r--media/libeffects/lvm/wrapper/Bundle/EffectBundle.cpp12
1 files changed, 4 insertions, 8 deletions
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; i<LVM_MAX_SESSIONS; i++){
- if((SessionIndex[i] == -1)||(SessionIndex[i] == sessionId)){
+ if((SessionIndex[i] == LVM_UNUSED_SESSION)||(SessionIndex[i] == sessionId)){
sessionNo = i;
SessionIndex[i] = sessionId;
LOGV("\tEffectCreate: Allocating SessionNo %d for SessionId %d\n", sessionNo,sessionId);
@@ -398,7 +394,7 @@ extern "C" int EffectRelease(effect_interface_t interface){
// Clear the SessionIndex
for(int i=0; i<LVM_MAX_SESSIONS; i++){
if(SessionIndex[i] == pContext->pBundledContext->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;
}