aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNikolay Zamotaev <nzamotaev@luxoft.com>2020-04-30 17:52:00 +0300
committerNikolay Zamotaev <nzamotaev@luxoft.com>2020-08-24 12:05:09 +0300
commitdc20219e1dbd5e39ae7495369b1c13279ad7e915 (patch)
treeda0b514d0c603bc0091d1d23ffcd9fab187f3611
parentea3bbee59cef68320585f8f0a030e03156904da6 (diff)
AVS device SDK integration for automotive boot2qtv5.15.0_QtAS5.15.0_QtAS
This change includes AVS device SDK, fixups for the libcurl compilation options. Alsa device settings for coexistance of alexa app and neptune ui are included, but not tested. Task-number: AUTOSUITE-1419 Change-Id: Ia35c1d1d83fe114e1d0695d0f56f46c26dc19bc1 Reviewed-by: Jukka Jokiniva <jukka.jokiniva@qt.io>
-rw-r--r--meta-boot2qt-distro/recipes-qt/packagegroups/packagegroup-b2qt-automotive-addons.bb1
-rw-r--r--meta-boot2qt-distro/recipes-qt/packagegroups/packagegroup-b2qt-automotive-qt5-toolchain-target.bb1
-rw-r--r--meta-boot2qt/recipes-alexa/avs-device-sdk/avs-device-sdk.inc86
-rw-r--r--meta-boot2qt/recipes-alexa/avs-device-sdk/avs-device-sdk_1.12.1.bb14
-rw-r--r--meta-boot2qt/recipes-alexa/openblas/openblas_0.3.5.bb77
-rw-r--r--meta-boot2qt/recipes-alexa/snowboy/snowboy_1.3.0.bb46
-rw-r--r--meta-boot2qt/recipes-support/curl/curl_%.bbappend4
7 files changed, 229 insertions, 0 deletions
diff --git a/meta-boot2qt-distro/recipes-qt/packagegroups/packagegroup-b2qt-automotive-addons.bb b/meta-boot2qt-distro/recipes-qt/packagegroups/packagegroup-b2qt-automotive-addons.bb
index 884a5acf..c9fc07ce 100644
--- a/meta-boot2qt-distro/recipes-qt/packagegroups/packagegroup-b2qt-automotive-addons.bb
+++ b/meta-boot2qt-distro/recipes-qt/packagegroups/packagegroup-b2qt-automotive-addons.bb
@@ -43,6 +43,7 @@ RDEPENDS_${PN} += " \
gammaray \
qmllive \
qdb \
+ avs-device-sdk \
"
RDEPENDS_${PN} += "${@bb.utils.filter('DISTRO_FEATURES', 'qtsaferenderer', d)}"
diff --git a/meta-boot2qt-distro/recipes-qt/packagegroups/packagegroup-b2qt-automotive-qt5-toolchain-target.bb b/meta-boot2qt-distro/recipes-qt/packagegroups/packagegroup-b2qt-automotive-qt5-toolchain-target.bb
index efdb6e63..2b3d1162 100644
--- a/meta-boot2qt-distro/recipes-qt/packagegroups/packagegroup-b2qt-automotive-qt5-toolchain-target.bb
+++ b/meta-boot2qt-distro/recipes-qt/packagegroups/packagegroup-b2qt-automotive-qt5-toolchain-target.bb
@@ -40,6 +40,7 @@ RDEPENDS_${PN} += " \
libarchive-dev \
qtapplicationmanager-dev \
qtapplicationmanager-staticdev \
+ avs-device-sdk \
"
RDEPENDS_${PN} += "${@bb.utils.contains('DISTRO_FEATURES', 'qtsaferenderer', \
diff --git a/meta-boot2qt/recipes-alexa/avs-device-sdk/avs-device-sdk.inc b/meta-boot2qt/recipes-alexa/avs-device-sdk/avs-device-sdk.inc
new file mode 100644
index 00000000..ca187054
--- /dev/null
+++ b/meta-boot2qt/recipes-alexa/avs-device-sdk/avs-device-sdk.inc
@@ -0,0 +1,86 @@
+#
+# Copyright (c) 2019 Amazon.com, Inc.
+# Copyright (c) 2019 Luxoft Sweden AB
+#
+# SPDX-License-Identifier: Apache-2.0
+#
+
+SUMMARY = "An SDK for commercial device makers to integrate Alexa directly into connected products."
+HOMEPAGE = "https://developer.amazon.com/avs/sdk"
+LICENSE = "Apache-2.0"
+LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=d92e60ee98664c54f68aa515a6169708"
+
+DEPENDS = "curl nghttp2 sqlite3 openssl gstreamer1.0 gstreamer1.0-plugins-base"
+
+RDEPENDS_${PN} += "${PN}-sampleapp"
+
+SRC_URI = "https://github.com/alexa/avs-device-sdk/archive/v${PV}.tar.gz"
+
+# Skip checksum verification
+BB_STRICT_CHECKSUM = "0"
+
+# Default extra variables
+AAC_BUILD_TYPE = "${@['RELEASE', 'DEBUG'][d.getVar('DEBUG_BUILD') == '1']}"
+AAC_SENSITIVE_LOGS = "OFF"
+AAC_LATENCY_LOGS = "OFF"
+AAC_ENABLE_TESTS = "OFF"
+
+inherit pkgconfig cmake
+
+EXTRA_OECMAKE += "-DCMAKE_BUILD_TYPE=${AAC_BUILD_TYPE} \
+ -DACSDK_EMIT_SENSITIVE_LOGS=${AAC_SENSITIVE_LOGS} \
+ -DACSDK_LATENCY_LOG=${AAC_LATENCY_LOGS} \
+ -DGSTREAMER_MEDIA_PLAYER=ON \
+ "
+
+PACKAGES += "${PN}-sampleapp"
+
+FILES_${PN}-sampleapp = "${bindir}/SampleApp"
+FILES_${PN} = "${libdir}"
+FILES_${PN}-dev = "${includedir}"
+
+# Portaudio for microphone input
+PORTAUDIO_CMAKE_OPTIONS = "\
+ -DPORTAUDIO=ON \
+ -DPORTAUDIO_LIB_PATH=${STAGING_DIR_HOST}${libdir}/libportaudio.so \
+ -DPORTAUDIO_INCLUDE_DIR=${STAGING_DIR_HOST}${includedir} \
+"
+
+PACKAGECONFIG[portaudio] = "${PORTAUDIO_CMAKE_OPTIONS},,portaudio-v19,portaudio-v19"
+
+# WakeWord: KITT.AI
+KITTAT_CMAKE_OPTIONS = "\
+ -DKITTAI_KEY_WORD_DETECTOR=ON \
+ -DKITTAI_KEY_WORD_DETECTOR_LIB_PATH=${STAGING_DIR_HOST}${libdir}/libsnowboy-detect.a \
+ -DKITTAI_KEY_WORD_DETECTOR_INCLUDE_DIR=${STAGING_DIR_HOST}${includedir} \
+"
+
+PACKAGECONFIG[kittai] = "${KITTAT_CMAKE_OPTIONS},,snowboy openblas,"
+
+# WakeWord: Sensory
+SENSORY_CMAKE_OPTIONS = "\
+ -DSENSORY_KEY_WORD_DETECTOR=ON \
+ -DSENSORY_KEY_WORD_DETECTOR_LIB_PATH=${STAGING_DIR_HOST}${libdir}/libsnsr.a \
+ -DSENSORY_KEY_WORD_DETECTOR_INCLUDE_DIR=${STAGING_DIR_HOST}${includedir} \
+"
+PACKAGECONFIG[sensory] = "${SENSORY_CMAKE_OPTIONS},,truly-handsfree"
+
+# Opus encoding (v1.11 or later)
+PACKAGECONFIG[opus] = "-DOPUS=ON,,libopus"
+
+do_install_append() {
+ cp -R ${S}/ThirdParty/rapidjson/rapidjson-1.1.0/include/* ${D}${includedir}/include
+ install -d ${D}${libdir}
+
+ # Copy the Mock headers from AVS SDK
+ mkdir -p ${D}${includedir}/AVSCommon/SDKInterfaces/test
+ cp -R ${S}/AVSCommon/SDKInterfaces/test/AVSCommon/SDKInterfaces/* ${D}${includedir}/AVSCommon/SDKInterfaces/test
+
+ # Install Sample application to test Alexa Voice Service
+ install -d ${D}${bindir}
+ install -m 0755 ${B}/SampleApp/src/SampleApp ${D}${bindir}
+
+ chrpath -d ${D}${bindir}/SampleApp
+}
+
+TARGET_CXXFLAGS+= "-Wno-deprecated-copy"
diff --git a/meta-boot2qt/recipes-alexa/avs-device-sdk/avs-device-sdk_1.12.1.bb b/meta-boot2qt/recipes-alexa/avs-device-sdk/avs-device-sdk_1.12.1.bb
new file mode 100644
index 00000000..63f4913e
--- /dev/null
+++ b/meta-boot2qt/recipes-alexa/avs-device-sdk/avs-device-sdk_1.12.1.bb
@@ -0,0 +1,14 @@
+#
+# Copyright (c) 2019 Amazon.com, Inc.
+#
+# SPDX-License-Identifier: Apache-2.0
+#
+
+require avs-device-sdk.inc
+
+SRC_URI[md5sum] = "ece2fda85607567dccb3163bf9311efb"
+SRC_URI[sha256sum] = "fba17b343c011410584330d8e268d09f449d16d62007b1a797751721a5616368"
+
+# Enable OPUS by default
+PACKAGECONFIG += "opus portaudio"
+PACKAGECONFIG_append_intel-corei7-64 = " kittai "
diff --git a/meta-boot2qt/recipes-alexa/openblas/openblas_0.3.5.bb b/meta-boot2qt/recipes-alexa/openblas/openblas_0.3.5.bb
new file mode 100644
index 00000000..a21b8f00
--- /dev/null
+++ b/meta-boot2qt/recipes-alexa/openblas/openblas_0.3.5.bb
@@ -0,0 +1,77 @@
+#
+# Copyright (c) 2016 Intel Corporation. All rights reserved.
+# Copyright (c) 2019 Luxoft Sweden AB
+#
+# SPDX-License-Identifier: MIT
+#
+
+DESCRIPTION = "OpenBLAS is an optimized BLAS library based on GotoBLAS2 1.13 BSD version."
+SUMMARY = "OpenBLAS : An optimized BLAS library"
+AUTHOR = "Alexander Leiva <norxander@gmail.com>"
+HOMEPAGE = "http://www.openblas.net/"
+SECTION = "libs"
+LICENSE = "BSD-3-Clause"
+
+DEPENDS = "make"
+
+LIC_FILES_CHKSUM = "file://LICENSE;md5=5adf4792c949a00013ce25d476a2abc0"
+
+SRC_URI = "https://github.com/xianyi/OpenBLAS/archive/v${PV}.tar.gz"
+SRC_URI[md5sum] = "579bda57f68ea6e9074bf5780e8620bb"
+SRC_URI[sha256sum] = "0950c14bd77c90a6427e26210d6dab422271bc86f9fc69126725833ecdaa0e85"
+
+S = "${WORKDIR}/OpenBLAS-${PV}"
+
+def map_arch(a, d):
+ import re
+ if re.match('i.86$', a): return 'ATOM'
+ elif re.match('x86_64$', a): return 'ATOM'
+ elif re.match('aarch32$', a): return 'CORTEXA9'
+ elif re.match('aarch64$', a): return 'ARMV8'
+ elif re.match('arm$', a): return 'ARMV7'
+ return a
+
+def map_bits(a, d):
+ import re
+ if re.match('i.86$', a): return 32
+ elif re.match('x86_64$', a): return 64
+ elif re.match('aarch32$', a): return 32
+ elif re.match('aarch64$', a): return 64
+ elif re.match('arm$', a): return 32
+ return 32
+
+def map_extra_options(a, d):
+ import re
+ if re.match('arm$', a): return '-mfpu=neon-vfpv4 -mfloat-abi=hard'
+ return ''
+
+do_compile () {
+ oe_runmake HOSTCC="${BUILD_CC}" \
+ CC="${TARGET_PREFIX}gcc ${TOOLCHAIN_OPTIONS} ${@map_extra_options(d.getVar('TARGET_ARCH', True), d)}" \
+ PREFIX=${exec_prefix} \
+ CROSS_SUFFIX=${HOST_PREFIX} \
+ ONLY_CBLAS=1 BINARY='${@map_bits(d.getVar('TARGET_ARCH', True), d)}' \
+ TARGET='${@map_arch(d.getVar('TARGET_ARCH', True), d)}'
+}
+
+do_install() {
+ oe_runmake HOSTCC="${BUILD_CC}" \
+ CC="${TARGET_PREFIX}gcc ${TOOLCHAIN_OPTIONS}" \
+ PREFIX=${exec_prefix} \
+ CROSS_SUFFIX=${HOST_PREFIX} \
+ ONLY_CBLAS=1 BINARY='${@map_bits(d.getVar('TARGET_ARCH', True), d)}' \
+ TARGET='${@map_arch(d.getVar('TARGET_ARCH', True), d)}' \
+ DESTDIR=${D} \
+ install
+ rm -rf ${D}${bindir}
+ rm -rf ${D}${libdir}/cmake
+
+ rm -rf ${D}${libdir}/lib${PN}*.so*
+ rm -rf ${D}${libdir}/pkgconfig/${PN}.pc
+ rm -rf ${D}${libdir}/pkgconfig
+
+ cd ${D}${libdir}
+ ln -s libopenblas.a libblas.a
+}
+
+FILES_${PN}-dev = "${includedir} ${libdir}/lib${PN}.a ${libdir}/libblas.a"
diff --git a/meta-boot2qt/recipes-alexa/snowboy/snowboy_1.3.0.bb b/meta-boot2qt/recipes-alexa/snowboy/snowboy_1.3.0.bb
new file mode 100644
index 00000000..951e7d41
--- /dev/null
+++ b/meta-boot2qt/recipes-alexa/snowboy/snowboy_1.3.0.bb
@@ -0,0 +1,46 @@
+#
+# Copyright (c) 2019 Amazon.com, Inc.
+# Copyright (c) 2019 Luxoft Sweden AB
+#
+# SPDX-License-Identifier: Apache-2.0
+#
+
+SUMMARY = "Snowboy Hotword Detection by KITT.AI"
+HOMEPAGE = "https://snowboy.kitt.ai/"
+LICENSE = "Apache-2.0"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=8d385adc93db3f7e5d092b82fb2c9353"
+
+SRC_URI = "https://github.com/Kitt-AI/snowboy/archive/v${PV}.tar.gz"
+SRC_URI[md5sum] = "e16e117914f76f4a35facb16b0fcd61b"
+SRC_URI[sha256sum] = "93658cc5d4d83dd7a6e954d0dc1e18d1c70b1dd8623181850c4804d3aca19e96"
+
+COMPATIBLE_HOST = "x86_64-.*-linux"
+
+INSANE_SKIP_${PN} += "already-stripped"
+
+def get_snowboy_arch(d):
+ import re
+ architecture = d.getVar('TARGET_ARCH')
+ if re.match('x86_64$', architecture):
+ return "ubuntu64"
+ elif re.match('arm$', architecture):
+ return "rpi"
+ elif re.match('aarch64$', architecture):
+ return "aarch64-ubuntu1604"
+ else:
+ return "ubuntu64"
+
+SNOWBOY_ARCH ?= "${@get_snowboy_arch(d)}"
+
+do_install() {
+ mkdir -p ${D}${libdir}
+ cp ${S}/lib/${SNOWBOY_ARCH}/libsnowboy-detect.a ${D}${libdir}
+ mkdir -p ${D}${includedir}
+ cp ${S}/include/snowboy-detect.h ${D}${includedir}
+
+ install -d ${D}${datadir}/snowboy
+ install -m 0755 ${S}/resources/common.res ${D}${datadir}/snowboy/
+ install -m 0755 ${S}/resources/alexa/alexa-avs-sample-app/alexa.umdl ${D}${datadir}/snowboy/
+}
+
+FILES_${PN} = "${datadir}/snowboy/alexa.umdl ${datadir}/snowboy/common.res"
diff --git a/meta-boot2qt/recipes-support/curl/curl_%.bbappend b/meta-boot2qt/recipes-support/curl/curl_%.bbappend
new file mode 100644
index 00000000..9fe597e8
--- /dev/null
+++ b/meta-boot2qt/recipes-support/curl/curl_%.bbappend
@@ -0,0 +1,4 @@
+PACKAGECONFIG_append = " nghttp2 libssh2 libidn "
+PACKAGECONFIG_remove_class-native = " nghttp2 "
+PACKAGECONFIG_remove_class-nativesdk = " nghttp2 libssh2 "
+