Snap for 8564071 from 2be2e96210253816487f8fcff8f439ddf9b0d3ea to mainline-wifi-release
Change-Id: Ia176343c46571604c9210710e86a083d9c8ecd5b
diff --git a/Android.bp b/Android.bp
new file mode 100644
index 0000000..c9e764b
--- /dev/null
+++ b/Android.bp
@@ -0,0 +1,386 @@
+// Copyright (C) 2018 Knowles Electronics
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package {
+ default_applicable_licenses: [
+ "Android-Apache-2.0",
+ ],
+}
+
+soong_config_string_variable {
+ name: "use_sound_trigger_hal",
+ values: [
+ "iaxxx",
+ ],
+}
+
+soong_config_bool_variable {
+ name: "sound_trigger_hal_is_android_p",
+}
+
+soong_config_module_type {
+ name: "use_sound_trigger_hal_cc_defaults",
+ module_type: "cc_defaults",
+ config_namespace: "knowles",
+ variables: [
+ "use_sound_trigger_hal",
+ "sound_trigger_hal_is_android_p",
+ ],
+ properties: [
+ "enabled",
+ "proprietary",
+ "cflags",
+ ],
+}
+
+use_sound_trigger_hal_cc_defaults {
+ name: "use_sound_trigger_hal_defaults",
+ header_libs: ["device_kernel_headers"],
+ soong_config_variables: {
+ use_sound_trigger_hal: {
+ iaxxx: {
+ enabled: true,
+ },
+ conditions_default: {
+ enabled: false,
+ }
+ },
+ sound_trigger_hal_is_android_p: {
+ proprietary: true,
+ cflags: ["-DANDROID_P"],
+ }
+ },
+}
+
+cc_library_shared {
+ name: "sound_trigger.primary.msmnile",
+ defaults: [
+ "use_sound_trigger_hal_defaults",
+ ],
+ relative_install_path: "hw",
+ srcs: [
+ "sound_trigger_hw_iaxxx.c",
+ "cvq_util.c",
+ ],
+ vendor: true,
+ include_dirs: [
+ "external/tinyalsa/include",
+ "system/media/audio_route/include",
+ ],
+ header_libs: ["libhardware_headers"],
+ shared_libs: [
+ "liblog",
+ "libcutils",
+ "libtinyalsa",
+ "libaudioroute",
+ "libodsp",
+ "libhardware_legacy",
+ ],
+}
+
+cc_library_shared {
+ name: "adnc_strm.primary.default",
+ defaults: [
+ "use_sound_trigger_hal_defaults",
+ ],
+ relative_install_path: "hw",
+ vendor: true,
+ srcs: ["adnc_strm.c"],
+ shared_libs: [
+ "liblog",
+ "libcutils",
+ "libtinyalsa",
+ "libtunnel",
+ ],
+}
+
+cc_library_shared {
+ name: "libtunnel",
+ defaults: [
+ "use_sound_trigger_hal_defaults",
+ ],
+ vendor: true,
+ srcs: ["tunnel.c"],
+ shared_libs: [
+ "liblog",
+ "libcutils",
+ ],
+}
+
+cc_library_shared {
+ name: "libodsp",
+ defaults: [
+ "use_sound_trigger_hal_defaults",
+ ],
+ vendor: true,
+ srcs: ["iaxxx_odsp_hw.c"],
+ shared_libs: [
+ "liblog",
+ "libcutils",
+ ],
+}
+
+cc_binary {
+ name: "tunneling_hal_test",
+ defaults: [
+ "use_sound_trigger_hal_defaults",
+ ],
+ vendor: true,
+ srcs: [
+ "tests/tunnel_test.c",
+ "tests/conversion_routines.c",
+ ],
+ compile_multilib: "32",
+ shared_libs: [
+ "liblog",
+ "libcutils",
+ "libtunnel",
+ ],
+ cflags: ["-DFILENAME_ASSIGN"],
+}
+
+cc_binary {
+ name: "sensor_param_test",
+ defaults: [
+ "use_sound_trigger_hal_defaults",
+ ],
+ vendor: true,
+ srcs: ["tests/sensor_param_test.c"],
+ compile_multilib: "32",
+ shared_libs: [
+ "liblog",
+ "libutils",
+ "libcutils",
+ "libtinyalsa",
+ ],
+ include_dirs: ["external/tinyalsa/include"],
+}
+
+cc_library_shared {
+ name: "libosloutils",
+ defaults: [
+ "use_sound_trigger_hal_defaults",
+ ],
+ srcs: [
+ "tests/oslo_sound_model_control.cpp",
+ "tests/oslo_iaxxx_sensor_control.c",
+ ],
+ include_dirs: [
+ "external/tinyalsa/include",
+ "system/media/audio_route/include",
+ ],
+ header_libs: ["libhardware_headers"],
+ shared_libs: [
+ "liblog",
+ "libutils",
+ "libcutils",
+ "libtinyalsa",
+ "libhidlbase",
+ "libodsp",
+ "android.hardware.soundtrigger@2.0",
+ ],
+ proprietary: true,
+}
+
+cc_binary {
+ name: "oslo_data_injection_test",
+ defaults: [
+ "use_sound_trigger_hal_defaults",
+ ],
+ srcs: ["tests/oslo_data_injection_test.c"],
+ compile_multilib: "32",
+ header_libs: ["libhardware_headers"],
+ shared_libs: [
+ "liblog",
+ "libutils",
+ "libcutils",
+ "libosloutils",
+ ],
+ proprietary: true,
+}
+
+cc_binary {
+ name: "oslo_config_test",
+ defaults: [
+ "use_sound_trigger_hal_defaults",
+ ],
+ srcs: ["tests/oslo_config_test.c"],
+ compile_multilib: "32",
+ header_libs: ["libhardware_headers"],
+ shared_libs: [
+ "liblog",
+ "libutils",
+ "libcutils",
+ "libosloutils",
+ ],
+ proprietary: true,
+}
+
+cc_binary {
+ name: "oslo_get_stats",
+ defaults: [
+ "use_sound_trigger_hal_defaults",
+ ],
+ srcs: ["tests/oslo_get_stats.c"],
+ header_libs: ["libhardware_headers"],
+ shared_libs: [
+ "liblog",
+ "libutils",
+ "libcutils",
+ "libosloutils",
+ ],
+ proprietary: true,
+}
+
+cc_binary {
+ name: "spi_reliability_test",
+ defaults: [
+ "use_sound_trigger_hal_defaults",
+ ],
+ srcs: ["tests/spi_reliability_test.c"],
+ compile_multilib: "32",
+ shared_libs: [
+ "liblog",
+ "libcutils",
+ ],
+ vendor: true,
+}
+
+cc_binary {
+ name: "oslo_package_test",
+ defaults: [
+ "use_sound_trigger_hal_defaults",
+ ],
+ srcs: ["./tests/oslo_package_test.c"],
+ compile_multilib: "32",
+ shared_libs: [
+ "liblog",
+ "libcutils",
+ "libtinyalsa",
+ ],
+ vendor: true,
+}
+
+cc_binary {
+ name: "tunneling_hal_test_sensor",
+ defaults: [
+ "use_sound_trigger_hal_defaults",
+ ],
+ srcs: ["tests/tunnel_test_sensor.c"],
+ compile_multilib: "32",
+ shared_libs: ["liblog"],
+ vendor: true,
+}
+
+cc_binary {
+ name: "odsp_api_test",
+ defaults: [
+ "use_sound_trigger_hal_defaults",
+ ],
+ vendor: true,
+ srcs: ["tests/odsp_api_test.c"],
+ include_dirs: ["hardware/knowles/athletico/sound_trigger_hal/tests"],
+ compile_multilib: "32",
+ shared_libs: [
+ "liblog",
+ "libcutils",
+ "libodsp",
+ ],
+}
+
+cc_binary {
+ name: "dump_debug_info",
+ vendor: true,
+ defaults: [
+ "use_sound_trigger_hal_defaults",
+ ],
+ srcs: ["tests/dump_debug_info.c"],
+ compile_multilib: "32",
+ shared_libs: ["liblog"],
+}
+
+cc_binary {
+ name: "crash_event_logger",
+ vendor: true,
+ defaults: [
+ "use_sound_trigger_hal_defaults",
+ ],
+ srcs: [
+ "tests/crash_event_logger.c",
+ "tests/crash_analyzer.c",
+ ],
+ compile_multilib: "32",
+ shared_libs: [
+ "liblog",
+ "libcutils",
+ ],
+}
+
+cc_binary {
+ vendor: true,
+ name: "setparamblk_test",
+ defaults: [
+ "use_sound_trigger_hal_defaults",
+ ],
+ srcs: ["tests/setparamblk_test.c"],
+ compile_multilib: "32",
+ shared_libs: [
+ "libcutils",
+ "libodsp",
+ ],
+}
+
+cc_binary {
+ name: "crash_trigger_test",
+ defaults: [
+ "use_sound_trigger_hal_defaults",
+ ],
+ srcs: ["tests/crash_trigger_test.c"],
+ vendor: true,
+ compile_multilib: "32",
+ shared_libs: [
+ "liblog",
+ "libodsp",
+ ],
+}
+
+cc_binary {
+ name: "plugin_status_test",
+ defaults: [
+ "use_sound_trigger_hal_defaults",
+ ],
+ srcs: ["tests/plugin_status_test.c"],
+ vendor: true,
+ local_include_dirs: [""],
+ compile_multilib: "32",
+ shared_libs: [
+ "libcutils",
+ "libodsp",
+ ],
+}
+
+cc_binary {
+ name: "get_pwr_stats",
+ defaults: [
+ "use_sound_trigger_hal_defaults",
+ ],
+ vendor: true,
+ srcs: ["tests/get_pwr_stats.c"],
+ local_include_dirs: [""],
+ compile_multilib: "32",
+ shared_libs: [
+ "libcutils",
+ "liblog",
+ ],
+}
diff --git a/Android.mk b/Android.mk
deleted file mode 100644
index 75e6358..0000000
--- a/Android.mk
+++ /dev/null
@@ -1,276 +0,0 @@
-# Copyright (C) 2018 Knowles Electronics
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-ifneq (,$(findstring $(USE_SOUND_TRIGGER_HAL),iaxxx))
-
-LOCAL_PATH := $(call my-dir)
-
-include $(CLEAR_VARS)
-
-LOCAL_MODULE := sound_trigger.primary.$(TARGET_BOARD_PLATFORM)
-LOCAL_MODULE_RELATIVE_PATH := hw
-LOCAL_SRC_FILES := sound_trigger_hw_iaxxx.c cvq_util.c
-LOCAL_VENDOR_MODULE := true
-LOCAL_C_INCLUDES += external/tinyalsa/include \
- $(call include-path-for, audio-route)
-LOCAL_HEADER_LIBRARIES := libhardware_headers
-LOCAL_SHARED_LIBRARIES := liblog \
- libcutils \
- libtinyalsa \
- libaudioroute \
- libodsp \
- libhardware_legacy
-LOCAL_MODULE_TAGS := optional
-ifneq (,$(findstring $(PLATFORM_VERSION), P))
-LOCAL_PROPRIETARY_MODULE := true
-LOCAL_CFLAGS += -DANDROID_P
-endif
-
-include $(BUILD_SHARED_LIBRARY)
-
-include $(CLEAR_VARS)
-
-LOCAL_MODULE := adnc_strm.primary.default
-LOCAL_MODULE_RELATIVE_PATH := hw
-LOCAL_VENDOR_MODULE := true
-LOCAL_SRC_FILES := adnc_strm.c
-LOCAL_SHARED_LIBRARIES := liblog \
- libcutils \
- libtinyalsa \
- libtunnel
-LOCAL_MODULE_TAGS := optional
-ifneq (,$(findstring $(PLATFORM_VERSION), P))
-LOCAL_PROPRIETARY_MODULE := true
-endif
-
-include $(BUILD_SHARED_LIBRARY)
-
-include $(CLEAR_VARS)
-
-LOCAL_MODULE := libtunnel
-LOCAL_VENDOR_MODULE := true
-LOCAL_SRC_FILES := tunnel.c
-LOCAL_SHARED_LIBRARIES := liblog \
- libcutils
-
-include $(BUILD_SHARED_LIBRARY)
-
-include $(CLEAR_VARS)
-
-LOCAL_MODULE := libodsp
-LOCAL_VENDOR_MODULE := true
-LOCAL_SRC_FILES := iaxxx_odsp_hw.c
-LOCAL_SHARED_LIBRARIES := liblog \
- libcutils
-LOCAL_MODULE_TAGS := optional
-
-include $(BUILD_SHARED_LIBRARY)
-
-include $(CLEAR_VARS)
-
-LOCAL_PRELINK_MODULE := false
-LOCAL_MODULE := tunneling_hal_test
-LOCAL_VENDOR_MODULE := true
-LOCAL_SRC_FILES := tests/tunnel_test.c \
- tests/conversion_routines.c
-LOCAL_32_BIT_ONLY := true
-LOCAL_SHARED_LIBRARIES := liblog \
- libcutils \
- libtunnel
-LOCAL_CFLAGS += -DFILENAME_ASSIGN
-
-include $(BUILD_EXECUTABLE)
-
-include $(CLEAR_VARS)
-
-LOCAL_PRELINK_MODULE := false
-LOCAL_VENDOR_MODULE := true
-LOCAL_MODULE := sensor_param_test
-LOCAL_SRC_FILES := tests/sensor_param_test.c
-LOCAL_32_BIT_ONLY := true
-LOCAL_SHARED_LIBRARIES := liblog \
- libutils \
- libcutils \
- libtinyalsa
-LOCAL_C_INCLUDES += external/tinyalsa/include \
- $(LOCAL_PATH)/../hal
-
-include $(BUILD_EXECUTABLE)
-
-include $(CLEAR_VARS)
-LOCAL_MODULE := libosloutils
-LOCAL_SRC_FILES := tests/oslo_sound_model_control.cpp \
- tests/oslo_iaxxx_sensor_control.c
-LOCAL_C_INCLUDES += external/tinyalsa/include \
- $(call include-path-for, audio-route)
-LOCAL_HEADER_LIBRARIES := libhardware_headers
-LOCAL_SHARED_LIBRARIES := liblog \
- libutils \
- libcutils \
- libtinyalsa \
- libhidlbase \
- libodsp \
- android.hardware.soundtrigger@2.0
-LOCAL_MODULE_TAGS := optional
-LOCAL_PROPRIETARY_MODULE := true
-include $(BUILD_SHARED_LIBRARY)
-
-include $(CLEAR_VARS)
-LOCAL_PRELINK_MODULE := false
-LOCAL_MODULE := oslo_data_injection_test
-LOCAL_SRC_FILES := tests/oslo_data_injection_test.c
-LOCAL_32_BIT_ONLY := true
-LOCAL_HEADER_LIBRARIES := libhardware_headers
-LOCAL_SHARED_LIBRARIES := liblog \
- libutils \
- libcutils \
- libosloutils
-LOCAL_PROPRIETARY_MODULE := true
-include $(BUILD_EXECUTABLE)
-
-include $(CLEAR_VARS)
-LOCAL_PRELINK_MODULE := false
-LOCAL_MODULE := oslo_config_test
-LOCAL_SRC_FILES := tests/oslo_config_test.c
-LOCAL_32_BIT_ONLY := true
-LOCAL_HEADER_LIBRARIES := libhardware_headers
-LOCAL_SHARED_LIBRARIES := liblog \
- libutils \
- libcutils \
- libosloutils
-LOCAL_PROPRIETARY_MODULE := true
-include $(BUILD_EXECUTABLE)
-
-include $(CLEAR_VARS)
-LOCAL_PRELINK_MODULE := false
-LOCAL_MODULE := oslo_get_stats
-LOCAL_SRC_FILES := tests/oslo_get_stats.c
-LOCAL_HEADER_LIBRARIES := libhardware_headers
-LOCAL_SHARED_LIBRARIES := liblog \
- libutils \
- libcutils \
- libosloutils
-LOCAL_PROPRIETARY_MODULE := true
-include $(BUILD_EXECUTABLE)
-
-include $(CLEAR_VARS)
-
-LOCAL_PRELINK_MODULE := false
-LOCAL_MODULE := spi_reliability_test
-LOCAL_SRC_FILES := tests/spi_reliability_test.c
-LOCAL_32_BIT_ONLY := true
-LOCAL_SHARED_LIBRARIES := liblog \
- libcutils
-
-include $(BUILD_EXECUTABLE)
-
-include $(CLEAR_VARS)
-
-LOCAL_PRELINK_MODULE := false
-LOCAL_MODULE := oslo_package_test
-LOCAL_SRC_FILES := ./tests/oslo_package_test.c
-LOCAL_32_BIT_ONLY := true
-LOCAL_SHARED_LIBRARIES := liblog \
- libcutils \
- libtinyalsa
-
-include $(BUILD_EXECUTABLE)
-
-include $(CLEAR_VARS)
-
-LOCAL_PRELINK_MODULE := false
-LOCAL_MODULE := tunneling_hal_test_sensor
-LOCAL_SRC_FILES := tests/tunnel_test_sensor.c
-LOCAL_32_BIT_ONLY := true
-LOCAL_SHARED_LIBRARIES := liblog
-
-include $(BUILD_EXECUTABLE)
-
-include $(CLEAR_VARS)
-
-LOCAL_PRELINK_MODULE := false
-LOCAL_MODULE := odsp_api_test
-LOCAL_VENDOR_MODULE := true
-LOCAL_SRC_FILES := tests/odsp_api_test.c
-LOCAL_C_INCLUDES += ./tests/
-LOCAL_32_BIT_ONLY := true
-LOCAL_SHARED_LIBRARIES := liblog \
- libcutils \
- libodsp
-
-include $(BUILD_EXECUTABLE)
-
-include $(CLEAR_VARS)
-
-LOCAL_PRELINK_MODULE := false
-LOCAL_VENDOR_MODULE := true
-LOCAL_MODULE := dump_debug_info
-LOCAL_SRC_FILES := tests/dump_debug_info.c
-LOCAL_32_BIT_ONLY := true
-LOCAL_SHARED_LIBRARIES := liblog
-
-include $(BUILD_EXECUTABLE)
-
-include $(CLEAR_VARS)
-
-LOCAL_PRELINK_MODULE := false
-LOCAL_VENDOR_MODULE := true
-LOCAL_MODULE := crash_event_logger
-LOCAL_SRC_FILES := tests/crash_event_logger.c tests/crash_analyzer.c
-LOCAL_32_BIT_ONLY := true
-LOCAL_SHARED_LIBRARIES := liblog libcutils
-LOCAL_MODULE_TAGS := optional
-
-include $(BUILD_EXECUTABLE)
-
-include $(CLEAR_VARS)
-LOCAL_PRELINK_MODULE := false
-LOCAL_VENDOR_MODULE := true
-LOCAL_MODULE := setparamblk_test
-LOCAL_SRC_FILES := tests/setparamblk_test.c
-LOCAL_32_BIT_ONLY := true
-LOCAL_SHARED_LIBRARIES := libcutils \
- libodsp
-
-include $(BUILD_EXECUTABLE)
-
-include $(CLEAR_VARS)
-LOCAL_MODULE := crash_trigger_test
-LOCAL_SRC_FILES := tests/crash_trigger_test.c
-LOCAL_VENDOR_MODULE := true
-LOCAL_C_INCLUDES += $(LOCAL_PATH)/../hal
-LOCAL_32_BIT_ONLY := true
-LOCAL_SHARED_LIBRARIES := liblog libodsp
-
-include $(BUILD_EXECUTABLE)
-
-include $(CLEAR_VARS)
-LOCAL_MODULE := plugin_status_test
-LOCAL_SRC_FILES := tests/plugin_status_test.c
-LOCAL_VENDOR_MODULE := true
-LOCAL_C_INCLUDES += $(LOCAL_PATH)/
-LOCAL_32_BIT_ONLY := true
-LOCAL_SHARED_LIBRARIES := libcutils libodsp
-
-include $(BUILD_EXECUTABLE)
-
-include $(CLEAR_VARS)
-LOCAL_MODULE := get_pwr_stats
-LOCAL_VENDOR_MODULE := true
-LOCAL_SRC_FILES := tests/get_pwr_stats.c
-LOCAL_C_INCLUDES += $(LOCAL_PATH)/
-LOCAL_32_BIT_ONLY := true
-LOCAL_SHARED_LIBRARIES := libcutils liblog
-
-include $(BUILD_EXECUTABLE)
-endif
diff --git a/METADATA b/METADATA
new file mode 100644
index 0000000..d97975c
--- /dev/null
+++ b/METADATA
@@ -0,0 +1,3 @@
+third_party {
+ license_type: NOTICE
+}
diff --git a/cvq_ioctl.h b/cvq_ioctl.h
index 232e928..dcbf481 100644
--- a/cvq_ioctl.h
+++ b/cvq_ioctl.h
@@ -116,6 +116,13 @@
#define HOTWORD_DEFAULT_VER 0
#define AMBIENT_DEFAULT_VER 0
+enum {
+ PARAM_BLOCK_GET_MIN = 0,
+ PARAM_BLOCK_GET_RECOGNITION_PAYLOAD = 100,
+ PARAM_BLOCK_GET_DSP_IDENTIFIER,
+ PARAM_BLOCK_GET_MAX,
+};
+
#define BUFFER_PACKAGE "BufferPackage.bin"
#define BUFFER_CONFIG_OSLO_VAL "BufferConfigValOslo.bin"
#define BUFFER_CONFIG_VAL_MULTI_SEC "BufferConfigVal.bin"
@@ -131,6 +138,8 @@
#define SRC_PACKAGE "SampleRateConverterPackage.bin"
#define SRC_CONFIG "SampleRateConverterCreateCfgBlkGen.bin"
+#define PAYLOAD_MAX_STRING_LEN 64
+
/* The routing definition depend on the platform
and the features plugin.
*/
@@ -202,10 +211,12 @@
int destroy_buffer_package(struct iaxxx_odsp_hw *odsp_hdl);
int setup_hotword_package(struct iaxxx_odsp_hw *odsp_hdl);
int destroy_hotword_package(struct iaxxx_odsp_hw *odsp_hdl);
-unsigned int get_hotword_version(struct iaxxx_odsp_hw *odsp_hdl);
+int get_hotword_info(struct iaxxx_odsp_hw *odsp_hdl,
+ unsigned int *hotword_version, void *supported_model_arch);
int setup_ambient_package(struct iaxxx_odsp_hw *odsp_hdl);
int destroy_ambient_package(struct iaxxx_odsp_hw *odsp_hdl);
-unsigned int get_ambient_version(struct iaxxx_odsp_hw *odsp_hdl);
+int get_ambient_info(struct iaxxx_odsp_hw *odsp_hdl,
+ unsigned int *ambient_version, void *supported_model_arch);
int setup_aec_package(struct iaxxx_odsp_hw *odsp_hdl);
int destroy_aec_package(struct iaxxx_odsp_hw *odsp_hdl);
int setup_chre_package(struct iaxxx_odsp_hw *odsp_hdl);
diff --git a/cvq_util.c b/cvq_util.c
index bd285eb..3fe23ca 100644
--- a/cvq_util.c
+++ b/cvq_util.c
@@ -796,7 +796,8 @@
return err;
}
-unsigned int get_hotword_version(struct iaxxx_odsp_hw *odsp_hdl)
+int get_hotword_info(struct iaxxx_odsp_hw *odsp_hdl,
+ unsigned int *hotword_version, void *supported_model_arch)
{
int err = 0;
const uint32_t inst_id = HOTWORD_INSTANCE_ID;
@@ -817,6 +818,15 @@
ALOGD("%s: Value of parameter id %u is %u", __func__, param_id,
param_val);
}
+ *hotword_version = param_val;
+ err = iaxxx_odsp_plugin_get_parameter_blk(odsp_hdl, inst_id, block_id,
+ PARAM_BLOCK_GET_DSP_IDENTIFIER,
+ supported_model_arch,
+ PAYLOAD_MAX_STRING_LEN);
+ if (err != 0) {
+ ALOGE("%s: Failed to get dsp identifier with error %d: %s",
+ __func__, err, strerror(errno));
+ }
} else {
ALOGE("%s: ERROR: setup hotword package failed", __func__);
}
@@ -830,12 +840,21 @@
ALOGD("%s: Value of parameter id %u is %u", __func__, param_id,
param_val);
}
+ *hotword_version = param_val;
+ err = iaxxx_odsp_plugin_get_parameter_blk(odsp_hdl, inst_id, block_id,
+ PARAM_BLOCK_GET_DSP_IDENTIFIER,
+ supported_model_arch,
+ PAYLOAD_MAX_STRING_LEN);
+ if (err != 0) {
+ ALOGE("%s: Failed to get dsp identifier with error %d: %s",
+ __func__, err, strerror(errno));
+ }
err = destroy_hotword_package(odsp_hdl);
if (err != 0)
ALOGE("%s: ERROR: destroy hotword package failed", __func__);
}
- return param_val;
+ return err;
}
int setup_ambient_package(struct iaxxx_odsp_hw *odsp_hdl)
@@ -905,7 +924,8 @@
return err;
}
-unsigned int get_ambient_version(struct iaxxx_odsp_hw *odsp_hdl)
+int get_ambient_info(struct iaxxx_odsp_hw *odsp_hdl,
+ unsigned int *ambient_version, void *supported_model_arch)
{
int err = 0;
const uint32_t inst_id = AMBIENT_INSTANCE_ID;
@@ -926,6 +946,15 @@
ALOGD("%s: Value of parameter id %u is %u", __func__, param_id,
param_val);
}
+ *ambient_version = param_val;
+ err = iaxxx_odsp_plugin_get_parameter_blk(odsp_hdl, inst_id, block_id,
+ PARAM_BLOCK_GET_DSP_IDENTIFIER,
+ supported_model_arch,
+ PAYLOAD_MAX_STRING_LEN);
+ if (err != 0) {
+ ALOGE("%s: Failed to get dsp identifier with error %d: %s",
+ __func__, err, strerror(errno));
+ }
} else {
ALOGE("%s: ERROR: setup Ambient package failed", __func__);
}
@@ -939,12 +968,21 @@
ALOGD("%s: Value of parameter id %u is %u", __func__, param_id,
param_val);
}
+ *ambient_version = param_val;
+ err = iaxxx_odsp_plugin_get_parameter_blk(odsp_hdl, inst_id, block_id,
+ PARAM_BLOCK_GET_DSP_IDENTIFIER,
+ supported_model_arch,
+ PAYLOAD_MAX_STRING_LEN);
+ if (err != 0) {
+ ALOGE("%s: Failed to get dsp identifier with error %d: %s",
+ __func__, err, strerror(errno));
+ }
err = destroy_ambient_package(odsp_hdl);
if (err != 0)
ALOGE("%s: ERROR: destroy Ambient package failed", __func__);
}
- return param_val;
+ return err;
}
int setup_aec_package(struct iaxxx_odsp_hw *odsp_hdl)
@@ -1224,7 +1262,7 @@
return err;
}
- // Create Dummy sensor plugin
+ // Create placeholder sensor plugin
err = iaxxx_odsp_plugin_create(odsp_hdl, SENSOR_INSTANCE_ID,
SENSOR_PRIORITY, SENSOR_PKG_ID,
SENSOR_PLUGIN_IDX, IAXXX_HMD_BLOCK_ID,
@@ -1783,8 +1821,8 @@
err = iaxxx_odsp_plugin_get_parameter_blk(odsp_hdl,
AMBIENT_INSTANCE_ID,
IAXXX_HMD_BLOCK_ID,
- 100, payload,
- payload_size);
+ PARAM_BLOCK_GET_RECOGNITION_PAYLOAD,
+ payload, payload_size);
if (err < 0) {
ALOGE("%s: Failed to get param blk error %s\n",
@@ -1800,8 +1838,8 @@
err = iaxxx_odsp_plugin_get_parameter_blk(odsp_hdl,
HOTWORD_INSTANCE_ID,
IAXXX_HMD_BLOCK_ID,
- 100, payload,
- payload_size);
+ PARAM_BLOCK_GET_RECOGNITION_PAYLOAD,
+ payload, payload_size);
if (err < 0) {
ALOGE("%s: Failed to get param blk error %s\n",
diff --git a/sound_trigger_hw_iaxxx.c b/sound_trigger_hw_iaxxx.c
index 014c96a..5225091 100644
--- a/sound_trigger_hw_iaxxx.c
+++ b/sound_trigger_hw_iaxxx.c
@@ -115,7 +115,7 @@
false, // trigger_in_event
POWER_CONSUMPTION // power_consumption_mw
},
- "9b55e25e-8ea3-4f73-bce9-b37860d57f5a", //supported arch
+ "", //supported arch
0, // audio capability
};
@@ -2252,7 +2252,9 @@
if (fw_status == IAXXX_FW_ACTIVE) {
stdev->is_st_hal_ready = false;
// query version during reset progress.
- stdev->hotword_version = get_hotword_version(stdev->odsp_hdl);
+ get_hotword_info(stdev->odsp_hdl,
+ &stdev->hotword_version,
+ &hw_properties.supported_model_arch);
// reset the firmware and wait for firmware download complete
err = reset_fw(stdev->odsp_hdl);
if (err == -1) {
@@ -2264,7 +2266,9 @@
// Firmware has crashed wait till it recovers
stdev->is_st_hal_ready = false;
} else if (fw_status == IAXXX_FW_IDLE) {
- stdev->hotword_version = get_hotword_version(stdev->odsp_hdl);
+ err = get_hotword_info(stdev->odsp_hdl,
+ &stdev->hotword_version,
+ &hw_properties.supported_model_arch);
if (stdev->hotword_version == HOTWORD_DEFAULT_VER) {
/* This is unlikely use-case, the codec is abnormal at the beginning
* reset_fw the firmware to recovery.
@@ -2628,6 +2632,10 @@
model->is_active = false;
goto exit;
}
+ if (model->is_active == false) {
+ ALOGW("%s: the model was disabled already", __func__);
+ goto exit;
+ }
if (stdev->adnc_strm_handle[handle] != 0) {
ALOGD("%s: stop tunnling for index:%d", __func__, handle);
@@ -3552,6 +3560,9 @@
stdev->device.get_properties_extended = stdev_get_properties_extended;
stdev->opened = true;
+ stdev->send_sock = -1;
+ stdev->recv_sock = -1;
+
/* Initialize all member variable */
for (i = 0; i < MAX_MODELS; i++) {
stdev->models[i].type = SOUND_MODEL_TYPE_UNKNOWN;
diff --git a/tests/oslo_config_test.c b/tests/oslo_config_test.c
index 4056218..c4f87dd 100644
--- a/tests/oslo_config_test.c
+++ b/tests/oslo_config_test.c
@@ -38,14 +38,14 @@
#define BGT60TR24C_NUM_REGISTERS 0x60
/* Oslo Calibration */
-#define CAL_FILE "/persist/oslo/oslo.cal"
+#define CAL_FILE "/mnt/vendor/persist/oslo/oslo.cal"
#define CAL_MODES_MAX 10
#define CAL_INVALID_MODE -1
#define CAL_MODE_IS_VALID(x) (x >= 0 && x < CAL_MODES_MAX)
#define CAL_VERSION_DEFAULT 1.0f
/* Transmit power */
-#define TX_CAL_FILE "/persist/oslo/tx_power.cal"
+#define TX_CAL_FILE "/mnt/vendor/persist/oslo/tx_power.cal"
typedef enum {
INJECT_MODE_OFF = 0,
diff --git a/tests/oslo_package_test.c b/tests/oslo_package_test.c
index 3b47bba..dccc47f 100644
--- a/tests/oslo_package_test.c
+++ b/tests/oslo_package_test.c
@@ -205,7 +205,7 @@
goto exit;
}
- /* Create Dummy sensor plugin */
+ /* Create placeholder sensor plugin */
pi.plg_idx = 0;
pi.pkg_id = sensor_pkg_id;
pi.block_id = 1;
@@ -345,7 +345,7 @@
goto exit;
}
- /* destroy Dummy sensor plugin */
+ /* destroy placeholder sensor plugin */
pi.block_id = 1;
pi.inst_id = 3;
err = ioctl(fileno(odsp_node), ODSP_PLG_DESTROY, (unsigned long)&pi);
diff --git a/tests/oslo_sound_model_control.cpp b/tests/oslo_sound_model_control.cpp
index 671cd6f..38a2f8a 100644
--- a/tests/oslo_sound_model_control.cpp
+++ b/tests/oslo_sound_model_control.cpp
@@ -88,7 +88,7 @@
soundModel.vendorUuid.variantAndClockSeqHigh = uuid.clockSeq;
memcpy(&soundModel.vendorUuid.node[0], &uuid.node[0], sizeof(uuid.node));
- soundModel.data.resize(1); // Insert a dummy byte to bypass HAL NULL checks.
+ soundModel.data.resize(1); // Insert an unused byte to bypass HAL NULL checks.
bool loaded = false;
sp<ISoundTriggerHw> stHal = ISoundTriggerHw::getService();
diff --git a/tests/tunnel_test_sensor.c b/tests/tunnel_test_sensor.c
index 2c218d2..08f4c92 100644
--- a/tests/tunnel_test_sensor.c
+++ b/tests/tunnel_test_sensor.c
@@ -25,7 +25,7 @@
#define LOG_TAG "ia_tunneling_sensor_test"
-#include <cutils/log.h>
+#include <log/log.h>
#include <linux/mfd/adnc/iaxxx-system-identifiers.h>
#include <linux/mfd/adnc/iaxxx-tunnel-intf.h>
#include <linux/mfd/adnc/iaxxx-sensor-tunnel.h>
diff --git a/tunnel.c b/tunnel.c
index b54e971..65c8a1b 100644
--- a/tunnel.c
+++ b/tunnel.c
@@ -17,6 +17,7 @@
#define LOG_TAG "ia_tunneling_hal"
#define LOG_NDEBUG 0
+#include <fcntl.h>
#include <stdlib.h>
#include <ctype.h>
#include <errno.h>