summaryrefslogtreecommitdiffstats
path: root/audio
diff options
context:
space:
mode:
authorEric Laurent <elaurent@google.com>2012-10-18 10:54:44 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2012-10-18 10:54:45 -0700
commit672e9ace42a3f7d4f93460efc79ebd444786a5eb (patch)
treee41daa7368148316b06a238b44f43a1920816d08 /audio
parent772686310a3bc44d93591349e174a60360a3d30d (diff)
parent0d6490a58bf607f1efc00638709f9c4c8f7dd270 (diff)
downloadplatform_hardware_libhardware_legacy-672e9ace42a3f7d4f93460efc79ebd444786a5eb.tar.gz
platform_hardware_libhardware_legacy-672e9ace42a3f7d4f93460efc79ebd444786a5eb.tar.bz2
platform_hardware_libhardware_legacy-672e9ace42a3f7d4f93460efc79ebd444786a5eb.zip
Merge "audio policy: tune voice/video chat volumes" into jb-mr1-dev
Diffstat (limited to 'audio')
-rw-r--r--audio/AudioPolicyManagerBase.cpp38
1 files changed, 20 insertions, 18 deletions
diff --git a/audio/AudioPolicyManagerBase.cpp b/audio/AudioPolicyManagerBase.cpp
index 4682e39..98453d0 100644
--- a/audio/AudioPolicyManagerBase.cpp
+++ b/audio/AudioPolicyManagerBase.cpp
@@ -2617,12 +2617,22 @@ const AudioPolicyManagerBase::VolumeCurvePoint
};
const AudioPolicyManagerBase::VolumeCurvePoint
+ AudioPolicyManagerBase::sDefaultVoiceVolumeCurve[AudioPolicyManagerBase::VOLCNT] = {
+ {0, -42.0f}, {33, -28.0f}, {66, -14.0f}, {100, 0.0f}
+};
+
+const AudioPolicyManagerBase::VolumeCurvePoint
+ AudioPolicyManagerBase::sSpeakerVoiceVolumeCurve[AudioPolicyManagerBase::VOLCNT] = {
+ {0, -24.0f}, {33, -16.0f}, {66, -8.0f}, {100, 0.0f}
+};
+
+const AudioPolicyManagerBase::VolumeCurvePoint
*AudioPolicyManagerBase::sVolumeProfiles[AUDIO_STREAM_CNT]
[AudioPolicyManagerBase::DEVICE_CATEGORY_CNT] = {
{ // AUDIO_STREAM_VOICE_CALL
- sDefaultVolumeCurve, // DEVICE_CATEGORY_HEADSET
- sDefaultVolumeCurve, // DEVICE_CATEGORY_SPEAKER
- sDefaultVolumeCurve // DEVICE_CATEGORY_EARPIECE
+ sDefaultVoiceVolumeCurve, // DEVICE_CATEGORY_HEADSET
+ sSpeakerVoiceVolumeCurve, // DEVICE_CATEGORY_SPEAKER
+ sDefaultVoiceVolumeCurve // DEVICE_CATEGORY_EARPIECE
},
{ // AUDIO_STREAM_SYSTEM
sHeadsetSystemVolumeCurve, // DEVICE_CATEGORY_HEADSET
@@ -2650,9 +2660,9 @@ const AudioPolicyManagerBase::VolumeCurvePoint
sDefaultVolumeCurve // DEVICE_CATEGORY_EARPIECE
},
{ // AUDIO_STREAM_BLUETOOTH_SCO
- sDefaultVolumeCurve, // DEVICE_CATEGORY_HEADSET
- sDefaultVolumeCurve, // DEVICE_CATEGORY_SPEAKER
- sDefaultVolumeCurve // DEVICE_CATEGORY_EARPIECE
+ sDefaultVoiceVolumeCurve, // DEVICE_CATEGORY_HEADSET
+ sSpeakerVoiceVolumeCurve, // DEVICE_CATEGORY_SPEAKER
+ sDefaultVoiceVolumeCurve // DEVICE_CATEGORY_EARPIECE
},
{ // AUDIO_STREAM_ENFORCED_AUDIBLE
sHeadsetSystemVolumeCurve, // DEVICE_CATEGORY_HEADSET
@@ -2776,19 +2786,11 @@ status_t AudioPolicyManagerBase::checkAndSetVolume(int stream,
force) {
mOutputs.valueFor(output)->mCurVolume[stream] = volume;
ALOGVV("checkAndSetVolume() for output %d stream %d, volume %f, delay %d", output, stream, volume, delayMs);
- if (stream == AudioSystem::VOICE_CALL ||
- stream == AudioSystem::DTMF ||
- stream == AudioSystem::BLUETOOTH_SCO) {
- // offset value to reflect actual hardware volume that never reaches 0
- // 1% corresponds roughly to first step in VOICE_CALL stream volume setting (see AudioService.java)
- volume = 0.01 + 0.99 * volume;
- // Force VOICE_CALL to track BLUETOOTH_SCO stream volume when bluetooth audio is
- // enabled
- if (stream == AudioSystem::BLUETOOTH_SCO) {
- mpClientInterface->setStreamVolume(AudioSystem::VOICE_CALL, volume, output, delayMs);
- }
+ // Force VOICE_CALL to track BLUETOOTH_SCO stream volume when bluetooth audio is
+ // enabled
+ if (stream == AudioSystem::BLUETOOTH_SCO) {
+ mpClientInterface->setStreamVolume(AudioSystem::VOICE_CALL, volume, output, delayMs);
}
-
mpClientInterface->setStreamVolume((AudioSystem::stream_type)stream, volume, output, delayMs);
}