summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
Diffstat (limited to 'services')
-rw-r--r--services/audioflinger/Android.mk4
-rw-r--r--services/audioflinger/AudioFlinger.cpp25
-rw-r--r--services/audioflinger/AudioMixer.cpp4
3 files changed, 26 insertions, 7 deletions
diff --git a/services/audioflinger/Android.mk b/services/audioflinger/Android.mk
index bd9421c..c2b97d8 100644
--- a/services/audioflinger/Android.mk
+++ b/services/audioflinger/Android.mk
@@ -13,6 +13,10 @@ include $(BUILD_STATIC_LIBRARY)
include $(CLEAR_VARS)
+ifeq ($(TARGET_QCOM_AUDIO_VARIANT),caf)
+LOCAL_CFLAGS += -DQCOM_ENHANCED_AUDIO
+endif
+
LOCAL_SRC_FILES:= \
AudioFlinger.cpp \
AudioMixer.cpp.arm \
diff --git a/services/audioflinger/AudioFlinger.cpp b/services/audioflinger/AudioFlinger.cpp
index 12cfe9d..d260074 100644
--- a/services/audioflinger/AudioFlinger.cpp
+++ b/services/audioflinger/AudioFlinger.cpp
@@ -1204,7 +1204,15 @@ status_t AudioFlinger::setParameters(audio_io_handle_t ioHandle, const String8&
if (desc != NULL) {
ALOGV("setParameters for mAudioTracks size %d desc %p",mDirectAudioTracks.size(),desc);
desc->stream->common.set_parameters(&desc->stream->common, keyValuePairs.string());
- return NO_ERROR;
+ AudioParameter param = AudioParameter(keyValuePairs);
+ String8 key = String8(AudioParameter::keyRouting);
+ int device;
+ if (param.getInt(key, device) == NO_ERROR) {
+ if(mLPAEffectChain != NULL){
+ mLPAEffectChain->setDevice_l(device);
+ audioConfigChanged_l(AudioSystem::EFFECT_CONFIG_CHANGED, 0, NULL);
+ }
+ }
}
}
#endif
@@ -6169,9 +6177,12 @@ AudioFlinger::DirectAudioTrack::~DirectAudioTrack() {
AudioSystem::releaseOutput(mOutput);
releaseWakeLock();
- if (mPowerManager != 0) {
- sp<IBinder> binder = mPowerManager->asBinder();
- binder->unlinkToDeath(mDeathRecipient);
+ {
+ Mutex::Autolock _l(pmLock);
+ if (mPowerManager != 0) {
+ sp<IBinder> binder = mPowerManager->asBinder();
+ binder->unlinkToDeath(mDeathRecipient);
+ }
}
}
@@ -6234,8 +6245,8 @@ void AudioFlinger::DirectAudioTrack::mute(bool muted) {
}
void AudioFlinger::DirectAudioTrack::setVolume(float left, float right) {
- mOutputDesc->mVolumeLeft = 1.0;
- mOutputDesc->mVolumeRight = 1.0;
+ mOutputDesc->mVolumeLeft = left;
+ mOutputDesc->mVolumeRight = right;
}
int64_t AudioFlinger::DirectAudioTrack::getTimeStamp() {
@@ -6428,8 +6439,8 @@ void AudioFlinger::DirectAudioTrack::releaseWakeLock()
void AudioFlinger::DirectAudioTrack::clearPowerManager()
{
- Mutex::Autolock _l(pmLock);
releaseWakeLock();
+ Mutex::Autolock _l(pmLock);
mPowerManager.clear();
}
diff --git a/services/audioflinger/AudioMixer.cpp b/services/audioflinger/AudioMixer.cpp
index af169d5..ced0453 100644
--- a/services/audioflinger/AudioMixer.cpp
+++ b/services/audioflinger/AudioMixer.cpp
@@ -549,7 +549,11 @@ bool AudioMixer::track_t::setResampler(uint32_t value, uint32_t devSampleRate)
(value == 48000 && devSampleRate == 44100))) {
quality = AudioResampler::LOW_QUALITY;
} else {
+#ifdef QCOM_ENHANCED_AUDIO
+ quality = AudioResampler::VERY_HIGH_QUALITY;
+#else
quality = AudioResampler::DEFAULT_QUALITY;
+#endif
}
resampler = AudioResampler::create(
format,