diff options
author | Eric Laurent <elaurent@google.com> | 2011-09-12 11:38:12 -0700 |
---|---|---|
committer | Eric Laurent <elaurent@google.com> | 2011-09-12 17:01:15 -0700 |
commit | cd057ad2774903c62f5c11bc71c4e7357aee71b8 (patch) | |
tree | 1f02580b5f33a74d99c6b9155cd4c6d26e0a69ac /include/hardware_legacy/AudioPolicyManagerBase.h | |
parent | fd6aba424765b2856c0b78135ce15d1bd7508948 (diff) | |
download | hardware_libhardware_legacy-cd057ad2774903c62f5c11bc71c4e7357aee71b8.zip hardware_libhardware_legacy-cd057ad2774903c62f5c11bc71c4e7357aee71b8.tar.gz hardware_libhardware_legacy-cd057ad2774903c62f5c11bc71c4e7357aee71b8.tar.bz2 |
Issue 5256795: Phone ringtone volume is too low
Modified the volume curve for ringtones and notifications
in audio policy manager. The first volume step now corresponds to
-30dB instead of -50dB thus making ringtone much more
audible for low volume settings.
Also made a generic implementation of volume curves according to
audio policy strategies.
Change-Id: Ieb7916ba2e53c2a10a47efec82814cabed21c48b
Diffstat (limited to 'include/hardware_legacy/AudioPolicyManagerBase.h')
-rw-r--r-- | include/hardware_legacy/AudioPolicyManagerBase.h | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/include/hardware_legacy/AudioPolicyManagerBase.h b/include/hardware_legacy/AudioPolicyManagerBase.h index 21cf872..2cc8d87 100644 --- a/include/hardware_legacy/AudioPolicyManagerBase.h +++ b/include/hardware_legacy/AudioPolicyManagerBase.h @@ -133,6 +133,21 @@ protected: NUM_STRATEGIES }; + // 4 points to define the volume attenuation curve, each characterized by the volume + // index (from 0 to 100) at which they apply, and the attenuation in dB at that index. + // we use 100 steps to avoid rounding errors when computing the volume in volIndexToAmpl() + + enum { VOLMIN = 0, VOLKNEE1 = 1, VOLKNEE2 = 2, VOLMAX = 3, VOLCNT = 4}; + + class VolumeCurvePoint + { + public: + int mIndex; + float mDBAttenuation; + }; + + static const VolumeCurvePoint sVolumeProfiles[NUM_STRATEGIES][VOLCNT]; + // descriptor for audio outputs. Used to maintain current configuration of each opened audio output // and keep track of the usage of this output by each audio stream type. class AudioOutputDescriptor @@ -196,14 +211,7 @@ protected: int mIndexCur; // current volume index bool mCanBeMuted; // true is the stream can be muted - // 4 points to define the volume attenuation curve, each characterized by the volume - // index (from 0 to 100) at which they apply, and the attenuation in dB at that index. - int mVolIndex[NUM_VOL_CURVE_KNEES+2]; // minimum index, index at knees, and max index - float mVolDbAtt[NUM_VOL_CURVE_KNEES+2]; // largest attenuation, attenuation at knees, - // and attenuation at max vol (usually 0dB) - // indices in mVolIndex and mVolDbAtt respectively for points at lowest volume, knee 1, - // knee 2 and highest volume. - enum { VOLMIN = 0, VOLKNEE1 = 1, VOLKNEE2 = 2, VOLMAX = 3 }; + VolumeCurvePoint mVolumeCurve[VOLCNT]; }; // stream descriptor used for volume control |