hal: limit AFE and ADM sample rate at 48 for speaker

Limit AFE and ADM Sample Rate at 48 for speaker, irrespective
of the bitwidth.

CRs-Fixed: 974913

Change-Id: I43db793dd6d1adede088f7a7c3d86bd39770e2d7
This commit is contained in:
Sidipotu Ashok 2016-02-11 10:31:38 +05:30 committed by Gerrit - the friendly Code Review server
parent 44ddaf8834
commit fdd505a4c8
3 changed files with 12 additions and 16 deletions

View File

@ -622,8 +622,7 @@ int audio_extn_utils_send_app_type_cfg(struct audio_device *adev,
__func__, platform_get_default_app_type(adev->platform), acdb_dev_id, sample_rate);
} else if (usecase->type == PCM_PLAYBACK) {
if ((24 == usecase->stream.out->bit_width) &&
(usecase->stream.out->devices & AUDIO_DEVICE_OUT_SPEAKER)) {
if (usecase->stream.out->devices & AUDIO_DEVICE_OUT_SPEAKER) {
usecase->stream.out->app_type_cfg.sample_rate = DEFAULT_OUTPUT_SAMPLING_RATE;
} else if ((usecase->stream.out->app_type_cfg.sample_rate == OUTPUT_SAMPLING_RATE_44100 &&
!(audio_is_this_native_usecase(usecase))) ||

View File

@ -4291,16 +4291,15 @@ bool platform_check_codec_backend_cfg(struct audio_device* adev,
}
/*
* 24 bit playback on speakers is allowed through 48
* khz backend only
* hifi playback not supported on spkr devices, limit the Sample Rate
* to 48 khz.
*/
if ((24 == bit_width) &&
(usecase->stream.out->devices & AUDIO_DEVICE_OUT_SPEAKER)) {
bit_width = (uint32_t)platform_get_snd_device_bit_width(SND_DEVICE_OUT_SPEAKER);
if (usecase->stream.out->devices & AUDIO_DEVICE_OUT_SPEAKER) {
sample_rate = CODEC_BACKEND_DEFAULT_SAMPLE_RATE;
ALOGD("%s:becf: afe: 24 bit playback on speakers"
"Configure afe to default Sample Rate(48k)", __func__);
ALOGD("%s:becf: afe: playback on speakers Configure afe to \
default Sample Rate(48k)", __func__);
}
/*

View File

@ -3893,15 +3893,13 @@ bool platform_check_codec_backend_cfg(struct audio_device* adev,
}
/*
* 24 bit playback on speakers is allowed through 48
* khz backend only
* hifi playback not supported on spkr devices, limit the Sample Rate
* to 48 khz.
*/
if ((24 == bit_width) &&
(usecase->stream.out->devices & AUDIO_DEVICE_OUT_SPEAKER)) {
bit_width = (uint32_t)platform_get_snd_device_bit_width(SND_DEVICE_OUT_SPEAKER);
if (usecase->stream.out->devices & AUDIO_DEVICE_OUT_SPEAKER) {
sample_rate = CODEC_BACKEND_DEFAULT_SAMPLE_RATE;
ALOGD("%s:becf: afe: 24 bit playback on speakers"
"Configure afe to default Sample Rate(48k)", __func__);
ALOGD("%s:becf: afe: playback on speakers Configure afe to \
default Sample Rate(48k)", __func__);
}
/*