From 18fc094c0ed41851be3d746423c6695dd28d48e1 Mon Sep 17 00:00:00 2001 From: Jean-Michel Trivi Date: Thu, 14 Nov 2013 16:30:20 -0800 Subject: Define and use DRC-specific volume curves when applicable Add support for property defining whether a DRC on the speaker path is enabled and will boost soft sounds. Define new volume curves with more attenuations than existing ones to compensate for DRC-induced boost on sonification sounds to provide a more "linear" control to the user over the applied volume. Bug 11600699 Change-Id: If23dd097a8b9b5ebb61e75dd8512ff75e63ba899 --- include/hardware_legacy/AudioPolicyManagerBase.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'include/hardware_legacy/AudioPolicyManagerBase.h') diff --git a/include/hardware_legacy/AudioPolicyManagerBase.h b/include/hardware_legacy/AudioPolicyManagerBase.h index 5fea77a..8343f2b 100644 --- a/include/hardware_legacy/AudioPolicyManagerBase.h +++ b/include/hardware_legacy/AudioPolicyManagerBase.h @@ -236,7 +236,9 @@ protected: static const VolumeCurvePoint sSpeakerMediaVolumeCurve[AudioPolicyManagerBase::VOLCNT]; // volume curve for sonification strategy on speakers static const VolumeCurvePoint sSpeakerSonificationVolumeCurve[AudioPolicyManagerBase::VOLCNT]; + static const VolumeCurvePoint sSpeakerSonificationVolumeCurveDrc[AudioPolicyManagerBase::VOLCNT]; static const VolumeCurvePoint sDefaultSystemVolumeCurve[AudioPolicyManagerBase::VOLCNT]; + static const VolumeCurvePoint sDefaultSystemVolumeCurveDrc[AudioPolicyManagerBase::VOLCNT]; static const VolumeCurvePoint sHeadsetSystemVolumeCurve[AudioPolicyManagerBase::VOLCNT]; static const VolumeCurvePoint sDefaultVoiceVolumeCurve[AudioPolicyManagerBase::VOLCNT]; static const VolumeCurvePoint sSpeakerVoiceVolumeCurve[AudioPolicyManagerBase::VOLCNT]; @@ -499,6 +501,7 @@ protected: static uint32_t stringToEnum(const struct StringToEnum *table, size_t size, const char *name); + static bool stringToBool(const char *value); static audio_output_flags_t parseFlagNames(char *name); static audio_devices_t parseDeviceNames(char *name); void loadSamplingRates(char *name, IOProfile *profile); @@ -552,6 +555,8 @@ protected: audio_devices_t mAttachedOutputDevices; // output devices always available on the platform audio_devices_t mDefaultOutputDevice; // output device selected by default at boot time // (must be in mAttachedOutputDevices) + bool mSpeakerDrcEnabled;// true on devices that use DRC on the DEVICE_CATEGORY_SPEAKER path + // to boost soft sounds, used to adjust volume curves accordingly Vector mHwModules; -- cgit v1.1