Loading hal/audio_extn/audio_extn.h +1 −0 Original line number Diff line number Diff line Loading @@ -421,6 +421,7 @@ void audio_extn_utils_update_stream_app_type_cfg(void *platform, audio_format_t format, uint32_t sample_rate, uint32_t bit_width, audio_channel_mask_t channel_mask, struct stream_app_type_cfg *app_type_cfg); int audio_extn_utils_send_app_type_cfg(struct audio_usecase *usecase); void audio_extn_utils_send_audio_calibration(struct audio_device *adev, Loading hal/audio_extn/utils.c +21 −0 Original line number Diff line number Diff line Loading @@ -452,12 +452,14 @@ void audio_extn_utils_update_stream_app_type_cfg(void *platform, audio_format_t format, uint32_t sample_rate, uint32_t bit_width, audio_channel_mask_t channel_mask, struct stream_app_type_cfg *app_type_cfg) { struct listnode *node_i, *node_j, *node_k; struct streams_output_cfg *so_info; struct stream_format *sf_info; struct stream_sample_rate *ss_info; char value[PROPERTY_VALUE_MAX] = {0}; if ((24 == bit_width) && (devices & AUDIO_DEVICE_OUT_SPEAKER)) { Loading @@ -468,6 +470,16 @@ void audio_extn_utils_update_stream_app_type_cfg(void *platform, ALOGI("%s Allowing 24-bit playback on speaker ONLY at default sampling rate", __func__); } property_get("audio.playback.mch.downsample",value,""); if (!strncmp("true", value, sizeof("true"))) { if ((popcount(channel_mask) > 2) && (sample_rate > CODEC_BACKEND_DEFAULT_SAMPLE_RATE) && !(flags & AUDIO_OUTPUT_FLAG_COMPRESS_PASSTHROUGH)) { sample_rate = CODEC_BACKEND_DEFAULT_SAMPLE_RATE; ALOGD("%s: MCH session defaulting sample rate to %d", __func__, sample_rate); } } ALOGV("%s: flags: %x, format: %x sample_rate %d", __func__, flags, format, sample_rate); list_for_each(node_i, streams_output_cfg_list) { Loading Loading @@ -509,6 +521,7 @@ int audio_extn_utils_send_app_type_cfg(struct audio_usecase *usecase) struct mixer_ctl *ctl; int pcm_device_id, acdb_dev_id, snd_device = usecase->out_snd_device; int32_t sample_rate = DEFAULT_OUTPUT_SAMPLING_RATE; char value[PROPERTY_VALUE_MAX] = {0}; ALOGV("%s", __func__); Loading Loading @@ -558,6 +571,14 @@ int audio_extn_utils_send_app_type_cfg(struct audio_usecase *usecase) sample_rate = out->app_type_cfg.sample_rate; } property_get("audio.playback.mch.downsample",value,""); if (!strncmp("true", value, sizeof("true"))) { if ((popcount(out->channel_mask) > 2) && (out->sample_rate > CODEC_BACKEND_DEFAULT_SAMPLE_RATE) && !(out->flags & AUDIO_OUTPUT_FLAG_COMPRESS_PASSTHROUGH)) sample_rate = CODEC_BACKEND_DEFAULT_SAMPLE_RATE; } app_type_cfg[len++] = out->app_type_cfg.app_type; app_type_cfg[len++] = acdb_dev_id; if (((out->format == AUDIO_FORMAT_E_AC3) || Loading hal/audio_hw.c +3 −1 Original line number Diff line number Diff line Loading @@ -954,6 +954,7 @@ int select_devices(struct audio_device *adev, audio_usecase_t uc_id) usecase->stream.out->format, usecase->stream.out->sample_rate, usecase->stream.out->bit_width, usecase->stream.out->channel_mask, &usecase->stream.out->app_type_cfg); ALOGI("%s Selected apptype: %d", __func__, usecase->stream.out->app_type_cfg.app_type); } Loading Loading @@ -2978,7 +2979,8 @@ static int adev_open_output_stream(struct audio_hw_device *dev, audio_extn_utils_update_stream_app_type_cfg(adev->platform, &adev->streams_output_cfg_list, devices, flags, format, out->sample_rate, out->bit_width, &out->app_type_cfg); out->bit_width, out->channel_mask, &out->app_type_cfg); if ((out->usecase == USECASE_AUDIO_PLAYBACK_PRIMARY) || (flags & AUDIO_OUTPUT_FLAG_PRIMARY)) { /* Ensure the default output is not selected twice */ Loading hal/msm8916/platform.c +17 −0 Original line number Diff line number Diff line Loading @@ -3469,6 +3469,7 @@ bool platform_check_codec_backend_cfg(struct audio_device* adev, struct stream_out *out = NULL; unsigned int bit_width = CODEC_BACKEND_DEFAULT_BIT_WIDTH; unsigned int sample_rate = CODEC_BACKEND_DEFAULT_SAMPLE_RATE; char value[PROPERTY_VALUE_MAX] = {0}; // For voice calls use default configuration // force routing is not required here, caller will do it anyway Loading Loading @@ -3508,6 +3509,22 @@ bool platform_check_codec_backend_cfg(struct audio_device* adev, if (16 == bit_width) { sample_rate = CODEC_BACKEND_DEFAULT_SAMPLE_RATE; } //check if mulitchannel clip needs to be down sampled to 48k property_get("audio.playback.mch.downsample",value,""); if (!strncmp("true", value, sizeof("true"))) { out = usecase->stream.out; if ((popcount(out->channel_mask) > 2) && (out->sample_rate > CODEC_BACKEND_DEFAULT_SAMPLE_RATE) && !(out->flags & AUDIO_OUTPUT_FLAG_COMPRESS_PASSTHROUGH)) { sample_rate = CODEC_BACKEND_DEFAULT_SAMPLE_RATE; /* update out sample rate to reflect current backend sample rate */ out->sample_rate = sample_rate; ALOGD("%s: MCH session defaulting sample rate to %d", __func__, sample_rate); } } // 24 bit playback on speakers is allowed through 48 khz backend only // bit width re-configured based on platform info if ((24 == bit_width) && Loading hal/msm8974/platform.c +16 −0 Original line number Diff line number Diff line Loading @@ -3132,6 +3132,7 @@ bool platform_check_codec_backend_cfg(struct audio_device* adev, struct stream_out *out = NULL; unsigned int bit_width = CODEC_BACKEND_DEFAULT_BIT_WIDTH; unsigned int sample_rate = CODEC_BACKEND_DEFAULT_SAMPLE_RATE; char value[PROPERTY_VALUE_MAX] = {0}; // For voice calls use default configuration // force routing is not required here, caller will do it anyway Loading Loading @@ -3171,6 +3172,21 @@ bool platform_check_codec_backend_cfg(struct audio_device* adev, if (16 == bit_width) { sample_rate = CODEC_BACKEND_DEFAULT_SAMPLE_RATE; } //check if mulitchannel clip needs to be down sampled to 48k property_get("audio.playback.mch.downsample",value,""); if (!strncmp("true", value, sizeof("true"))) { out = usecase->stream.out; if ((popcount(out->channel_mask) > 2) && (out->sample_rate > CODEC_BACKEND_DEFAULT_SAMPLE_RATE) && !(out->flags & AUDIO_OUTPUT_FLAG_COMPRESS_PASSTHROUGH)) { /* update out sample rate to reflect current backend sample rate */ sample_rate = CODEC_BACKEND_DEFAULT_SAMPLE_RATE; ALOGD("%s: MCH session defaulting sample rate to %d", __func__, sample_rate); } } // 24 bit playback on speakers is allowed through 48 khz backend only // bit width re-configured based on platform info if ((24 == bit_width) && Loading Loading
hal/audio_extn/audio_extn.h +1 −0 Original line number Diff line number Diff line Loading @@ -421,6 +421,7 @@ void audio_extn_utils_update_stream_app_type_cfg(void *platform, audio_format_t format, uint32_t sample_rate, uint32_t bit_width, audio_channel_mask_t channel_mask, struct stream_app_type_cfg *app_type_cfg); int audio_extn_utils_send_app_type_cfg(struct audio_usecase *usecase); void audio_extn_utils_send_audio_calibration(struct audio_device *adev, Loading
hal/audio_extn/utils.c +21 −0 Original line number Diff line number Diff line Loading @@ -452,12 +452,14 @@ void audio_extn_utils_update_stream_app_type_cfg(void *platform, audio_format_t format, uint32_t sample_rate, uint32_t bit_width, audio_channel_mask_t channel_mask, struct stream_app_type_cfg *app_type_cfg) { struct listnode *node_i, *node_j, *node_k; struct streams_output_cfg *so_info; struct stream_format *sf_info; struct stream_sample_rate *ss_info; char value[PROPERTY_VALUE_MAX] = {0}; if ((24 == bit_width) && (devices & AUDIO_DEVICE_OUT_SPEAKER)) { Loading @@ -468,6 +470,16 @@ void audio_extn_utils_update_stream_app_type_cfg(void *platform, ALOGI("%s Allowing 24-bit playback on speaker ONLY at default sampling rate", __func__); } property_get("audio.playback.mch.downsample",value,""); if (!strncmp("true", value, sizeof("true"))) { if ((popcount(channel_mask) > 2) && (sample_rate > CODEC_BACKEND_DEFAULT_SAMPLE_RATE) && !(flags & AUDIO_OUTPUT_FLAG_COMPRESS_PASSTHROUGH)) { sample_rate = CODEC_BACKEND_DEFAULT_SAMPLE_RATE; ALOGD("%s: MCH session defaulting sample rate to %d", __func__, sample_rate); } } ALOGV("%s: flags: %x, format: %x sample_rate %d", __func__, flags, format, sample_rate); list_for_each(node_i, streams_output_cfg_list) { Loading Loading @@ -509,6 +521,7 @@ int audio_extn_utils_send_app_type_cfg(struct audio_usecase *usecase) struct mixer_ctl *ctl; int pcm_device_id, acdb_dev_id, snd_device = usecase->out_snd_device; int32_t sample_rate = DEFAULT_OUTPUT_SAMPLING_RATE; char value[PROPERTY_VALUE_MAX] = {0}; ALOGV("%s", __func__); Loading Loading @@ -558,6 +571,14 @@ int audio_extn_utils_send_app_type_cfg(struct audio_usecase *usecase) sample_rate = out->app_type_cfg.sample_rate; } property_get("audio.playback.mch.downsample",value,""); if (!strncmp("true", value, sizeof("true"))) { if ((popcount(out->channel_mask) > 2) && (out->sample_rate > CODEC_BACKEND_DEFAULT_SAMPLE_RATE) && !(out->flags & AUDIO_OUTPUT_FLAG_COMPRESS_PASSTHROUGH)) sample_rate = CODEC_BACKEND_DEFAULT_SAMPLE_RATE; } app_type_cfg[len++] = out->app_type_cfg.app_type; app_type_cfg[len++] = acdb_dev_id; if (((out->format == AUDIO_FORMAT_E_AC3) || Loading
hal/audio_hw.c +3 −1 Original line number Diff line number Diff line Loading @@ -954,6 +954,7 @@ int select_devices(struct audio_device *adev, audio_usecase_t uc_id) usecase->stream.out->format, usecase->stream.out->sample_rate, usecase->stream.out->bit_width, usecase->stream.out->channel_mask, &usecase->stream.out->app_type_cfg); ALOGI("%s Selected apptype: %d", __func__, usecase->stream.out->app_type_cfg.app_type); } Loading Loading @@ -2978,7 +2979,8 @@ static int adev_open_output_stream(struct audio_hw_device *dev, audio_extn_utils_update_stream_app_type_cfg(adev->platform, &adev->streams_output_cfg_list, devices, flags, format, out->sample_rate, out->bit_width, &out->app_type_cfg); out->bit_width, out->channel_mask, &out->app_type_cfg); if ((out->usecase == USECASE_AUDIO_PLAYBACK_PRIMARY) || (flags & AUDIO_OUTPUT_FLAG_PRIMARY)) { /* Ensure the default output is not selected twice */ Loading
hal/msm8916/platform.c +17 −0 Original line number Diff line number Diff line Loading @@ -3469,6 +3469,7 @@ bool platform_check_codec_backend_cfg(struct audio_device* adev, struct stream_out *out = NULL; unsigned int bit_width = CODEC_BACKEND_DEFAULT_BIT_WIDTH; unsigned int sample_rate = CODEC_BACKEND_DEFAULT_SAMPLE_RATE; char value[PROPERTY_VALUE_MAX] = {0}; // For voice calls use default configuration // force routing is not required here, caller will do it anyway Loading Loading @@ -3508,6 +3509,22 @@ bool platform_check_codec_backend_cfg(struct audio_device* adev, if (16 == bit_width) { sample_rate = CODEC_BACKEND_DEFAULT_SAMPLE_RATE; } //check if mulitchannel clip needs to be down sampled to 48k property_get("audio.playback.mch.downsample",value,""); if (!strncmp("true", value, sizeof("true"))) { out = usecase->stream.out; if ((popcount(out->channel_mask) > 2) && (out->sample_rate > CODEC_BACKEND_DEFAULT_SAMPLE_RATE) && !(out->flags & AUDIO_OUTPUT_FLAG_COMPRESS_PASSTHROUGH)) { sample_rate = CODEC_BACKEND_DEFAULT_SAMPLE_RATE; /* update out sample rate to reflect current backend sample rate */ out->sample_rate = sample_rate; ALOGD("%s: MCH session defaulting sample rate to %d", __func__, sample_rate); } } // 24 bit playback on speakers is allowed through 48 khz backend only // bit width re-configured based on platform info if ((24 == bit_width) && Loading
hal/msm8974/platform.c +16 −0 Original line number Diff line number Diff line Loading @@ -3132,6 +3132,7 @@ bool platform_check_codec_backend_cfg(struct audio_device* adev, struct stream_out *out = NULL; unsigned int bit_width = CODEC_BACKEND_DEFAULT_BIT_WIDTH; unsigned int sample_rate = CODEC_BACKEND_DEFAULT_SAMPLE_RATE; char value[PROPERTY_VALUE_MAX] = {0}; // For voice calls use default configuration // force routing is not required here, caller will do it anyway Loading Loading @@ -3171,6 +3172,21 @@ bool platform_check_codec_backend_cfg(struct audio_device* adev, if (16 == bit_width) { sample_rate = CODEC_BACKEND_DEFAULT_SAMPLE_RATE; } //check if mulitchannel clip needs to be down sampled to 48k property_get("audio.playback.mch.downsample",value,""); if (!strncmp("true", value, sizeof("true"))) { out = usecase->stream.out; if ((popcount(out->channel_mask) > 2) && (out->sample_rate > CODEC_BACKEND_DEFAULT_SAMPLE_RATE) && !(out->flags & AUDIO_OUTPUT_FLAG_COMPRESS_PASSTHROUGH)) { /* update out sample rate to reflect current backend sample rate */ sample_rate = CODEC_BACKEND_DEFAULT_SAMPLE_RATE; ALOGD("%s: MCH session defaulting sample rate to %d", __func__, sample_rate); } } // 24 bit playback on speakers is allowed through 48 khz backend only // bit width re-configured based on platform info if ((24 == bit_width) && Loading