summaryrefslogtreecommitdiffstats
path: root/services/audioflinger/Effects.cpp
diff options
context:
space:
mode:
authorRicardo Garcia <rago@google.com>2015-05-28 12:14:12 -0700
committerRicardo Garcia <rago@google.com>2015-05-28 14:28:40 -0700
commitd11da70f0e1d06ee6c7b2f83fcfb06257a1c90f2 (patch)
tree3620c1269dd9a73cf533cbed5888459edbf87abf /services/audioflinger/Effects.cpp
parent70b2313318aaf245d185b6ddb188606608bdf7c9 (diff)
downloadframeworks_av-d11da70f0e1d06ee6c7b2f83fcfb06257a1c90f2.zip
frameworks_av-d11da70f0e1d06ee6c7b2f83fcfb06257a1c90f2.tar.gz
frameworks_av-d11da70f0e1d06ee6c7b2f83fcfb06257a1c90f2.tar.bz2
Fix for audio effects in offload path for mono content
Effects path is always stereo, and it should be initialized as thus even if the source is mono. Fixed condition check before initialization. bug: 18157592 Change-Id: Idd7241931e4ba6085fd804345128d898c8511e11
Diffstat (limited to 'services/audioflinger/Effects.cpp')
-rw-r--r--services/audioflinger/Effects.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/services/audioflinger/Effects.cpp b/services/audioflinger/Effects.cpp
index 8bccb47..949c91d 100644
--- a/services/audioflinger/Effects.cpp
+++ b/services/audioflinger/Effects.cpp
@@ -335,13 +335,21 @@ status_t AudioFlinger::EffectModule::configure()
// TODO: handle configuration of effects replacing track process
channelMask = thread->channelMask();
+ mConfig.outputCfg.channels = channelMask;
if ((mDescriptor.flags & EFFECT_FLAG_TYPE_MASK) == EFFECT_FLAG_TYPE_AUXILIARY) {
mConfig.inputCfg.channels = AUDIO_CHANNEL_OUT_MONO;
} else {
mConfig.inputCfg.channels = channelMask;
+ // TODO: Update this logic when multichannel effects are implemented.
+ // For offloaded tracks consider mono output as stereo for proper effect initialization
+ if (channelMask == AUDIO_CHANNEL_OUT_MONO) {
+ mConfig.inputCfg.channels = AUDIO_CHANNEL_OUT_STEREO;
+ mConfig.outputCfg.channels = AUDIO_CHANNEL_OUT_STEREO;
+ ALOGV("Overriding effect input and output as STEREO");
+ }
}
- mConfig.outputCfg.channels = channelMask;
+
mConfig.inputCfg.format = AUDIO_FORMAT_PCM_16_BIT;
mConfig.outputCfg.format = AUDIO_FORMAT_PCM_16_BIT;
mConfig.inputCfg.samplingRate = thread->sampleRate();