Add agl-voiceagent-alexa feature 08/22408/1
authorScott Murray <scott.murray@konsulko.com>
Thu, 12 Sep 2019 17:30:23 +0000 (13:30 -0400)
committerScott Murray <scott.murray@konsulko.com>
Thu, 12 Sep 2019 17:36:47 +0000 (13:36 -0400)
Add feature and associated recipes and bbappends to enable building
the Amazon Alexa voice agent for the speech framework using the Alexa
Automotive SDK 2.0 release.  A separate feature is used to accomodate
potentially building with a different voiceagent provider.

Some follow on development is required to add PipeWire support to the
new gstreamer extension added in AAC 2.0, see SPEC-2767.

Bug-AGL: SPEC-2765

Change-Id: Ie6e8f6a7965f8014ca2e64a2535faec073e320bc
Signed-off-by: Scott Murray <scott.murray@konsulko.com>
12 files changed:
meta-speech-framework/conf/include/agl-speech-framework.inc [new file with mode: 0644]
meta-speech-framework/conf/include/agl-voiceagent-alexa.inc [new file with mode: 0644]
meta-speech-framework/conf/layer.conf
meta-speech-framework/meta-aac/recipes-apis/alexa-voiceagent-service/alexa-voiceagent-service/0001-remove-library-dependency-copying.patch [new file with mode: 0644]
meta-speech-framework/meta-aac/recipes-apis/alexa-voiceagent-service/alexa-voiceagent-service_git.bb [new file with mode: 0644]
meta-speech-framework/meta-aac/recipes-modules/aac-module-gstreamer/aac-module-gstreamer.bbappend [new file with mode: 0644]
meta-speech-framework/recipes-platform/packagegroups/packagegroup-agl-core-services.bbappend
templates/feature/agl-speech-framework/50_local.conf.inc [new file with mode: 0644]
templates/feature/agl-voiceagent-alexa/50_bblayers.conf.inc [new file with mode: 0644]
templates/feature/agl-voiceagent-alexa/50_local.conf.inc [new file with mode: 0644]
templates/feature/agl-voiceagent-alexa/README_feature_agl-voiceagent-alexa.md [new file with mode: 0644]
templates/feature/agl-voiceagent-alexa/included.dep [new file with mode: 0644]

diff --git a/meta-speech-framework/conf/include/agl-speech-framework.inc b/meta-speech-framework/conf/include/agl-speech-framework.inc
new file mode 100644 (file)
index 0000000..9b7a0f0
--- /dev/null
@@ -0,0 +1,2 @@
+# Currently no default voiceagent
+PREFERRED_RPROVIDER_virtual/voiceagent ?= ""
diff --git a/meta-speech-framework/conf/include/agl-voiceagent-alexa.inc b/meta-speech-framework/conf/include/agl-voiceagent-alexa.inc
new file mode 100644 (file)
index 0000000..9da4821
--- /dev/null
@@ -0,0 +1 @@
+PREFERRED_RPROVIDER_virtual/voiceagent = "alexa-voiceagent-service"
index 8ab7eb0..ce97b9e 100644 (file)
@@ -1,6 +1,21 @@
 # We have a conf and classes directory, add to BBPATH
 BBPATH .= ":${LAYERDIR}"
 
+# Let us add layer-specific bbappends which are only applied when that
+# layer is included in our configuration -
+# e.g. only add layers if a bsp is present.
+# This is based on the BBFILE_COLLECTIONS name of the layer.
+# We use either the BBFILE_COLLECTIONS name of the layer directly (meta-ti)
+BBFILES += "${@' '.join('${LAYERDIR}/%s/recipes*/*/*.bbappend' % layer \
+               for layer in BBFILE_COLLECTIONS.split())}"
+BBFILES += "${@' '.join('${LAYERDIR}/%s/recipes*/*/*.bb' % layer \
+               for layer in BBFILE_COLLECTIONS.split())}"
+# or we prepend it with meta-  (e.g. rpi, fsl*)
+BBFILES += "${@' '.join('${LAYERDIR}/meta-%s/recipes*/*/*.bbappend' % layer \
+               for layer in BBFILE_COLLECTIONS.split())}"
+BBFILES += "${@' '.join('${LAYERDIR}/meta-%s/recipes*/*/*.bb' % layer \
+               for layer in BBFILE_COLLECTIONS.split())}"
+
 # We have recipes-* directories, add to BBFILES
 BBFILES += "${LAYERDIR}/recipes-*/*/*.bb \
        ${LAYERDIR}/recipes-*/*/*.bbappend"
