summaryrefslogtreecommitdiffstats
path: root/meta-speech-framework/meta-aac/recipes-apis/alexa-voiceagent-service
diff options
context:
space:
mode:
authorScott Murray <scott.murray@konsulko.com>2020-09-08 13:23:42 -0400
committerScott Murray <scott.murray@konsulko.com>2021-02-01 12:24:51 -0500
commite0d5ad833e89f47c88601e15158015319e568af8 (patch)
tree863a0cf2b3d208bb428ddde4b40dc2a2991cb23b /meta-speech-framework/meta-aac/recipes-apis/alexa-voiceagent-service
parent16d4abc248879d41db20c010b5775c70751dc394 (diff)
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 <scott.murray@konsulko.com> Change-Id: I18c910f9cbf874fef85d1d84508f6666d53629ed
Diffstat (limited to 'meta-speech-framework/meta-aac/recipes-apis/alexa-voiceagent-service')
-rw-r--r--meta-speech-framework/meta-aac/recipes-apis/alexa-voiceagent-service/alexa-voiceagent-config/AlexaAutoCoreEngineConfig.json.in170
-rw-r--r--meta-speech-framework/meta-aac/recipes-apis/alexa-voiceagent-service/alexa-voiceagent-config_1.0.bb39
-rw-r--r--meta-speech-framework/meta-aac/recipes-apis/alexa-voiceagent-service/alexa-voiceagent-service/0001-remove-library-dependency-copying.patch16
-rw-r--r--meta-speech-framework/meta-aac/recipes-apis/alexa-voiceagent-service/alexa-voiceagent-service/0002-update-config.xml.in.patch31
-rw-r--r--meta-speech-framework/meta-aac/recipes-apis/alexa-voiceagent-service/alexa-voiceagent-service/0003-update-audio-device-configuration.patch197
-rw-r--r--meta-speech-framework/meta-aac/recipes-apis/alexa-voiceagent-service/alexa-voiceagent-service/0004-update-config-and-database-paths.patch124
-rw-r--r--meta-speech-framework/meta-aac/recipes-apis/alexa-voiceagent-service/alexa-voiceagent-service/0005-fix-segmentation-fault-for-release-build-mode.patch33
-rw-r--r--meta-speech-framework/meta-aac/recipes-apis/alexa-voiceagent-service/alexa-voiceagent-service/0006-fix-event-argument-json.patch183
-rw-r--r--meta-speech-framework/meta-aac/recipes-apis/alexa-voiceagent-service/alexa-voiceagent-service_git.bb15
9 files changed, 61 insertions, 747 deletions
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 <scott.murray@konsulko.com>
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 <scott.murray@konsulko.com>
-
-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 @@
-
- <feature name="urn:AGL:widget:required-permission">
- <param name="urn:AGL:permission::public:no-htdocs" value="required" />
-+ <param name="urn:AGL:permission::public:audio" value="required" />
- <param name="urn:AGL:permission:audio:public:audiostream" value="required" />
- <param name="urn:AGL:permission::public:hidden" value="required" />
- <param name="urn:AGL:permission::system:run-by-default" value="required" />
-@@ -23,7 +24,6 @@
- </feature>
-
- <feature name="urn:AGL:widget:required-api">
-- <param name="ahl-4a" value="ws" />
- <param name="vshl-capabilities" value="ws" />
- </feature>
--</widget>
-\ No newline at end of file
-+</widget>
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 <scott.murray@konsulko.com>
-
-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 <json.h>
--
- #include <AACE/Engine/Core/EngineMacros.h>
-
- #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<Audio> Audio::create(
- std::shared_ptr<agl::common::interfaces::ILogger> logger,
-- shared_ptr<agl::common::interfaces::IAFBApi> api) {
-+ shared_ptr<agl::common::interfaces::IAFBApi> api)
-+{
- return std::shared_ptr<Audio>(new Audio(logger, api));
- }
-
- Audio::Audio(std::shared_ptr<ILogger> logger,
- std::shared_ptr<IAFBApi> api) :
- m_logger(logger),
-- m_api(api) {
--
--}
--
--std::string Audio::openAHLChannel(const std::string &role)
-+ m_api(api)
- {
-- json_object *request = json_object_new_object();
-- json_object *response = NULL;
-- json_object_object_add(request, "action", json_object_new_string("open"));
-- if (callAHL(role, request, &response)) {
-- json_object *val = NULL;
-- std::string result;
-- if (json_object_object_get_ex(response, "device_uri", &val)) {
-- const char* device = json_object_get_string(val);
-- m_logger->log(Level::DEBUG, TAG, "openAHLChannel: device=" + std::string(device));
-- result = device;
-- }
-- json_object_put(response);
-- return result;
-- }
-- return "";
- }
-
--bool Audio::setAHLChannelVolume(const std::string &role, int volume)
-+std::string Audio::openChannel(const std::string &role)
- {
-- json_object *request = json_object_new_object();
-- json_object_object_add(request, "action", json_object_new_string("volume"));
-- json_object_object_add(request, "value", json_object_new_int(volume));
-- return callAHL(role, request, NULL);
-+ // For now, return the given role as the device string, to match
-+ // the expectation of the PipeWire sink configuration in the
-+ // gstreamer output code.
-+ return role;
- }
-
--bool Audio::callAHL(const std::string &role, json_object *request, json_object **response)
-+bool Audio::setChannelVolume(const std::string &role, int volume)
- {
-- json_object *object = NULL;
-- std::string error, info;
-- bool result = false;
--
-- if (m_api->callSync("ahl-4a", role, request, &object, error, info) < 0) {
-- m_logger->log(Level::ERROR, TAG, "VA service call=" + role + " failed, error=" + error + ", info=" + info);
-- goto exit;
-- }
--
-- m_logger->log(Level::DEBUG, TAG, "callAHL, response=" + std::string(json_object_get_string(object)));
-- result = true;
-- if (response) {
-- *response = object;
-- }
--
--exit:
-- if (!result && object) {
-- json_object_put(object);
-- }
--
-- return result;
-+ return true;
- }
-
--}
--}
-\ No newline at end of file
-+} // namespace audio
-+} // namespace agl
-diff --git a/src/plugins/audio/Audio.h b/src/plugins/audio/Audio.h
-index 14bef4d..8998242 100644
---- a/src/plugins/audio/Audio.h
-+++ b/src/plugins/audio/Audio.h
-@@ -35,23 +35,21 @@ public:
- std::shared_ptr<agl::common::interfaces::ILogger> logger,
- shared_ptr<agl::common::interfaces::IAFBApi> api);
-
-- std::string openAHLChannel(const std::string &role);
-- bool setAHLChannelVolume(const std::string &role, int volume);
-+ std::string openChannel(const std::string &role);
-+ bool setChannelVolume(const std::string &role, int volume);
-
- private:
- Audio(std::shared_ptr<agl::common::interfaces::ILogger> logger,
- shared_ptr<agl::common::interfaces::IAFBApi> api);
-
-- bool callAHL(const std::string &role, json_object *request, json_object **response);
--
-- // Logger.
-- std::shared_ptr<agl::common::interfaces::ILogger> m_logger;
-+ // Logger.
-+ std::shared_ptr<agl::common::interfaces::ILogger> m_logger;
-
- // AFB API object for events pub/sub, and for calling other AGL services.
-- std::shared_ptr<agl::common::interfaces::IAFBApi> m_api;
-+ std::shared_ptr<agl::common::interfaces::IAFBApi> m_api;
- };
-
--}
--}
-+} // namespace audio
-+} // namespace agl
-
--#endif // AGL_AUDIO_AUDIO_H_
-\ No newline at end of file
-+#endif // AGL_AUDIO_AUDIO_H_
diff --git a/meta-speech-framework/meta-aac/recipes-apis/alexa-voiceagent-service/alexa-voiceagent-service/0004-update-config-and-database-paths.patch b/meta-speech-framework/meta-aac/recipes-apis/alexa-voiceagent-service/alexa-voiceagent-service/0004-update-config-and-database-paths.patch
deleted file mode 100644
index 0bf4267f..00000000
--- a/meta-speech-framework/meta-aac/recipes-apis/alexa-voiceagent-service/alexa-voiceagent-service/0004-update-config-and-database-paths.patch
+++ /dev/null
@@ -1,124 +0,0 @@
-alexa-voiceagent-service: update config and database file paths
-
-Tweak getDataRootPath in the AASBConfigProviderImpl class to use the
-AFM_WORKDIR environment variable as the basis for the path, which
-moves things from the binding installation hierarchy into the app
-framework's provided application data directory. This avoids the
-permissions problems stemming from the new security model of running
-as non-root. Also reworked the main configuration JSON file location
-logic to use a new helper member function that checks for the file
-in /etc/xdg/AGL and then in AFM_WORKDIR (app-data directory), before
-falling back to the original location in var/config under the binding
-installation directory. The local copy of GetBindingDirPath has been
-removed, as it seems to be working fine now that the binding is being
-built with AFB_BINDING_VERSION = 3.
-
-Upstream-Status: Pending
-
-Signed-off-by: Scott Murray <scott.murray@konsulko.com>
-
-diff --git a/src/plugins/aasb-client/config/AASBConfigProviderImpl.cpp b/src/plugins/aasb-client/config/AASBConfigProviderImpl.cpp
-index b51185c..5d5c3ba 100644
---- a/src/plugins/aasb-client/config/AASBConfigProviderImpl.cpp
-+++ b/src/plugins/aasb-client/config/AASBConfigProviderImpl.cpp
-@@ -19,6 +19,7 @@
- #include <iostream>
- #include <sstream>
- #include <unistd.h>
-+#include <sys/stat.h>
-
- #include <rapidjson/document.h>
- #include <rapidjson/istreamwrapper.h>
-@@ -36,6 +37,9 @@ using Level = agl::common::interfaces::ILogger::Level;
- /// Logging tag for this file.
- static std::string TAG = "agl::alexa::AASBConfigProviderImpl";
-
-+/// Directory where user over-ride alexa json configuration may be.
-+static std::string ALEXA_CONFIG_FILE_OVERRIDE_DIR = "/etc/xdg/AGL/";
-+
- /// File name where alexa json configuration is stored.
- static std::string ALEXA_CONFIG_FILE_NAME = "AlexaAutoCoreEngineConfig.json";
-
-@@ -64,8 +68,7 @@ AASBConfigProviderImpl::AASBConfigProviderImpl(std::shared_ptr<agl::common::inte
- m_enableLocalVoiceControl(false) {
- m_LocalVoiceControlConfiguration = std::unique_ptr<LVCConfiguration>(new LVCConfiguration());
- m_carControlConfiguration = std::unique_ptr<CarControlConfiguration>(new CarControlConfiguration());
-- std::string alexaConfigFile = getDataRootPath() + ALEXA_CONFIG_FILE_NAME;
-- initConfigFromFile(alexaConfigFile);
-+ initConfigFromFile(getAlexaConfigPath());
- logCurrentConfiguration();
- }
-
-@@ -520,32 +523,25 @@ void AASBConfigProviderImpl::initConfigFromFile(const std::string& fileName) {
- }
- }
-
--// GetBindingDirPath() method provided by AGL SDK crashes every single time.
--// It turns out that on latest AGL platforms, GetBindingDirPath(afb_api_t) version
--// is supposed to be the correct version. However when we include filescan-utils.h
--// it compiles a version without "afb_api_t" parameter. For now, I have made a
--// copy of this method here which accepts "afb_api_t" parameter.
--// TODO: Fix it
--std::string GetBindingDirectoryPath(afb_api_t api) {
-- // A file description should not be greater than 999.999.999
-- char fd_link[CONTROL_MAXPATH_LEN];
-- char retdir[CONTROL_MAXPATH_LEN];
-- ssize_t len;
-- sprintf(fd_link, "/proc/self/fd/%d", afb_dynapi_rootdir_get_fd(api));
--
-- if ((len = readlink(fd_link, retdir, sizeof(retdir) - 1)) == -1) {
-- perror("lstat");
-- strncpy(retdir, "/tmp", CONTROL_MAXPATH_LEN - 1);
-- } else {
-- retdir[len] = '\0';
-- }
--
-- return std::string(retdir);
-+std::string AASBConfigProviderImpl::getDataRootPath() {
-+ std::string workDir(getenv("AFM_WORKDIR"));
-+ return workDir + "/";
- }
-
--std::string AASBConfigProviderImpl::getDataRootPath() {
-- std::string bindingDir(GetBindingDirectoryPath(m_api));
-- return bindingDir + "/var/config/";
-+std::string AASBConfigProviderImpl::getAlexaConfigPath() {
-+ struct stat statbuf;
-+
-+ // Look in over-ride directory first
-+ std::string configPath = ALEXA_CONFIG_FILE_OVERRIDE_DIR + ALEXA_CONFIG_FILE_NAME;
-+ if(stat(configPath.c_str(), &statbuf) != 0) {
-+ // Look in work directory (app-data) next
-+ configPath = getDataRootPath() + ALEXA_CONFIG_FILE_NAME;
-+ if(stat(configPath.c_str(), &statbuf) != 0) {
-+ // Fall back to default version in widget
-+ configPath = std::string(GetBindingDirPath(m_api)) + "/var/config/" + ALEXA_CONFIG_FILE_NAME;
-+ }
-+ }
-+ return configPath;
- }
-
- void AASBConfigProviderImpl::logCurrentConfiguration() {
-diff --git a/src/plugins/aasb-client/config/AASBConfigProviderImpl.h b/src/plugins/aasb-client/config/AASBConfigProviderImpl.h
-index 6b79994..e32f7b7 100644
---- a/src/plugins/aasb-client/config/AASBConfigProviderImpl.h
-+++ b/src/plugins/aasb-client/config/AASBConfigProviderImpl.h
-@@ -87,6 +87,11 @@ private:
- */
- std::string getDataRootPath();
-
-+ /**
-+ * Provides the path where alexa json config resides.
-+ */
-+ std::string getAlexaConfigPath();
-+
- /**
- * Logs the current configuration loaded by this object.
- */
-@@ -139,4 +144,4 @@ private:
- } // namespace alexa
- } // namespace agl
-
--#endif // AGL_ALEXA_SVC_AASB_CONFIG_PROVIDER_IMPL_H_
-\ No newline at end of file
-+#endif // AGL_ALEXA_SVC_AASB_CONFIG_PROVIDER_IMPL_H_
diff --git a/meta-speech-framework/meta-aac/recipes-apis/alexa-voiceagent-service/alexa-voiceagent-service/0005-fix-segmentation-fault-for-release-build-mode.patch b/meta-speech-framework/meta-aac/recipes-apis/alexa-voiceagent-service/alexa-voiceagent-service/0005-fix-segmentation-fault-for-release-build-mode.patch
deleted file mode 100644
index 5012dfe8..00000000
--- a/meta-speech-framework/meta-aac/recipes-apis/alexa-voiceagent-service/alexa-voiceagent-service/0005-fix-segmentation-fault-for-release-build-mode.patch
+++ /dev/null
@@ -1,33 +0,0 @@
-Fix segmentation fault for release build mode
-
-'int IAFBApi::callSync(...)' is missing a return
-statement. When the sdk is compiled in release mode
-executing this code results in a segmentation fault.
-
-According to the C++ standard, a return statement is
-required on a function that returns a non-void value.
-Specifically: <<Flowing off the end of a function is
-equivalent to a return with no value; this results in
-undefined behaviour in a value-returning function.>>
-
-The proposed fix provides the missing return statement
-for IAFBApi's callSync method.
-
-Upstream-Status: Pending
-
-Signed-off-by: Raquel Medina <raquel.medina@konsulko.com>
-
-diff --git a/platforms/agl/alexa-voiceagent-service/src/plugins/afb/AFBApiImpl.cpp b/platforms/agl/alexa-voiceagent-service/src/plugins/afb/AFBApiImpl.cpp
-index 5ed9bce..e68ef7f 100644
---- a/src/plugins/afb/AFBApiImpl.cpp
-+++ b/src/plugins/afb/AFBApiImpl.cpp
-@@ -77,6 +77,8 @@ int AFBApiImpl::callSync(
- info = infoStr;
- free(infoStr);
- }
-+
-+ return rc;
- }
-
- /// Shim to transfer C++ function to C callback using void*
-
diff --git a/meta-speech-framework/meta-aac/recipes-apis/alexa-voiceagent-service/alexa-voiceagent-service/0006-fix-event-argument-json.patch b/meta-speech-framework/meta-aac/recipes-apis/alexa-voiceagent-service/alexa-voiceagent-service/0006-fix-event-argument-json.patch
deleted file mode 100644
index 8c6f1e4b..00000000
--- a/meta-speech-framework/meta-aac/recipes-apis/alexa-voiceagent-service/alexa-voiceagent-service/0006-fix-event-argument-json.patch
+++ /dev/null
@@ -1,183 +0,0 @@
-Fix event argument JSON
-
-It was discovered while trying to use some of the capabilities events
-that the argument JSON was incorrectly formatted, with instances of
-all or part of it being double-quoted as strings with escaping. A
-couple instances of this had previously been worked around by hacks
-involving reparsing all or some parts of the arguments a second time
-with a JSON parser, but it seems better to fix it at the source so
-that the events match documentation and are usable as is.
-
-Note that it is ATM not clear if all affected event argument payloads
-are correct, e.g. LocalMediaSource may need some more work.
-
-Upstream-Status: Pending
-
-Signed-off-by: Scott Murray <scott.murray@konsulko.com>
-
-diff --git a/src/plugins/aasb-client/AlexaCapabilityDirectiveRouterImpl.cpp b/src/plugins/aasb-client/AlexaCapabilityDirectiveRouterImpl.cpp
-index 6aea920..23ed90c 100644
---- a/src/plugins/aasb-client/AlexaCapabilityDirectiveRouterImpl.cpp
-+++ b/src/plugins/aasb-client/AlexaCapabilityDirectiveRouterImpl.cpp
-@@ -17,6 +17,8 @@
-
- #include <sstream>
-
-+#include <json-c/json.h>
-+
- #include <aasb/Consts.h>
-
- #include "AlexaConsts.h"
-@@ -322,7 +324,16 @@ void AlexaCapabilityDirectiveRouterImpl::processTemplateRuntimeAction(
-
- json_object* argsJ = json_object_new_object();
- json_object* actionJ = json_object_new_string(vshlCapabilityAction.c_str());
-- json_object* payloadJ = json_object_new_string(payload.c_str());
-+ json_object* payloadJ = NULL;
-+ if(payload.length()) {
-+ payloadJ = json_tokener_parse(payload.c_str());
-+ } else {
-+ payloadJ = json_object_new_string("");
-+ }
-+ if(!payloadJ) {
-+ m_logger->log(Level::ERROR, TAG, "Unable to parse payload JSON: " + payload);
-+ return;
-+ }
- json_object_object_add(argsJ, agl::alexa::JSON_ATTR_ACTION.c_str(), actionJ);
- json_object_object_add(argsJ, agl::alexa::JSON_ATTR_PAYLOAD.c_str(), payloadJ);
-
-@@ -343,24 +354,40 @@ void AlexaCapabilityDirectiveRouterImpl::processCBLAction(
- const std::string& payload) {
- m_logger->log(Level::DEBUG, TAG, "Processing CBL action: " + action);
-
-- json_object* eventDataJ = json_object_new_object();
-+ json_object* payloadJ = NULL;
-+ if(payload.length()) {
-+ payloadJ = json_tokener_parse(payload.c_str());
-+ } else {
-+ payloadJ = json_object_new_string("");
-+ }
-+ if(!payloadJ) {
-+ m_logger->log(Level::ERROR, TAG, "Unable to parse payload JSON: " + payload);
-+ return;
-+ }
-+ // The payload string may already be of the form of a document like
-+ // "{ "payload" : { ... } }", the simplest way to handle that is to use
-+ // it as the event json_object if that's the case, that way we avoid
-+ // having to worry about copying.
-+ json_object* eventDataJ = NULL;
-+ if(json_object_object_get_ex(payloadJ, "payload", NULL)) {
-+ eventDataJ = payloadJ;
-+ } else {
-+ eventDataJ = json_object_new_object();
-+ json_object_object_add(eventDataJ, JSON_ATTR_PAYLOAD.c_str(), payloadJ);
-+ }
- json_object* vaIdJ = json_object_new_string(m_alexaVoiceAgentId.c_str());
--
- json_object_object_add(eventDataJ, JSON_ATTR_VOICEAGENT_ID.c_str(), vaIdJ);
-
- int observers = 0;
- if (action == aasb::bridge::ACTION_CBL_CODEPAIR_RECEIVED) {
- m_logger->log(Level::INFO, TAG, "CBL codepair received: " + payload);
-- json_object* payloadJ = json_object_new_string(payload.c_str());
-- json_object_object_add(eventDataJ, JSON_ATTR_PAYLOAD.c_str(), payloadJ);
- observers = m_cblCodePairReceivedEvent->publishEvent(eventDataJ);
- } else if (action == aasb::bridge::ACTION_CBL_CODEPAIR_EXPIRED) {
- m_logger->log(Level::INFO, TAG, "CBL codepair expired: " + payload);
-- json_object* payloadJ = json_object_new_string(payload.c_str());
-- json_object_object_add(eventDataJ, JSON_ATTR_PAYLOAD.c_str(), payloadJ);
- observers = m_cblCodePairExpiredEvent->publishEvent(eventDataJ);
- } else {
- m_logger->log(Level::INFO, TAG, "Unhandled action: " + action);
-+ json_object_put(eventDataJ);
- }
-
- std::stringstream logMsg;
-diff --git a/src/plugins/dispatchers/local-voice-control/car-control/CarControlDispatcher.cpp b/src/plugins/dispatchers/local-voice-control/car-control/CarControlDispatcher.cpp
-index 096f72f..75108d4 100644
---- a/src/plugins/dispatchers/local-voice-control/car-control/CarControlDispatcher.cpp
-+++ b/src/plugins/dispatchers/local-voice-control/car-control/CarControlDispatcher.cpp
-@@ -72,7 +72,16 @@ void CarControlDispatcher::onReceivedDirective(
-
- json_object* argsJ = json_object_new_object();
- json_object* actionJ = json_object_new_string(vshlCapabilityAction.c_str());
-- json_object* payloadJ = json_object_new_string(payload.c_str());
-+ json_object* payloadJ = NULL;
-+ if(payload.length()) {
-+ payloadJ = json_tokener_parse(payload.c_str());
-+ } else {
-+ payloadJ = json_object_new_string("");
-+ }
-+ if(!payloadJ) {
-+ m_logger->log(Level::ERROR, TAG, "Unable to parse payload JSON: " + payload);
-+ return;
-+ }
- json_object_object_add(argsJ, agl::alexa::JSON_ATTR_ACTION.c_str(), actionJ);
- json_object_object_add(argsJ, agl::alexa::JSON_ATTR_PAYLOAD.c_str(), payloadJ);
-
-diff --git a/src/plugins/dispatchers/localmediasource/LocalMediaSourceDispatcher.cpp b/src/plugins/dispatchers/localmediasource/LocalMediaSourceDispatcher.cpp
-index c261a56..04ac10c 100644
---- a/src/plugins/dispatchers/localmediasource/LocalMediaSourceDispatcher.cpp
-+++ b/src/plugins/dispatchers/localmediasource/LocalMediaSourceDispatcher.cpp
-@@ -71,7 +71,16 @@ void LocalMediaSourceDispatcher::onReceivedDirective(
-
- json_object* argsJ = json_object_new_object();
- json_object* actionJ = json_object_new_string(vshlCapabilityAction.c_str());
-- json_object* payloadJ = json_object_new_string(payload.c_str());
-+ json_object* payloadJ = NULL;
-+ if(payload.length()) {
-+ payloadJ = json_tokener_parse(payload.c_str());
-+ } else {
-+ payloadJ = json_object_new_string("");
-+ }
-+ if(!payloadJ) {
-+ m_logger->log(Level::ERROR, TAG, "Unable to parse payload JSON: " + payload);
-+ return;
-+ }
- json_object_object_add(argsJ, agl::alexa::JSON_ATTR_ACTION.c_str(), actionJ);
- json_object_object_add(argsJ, agl::alexa::JSON_ATTR_PAYLOAD.c_str(), payloadJ);
-
-diff --git a/src/plugins/dispatchers/navigation/NavigationDispatcher.cpp b/src/plugins/dispatchers/navigation/NavigationDispatcher.cpp
-index 55a6017..283b42b 100644
---- a/src/plugins/dispatchers/navigation/NavigationDispatcher.cpp
-+++ b/src/plugins/dispatchers/navigation/NavigationDispatcher.cpp
-@@ -68,7 +68,16 @@ void NavigationDispatcher::onReceivedDirective(
-
- json_object* argsJ = json_object_new_object();
- json_object* actionJ = json_object_new_string(vshlCapabilityAction.c_str());
-- json_object* payloadJ = json_object_new_string(payload.c_str());
-+ json_object* payloadJ = NULL;
-+ if(payload.length()) {
-+ payloadJ = json_tokener_parse(payload.c_str());
-+ } else {
-+ payloadJ = json_object_new_string("");
-+ }
-+ if(!payloadJ) {
-+ m_logger->log(Level::ERROR, TAG, "Unable to parse payload JSON: " + payload);
-+ return;
-+ }
- json_object_object_add(argsJ, agl::alexa::JSON_ATTR_ACTION.c_str(), actionJ);
- json_object_object_add(argsJ, agl::alexa::JSON_ATTR_PAYLOAD.c_str(), payloadJ);
-
-diff --git a/src/plugins/dispatchers/phonecall/PhoneCallDispatcher.cpp b/src/plugins/dispatchers/phonecall/PhoneCallDispatcher.cpp
-index 29ad96a..3432892 100644
---- a/src/plugins/dispatchers/phonecall/PhoneCallDispatcher.cpp
-+++ b/src/plugins/dispatchers/phonecall/PhoneCallDispatcher.cpp
-@@ -86,7 +86,16 @@ void PhoneCallDispatcher::onReceivedDirective(
-
- json_object* argsJ = json_object_new_object();
- json_object* actionJ = json_object_new_string(vshlCapabilityAction.c_str());
-- json_object* payloadJ = json_object_new_string(payload.c_str());
-+ json_object* payloadJ = NULL;
-+ if(payload.length()) {
-+ payloadJ = json_tokener_parse(payload.c_str());
-+ } else {
-+ payloadJ = json_object_new_string("");
-+ }
-+ if(!payloadJ) {
-+ m_logger->log(Level::ERROR, TAG, "Unable to parse payload JSON: " + payload);
-+ return;
-+ }
- json_object_object_add(argsJ, agl::alexa::JSON_ATTR_ACTION.c_str(), actionJ);
- json_object_object_add(argsJ, agl::alexa::JSON_ATTR_PAYLOAD.c_str(), payloadJ);
-
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
index abae3dec..580b141c 100644
--- 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
@@ -12,27 +12,24 @@ DEPENDS = " \
avs-device-sdk \
aac-module-core \
aac-module-alexa \
+ aac-module-address-book \
+ aac-module-car-control \
aac-module-cbl \
aac-module-contact-uploader \
aac-module-navigation \
aac-module-phone-control \
- aac-module-gstreamer \
+ aac-module-system-audio \
${@bb.utils.contains("ALEXA_WAKEWORD", "true", "aac-module-amazonlite pryon-lite", "", d)} \
"
-SRC_URI = "git://github.com/alexa/alexa-auto-sdk.git;protocol=https;branch=2.0 \
+SRC_URI = "git://github.com/alexa/alexa-auto-sdk.git;protocol=https;branch=2.3 \
file://alexa.json \
file://0001-remove-library-dependency-copying.patch \
- file://0002-update-config.xml.in.patch \
- file://0003-update-audio-device-configuration.patch \
- file://0004-update-config-and-database-paths.patch \
- file://0005-fix-segmentation-fault-for-release-build-mode.patch \
- file://0006-fix-event-argument-json.patch \
file://0007-add-autobuild-scripts.patch \
"
-SRCREV = "86916d2d8c1702a8be3c88a9012ca56583bcc0c8"
+SRCREV = "d46f22b453f528868b483e39bc7a057ca68a5199"
-PV = "2.0+git${SRCPV}"
+PV = "2.3+git${SRCPV}"
S = "${WORKDIR}/git/platforms/agl/alexa-voiceagent-service"
inherit cmake aglwgt