diff --git a/hal/audio_extn/audio_extn.h b/hal/audio_extn/audio_extn.h index d407f800..4858eac8 100644 --- a/hal/audio_extn/audio_extn.h +++ b/hal/audio_extn/audio_extn.h @@ -1286,6 +1286,10 @@ int audio_extn_utils_get_license_params(const struct audio_device *adev, struct #define audio_extn_auto_hal_set_audio_port_config(dev, config) (0) #define audio_extn_auto_hal_set_parameters(adev, parms) (0) #else +#define AUDIO_OUTPUT_FLAG_MEDIA 0x100000 +#define AUDIO_OUTPUT_FLAG_SYS_NOTIFICATION 0x200000 +#define AUDIO_OUTPUT_FLAG_NAV_GUIDANCE 0x400000 +#define AUDIO_OUTPUT_FLAG_PHONE 0x800000 int32_t audio_extn_auto_hal_init(struct audio_device *adev); void audio_extn_auto_hal_deinit(void); int audio_extn_auto_hal_create_audio_patch(struct audio_hw_device *dev, diff --git a/hal/audio_extn/auto_hal.c b/hal/audio_extn/auto_hal.c index 7f2163d0..d74c80e6 100644 --- a/hal/audio_extn/auto_hal.c +++ b/hal/audio_extn/auto_hal.c @@ -264,11 +264,16 @@ int32_t audio_extn_auto_hal_open_output_stream(struct stream_out *out) ret = -EINVAL; goto error; } + if (out->flags == AUDIO_OUTPUT_FLAG_NONE || + out->flags == AUDIO_OUTPUT_FLAG_PRIMARY) + out->flags |= AUDIO_OUTPUT_FLAG_MEDIA; break; case CAR_AUDIO_STREAM_SYS_NOTIFICATION: /* sys notification bus stream shares pcm device with low-latency */ out->usecase = USECASE_AUDIO_PLAYBACK_SYS_NOTIFICATION; out->config = pcm_config_low_latency; + if (out->flags == AUDIO_OUTPUT_FLAG_NONE) + out->flags |= AUDIO_OUTPUT_FLAG_SYS_NOTIFICATION; break; case CAR_AUDIO_STREAM_NAV_GUIDANCE: out->usecase = USECASE_AUDIO_PLAYBACK_NAV_GUIDANCE; @@ -280,10 +285,14 @@ int32_t audio_extn_auto_hal_open_output_stream(struct stream_out *out) ret = -EINVAL; goto error; } + if (out->flags == AUDIO_OUTPUT_FLAG_NONE) + out->flags |= AUDIO_OUTPUT_FLAG_NAV_GUIDANCE; break; case CAR_AUDIO_STREAM_PHONE: out->usecase = USECASE_AUDIO_PLAYBACK_PHONE; out->config = pcm_config_low_latency; + if (out->flags == AUDIO_OUTPUT_FLAG_NONE) + out->flags |= AUDIO_OUTPUT_FLAG_PHONE; break; default: ALOGE("%s: Car audio stream %x not supported", __func__, diff --git a/hal/audio_extn/utils.c b/hal/audio_extn/utils.c index 30bc10de..10626c02 100644 --- a/hal/audio_extn/utils.c +++ b/hal/audio_extn/utils.c @@ -146,6 +146,12 @@ const struct string_to_enum s_flag_name_to_enum_table[] = { STRING_TO_ENUM(AUDIO_OUTPUT_FLAG_VOIP_RX), STRING_TO_ENUM(AUDIO_OUTPUT_FLAG_BD), STRING_TO_ENUM(AUDIO_OUTPUT_FLAG_INTERACTIVE), +#ifdef AUDIO_EXTN_AUTO_HAL_ENABLED + STRING_TO_ENUM(AUDIO_OUTPUT_FLAG_MEDIA), + STRING_TO_ENUM(AUDIO_OUTPUT_FLAG_SYS_NOTIFICATION), + STRING_TO_ENUM(AUDIO_OUTPUT_FLAG_NAV_GUIDANCE), + STRING_TO_ENUM(AUDIO_OUTPUT_FLAG_PHONE), +#endif STRING_TO_ENUM(AUDIO_INPUT_FLAG_NONE), STRING_TO_ENUM(AUDIO_INPUT_FLAG_FAST), STRING_TO_ENUM(AUDIO_INPUT_FLAG_HW_HOTWORD),