audio-hal: enable low latency support for playback usecase and primary output support for HFP
Enable low latency playback support for 8, 16, 24 and 32 KHz sample rates
and primary output support for HFP.
Suggested-by: Shital Jadhav (Temp) <shitjadh@qti.qualcomm.com>
Change-Id: I45bb5155b2eb794af7a25502d391fc7fde28d7e6
Signed-off-by: nkogara <nkogara@qti.qualcomm.com>
Signed-off-by: sasevs <quic_sasevs@quicinc.com>
diff --git a/hal/audio_hw.c b/hal/audio_hw.c
index d4d1218..3fcaa45 100644
--- a/hal/audio_hw.c
+++ b/hal/audio_hw.c
@@ -8459,7 +8459,14 @@
out->config.period_size = HDMI_MULTI_PERIOD_BYTES / (out->config.channels *
audio_bytes_per_sample(config->format));
out->config.format = pcm_format_from_audio_format(out->format);
- } else if ((out->flags & AUDIO_OUTPUT_FLAG_COMPRESS_OFFLOAD) ||
+ } else if (compare_device_type(&out->device_list, AUDIO_DEVICE_OUT_BUS)) {
+ ret = audio_extn_auto_hal_open_output_stream(out);
+ if (ret) {
+ ALOGE("%s: Failed to open output stream for bus device", __func__);
+ ret = -EINVAL;
+ goto error_open;
+ }
+ }else if ((out->flags & AUDIO_OUTPUT_FLAG_COMPRESS_OFFLOAD) ||
(out->flags == AUDIO_OUTPUT_FLAG_DIRECT)) {
pthread_mutex_lock(&adev->lock);
bool offline = (adev->card_status == CARD_STATUS_OFFLINE);
@@ -8927,14 +8934,7 @@
adev->haptics_config.channels = 1;
} else
adev->haptics_config.channels = audio_channel_count_from_out_mask(out->channel_mask & AUDIO_CHANNEL_HAPTIC_ALL);
- } else if (compare_device_type(&out->device_list, AUDIO_DEVICE_OUT_BUS)) {
- ret = audio_extn_auto_hal_open_output_stream(out);
- if (ret) {
- ALOGE("%s: Failed to open output stream for bus device", __func__);
- ret = -EINVAL;
- goto error_open;
- }
- } else {
+ } else {
/* primary path is the default path selected if no other outputs are available/suitable */
out->usecase = GET_USECASE_AUDIO_PLAYBACK_PRIMARY(use_db_as_primary);
out->config = GET_PCM_CONFIG_AUDIO_PLAYBACK_PRIMARY(use_db_as_primary);
@@ -8973,8 +8973,8 @@
out->hal_op_format, out->sample_rate,
out->bit_width, out->channel_mask, out->profile,
&out->app_type_cfg);
- if (((out->usecase == (audio_usecase_t)(GET_USECASE_AUDIO_PLAYBACK_PRIMARY(use_db_as_primary))) ||
- (flags & AUDIO_OUTPUT_FLAG_PRIMARY)) && (!compare_device_type(&out->device_list, AUDIO_DEVICE_OUT_BUS))) {
+ if ((out->usecase == (audio_usecase_t)(GET_USECASE_AUDIO_PLAYBACK_PRIMARY(use_db_as_primary))) ||
+ (flags & AUDIO_OUTPUT_FLAG_PRIMARY)) {
/* Ensure the default output is not selected twice */
if(adev->primary_output == NULL)
adev->primary_output = out;