summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTony Layher <layhertony@gmail.com>2014-12-23 10:58:58 -0500
committerTony Layher <layhertony@gmail.com>2014-12-23 10:58:58 -0500
commite2142bbdc5b75e8d42c92781644f16a7afe958b6 (patch)
tree54232699a69f3a60ae5a3adf3453a0757fe7c2d7
parent555c4ec6ec00763c6462ad91b471d21611095902 (diff)
downloadhardware_qcom_audio-cm-12.0-caf-8084-old.tar.gz
hardware_qcom_audio-cm-12.0-caf-8084-old.tar.bz2
hardware_qcom_audio-cm-12.0-caf-8084-old.zip
8084: Add define for ES705 codecs.cm-12.0-caf-8084-old
The ES705 Codec reverses the volume adjustment. When attempting to change volume low = loud and vice versa. Correct this by remving the 100 - vol statement. Credit to Lessaj Change-Id: I4bfc280293bc2ab1170c2e5cf934734a7cfd809e
-rw-r--r--hal/Android.mk4
-rw-r--r--hal/voice.c4
-rw-r--r--hal/voice_extn/compress_voip.c4
3 files changed, 8 insertions, 4 deletions
diff --git a/hal/Android.mk b/hal/Android.mk
index c7d1a8a2..e5125f27 100644
--- a/hal/Android.mk
+++ b/hal/Android.mk
@@ -171,6 +171,10 @@ ifeq ($(strip $(AUDIO_FEATURE_ENABLED_AUXPCM_BT)),true)
LOCAL_CFLAGS += -DAUXPCM_BT_ENABLED
endif
+ifeq ($(BOARD_USES_ES705),true)
+ LOCAL_CFLAGS += -DUSE_ES705
+endif
+
LOCAL_COPY_HEADERS_TO := mm-audio
LOCAL_COPY_HEADERS := audio_extn/audio_defs.h
diff --git a/hal/voice.c b/hal/voice.c
index 94afa47c..d5dcc19b 100644
--- a/hal/voice.c
+++ b/hal/voice.c
@@ -326,12 +326,12 @@ int voice_set_volume(struct audio_device *adev, float volume)
}
vol = lrint(volume * 100.0);
-
+#ifndef USE_ES705
// Voice volume levels from android are mapped to driver volume levels as follows.
// 0 -> 5, 20 -> 4, 40 ->3, 60 -> 2, 80 -> 1, 100 -> 0
// So adjust the volume to get the correct volume index in driver
vol = 100 - vol;
-
+#endif
err = platform_set_voice_volume(adev->platform, vol);
}
if (adev->mode == AUDIO_MODE_IN_COMMUNICATION)
diff --git a/hal/voice_extn/compress_voip.c b/hal/voice_extn/compress_voip.c
index 348170a7..408d59a6 100644
--- a/hal/voice_extn/compress_voip.c
+++ b/hal/voice_extn/compress_voip.c
@@ -688,13 +688,13 @@ int voice_extn_compress_voip_set_volume(struct audio_device *adev, float volume)
}
vol = lrint(volume * 100.0);
-
+#ifndef USE_ES705
/* Voice volume levels from android are mapped to driver volume levels as follows.
* 0 -> 5, 20 -> 4, 40 ->3, 60 -> 2, 80 -> 1, 100 -> 0
* So adjust the volume to get the correct volume index in driver
*/
vol = 100 - vol;
-
+#endif
err = voip_set_volume(adev, vol);
ALOGV("%s: exit: status(%d)", __func__, err);