diff --git a/meta-speech-framework/meta-aac/recipes-apis/alexa-voiceagent-service/alexa-voiceagent-service/0001-remove-library-dependency-copying.patch b/meta-speech-framework/meta-aac/recipes-apis/alexa-voiceagent-service/alexa-voiceagent-service/0001-remove-library-dependency-copying.patch
new file mode 100644 (file)
index 0000000..7b0141c
--- /dev/null
@@ -0,0 +1,30 @@
+Remove copying of library dependencies
+
+Since we are targeting building into an image, the widget build does
+not have to copy host library dependencies into the widget as it would
+when being built standalone with the SDK.  Remove the copying, as
+runtime dependencies will be used to pull the libraries in.
+
+Upstream-Status: Inappropriate [embedded specific]
+
+Signed-off-by: Scott Murray <scott.murray@konsulko.com>
+
+diff --git a/platforms/agl/alexa-voiceagent-service/libs/CMakeLists.txt b/platforms/agl/alexa-voiceagent-service/libs/CMakeLists.txt
+index 4732e7b..ffc149d 100644
+--- a/libs/CMakeLists.txt
++++ b/libs/CMakeLists.txt
+@@ -70,14 +70,6 @@ add_avs_library(SpeechEncoder ${AAC_HOME}/lib/libSpeechEncoder.so)
+ add_avs_library(OpusEncoderContext ${AAC_HOME}/lib/libOpusEncoderContext.so)
+ add_avs_library(SpeechSynthesizer ${AAC_HOME}/lib/libSpeechSynthesizer.so)
+ add_avs_library(TemplateRuntime ${AAC_HOME}/lib/libTemplateRuntime.so)
+-#add_avs_library(curl ${AAC_HOME}/lib/libcurl.so.4.5.0)
+-add_avs_library(curl ${AAC_HOME}/lib/libcurl.so.4)
+-#add_avs_library(nghttp2 ${AAC_HOME}/lib/libnghttp2.so.14.16)
+-add_avs_library(nghttp2 ${AAC_HOME}/lib/libnghttp2.so.14)
+-#add_avs_library(opus ${AAC_HOME}/lib/libopus.so.0.6.1)
+-add_avs_library(opus ${AAC_HOME}/lib/libopus.so.0)
+-#add_avs_library(sqlite3 ${AAC_HOME}/lib/libsqlite3.so.0.8.6)
+-add_avs_library(sqlite3 ${AAC_HOME}/lib/libsqlite3.so.0)
+ add_avs_library(equalizer ${AAC_HOME}/lib/libEqualizer.so)
+ add_avs_library(EqualizerImplementations ${AAC_HOME}/lib/libEqualizerImplementations.so)
diff --git a/meta-speech-framework/meta-aac/recipes-apis/alexa-voiceagent-service/alexa-voiceagent-service_git.bb b/meta-speech-framework/meta-aac/recipes-apis/alexa-voiceagent-service/alexa-voiceagent-service_git.bb
new file mode 100644 (file)
index 0000000..ec7a1e9
--- /dev/null
@@ -0,0 +1,38 @@
+SUMMARY = "Alexa voice agent binding"
+DESCRIPTION = "alexa-voiceagent-service is an Alexa Auto SDK based voiceagent binding"
+HOMEPAGE = "https://gerrit.automotivelinux.org/gerrit/apps/agl-service-voice-high"
+SECTION = "apps"
+
+LICENSE = "Apache-2.0"
+LIC_FILES_CHKSUM = "file://License.txt;md5=3b83ef96387f14655fc854ddc3c6bd57"
+
+DEPENDS = " \
+       libafb-helpers \
+       libappcontroller \
+       avs-device-sdk \
+       aac-module-core \
+       aac-module-alexa \
+       aac-module-cbl \
+       aac-module-contact-uploader \
+       aac-module-navigation \
+       aac-module-phone-control \
+       aac-module-gstreamer \
+"
+
+SRC_URI = "git://github.com/alexa/alexa-auto-sdk.git;protocol=https;branch=2.0 \
+           file://0001-remove-library-dependency-copying.patch \
+"
+SRCREV = "86916d2d8c1702a8be3c88a9012ca56583bcc0c8"
+
+PV = "2.0+git${SRCPV}"
+S = "${WORKDIR}/git/platforms/agl/alexa-voiceagent-service"
+
+inherit cmake aglwgt
+
+EXTRA_OECMAKE += "-DAAC_HOME=${RECIPE_SYSROOT}/${AAC_PREFIX}"
+
+# NOTE: curl and opus are from the base SDK libraries, sqlite3 from the
+#       core module
+RDEPENDS_${PN} += "libcurl libopus libsqlite3"
+
+RPROVIDES_${PN} += "virtual/voiceagent"
diff --git a/meta-speech-framework/meta-aac/recipes-modules/aac-module-gstreamer/aac-module-gstreamer.bbappend b/meta-speech-framework/meta-aac/recipes-modules/aac-module-gstreamer/aac-module-gstreamer.bbappend
new file mode 100644 (file)
index 0000000..78107c8
--- /dev/null
@@ -0,0 +1,5 @@
+# Needed for the required gstreamer-app-1.0 pkgconfig bits
+DEPENDS += "gstreamer1.0-plugins-base"
+
+# Pull static library into appropriate package to avoid a QA error
+FILES_${PN}-staticdev += "${AAC_PREFIX}/lib/libaal.a"
index a2c8076..42fc5e5 100644 (file)
@@ -1,2 +1,7 @@
-RDEPENDS_${PN} += "agl-service-voice-high"
-RDEPENDS_${PN} += "agl-service-voice-high-capabilities"
+# Checking PREFERRED_RPROVIDER_virtual/voiceagent below is less than ideal, but
+# seems required until there is a usable default voiceagent.
+RDEPENDS_${PN} += " \
+       agl-service-voice-high \
+       agl-service-voice-high-capabilities \
+       ${@oe.utils.conditional("PREFERRED_RPROVIDER_virtual/voiceagent", "", "", "virtual/voiceagent", d)} \
+"
diff --git a/templates/feature/agl-speech-framework/50_local.conf.inc b/templates/feature/agl-speech-framework/50_local.conf.inc
new file mode 100644 (file)
index 0000000..c542f38
--- /dev/null
@@ -0,0 +1,2 @@
+#see meta-agl-devel/meta-speech-framework/conf/include/agl-speech-framework.inc
+require conf/include/agl-speech-framework.inc
diff --git a/templates/feature/agl-voiceagent-alexa/50_bblayers.conf.inc b/templates/feature/agl-voiceagent-alexa/50_bblayers.conf.inc
new file mode 100644 (file)
index 0000000..2397a1d
--- /dev/null
@@ -0,0 +1,10 @@
+BBLAYERS =+ " \
+       ${METADIR}/external/alexa-auto-sdk/builder/meta-aac \
+"
+
+# Per the SDK documentation, the module recipes need to be manually
+# added, as they sit outside of the layer.
+BBFILES += "${METADIR}/external/alexa-auto-sdk/modules/*/*.bb"
+
+# Include the recipe for the required gstreamer module as well
+BBFILES += "${METADIR}/external/alexa-auto-sdk/extensions/experimental/gstreamer/modules/*/*.bb"
diff --git a/templates/feature/agl-voiceagent-alexa/50_local.conf.inc b/templates/feature/agl-voiceagent-alexa/50_local.conf.inc
new file mode 100644 (file)
index 0000000..828b88d
--- /dev/null
@@ -0,0 +1,2 @@
+#see meta-agl-devel/meta-speech-framework/conf/include/agl-voiceagent-alexa.inc
+require conf/include/agl-voiceagent-alexa.inc
diff --git a/templates/feature/agl-voiceagent-alexa/README_feature_agl-voiceagent-alexa.md b/templates/feature/agl-voiceagent-alexa/README_feature_agl-voiceagent-alexa.md
new file mode 100644 (file)
index 0000000..584042f
--- /dev/null
@@ -0,0 +1,8 @@
+---
+description: Feature agl-voiceagent-alexa
+authors: Scott Murray <scott.murray@konsulko.com>
+---
+
+### Feature agl-voiceagent-alexa
+
+Enables building Amazon Alexa voice agent binding for the speech framework using the Alexa Automotive SDK.
diff --git a/templates/feature/agl-voiceagent-alexa/included.dep b/templates/feature/agl-voiceagent-alexa/included.dep
new file mode 100644 (file)
index 0000000..fde3c2d
--- /dev/null
@@ -0,0 +1 @@
+agl-speech-framework