Loading hal/audio_extn/audio_extn.h +3 −0 Original line number Diff line number Diff line Loading @@ -1287,6 +1287,9 @@ int audio_extn_utils_get_license_params(const struct audio_device *adev, struct #ifndef AUDIO_OUTPUT_FLAG_PHONE #define AUDIO_OUTPUT_FLAG_PHONE 0x800000 #endif #ifndef AUDIO_OUTPUT_FLAG_REAR_SEAT #define AUDIO_OUTPUT_FLAG_REAR_SEAT 0x1000000 #endif int 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, Loading hal/audio_extn/auto_hal.c +17 −0 Original line number Diff line number Diff line Loading @@ -89,6 +89,7 @@ static const audio_usecase_t bus_device_usecases[] = { USECASE_AUDIO_PLAYBACK_SYS_NOTIFICATION, USECASE_AUDIO_PLAYBACK_NAV_GUIDANCE, USECASE_AUDIO_PLAYBACK_PHONE, USECASE_AUDIO_PLAYBACK_REAR_SEAT, }; int auto_hal_release_audio_patch(struct audio_hw_device *dev, Loading Loading @@ -505,6 +506,19 @@ int auto_hal_open_output_stream(struct stream_out *out) if (out->flags == AUDIO_OUTPUT_FLAG_NONE) out->flags |= AUDIO_OUTPUT_FLAG_PHONE; break; case CAR_AUDIO_STREAM_REAR_SEAT: out->usecase = USECASE_AUDIO_PLAYBACK_REAR_SEAT; out->config = pcm_config_deep_buffer; out->config.period_size = fp_get_output_period_size(out->sample_rate, out->format, channels, DEEP_BUFFER_OUTPUT_PERIOD_DURATION); if (out->config.period_size <= 0) { ALOGE("Invalid configuration period size is not valid"); ret = -EINVAL; goto error; } if (out->flags == AUDIO_OUTPUT_FLAG_NONE) out->flags |= AUDIO_OUTPUT_FLAG_REAR_SEAT; break; default: ALOGE("%s: Car audio stream %x not supported", __func__, out->car_audio_stream); Loading Loading @@ -543,6 +557,9 @@ snd_device_t auto_hal_get_snd_device_for_car_audio_stream(struct stream_out *out case CAR_AUDIO_STREAM_PHONE: snd_device = SND_DEVICE_OUT_BUS_PHN; break; case CAR_AUDIO_STREAM_REAR_SEAT: snd_device = SND_DEVICE_OUT_BUS_RSE; break; default: ALOGE("%s: Unknown car audio stream (%x)", __func__, out->car_audio_stream); Loading hal/audio_extn/utils.c +1 −0 Original line number Diff line number Diff line Loading @@ -150,6 +150,7 @@ const struct string_to_enum s_flag_name_to_enum_table[] = { STRING_TO_ENUM(AUDIO_OUTPUT_FLAG_SYS_NOTIFICATION), STRING_TO_ENUM(AUDIO_OUTPUT_FLAG_NAV_GUIDANCE), STRING_TO_ENUM(AUDIO_OUTPUT_FLAG_PHONE), STRING_TO_ENUM(AUDIO_OUTPUT_FLAG_REAR_SEAT), STRING_TO_ENUM(AUDIO_INPUT_FLAG_NONE), STRING_TO_ENUM(AUDIO_INPUT_FLAG_FAST), STRING_TO_ENUM(AUDIO_INPUT_FLAG_HW_HOTWORD), Loading hal/audio_hw.c +2 −2 Original line number Diff line number Diff line Loading @@ -406,6 +406,7 @@ const char * const use_case_table[AUDIO_USECASE_MAX] = { [USECASE_AUDIO_PLAYBACK_SYS_NOTIFICATION] = "sys-notification-playback", [USECASE_AUDIO_PLAYBACK_NAV_GUIDANCE] = "nav-guidance-playback", [USECASE_AUDIO_PLAYBACK_PHONE] = "phone-playback", [USECASE_AUDIO_PLAYBACK_REAR_SEAT] = "rear-seat-playback", [USECASE_AUDIO_FM_TUNER_EXT] = "fm-tuner-ext", }; Loading Loading @@ -5146,8 +5147,7 @@ static int out_set_volume(struct audio_stream_out *stream, float left, mixer_ctl_set_array(ctl, volume, sizeof(volume)/sizeof(volume[0])); return 0; } else if ((out->devices & AUDIO_DEVICE_OUT_BUS) && (audio_extn_auto_hal_get_snd_device_for_car_audio_stream(out) == SND_DEVICE_OUT_BUS_MEDIA)) { (out->car_audio_stream == CAR_AUDIO_STREAM_MEDIA)) { ALOGD("%s: Overriding offload set volume for media bus stream", __func__); struct listnode *node = NULL; list_for_each(node, &adev->active_outputs_list) { Loading hal/audio_hw.h +5 −3 Original line number Diff line number Diff line Loading @@ -227,6 +227,7 @@ enum { USECASE_AUDIO_PLAYBACK_SYS_NOTIFICATION, USECASE_AUDIO_PLAYBACK_NAV_GUIDANCE, USECASE_AUDIO_PLAYBACK_PHONE, USECASE_AUDIO_PLAYBACK_REAR_SEAT, /*Audio FM Tuner usecase*/ USECASE_AUDIO_FM_TUNER_EXT, Loading Loading @@ -300,15 +301,16 @@ typedef enum render_mode { /* This defines the physical car streams supported in audio HAL, * limited by the available frontend PCM driver. * Max number of physical streams supported is currently 8 and is * represented by stream bit flag as indicated in vehicle HAL interface. * Max number of physical streams supported is currently 16 and is * represented by stream bit flag. */ #define MAX_CAR_AUDIO_STREAMS 8 #define MAX_CAR_AUDIO_STREAMS 16 enum { CAR_AUDIO_STREAM_MEDIA = 0x1, CAR_AUDIO_STREAM_SYS_NOTIFICATION = 0x2, CAR_AUDIO_STREAM_NAV_GUIDANCE = 0x4, CAR_AUDIO_STREAM_PHONE = 0x8, CAR_AUDIO_STREAM_REAR_SEAT = 0x100, }; struct stream_app_type_cfg { Loading Loading
hal/audio_extn/audio_extn.h +3 −0 Original line number Diff line number Diff line Loading @@ -1287,6 +1287,9 @@ int audio_extn_utils_get_license_params(const struct audio_device *adev, struct #ifndef AUDIO_OUTPUT_FLAG_PHONE #define AUDIO_OUTPUT_FLAG_PHONE 0x800000 #endif #ifndef AUDIO_OUTPUT_FLAG_REAR_SEAT #define AUDIO_OUTPUT_FLAG_REAR_SEAT 0x1000000 #endif int 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, Loading
hal/audio_extn/auto_hal.c +17 −0 Original line number Diff line number Diff line Loading @@ -89,6 +89,7 @@ static const audio_usecase_t bus_device_usecases[] = { USECASE_AUDIO_PLAYBACK_SYS_NOTIFICATION, USECASE_AUDIO_PLAYBACK_NAV_GUIDANCE, USECASE_AUDIO_PLAYBACK_PHONE, USECASE_AUDIO_PLAYBACK_REAR_SEAT, }; int auto_hal_release_audio_patch(struct audio_hw_device *dev, Loading Loading @@ -505,6 +506,19 @@ int auto_hal_open_output_stream(struct stream_out *out) if (out->flags == AUDIO_OUTPUT_FLAG_NONE) out->flags |= AUDIO_OUTPUT_FLAG_PHONE; break; case CAR_AUDIO_STREAM_REAR_SEAT: out->usecase = USECASE_AUDIO_PLAYBACK_REAR_SEAT; out->config = pcm_config_deep_buffer; out->config.period_size = fp_get_output_period_size(out->sample_rate, out->format, channels, DEEP_BUFFER_OUTPUT_PERIOD_DURATION); if (out->config.period_size <= 0) { ALOGE("Invalid configuration period size is not valid"); ret = -EINVAL; goto error; } if (out->flags == AUDIO_OUTPUT_FLAG_NONE) out->flags |= AUDIO_OUTPUT_FLAG_REAR_SEAT; break; default: ALOGE("%s: Car audio stream %x not supported", __func__, out->car_audio_stream); Loading Loading @@ -543,6 +557,9 @@ snd_device_t auto_hal_get_snd_device_for_car_audio_stream(struct stream_out *out case CAR_AUDIO_STREAM_PHONE: snd_device = SND_DEVICE_OUT_BUS_PHN; break; case CAR_AUDIO_STREAM_REAR_SEAT: snd_device = SND_DEVICE_OUT_BUS_RSE; break; default: ALOGE("%s: Unknown car audio stream (%x)", __func__, out->car_audio_stream); Loading
hal/audio_extn/utils.c +1 −0 Original line number Diff line number Diff line Loading @@ -150,6 +150,7 @@ const struct string_to_enum s_flag_name_to_enum_table[] = { STRING_TO_ENUM(AUDIO_OUTPUT_FLAG_SYS_NOTIFICATION), STRING_TO_ENUM(AUDIO_OUTPUT_FLAG_NAV_GUIDANCE), STRING_TO_ENUM(AUDIO_OUTPUT_FLAG_PHONE), STRING_TO_ENUM(AUDIO_OUTPUT_FLAG_REAR_SEAT), STRING_TO_ENUM(AUDIO_INPUT_FLAG_NONE), STRING_TO_ENUM(AUDIO_INPUT_FLAG_FAST), STRING_TO_ENUM(AUDIO_INPUT_FLAG_HW_HOTWORD), Loading
hal/audio_hw.c +2 −2 Original line number Diff line number Diff line Loading @@ -406,6 +406,7 @@ const char * const use_case_table[AUDIO_USECASE_MAX] = { [USECASE_AUDIO_PLAYBACK_SYS_NOTIFICATION] = "sys-notification-playback", [USECASE_AUDIO_PLAYBACK_NAV_GUIDANCE] = "nav-guidance-playback", [USECASE_AUDIO_PLAYBACK_PHONE] = "phone-playback", [USECASE_AUDIO_PLAYBACK_REAR_SEAT] = "rear-seat-playback", [USECASE_AUDIO_FM_TUNER_EXT] = "fm-tuner-ext", }; Loading Loading @@ -5146,8 +5147,7 @@ static int out_set_volume(struct audio_stream_out *stream, float left, mixer_ctl_set_array(ctl, volume, sizeof(volume)/sizeof(volume[0])); return 0; } else if ((out->devices & AUDIO_DEVICE_OUT_BUS) && (audio_extn_auto_hal_get_snd_device_for_car_audio_stream(out) == SND_DEVICE_OUT_BUS_MEDIA)) { (out->car_audio_stream == CAR_AUDIO_STREAM_MEDIA)) { ALOGD("%s: Overriding offload set volume for media bus stream", __func__); struct listnode *node = NULL; list_for_each(node, &adev->active_outputs_list) { Loading
hal/audio_hw.h +5 −3 Original line number Diff line number Diff line Loading @@ -227,6 +227,7 @@ enum { USECASE_AUDIO_PLAYBACK_SYS_NOTIFICATION, USECASE_AUDIO_PLAYBACK_NAV_GUIDANCE, USECASE_AUDIO_PLAYBACK_PHONE, USECASE_AUDIO_PLAYBACK_REAR_SEAT, /*Audio FM Tuner usecase*/ USECASE_AUDIO_FM_TUNER_EXT, Loading Loading @@ -300,15 +301,16 @@ typedef enum render_mode { /* This defines the physical car streams supported in audio HAL, * limited by the available frontend PCM driver. * Max number of physical streams supported is currently 8 and is * represented by stream bit flag as indicated in vehicle HAL interface. * Max number of physical streams supported is currently 16 and is * represented by stream bit flag. */ #define MAX_CAR_AUDIO_STREAMS 8 #define MAX_CAR_AUDIO_STREAMS 16 enum { CAR_AUDIO_STREAM_MEDIA = 0x1, CAR_AUDIO_STREAM_SYS_NOTIFICATION = 0x2, CAR_AUDIO_STREAM_NAV_GUIDANCE = 0x4, CAR_AUDIO_STREAM_PHONE = 0x8, CAR_AUDIO_STREAM_REAR_SEAT = 0x100, }; struct stream_app_type_cfg { Loading