hal: Add support for ULLPP for proaudio
Give option to use ULLPP for proaudio use cases.
This is achieved by sending the required mixer control
and sending the app type to the NOIRQ driver.
CRS-Fixed: 1099039
Change-Id: Iff762fb6dd56641ca83a6ec91178731f5ba779d0
diff --git a/hal/audio_extn/utils.c b/hal/audio_extn/utils.c
index b12ab8e..550fbdc 100644
--- a/hal/audio_extn/utils.c
+++ b/hal/audio_extn/utils.c
@@ -92,6 +92,7 @@
STRING_TO_ENUM(AUDIO_OUTPUT_FLAG_DIRECT_PCM),
STRING_TO_ENUM(AUDIO_OUTPUT_FLAG_PRIMARY),
STRING_TO_ENUM(AUDIO_OUTPUT_FLAG_FAST),
+ STRING_TO_ENUM(AUDIO_OUTPUT_FLAG_RAW),
STRING_TO_ENUM(AUDIO_OUTPUT_FLAG_DEEP_BUFFER),
STRING_TO_ENUM(AUDIO_OUTPUT_FLAG_COMPRESS_OFFLOAD),
STRING_TO_ENUM(AUDIO_OUTPUT_FLAG_NON_BLOCKING),
@@ -192,7 +193,7 @@
flag_name = strtok_r(NULL, "|", &last_r);
}
- ALOGV("parse_flag_names: flag - %d", flag);
+ ALOGV("parse_flag_names: flag - %x", flag);
io_flags.in_flags = (audio_input_flags_t)flag;
io_flags.out_flags = (audio_output_flags_t)flag;
return io_flags;
@@ -676,8 +677,8 @@
__func__, sample_rate, bit_width);
}
- ALOGV("%s: flags: %x, format: %x sample_rate %d, profile %s",
- __func__, flags, format, sample_rate, profile);
+ ALOGV("%s: flags: %x, format: %x sample_rate %d, profile %s, app_type %d",
+ __func__, flags, format, sample_rate, profile, app_type_cfg->app_type);
list_for_each(node_i, streams_output_cfg_list) {
s_info = node_to_item(node_i, struct streams_io_cfg, list);
/* Along with flags do profile matching if set at either end.*/
@@ -725,6 +726,12 @@
return native_usecase;
}
+
+static inline bool audio_is_vr_mode_on(struct audio_device *(__attribute__((unused)) adev))
+{
+ return adev->vr_audio_mode_enabled;
+}
+
void audio_extn_utils_update_stream_app_type_cfg_for_usecase(
struct audio_device *adev,
struct audio_usecase *usecase)
@@ -789,12 +796,21 @@
if ((usecase->id != USECASE_AUDIO_PLAYBACK_DEEP_BUFFER) &&
(usecase->id != USECASE_AUDIO_PLAYBACK_LOW_LATENCY) &&
(usecase->id != USECASE_AUDIO_PLAYBACK_MULTI_CH) &&
+ (usecase->id != USECASE_AUDIO_PLAYBACK_ULL) &&
(!is_offload_usecase(usecase->id)) &&
(usecase->type != PCM_CAPTURE)) {
ALOGV("%s: a rx/tx/loopback path where app type cfg is not required %d", __func__, usecase->id);
rc = 0;
goto exit_send_app_type_cfg;
}
+
+ //if VR is active then only send the mixer control
+ if (usecase->id == USECASE_AUDIO_PLAYBACK_ULL && !audio_is_vr_mode_on(adev)) {
+ ALOGI("ULL doesnt need sending app type cfg, returning");
+ rc = 0;
+ goto exit_send_app_type_cfg;
+ }
+
if (usecase->type == PCM_PLAYBACK) {
pcm_device_id = platform_get_pcm_device_id(usecase->id, PCM_PLAYBACK);
snprintf(mixer_ctl_name, sizeof(mixer_ctl_name),