OSDN Git Service

Audio policy: new media volume curve for speaker with DRC
authorJean-Michel Trivi <jmtrivi@google.com>
Thu, 5 Jun 2014 22:33:20 +0000 (15:33 -0700)
committerJean-Michel Trivi <jmtrivi@google.com>
Thu, 5 Jun 2014 22:33:20 +0000 (15:33 -0700)
For devices with DRC on speaker (using the flag "speaker_drc_enabled"
 in audio_policy.conf), set the speaker media volume to use a
 new curve with more aggressive attenuation in the upper range.

Bug 15318604

Change-Id: Ia5fb9fdd608fddad22fadfb1065d35574030bb52

services/audiopolicy/AudioPolicyManager.cpp
services/audiopolicy/AudioPolicyManager.h

index 7f3bdef..6d81ce8 100644 (file)
@@ -4021,6 +4021,11 @@ const AudioPolicyManager::VolumeCurvePoint
 };
 
 const AudioPolicyManager::VolumeCurvePoint
+    AudioPolicyManager::sSpeakerMediaVolumeCurveDrc[AudioPolicyManager::VOLCNT] = {
+    {1, -56.0f}, {20, -34.0f}, {86, -10.0f}, {100, 0.0f}
+};
+
+const AudioPolicyManager::VolumeCurvePoint
     AudioPolicyManager::sSpeakerSonificationVolumeCurve[AudioPolicyManager::VOLCNT] = {
     {1, -29.7f}, {33, -20.1f}, {66, -10.2f}, {100, 0.0f}
 };
@@ -4134,6 +4139,8 @@ void AudioPolicyManager::initializeVolumeCurves()
                 sSpeakerSonificationVolumeCurveDrc;
         mStreams[AUDIO_STREAM_NOTIFICATION].mVolumeCurve[DEVICE_CATEGORY_SPEAKER] =
                 sSpeakerSonificationVolumeCurveDrc;
+        mStreams[AUDIO_STREAM_MUSIC].mVolumeCurve[DEVICE_CATEGORY_SPEAKER] =
+                sSpeakerMediaVolumeCurveDrc;
     }
 }
 
index e012d63..472d895 100644 (file)
@@ -360,6 +360,7 @@ protected:
         static const VolumeCurvePoint sDefaultMediaVolumeCurve[AudioPolicyManager::VOLCNT];
         // volume curve for media strategy on speakers
         static const VolumeCurvePoint sSpeakerMediaVolumeCurve[AudioPolicyManager::VOLCNT];
+        static const VolumeCurvePoint sSpeakerMediaVolumeCurveDrc[AudioPolicyManager::VOLCNT];
         // volume curve for sonification strategy on speakers
         static const VolumeCurvePoint sSpeakerSonificationVolumeCurve[AudioPolicyManager::VOLCNT];
         static const VolumeCurvePoint sSpeakerSonificationVolumeCurveDrc[AudioPolicyManager::VOLCNT];