* commit 'd22bb8f46c5e3699949c7c54cc61e994979cd6e9': audio policy: tune voice/video chat volumes
This commit is contained in:
commit
6afb500f07
2 changed files with 22 additions and 18 deletions
|
@ -2616,13 +2616,23 @@ const AudioPolicyManagerBase::VolumeCurvePoint
|
|||
{1, -30.0f}, {33, -26.0f}, {66, -22.0f}, {100, -18.0f}
|
||||
};
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
|
|
|
@ -227,6 +227,8 @@ protected:
|
|||
static const VolumeCurvePoint sSpeakerSonificationVolumeCurve[AudioPolicyManagerBase::VOLCNT];
|
||||
static const VolumeCurvePoint sDefaultSystemVolumeCurve[AudioPolicyManagerBase::VOLCNT];
|
||||
static const VolumeCurvePoint sHeadsetSystemVolumeCurve[AudioPolicyManagerBase::VOLCNT];
|
||||
static const VolumeCurvePoint sDefaultVoiceVolumeCurve[AudioPolicyManagerBase::VOLCNT];
|
||||
static const VolumeCurvePoint sSpeakerVoiceVolumeCurve[AudioPolicyManagerBase::VOLCNT];
|
||||
// default volume curves per stream and device category. See initializeVolumeCurves()
|
||||
static const VolumeCurvePoint *sVolumeProfiles[AUDIO_STREAM_CNT][DEVICE_CATEGORY_CNT];
|
||||
|
||||
|
|
Loading…
Reference in a new issue