HAL: Add synth enablement control
Add synth enablement control, create hostless loopback for synth playback case
Change-Id: I0d4da24975e2fe7f28f30adba1a604c85451eeaa
diff --git a/hal/audio_extn/Android.mk b/hal/audio_extn/Android.mk
old mode 100644
new mode 100755
index eaf8926..c88bc34
--- a/hal/audio_extn/Android.mk
+++ b/hal/audio_extn/Android.mk
@@ -673,6 +673,74 @@
include $(BUILD_SHARED_LIBRARY)
#-------------------------------------------
+# Build SYNTH LIB
+#-------------------------------------------
+include $(CLEAR_VARS)
+
+LOCAL_MODULE := libsynth
+LOCAL_VENDOR_MODULE := true
+
+PRIMARY_HAL_PATH := vendor/qcom/opensource/audio-hal/primary-hal/hal
+AUDIO_PLATFORM := $(TARGET_BOARD_PLATFORM)
+
+ifneq ($(filter sdm845 sdm710 sdmshrike msmnile kona lito bengal atoll sdm660 msm8937 msm8998 $(MSMSTEPPE) $(TRINKET),$(TARGET_BOARD_PLATFORM)),)
+ # B-family platform uses msm8974 code base
+ AUDIO_PLATFORM := msm8974
+ MULTIPLE_HW_VARIANTS_ENABLED := true
+endif
+
+ifeq ($(TARGET_BOARD_AUTO),true)
+ LOCAL_CFLAGS += -DPLATFORM_AUTO
+endif
+
+LOCAL_SRC_FILES:= \
+ synth.c \
+ device_utils.c
+
+LOCAL_CFLAGS += \
+ -Wall \
+ -Werror \
+ -Wno-unused-function \
+ -Wno-unused-variable
+
+LOCAL_SHARED_LIBRARIES := \
+ libaudioroute \
+ libaudioutils \
+ libcutils \
+ libdl \
+ libexpat \
+ liblog \
+ libtinyalsa \
+ libtinycompress
+
+LOCAL_C_INCLUDES := \
+ $(PRIMARY_HAL_PATH) \
+ $(PRIMARY_HAL_PATH)/$(AUDIO_PLATFORM) \
+ external/tinyalsa/include \
+ external/tinycompress/include \
+ external/expat/lib \
+ system/media/audio_utils/include \
+ $(call include-path-for, audio-route) \
+
+LOCAL_C_INCLUDES += $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr/include
+LOCAL_C_INCLUDES += $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr/include/audio
+LOCAL_C_INCLUDES += $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr/techpack/audio/include
+LOCAL_ADDITIONAL_DEPENDENCIES += $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr
+
+ifeq ($(strip $(AUDIO_FEATURE_ENABLED_DLKM)),true)
+ LOCAL_HEADER_LIBRARIES += audio_kernel_headers
+ LOCAL_C_INCLUDES += $(TARGET_OUT_INTERMEDIATES)/vendor/qcom/opensource/audio-kernel/include
+ LOCAL_ADDITIONAL_DEPENDENCIES += $(BOARD_VENDOR_KERNEL_MODULES)
+endif
+
+LOCAL_HEADER_LIBRARIES += libhardware_headers
+LOCAL_HEADER_LIBRARIES += libsystem_headers
+ifneq ($(filter kona,$(TARGET_BOARD_PLATFORM)),)
+LOCAL_SANITIZE := integer_overflow
+endif
+include $(BUILD_SHARED_LIBRARY)
+
+#-------------------------------------------
# Build HDMI PASSTHROUGH
#-------------------------------------------
include $(CLEAR_VARS)
diff --git a/hal/audio_extn/audio_extn.c b/hal/audio_extn/audio_extn.c
old mode 100644
new mode 100755
index 46c87b2..32051a8
--- a/hal/audio_extn/audio_extn.c
+++ b/hal/audio_extn/audio_extn.c
@@ -6351,6 +6351,90 @@
}
// END: AUTO_HAL ===================================================================
+// START: Synth ======================================================================
+#ifdef __LP64__
+#define SYNTH_LIB_PATH "/vendor/lib64/libsynth.so"
+#else
+#define SYNTH_LIB_PATH "/vendor/lib/libsynth.so"
+#endif
+
+static void *synth_lib_handle = NULL;
+
+typedef void (*synth_init_t)(synth_init_config_t);
+static synth_init_t synth_init;
+
+typedef bool (*synth_is_active_t)(struct audio_device *adev);
+static synth_is_active_t synth_is_active;
+
+typedef void (*synth_set_parameters_t)(struct audio_device *adev,
+ struct str_parms *parms);
+static synth_set_parameters_t synth_set_parameters;
+
+int synth_feature_init(bool is_feature_enabled)
+{
+ ALOGD("%s: Called with feature %s", __func__,
+ is_feature_enabled ? "Enabled" : "NOT Enabled");
+ if (is_feature_enabled) {
+ // dlopen lib
+ synth_lib_handle = dlopen(SYNTH_LIB_PATH, RTLD_NOW);
+
+ if (!synth_lib_handle) {
+ ALOGE("%s: dlopen failed", __func__);
+ goto feature_disabled;
+ }
+ if (!(synth_init = (synth_init_t)dlsym(
+ synth_lib_handle, "synth_init")) ||
+ !(synth_is_active =
+ (synth_is_active_t)dlsym(
+ synth_lib_handle, "synth_is_active")) ||
+ !(synth_set_parameters =
+ (synth_set_parameters_t)dlsym(
+ synth_lib_handle, "synth_set_parameters"))) {
+ ALOGE("%s: dlsym failed", __func__);
+ goto feature_disabled;
+ }
+ synth_init_config_t init_config;
+ init_config.fp_platform_get_pcm_device_id = platform_get_pcm_device_id;
+ init_config.fp_get_usecase_from_list = get_usecase_from_list;
+ init_config.fp_select_devices = select_devices;
+ init_config.fp_disable_audio_route = disable_audio_route;
+ init_config.fp_disable_snd_device = disable_snd_device;
+
+ synth_init(init_config);
+ ALOGD("%s:: ---- Feature Synth is Enabled ----", __func__);
+ return 0;
+ }
+
+feature_disabled:
+ if (synth_lib_handle) {
+ dlclose(synth_lib_handle);
+ synth_lib_handle = NULL;
+ }
+
+ synth_init = NULL;
+ synth_is_active = NULL;
+ synth_set_parameters = NULL;
+
+ ALOGW(":: %s: ---- Feature Synth is disabled ----", __func__);
+ return -ENOSYS;
+}
+
+bool audio_extn_synth_is_active(struct audio_device *adev)
+{
+ return ((synth_is_active) ?
+ synth_is_active(adev): false);
+}
+
+void audio_extn_synth_set_parameters(struct audio_device *adev,
+ struct str_parms *parms)
+{
+ ((synth_set_parameters) ?
+ synth_set_parameters(adev, parms): NULL);
+}
+
+// END: Synth ========================================================================
+
+
void audio_extn_feature_init()
{
vendor_enhanced_info = audio_extn_utils_get_vendor_enhanced_info();
@@ -6472,6 +6556,9 @@
auto_hal_feature_init(
property_get_bool("vendor.audio.feature.auto_hal.enable",
false));
+ synth_feature_init(
+ property_get_bool("vendor.audio.feature.synth.enable",
+ false));
}
void audio_extn_set_parameters(struct audio_device *adev,
@@ -6505,6 +6592,7 @@
audio_extn_ffv_set_parameters(adev, parms);
audio_extn_ext_hw_plugin_set_parameters(adev->ext_hw_plugin, parms);
audio_extn_icc_set_parameters(adev, parms);
+ audio_extn_synth_set_parameters(adev, parms);
}
void audio_extn_get_parameters(const struct audio_device *adev,
diff --git a/hal/audio_extn/audio_extn.h b/hal/audio_extn/audio_extn.h
old mode 100644
new mode 100755
index ac064c2..2c7711d
--- a/hal/audio_extn/audio_extn.h
+++ b/hal/audio_extn/audio_extn.h
@@ -1415,6 +1415,20 @@
} auto_hal_init_config_t;
// END: AUTO_HAL FEATURE ==================================================
+// START: SYNTH_HAL FEATURE ==================================================
+bool audio_extn_synth_is_active(struct audio_device *adev);
+void audio_extn_synth_set_parameters(struct audio_device *adev,
+ struct str_parms *parms);
+
+typedef struct synth_init_config {
+ fp_get_usecase_from_list_t fp_get_usecase_from_list;
+ fp_platform_get_pcm_device_id_t fp_platform_get_pcm_device_id;
+ fp_disable_audio_route_t fp_disable_audio_route;
+ fp_disable_snd_device_t fp_disable_snd_device;
+ fp_select_devices_t fp_select_devices;
+} synth_init_config_t;
+// END: SYNTH_HAL FEATURE ==================================================
+
bool audio_extn_edid_is_supported_sr(edid_audio_info* info, int sr);
bool audio_extn_edid_is_supported_bps(edid_audio_info* info, int bps);
int audio_extn_edid_get_highest_supported_sr(edid_audio_info* info);
diff --git a/hal/audio_extn/auto_hal.c b/hal/audio_extn/auto_hal.c
old mode 100644
new mode 100755
index 44c4ebf..ca3cd6b
--- a/hal/audio_extn/auto_hal.c
+++ b/hal/audio_extn/auto_hal.c
@@ -775,6 +775,9 @@
case USECASE_ICC_CALL:
snd_device = SND_DEVICE_IN_ICC;
break;
+ case USECASE_AUDIO_PLAYBACK_SYNTHESIZER:
+ snd_device = SND_DEVICE_IN_SYNTH_MIC;
+ break;
default:
ALOGE("%s: Usecase (%d) not supported", __func__, uc_id);
return -EINVAL;
@@ -870,6 +873,9 @@
case USECASE_ICC_CALL:
snd_device = SND_DEVICE_OUT_ICC;
break;
+ case USECASE_AUDIO_PLAYBACK_SYNTHESIZER:
+ snd_device = SND_DEVICE_OUT_SYNTH_SPKR;
+ break;
default:
ALOGE("%s: Usecase (%d) not supported", __func__, uc_id);
return -EINVAL;
diff --git a/hal/audio_extn/synth.c b/hal/audio_extn/synth.c
new file mode 100755
index 0000000..3656b40
--- /dev/null
+++ b/hal/audio_extn/synth.c
@@ -0,0 +1,249 @@
+/* synth.c
+Copyright (c) 2012-2015,2016,2020 The Linux Foundation. All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above
+ copyright notice, this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided
+ with the distribution.
+ * Neither the name of The Linux Foundation nor the names of its
+ contributors may be used to endorse or promote products derived
+ from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.*/
+
+#define LOG_TAG "audio_hw_synth"
+/*#define LOG_NDEBUG 0*/
+#define LOG_NDDEBUG 0
+
+#include <errno.h>
+#include <math.h>
+#include <log/log.h>
+#include <unistd.h>
+
+#include "audio_hw.h"
+#include "platform.h"
+#include "platform_api.h"
+#include <stdlib.h>
+#include <cutils/str_parms.h>
+#include <audio_extn.h>
+
+#ifdef DYNAMIC_LOG_ENABLED
+#include <log_xml_parser.h>
+#define LOG_MASK HAL_MOD_FILE_FM
+#include <log_utils.h>
+#endif
+
+#define AUDIO_PARAMETER_KEY_SYNTH_ENABLE "synth_enable"
+
+static int32_t synth_start(struct audio_device *adev);
+static int32_t synth_stop(struct audio_device *adev);
+
+static struct pcm_config pcm_config_synth = {
+ .channels = 4,
+ .rate = 16000,
+ .period_size = 240,
+ .period_count = 2,
+ .format = PCM_FORMAT_S16_LE,
+ .start_threshold = 0,
+ .stop_threshold = INT_MAX,
+ .avail_min = 0,
+};
+
+struct synth_module {
+ struct pcm *pcm_rx;
+ struct pcm *pcm_tx;
+ bool is_synth_running;
+ audio_usecase_t ucid;
+};
+
+static struct synth_module synthmod = {
+ .pcm_rx = NULL,
+ .pcm_tx = NULL,
+ .is_synth_running = 0,
+ .ucid = USECASE_AUDIO_PLAYBACK_SYNTHESIZER,
+};
+
+static fp_platform_get_pcm_device_id_t fp_platform_get_pcm_device_id;
+static fp_get_usecase_from_list_t fp_get_usecase_from_list;
+static fp_select_devices_t fp_select_devices;
+static fp_platform_get_pcm_device_id_t fp_platform_get_pcm_device_id;
+static fp_platform_send_audio_calibration_t fp_platform_send_audio_calibration;
+static fp_disable_audio_route_t fp_disable_audio_route;
+static fp_disable_snd_device_t fp_disable_snd_device;
+
+
+int32_t synth_start(struct audio_device *adev)
+{
+ int32_t ret = 0;
+ int pcm_dev_rx = -1, pcm_dev_tx = -1;
+ char mixer_path[MIXER_PATH_MAX_LENGTH];
+ struct audio_usecase *uc_info = NULL;
+
+ ALOGD("%s: Enable Synth", __func__);
+
+ // select devices
+ uc_info = (struct audio_usecase *)calloc(1, sizeof(*uc_info));
+ if (!uc_info) {
+ ALOGE("%s: allocate memory failed", __func__);
+ return -ENOMEM;
+ }
+
+ uc_info->id = synthmod.ucid;
+ uc_info->type = SYNTH_LOOPBACK;
+ uc_info->stream.out = adev->primary_output;
+ list_init(&uc_info->device_list);
+ assign_devices(&uc_info->device_list, &adev->primary_output->device_list);
+ uc_info->in_snd_device = SND_DEVICE_NONE;
+ uc_info->out_snd_device = SND_DEVICE_OUT_SPEAKER;
+
+ list_add_tail(&adev->usecase_list, &uc_info->list);
+
+ fp_select_devices(adev, synthmod.ucid);
+
+ // open pcm rx/tx
+ pcm_dev_tx = fp_platform_get_pcm_device_id(USECASE_AUDIO_PLAYBACK_SYNTHESIZER, PCM_CAPTURE);
+ pcm_dev_rx = fp_platform_get_pcm_device_id(USECASE_AUDIO_PLAYBACK_SYNTHESIZER, PCM_PLAYBACK);
+
+ if (pcm_dev_tx < 0 || pcm_dev_rx < 0 ) {
+ ALOGE("%s: Invalid PCM devices (rx: %d tx: %d) for the usecase(%d)",
+ __func__, pcm_dev_rx, pcm_dev_tx, uc_info->id);
+ ret = -EIO;
+ goto exit;
+ }
+
+ //open pcm rx/tx
+ synthmod.pcm_tx = pcm_open(adev->snd_card,
+ pcm_dev_tx,
+ PCM_IN, &pcm_config_synth);
+ if (synthmod.pcm_tx &&
+ !pcm_is_ready(synthmod.pcm_tx)) {
+ ALOGE("%s: pcm_tx %s", __func__,
+ pcm_get_error(synthmod.pcm_tx));
+ ret = -EIO;
+ goto exit;
+ }
+ synthmod.pcm_rx = pcm_open(adev->snd_card,
+ pcm_dev_rx,
+ PCM_OUT, &pcm_config_synth);
+ if (synthmod.pcm_rx &&
+ !pcm_is_ready(synthmod.pcm_rx)) {
+ ALOGE("%s: pcm_rx %s", __func__,
+ pcm_get_error(synthmod.pcm_rx));
+ ret = -EIO;
+ goto exit;
+ }
+
+ if (pcm_start(synthmod.pcm_tx) < 0) {
+ ALOGE("%s: pcm start for pcm tx failed", __func__);
+ ret = -EIO;
+ goto exit;
+ }
+ if (pcm_start(synthmod.pcm_rx) < 0) {
+ ALOGE("%s: pcm start for pcm rx failed", __func__);
+ ret = -EIO;
+ goto exit;
+ }
+
+ synthmod.is_synth_running = true;
+ return ret;
+
+exit:
+ synth_stop(adev);
+ ALOGE("%s: Problem in Synth start: status(%d)", __func__, ret);
+ return ret;
+}
+
+int32_t synth_stop(struct audio_device *adev)
+{
+ int32_t ret = 0;
+ struct audio_usecase *uc_info;
+
+ ALOGD("Enter %s:", __func__);
+ synthmod.is_synth_running = false;
+
+ if (synthmod.pcm_tx) {
+ pcm_close(synthmod.pcm_tx);
+ synthmod.pcm_tx = NULL;
+ }
+
+ if (synthmod.pcm_rx) {
+ pcm_close(synthmod.pcm_rx);
+ synthmod.pcm_rx = NULL;
+ }
+
+ uc_info = fp_get_usecase_from_list(adev, synthmod.ucid);
+ if (uc_info == NULL) {
+ ALOGE("%s: Could not find the usecase (%d) in the list",
+ __func__, synthmod.ucid);
+ return -EINVAL;
+ }
+
+ /* 3. Get and set stream specific mixer controls */
+ fp_disable_audio_route(adev, uc_info);
+
+ /* 4. Disable the rx and tx devices */
+ fp_disable_snd_device(adev, uc_info->out_snd_device);
+ fp_disable_snd_device(adev, uc_info->in_snd_device);
+
+ list_remove(&uc_info->list);
+ free(uc_info);
+
+ ALOGD("%s: exit: status(%d)", __func__, ret);
+ return ret;
+}
+
+bool synth_is_active(struct audio_device *adev) {
+ struct audio_usecase *synth_usecase = NULL;
+ synth_usecase = fp_get_usecase_from_list(adev, synthmod.ucid);
+ if (synth_usecase != NULL)
+ return true;
+ else
+ return false;
+}
+
+void synth_set_parameters(struct audio_device *adev,
+ struct str_parms *parms)
+{
+ int ret, val;
+ char value[32]={0};
+
+ ALOGD("%s: enter", __func__);
+ ret = str_parms_get_str(parms, AUDIO_PARAMETER_KEY_SYNTH_ENABLE, value, sizeof(value));
+ if (ret >= 0) {
+ if (!strncmp(value,"true",sizeof(value)) && !synthmod.is_synth_running) {
+ synth_start(adev);
+ }
+ else if (!strncmp(value,"false",sizeof(value)) && synthmod.is_synth_running) {
+ synth_stop(adev);
+ } else {
+ ALOGE("Not support key value");
+ }
+ }
+
+ ALOGD("%s: exit", __func__);
+}
+
+void synth_init(synth_init_config_t init_config)
+{
+ fp_platform_get_pcm_device_id = init_config.fp_platform_get_pcm_device_id;
+ fp_get_usecase_from_list = init_config.fp_get_usecase_from_list;
+ fp_select_devices = init_config.fp_select_devices;
+ fp_disable_audio_route = init_config.fp_disable_audio_route;
+ fp_disable_snd_device = init_config.fp_disable_snd_device;
+}
+
diff --git a/hal/audio_extn/utils.c b/hal/audio_extn/utils.c
old mode 100644
new mode 100755
index 58c5ff9..32b99e0
--- a/hal/audio_extn/utils.c
+++ b/hal/audio_extn/utils.c
@@ -998,6 +998,22 @@
ALOGV("%s Selected apptype: playback %d capture %d",
__func__, usecase->out_app_type_cfg.app_type, usecase->in_app_type_cfg.app_type);
break;
+ case SYNTH_LOOPBACK:
+ /* update out_app_type_cfg */
+ usecase->out_app_type_cfg.sample_rate = CODEC_BACKEND_DEFAULT_SAMPLE_RATE;
+ usecase->out_app_type_cfg.bit_width =
+ platform_get_snd_device_bit_width(usecase->out_snd_device);
+ usecase->out_app_type_cfg.app_type =
+ platform_get_default_app_type_v2(adev->platform, PCM_PLAYBACK);
+ /* update in_app_type_cfg */
+ usecase->in_app_type_cfg.sample_rate = CODEC_BACKEND_DEFAULT_SAMPLE_RATE;
+ usecase->in_app_type_cfg.bit_width =
+ platform_get_snd_device_bit_width(usecase->in_snd_device);
+ usecase->in_app_type_cfg.app_type =
+ platform_get_default_app_type_v2(adev->platform, PCM_CAPTURE);
+ ALOGV("%s Selected apptype: playback %d capture %d",
+ __func__, usecase->out_app_type_cfg.app_type, usecase->in_app_type_cfg.app_type);
+ break;
default:
ALOGE("%s: app type cfg not supported for usecase type (%d)",
__func__, usecase->type);
@@ -1217,6 +1233,64 @@
return rc;
}
+static int audio_extn_utils_send_app_type_cfg_synth(struct audio_device *adev,
+ struct audio_usecase *usecase)
+{
+ int pcm_device_id, acdb_dev_id = 0, snd_device = usecase->out_snd_device;
+ int32_t sample_rate = DEFAULT_OUTPUT_SAMPLING_RATE;
+ int app_type = 0, rc = 0;
+ bool is_bus_dev_usecase = false;
+
+ ALOGV("%s", __func__);
+
+ if (usecase->type != SYNTH_LOOPBACK) {
+ ALOGV("%s: not a SYNTH path, no need to cfg app type", __func__);
+ rc = 0;
+ goto exit_send_app_type_cfg;
+ }
+ if (usecase->id != USECASE_AUDIO_PLAYBACK_SYNTHESIZER) {
+ ALOGV("%s: a usecase where app type cfg is not required", __func__);
+ rc = 0;
+ goto exit_send_app_type_cfg;
+ }
+
+ if (compare_device_type(&usecase->device_list, AUDIO_DEVICE_OUT_BUS)) {
+ is_bus_dev_usecase = true;
+ }
+
+ snd_device = usecase->out_snd_device;
+ pcm_device_id = platform_get_pcm_device_id(usecase->id, PCM_PLAYBACK);
+
+ acdb_dev_id = platform_get_snd_device_acdb_id(snd_device);
+ if (acdb_dev_id < 0) {
+ ALOGE("%s: Couldn't get the acdb dev id", __func__);
+ rc = -EINVAL;
+ goto exit_send_app_type_cfg;
+ }
+
+ if (usecase->type == SYNTH_LOOPBACK) {
+ /* config SYNTH session: playback path */
+ if (is_bus_dev_usecase) {
+ app_type = usecase->out_app_type_cfg.app_type;
+ sample_rate= usecase->out_app_type_cfg.sample_rate;
+ } else {
+ snd_device = SND_DEVICE_NONE; // use legacy behavior
+ app_type = platform_get_default_app_type_v2(adev->platform, PCM_PLAYBACK);
+ sample_rate= CODEC_BACKEND_DEFAULT_SAMPLE_RATE;
+ }
+ rc = set_stream_app_type_mixer_ctrl(adev, pcm_device_id, app_type,
+ acdb_dev_id, sample_rate,
+ PCM_PLAYBACK,
+ snd_device);
+ if (rc < 0)
+ goto exit_send_app_type_cfg;
+ }
+
+ rc = 0;
+exit_send_app_type_cfg:
+ return rc;
+}
+
int audio_extn_utils_get_app_sample_rate_for_device(
struct audio_device *adev,
struct audio_usecase *usecase, int snd_device)
@@ -1564,6 +1638,8 @@
return audio_extn_utils_send_app_type_cfg_hfp(adev, usecase);
} else if (usecase->type == ICC_CALL) {
return audio_extn_utils_send_app_type_cfg_icc(adev, usecase);
+ } else if (usecase->type == SYNTH_LOOPBACK) {
+ return audio_extn_utils_send_app_type_cfg_synth(adev, usecase);
}
switch (usecase->type) {
@@ -1966,7 +2042,7 @@
usecase->stream.in->app_type_cfg.app_type);
} else if ((type == PCM_HFP_CALL) || (type == PCM_CAPTURE) ||
(type == TRANSCODE_LOOPBACK_RX && usecase->stream.inout != NULL) ||
- (type == ICC_CALL)) {
+ (type == ICC_CALL) || (type == SYNTH_LOOPBACK)) {
platform_send_audio_calibration(adev->platform, usecase,
platform_get_default_app_type_v2(adev->platform, usecase->type));
} else {