From 8bf3c50ab7eb48f8db63ea41d6a12e32f3633dee Mon Sep 17 00:00:00 2001 From: Scott Murray Date: Tue, 8 Sep 2020 13:23:42 -0400 Subject: meta-speech-framework: Update Alexa Auto SDK to v2.3 Changes: - Mask out the duplicate libopus recipe, the same version is available from a recipe in meta-oe. - Update BBFILES addition for the audio module in the feature template to work with yet another new audio output backend. - Update the AlexaAutoCoreEngineConfig.json.in template based on the new sample JSON in 2.3. - Update alexa-voiceagent-config recipe to add new configuration variables ALEXA_LOCALE, ALEXA_TIMEZONE, ALEXA_MFG_NAME, and ALEXA_DESCRIPTION to match requirements of the updated configuration JSON. - Remove local alexa-voiceagent-service patches merged by Amazon, and update 0001-remove-library-dependency-copying.patch for 2.3. - Update SDK module DEPENDS for alexa-voiceagent-service recipe to match what seems required now with 2.3. - Remove avs-device-sdk patch for building with g++ 9.x, as it is no longer required. - Add avs-device-sdk patch to workaround hang seen on first connection. - Add bbappends for aac-module-car-control and aac-module-messaging recipes to fix their nlohmann-json DEPENDS to work with the recipe that is available in meta-oe. - Rework aac-module-system-audio.bbappend to enable the PipeWire support that has been merged into the module. Bug-AGL: SPEC-3783 Signed-off-by: Scott Murray Change-Id: I18c910f9cbf874fef85d1d84508f6666d53629ed (cherry picked from commit e0d5ad833e89f47c88601e15158015319e568af8) --- .../conf/include/agl-voiceagent-alexa.inc | 4 +- .../AlexaAutoCoreEngineConfig.json.in | 170 +++--------------- .../alexa-voiceagent-config_1.0.bb | 39 ++-- .../0001-remove-library-dependency-copying.patch | 16 +- .../0002-update-config.xml.in.patch | 31 ---- .../0003-update-audio-device-configuration.patch | 197 --------------------- .../0004-update-config-and-database-paths.patch | 124 ------------- ...segmentation-fault-for-release-build-mode.patch | 33 ---- .../0006-fix-event-argument-json.patch | 183 ------------------- .../alexa-voiceagent-service_git.bb | 15 +- .../0001-connection-deadlock-workaround.patch | 35 ++++ .../0001-enable-building-with-g++-9.patch | 24 --- .../avs-device-sdk/avs-device-sdk_1.13.bbappend | 3 - .../avs-device-sdk/avs-device-sdk_1.19.1.bbappend | 3 + .../aac-module-car-control.bbappend | 3 + .../aac-module-gstreamer.bbappend | 9 - ...-gstreamer-implement-pipewire-integration.patch | 94 ---------- .../aac-module-messaging.bbappend | 3 + .../aac-module-system-audio.bbappend | 8 + 19 files changed, 116 insertions(+), 878 deletions(-) delete mode 100644 meta-speech-framework/meta-aac/recipes-apis/alexa-voiceagent-service/alexa-voiceagent-service/0002-update-config.xml.in.patch delete mode 100644 meta-speech-framework/meta-aac/recipes-apis/alexa-voiceagent-service/alexa-voiceagent-service/0003-update-audio-device-configuration.patch delete mode 100644 meta-speech-framework/meta-aac/recipes-apis/alexa-voiceagent-service/alexa-voiceagent-service/0004-update-config-and-database-paths.patch delete mode 100644 meta-speech-framework/meta-aac/recipes-apis/alexa-voiceagent-service/alexa-voiceagent-service/0005-fix-segmentation-fault-for-release-build-mode.patch delete mode 100644 meta-speech-framework/meta-aac/recipes-apis/alexa-voiceagent-service/alexa-voiceagent-service/0006-fix-event-argument-json.patch create mode 100644 meta-speech-framework/meta-aac/recipes-avs/avs-device-sdk/avs-device-sdk/0001-connection-deadlock-workaround.patch delete mode 100644 meta-speech-framework/meta-aac/recipes-avs/avs-device-sdk/avs-device-sdk/0001-enable-building-with-g++-9.patch delete mode 100644 meta-speech-framework/meta-aac/recipes-avs/avs-device-sdk/avs-device-sdk_1.13.bbappend create mode 100644 meta-speech-framework/meta-aac/recipes-avs/avs-device-sdk/avs-device-sdk_1.19.1.bbappend create mode 100644 meta-speech-framework/meta-aac/recipes-modules/aac-module-car-control/aac-module-car-control.bbappend delete mode 100644 meta-speech-framework/meta-aac/recipes-modules/aac-module-gstreamer/aac-module-gstreamer.bbappend delete mode 100644 meta-speech-framework/meta-aac/recipes-modules/aac-module-gstreamer/aac-module-gstreamer/0001-gstreamer-implement-pipewire-integration.patch create mode 100644 meta-speech-framework/meta-aac/recipes-modules/aac-module-messaging/aac-module-messaging.bbappend create mode 100644 meta-speech-framework/meta-aac/recipes-modules/aac-module-system-audio/aac-module-system-audio.bbappend (limited to 'meta-speech-framework') diff --git a/meta-speech-framework/conf/include/agl-voiceagent-alexa.inc b/meta-speech-framework/conf/include/agl-voiceagent-alexa.inc index 635d3ead..c8e61852 100644 --- a/meta-speech-framework/conf/include/agl-voiceagent-alexa.inc +++ b/meta-speech-framework/conf/include/agl-voiceagent-alexa.inc @@ -2,11 +2,13 @@ # from meta-aac to avoid triggering rebuilds of all curl dependencies when # agl-voiceagent-alexa is configured. BBMASK += "meta-aac/recipes-support/curl/curl_%.bbappend" -# Mask out the nghttp2 recipe in meta-aac as well, since the same version +# Mask out the nghttp2 recipe in meta-aac as well, as a newer version # is available in meta-networking, and due to meta-aac having a higher # layer priority, rebuilds will be triggered when the voiceagent feature # is configured and the layer is added. BBMASK += "meta-aac/recipes-connectivity/nghttp2" +# Mask out the duplicate libopus recipe in meta-aac for the same reason +BBMASK += "meta-aac/recipes-multimedia/libopus" PREFERRED_RPROVIDER_virtual/voice-high-config = "alexa-voice-high-config" diff --git a/meta-speech-framework/meta-aac/recipes-apis/alexa-voiceagent-service/alexa-voiceagent-config/AlexaAutoCoreEngineConfig.json.in b/meta-speech-framework/meta-aac/recipes-apis/alexa-voiceagent-service/alexa-voiceagent-config/AlexaAutoCoreEngineConfig.json.in index 9ead4893..4bf00f89 100644 --- a/meta-speech-framework/meta-aac/recipes-apis/alexa-voiceagent-service/alexa-voiceagent-config/AlexaAutoCoreEngineConfig.json.in +++ b/meta-speech-framework/meta-aac/recipes-apis/alexa-voiceagent-service/alexa-voiceagent-config/AlexaAutoCoreEngineConfig.json.in @@ -1,55 +1,34 @@ { "deviceInfo": { - "clientId":"@@ALEXA_CLIENTID@@", - "deviceSerialNumber":"@@ALEXA_SERIALNUMBER@@", - "productId":"@@ALEXA_PRODUCTID@@" + "clientId": "@@ALEXA_CLIENTID@@", + "deviceSerialNumber": "@@ALEXA_SERIALNUMBER@@", + "productId": "@@ALEXA_PRODUCTID@@", + "manufacturerName": "@@ALEXA_MFG_NAME@@", + "description": "@@ALEXA_DESCRIPTION@@" }, "libcurlUtils": { "CURLOPT_CAPATH":"/etc/ssl/certs" }, - "miscDatabase": - { - "databaseFilePath":"./miscDatabase.db" - }, - "certifiedSender": - { - "databaseFilePath":"./certifiedSender.db" - }, - "alertsCapabilityAgent": - { - "databaseFilePath":"./alertsCapabilityAgent.db" - }, - "notifications": - { - "databaseFilePath":"./notifications.db" - }, - "settings": - { - "databaseFilePath":"./settings.db", - "defaultAVSClientSettings": - { - "locale":"en-US" - } - }, - "aace.storage": { - "localStoragePath": "./sample-aace.db", - "storageType": "sqlite" + "deviceSettings": { + "defaultLocale":"@@ALEXA_LOCALE@@", + "defaultTimezone":"@@ALEXA_TIMEZONE@@" }, "aace.vehicle": { "info": { "make": "Amazon", - "model": "AACE", - "year": "2018", + "model": "AutoSDK", + "year": "2019", "trim": "aac", "geography": "US", "version": "1.2.3", - "os": "sample-aace", - "arch": "sample-aace", + "os": "AGL", + "arch": "aarch64", "language": "en_US", "microphone": "SingleArray", - "countries": "US,GB,IE,CA,DE,AT,IN,JP,AU,NZ,FR" + "countries": "US,GB,IE,CA,DE,AT,IN,JP,AU,NZ,FR", + "vehicleIdentifier": "Sample Identifier ABC" }, "operatingCountry": "US", "currentLocation": "36.1363,-115.1513" @@ -58,11 +37,12 @@ "voice": "Default" }, "aace.audio.output": { - "tts": "Speech-High", - "music": "Speech-Low" + "tts": "Speech-Low", + "music": "Speech-High", + "alarm": "Custom-Low" }, "aace.wakeword": { - "enabled":@@WAKEWORD@@ + "enabled":@@ALEXA_WAKEWORD@@ }, "aace.cbl": { "enabled": true @@ -70,115 +50,15 @@ "aace.localmediasource": { "enabled":false, "sources": { - "bluetooth":false, - "usb":false, - "fmRadio":false, - "amRadio":false, + "bluetooth":true, + "usb":true, + "fmRadio":true, + "amRadio":true, "satelliteRadio":false, "lineIn":false, - "compactDisc":false - } - }, - "aace.localvoicecontrol": { - "enabled":false, - "socketRootDirectory":"/var/" - }, - "aace.localskills": { - "aace.carcontrol": { - "enabled": false, - "cannedzones": [ - { - "name" : "zone.all", - "enabled": true, - "climate": { - "syncController": false, - "recirculationController": false - }, - "airconditioner" : { - "modes": { - "AUTO": true, - "ECONOMY": false, - "MANUAL": false, - "MAXIMIUM": false - } - }, - "heater" : { - "minimum": 60.0, - "maximum": 80.0, - "precision": 1.0, - "unit": "FAHRENHEIT" - }, - "fan" : { - "minimum": 0.0, - "maximium": 10.0, - "precision": 1.0 - }, - "vent": { - "positions" : { - "BODY": true, - "MIX": false, - "FLOOR": false, - "WINDSHIELD": false - } - }, - "window" : { - "defrost": true - }, - "light" : { - "type": "LIGHT", - "colors" : { - "WHITE": true, - "RED": true, - "ORANGE": true, - "YELLOW": true, - "GREEN": true, - "BLUE": true, - "INDIGO": true, - "VIOLET": true - } - } - }, - { - "name" : "zone.back.driver", - "enabled": false - }, - { - "name" : "zone.back.passenger", - "enabled": false - }, - { - "name" : "zone.driver", - "enabled": false - }, - { - "name" : "zone.first.row", - "enabled": false - }, - { - "name" : "zone.fourth.row", - "enabled": false - }, - { - "name" : "zone.front", - "enabled": false - }, - { - "name" : "zone.passenger", - "enabled": false - }, - { - "name" : "zone.rear", - "enabled": false - }, - { - "name" : "zone.second.row", - "enabled": false - }, - { - "name" : "zone.third.row", - "enabled": false - } - ] + "compactDisc":true, + "siriusXM":false, + "dab":false } } } diff --git a/meta-speech-framework/meta-aac/recipes-apis/alexa-voiceagent-service/alexa-voiceagent-config_1.0.bb b/meta-speech-framework/meta-aac/recipes-apis/alexa-voiceagent-service/alexa-voiceagent-config_1.0.bb index 7e5992bb..a16ad182 100644 --- a/meta-speech-framework/meta-aac/recipes-apis/alexa-voiceagent-service/alexa-voiceagent-config_1.0.bb +++ b/meta-speech-framework/meta-aac/recipes-apis/alexa-voiceagent-service/alexa-voiceagent-config_1.0.bb @@ -11,30 +11,41 @@ SRC_URI = "file://AlexaAutoCoreEngineConfig.json.in" inherit allarch ALEXA_WAKEWORD ??= "false" +ALEXA_LOCALE ??= "en-US" +ALEXA_TIMEZONE ??= "America/Vancouver" -do_compile () { +do_compile[noexec] = "1" - if test x"${ALEXA_CLIENTID}" == x"" ; then - bbfatal "ALEXA CLIENTID not defined in your environment e.g. conf/local.conf" +do_install () { + if [ -z "${ALEXA_CLIENTID}" ]; then + bbfatal "ALEXA_CLIENTID not defined in your environment e.g. conf/local.conf" fi - - if test x"${ALEXA_SERIALNUMBER}" == x"" ; then - bbfatal "ALEXA SERIALNUMBER not defined in your environment e.g. conf/local.conf" + if [ -z "${ALEXA_SERIALNUMBER}" ]; then + bbfatal "ALEXA_SERIALNUMBER not defined in your environment e.g. conf/local.conf" fi - - if test x"${ALEXA_PRODUCTID}" == x"" ; then - bbfatal "ALEXA PRODUCTID not defined in your environment e.g. conf/local.conf" + if [ -z "${ALEXA_PRODUCTID}" ]; then + bbfatal "ALEXA_PRODUCTID not defined in your environment e.g. conf/local.conf" + fi + if [ -z "${ALEXA_MFG_NAME}" ]; then + bbfatal "ALEXA_MFG_NAME not defined in your environment e.g. conf/local.conf" + fi + if [ -z "${ALEXA_DESCRIPTION}" ]; then + bbfatal "ALEXA_DESCRIPTION not defined in your environment e.g. conf/local.conf" fi -} - -do_install () { #replace - sed -e "s/@@ALEXA_CLIENTID@@/${ALEXA_CLIENTID}/" -e "s/@@ALEXA_SERIALNUMBER@@/${ALEXA_SERIALNUMBER}/" -e "s/@@ALEXA_PRODUCTID@@/${ALEXA_PRODUCTID}/" -e "s/@@WAKEWORD@@/${ALEXA_WAKEWORD}/" ${WORKDIR}/AlexaAutoCoreEngineConfig.json.in > ${WORKDIR}/AlexaAutoCoreEngineConfig.json + sed -e "s|@@ALEXA_CLIENTID@@|${ALEXA_CLIENTID}|" \ + -e "s|@@ALEXA_SERIALNUMBER@@|${ALEXA_SERIALNUMBER}|" \ + -e "s|@@ALEXA_PRODUCTID@@|${ALEXA_PRODUCTID}|" \ + -e "s|@@ALEXA_MFG_NAME@@|${ALEXA_MFG_NAME}|" \ + -e "s|@@ALEXA_DESCRIPTION@@|${ALEXA_DESCRIPTION}|" \ + -e "s|@@ALEXA_WAKEWORD@@|${ALEXA_WAKEWORD}|" \ + -e "s|@@ALEXA_LOCALE@@|${ALEXA_LOCALE}|" \ + -e "s|@@ALEXA_TIMEZONE@@|${ALEXA_TIMEZONE}|" \ + ${WORKDIR}/AlexaAutoCoreEngineConfig.json.in > ${WORKDIR}/AlexaAutoCoreEngineConfig.json # install install -D -m 644 ${WORKDIR}/AlexaAutoCoreEngineConfig.json ${D}${sysconfdir}/xdg/AGL/AlexaAutoCoreEngineConfig.json } RPROVIDES_${PN} += "virtual/alexa-voiceagent-config" - 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 index 3e45c527..ee61ac20 100644 --- 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 @@ -10,23 +10,17 @@ Upstream-Status: Inappropriate [embedded specific] Signed-off-by: Scott Murray diff --git a/libs/CMakeLists.txt b/libs/CMakeLists.txt -index 4732e7b..938e5f3 100644 +index 8a955feb..5b097877 100644 --- a/libs/CMakeLists.txt +++ b/libs/CMakeLists.txt -@@ -70,22 +70,13 @@ 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) +@@ -92,16 +92,11 @@ add_avs_library(SQLiteStorage ${AAC_HOME}/lib/libSQLiteStorage.so) + add_avs_library(SystemSoundPlayer ${AAC_HOME}/lib/libSystemSoundPlayer.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(ToggleController ${AAC_HOME}/lib/libToggleController.so) -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) -if(EXISTS ${AAC_HOME}/lib/libpryon_lite.so.1.13) +if(EXISTS ${AAC_HOME}/lib/libAACEAmazonLiteEngine.so) @@ -36,4 +30,4 @@ index 4732e7b..938e5f3 100644 - add_avs_library(pryon_lite ${AAC_HOME}/lib/libpryon_lite.so.1.13) endif() - if(EXISTS ${AAC_HOME}/lib/libAACEGStreamerEngine.so) + if(EXISTS ${AAC_HOME}/share/cmake/AACESystemAudio.cmake) diff --git a/meta-speech-framework/meta-aac/recipes-apis/alexa-voiceagent-service/alexa-voiceagent-service/0002-update-config.xml.in.patch b/meta-speech-framework/meta-aac/recipes-apis/alexa-voiceagent-service/alexa-voiceagent-service/0002-update-config.xml.in.patch deleted file mode 100644 index fd5aaf75..00000000 --- a/meta-speech-framework/meta-aac/recipes-apis/alexa-voiceagent-service/alexa-voiceagent-service/0002-update-config.xml.in.patch +++ /dev/null @@ -1,31 +0,0 @@ -Update config.xml.in - -Remove now unneeded 4A binding dependency, and add new required audio -permission. - -Upstream-Status: Pending - -Signed-off-by: Scott Murray - -diff --git a/platforms/agl/alexa-voiceagent-service/conf.d/wgt/config.xml.in b/platforms/agl/alexa-voiceagent-service/conf.d/wgt/config.xml.in -index 3486518..14fd6a2 100644 ---- a/conf.d/wgt/config.xml.in -+++ b/conf.d/wgt/config.xml.in -@@ -9,6 +9,7 @@ - - - -+ - - - -@@ -23,7 +24,6 @@ - - - -- - - -- -\ No newline at end of file -+ diff --git a/meta-speech-framework/meta-aac/recipes-apis/alexa-voiceagent-service/alexa-voiceagent-service/0003-update-audio-device-configuration.patch b/meta-speech-framework/meta-aac/recipes-apis/alexa-voiceagent-service/alexa-voiceagent-service/0003-update-audio-device-configuration.patch deleted file mode 100644 index ede3d533..00000000 --- a/meta-speech-framework/meta-aac/recipes-apis/alexa-voiceagent-service/alexa-voiceagent-service/0003-update-audio-device-configuration.patch +++ /dev/null @@ -1,197 +0,0 @@ -Update audio device configuration - -Rework the audio output device configuration to match the expectations -of the PipeWire output sink configuration in the gstreamer output code. -Currently, this means that the role is being stored as the device name -so the gstreamer code can use it when setting up the output sink -properties. - -Upstream-Status: Pending - -Signed-off-by: Scott Murray - -diff --git a/platforms/agl/alexa-voiceagent-service/src/plugins/aasb-client/config/AASBConfigProviderImpl.cpp b/platforms/agl/alexa-voiceagent-service/src/plugins/aasb-client/config/AASBConfigProviderImpl.cpp -index 83d0341..b51185c 100644 ---- a/src/plugins/aasb-client/config/AASBConfigProviderImpl.cpp -+++ b/src/plugins/aasb-client/config/AASBConfigProviderImpl.cpp -@@ -97,25 +97,25 @@ AASBConfigProviderImpl::AudioIOConfiguration AASBConfigProviderImpl::getAudioIOC - - // Output devices - if(!m_ttsOutputDevice.empty()) -- audioConfig.ttsOutputDevice = m_audio->openAHLChannel(m_ttsOutputDevice); -+ audioConfig.ttsOutputDevice = m_audio->openChannel(m_ttsOutputDevice); - - if(!m_musicOutputDevice.empty()) -- audioConfig.musicOutputDevice = m_audio->openAHLChannel(m_musicOutputDevice); -+ audioConfig.musicOutputDevice = m_audio->openChannel(m_musicOutputDevice); - - if(!m_notificationOutputDevice.empty()) -- audioConfig.notificationOutputDevice = m_audio->openAHLChannel(m_notificationOutputDevice); -+ audioConfig.notificationOutputDevice = m_audio->openChannel(m_notificationOutputDevice); - - if(!m_alarmOutputDevice.empty()) -- audioConfig.alarmOutputDevice = m_audio->openAHLChannel(m_alarmOutputDevice); -+ audioConfig.alarmOutputDevice = m_audio->openChannel(m_alarmOutputDevice); - - if(!m_earconOutputDevice.empty()) -- audioConfig.earconOutputDevice = m_audio->openAHLChannel(m_earconOutputDevice); -+ audioConfig.earconOutputDevice = m_audio->openChannel(m_earconOutputDevice); - - if(!m_communicationOutputDevice.empty()) -- audioConfig.communicationOutputDevice = m_audio->openAHLChannel(m_communicationOutputDevice); -+ audioConfig.communicationOutputDevice = m_audio->openChannel(m_communicationOutputDevice); - - if(!m_ringtoneOutputDevice.empty()) -- audioConfig.ringtoneOutputDevice = m_audio->openAHLChannel(m_ringtoneOutputDevice); -+ audioConfig.ringtoneOutputDevice = m_audio->openChannel(m_ringtoneOutputDevice); - - return audioConfig; - } -@@ -585,4 +585,4 @@ void AASBConfigProviderImpl::logCurrentConfiguration() { - } - - } // namespace alexa --} // namespace agl -\ No newline at end of file -+} // namespace agl -diff --git a/src/plugins/audio/Audio.cpp b/src/plugins/audio/Audio.cpp -index d662a06..1b2fa9d 100644 ---- a/src/plugins/audio/Audio.cpp -+++ b/src/plugins/audio/Audio.cpp -@@ -13,8 +13,6 @@ - * permissions and limitations under the License. - */ - --#include -- - #include - - #include "Audio.h" -@@ -22,7 +20,7 @@ - namespace agl { - namespace audio { - --/// Shortcut to reach logging level. -+// Shortcut to reach logging level. - using Level = agl::common::interfaces::ILogger::Level; - - using namespace agl::common::interfaces; -@@ -31,68 +29,30 @@ static std::string TAG = "agl::audio::Audio"; - - std::shared_ptr