Skip to content
This repository was archived by the owner on Jan 16, 2024. It is now read-only.

Commit e519638

Browse files
author
Sam Coulter
committed
Version 1.16 alexa-client-sdk
Changes in this update: **Enhancements** - Added support for SpeechSynthesizer v.1.2 which includes the new `playBehaviour` directive. For more information, see [SpeechSynthesizer v1.2](https://github.com/alexa/avs-device-sdk/wiki/SpeechSynthesizer-Interface-v1.2). - Added support for pre-buffering in [AudioPlayer](https://alexa.github.io/avs-device-sdk/classalexa_client_s_d_k_1_1capability_agents_1_1audio_player_1_1_audio_player.html). You can optionally choose the number of instances MediaPlayer uses in the [AlexaClientSDKconfig.json](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json). Important: the contract for [MediaPlayerInterface](https://alexa.github.io/avs-device-sdk/classalexa_client_s_d_k_1_1avs_common_1_1utils_1_1media_player_1_1_media_player_interface.html) has changed. You must now make sure that the `SourceId` value returned by `setSource()` is unique across all instances. - AudioPlayer is now licensed under the Amazon Software License instead of the Apache Software License. **Bug Fixes** - Fixed Android issue that caused the build script to ignore PKG_CONFIG_PATH. This sometimes caused the build to use a preinstalled dependency instead of the specific version downloaded by the Android script (e.g - openssl). - Fixed Android issue that prevented the Sample app from running at the same time as other applications using the microphone. Android doesn't inherently allow two applications to use the microphone. Pressing the mute button now temporarily stops Alexa from accessing the microphone. - Added 'quit' (– q) to the settings sub menu. - Fixed outdated dependencies issue in the Windows install script. - Fixed reminders issue that caused Notification LEDs to stay on, even after dismissing the alert. **Known Issues** * Music playback history isn't displayed in the Alexa app for certain account and device types. * When using Gnu Compiler Collection 8+ (GCC 8+), `-Wclass-memaccess` triggers warnings. You can ignore these, they don't cause the build to fail. * Android error `libDefaultClient.so not found` might occur. Resolve this by upgrading to ADB version 1.0.40. * If a device loses a network connection, the lost connection status isn't returned via local TTS. * ACL encounters issues if it receives audio attachments but doesn't consume them. * `SpeechSynthesizerState` uses `GAINING_FOCUS` and `LOSING_FOCUS` as a workaround for handling intermediate states. * Media steamed through Bluetooth might abruptly stop. To restart playback, resume the media in the source application or toggle next/previous. * If a connected Bluetooth device is inactive, the Alexa app might indicates that audio is playing. * The Bluetooth agent assumes that the Bluetooth adapter is always connected to a power source. Disconnecting from a power source during operation isn't yet supported. * When using some products, interrupted Bluetooth playback might not resume if other content is locally streamed. * `make integration` isn't available for Android. To run Android integration tests, manually upload the test binary and input file and run ADB. * Alexa might truncate the beginning of speech when responding to text-to-speech (TTS) user events. This only impacts Raspberry Pi devices running Android Things with HDMI output audio. * A reminder TTS message doesn't play if the sample app restarts and loses a network connection. Instead, the default alarm tone plays twice. * `ServerDisconnectIntegratonTest` tests are disabled until they are updated to reflect new service behavior. * Bluetooth initialization must complete before connecting devices, otherwise devices are ignored. * The `DirectiveSequencerTest.test_handleBlockingThenImmediatelyThenNonBockingOnSameDialogId` test fails intermittently. * On some devices, Alexa gets stuck in a permanent listening state. Pressing `t` and `h` in the Sample App doesn't exit the listening state. * Exiting the `settings` menu doesn't provide a message to indicate that you are back in the main menu.
1 parent 2e9428e commit e519638

121 files changed

Lines changed: 4298 additions & 1553 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

ADSL/include/ADSL/DirectiveProcessor.h

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2017-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+
* Copyright 2017-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License").
55
* You may not use this file except in compliance with the License.
@@ -82,6 +82,14 @@ class DirectiveProcessor {
8282
*/
8383
void setDialogRequestId(const std::string& dialogRequestId);
8484

85+
/**
86+
* Returns the @c dialogRequestId currently in use for Directive handling. This may be the empty string if
87+
* Directives have either experienced errors, or have been cancelled.
88+
*
89+
* @return dialogRequestId The current dialog request id.
90+
*/
91+
std::string getDialogRequestId();
92+
8593
/**
8694
* Queue an @c AVSDirective for handling by whatever @c DirectiveHandler was registered to handle it.
8795
*

ADSL/include/ADSL/DirectiveSequencer.h

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2017-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+
* Copyright 2017-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License").
55
* You may not use this file except in compliance with the License.
@@ -52,6 +52,8 @@ class DirectiveSequencer : public avsCommon::sdkInterfaces::DirectiveSequencerIn
5252

5353
void setDialogRequestId(const std::string& dialogRequestId) override;
5454

55+
std::string getDialogRequestId() override;
56+
5557
bool onDirective(std::shared_ptr<avsCommon::avs::AVSDirective> directive) override;
5658

5759
void disable() override;
@@ -67,11 +69,6 @@ class DirectiveSequencer : public avsCommon::sdkInterfaces::DirectiveSequencerIn
6769
*/
6870
DirectiveSequencer(std::shared_ptr<avsCommon::sdkInterfaces::ExceptionEncounteredSenderInterface> exceptionSender);
6971

70-
/**
71-
* @copydoc
72-
*
73-
* This method blocks until all processing of directives has stopped.
74-
*/
7572
void doShutdown() override;
7673

7774
/**

ADSL/src/DirectiveProcessor.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,11 @@ void DirectiveProcessor::setDialogRequestId(const std::string& dialogRequestId)
6363
setDialogRequestIdLocked(dialogRequestId);
6464
}
6565

66+
std::string DirectiveProcessor::getDialogRequestId() {
67+
std::lock_guard<std::mutex> lock(m_mutex);
68+
return m_dialogRequestId;
69+
}
70+
6671
bool DirectiveProcessor::onDirective(std::shared_ptr<AVSDirective> directive) {
6772
if (!directive) {
6873
ACSDK_ERROR(LX("onDirectiveFailed").d("action", "ignored").d("reason", "nullptrDirective"));

ADSL/src/DirectiveSequencer.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2017-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+
* Copyright 2017-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License").
55
* You may not use this file except in compliance with the License.
@@ -62,6 +62,10 @@ void DirectiveSequencer::setDialogRequestId(const std::string& dialogRequestId)
6262
m_directiveProcessor->setDialogRequestId(dialogRequestId);
6363
}
6464

65+
std::string DirectiveSequencer::getDialogRequestId() {
66+
return m_directiveProcessor->getDialogRequestId();
67+
}
68+
6569
bool DirectiveSequencer::onDirective(std::shared_ptr<AVSDirective> directive) {
6670
if (!directive) {
6771
ACSDK_ERROR(LX("onDirectiveFailed").d("action", "ignored").d("reason", "nullptrDirective"));

ADSL/test/ADSL/MockDirectiveSequencer.h

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2017-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+
* Copyright 2017-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License").
55
* You may not use this file except in compliance with the License.
@@ -43,13 +43,21 @@ class MockDirectiveSequencer : public avsCommon::sdkInterfaces::DirectiveSequenc
4343
removeDirectiveHandler,
4444
bool(std::shared_ptr<avsCommon::sdkInterfaces::DirectiveHandlerInterface> handler));
4545

46-
MOCK_METHOD1(setDialogRequestId, void(const std::string& dialogRequestId));
46+
inline void setDialogRequestId(const std::string& dialogRequestId) {
47+
m_dialogRequestId = dialogRequestId;
48+
};
49+
50+
inline std::string getDialogRequestId() {
51+
return m_dialogRequestId;
52+
};
4753

4854
MOCK_METHOD1(onDirective, bool(std::shared_ptr<avsCommon::avs::AVSDirective> directive));
4955

5056
MOCK_METHOD0(disable, void());
5157

5258
MOCK_METHOD0(enable, void());
59+
60+
std::string m_dialogRequestId;
5361
};
5462

5563
inline MockDirectiveSequencer::MockDirectiveSequencer() :

CapabilityAgents/AudioPlayer/include/AudioPlayer/PlayBehavior.h renamed to AVSCommon/AVS/include/AVSCommon/AVS/PlayBehavior.h

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2017-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+
* Copyright 2017-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License").
55
* You may not use this file except in compliance with the License.
@@ -13,17 +13,17 @@
1313
* permissions and limitations under the License.
1414
*/
1515

16-
#ifndef ALEXA_CLIENT_SDK_CAPABILITYAGENTS_AUDIOPLAYER_INCLUDE_AUDIOPLAYER_PLAYBEHAVIOR_H_
17-
#define ALEXA_CLIENT_SDK_CAPABILITYAGENTS_AUDIOPLAYER_INCLUDE_AUDIOPLAYER_PLAYBEHAVIOR_H_
16+
#ifndef ALEXA_CLIENT_SDK_AVSCOMMON_AVS_INCLUDE_AVSCOMMON_AVS_PLAYBEHAVIOR_H_
17+
#define ALEXA_CLIENT_SDK_AVSCOMMON_AVS_INCLUDE_AVSCOMMON_AVS_PLAYBEHAVIOR_H_
1818

19+
#include <string>
1920
#include <ostream>
2021

21-
#include <AVSCommon/SDKInterfaces/DialogUXStateObserverInterface.h>
2222
#include <AVSCommon/Utils/JSON/JSONUtils.h>
2323

2424
namespace alexaClientSDK {
25-
namespace capabilityAgents {
26-
namespace audioPlayer {
25+
namespace avsCommon {
26+
namespace avs {
2727

2828
/// Used to determine how a client must handle queueing and playback of a stream.
2929
enum class PlayBehavior {
@@ -107,8 +107,8 @@ inline bool convertToValue(const rapidjson::Value& documentNode, PlayBehavior* p
107107
return stringToPlayBehavior(text, playBehavior);
108108
}
109109

110-
} // namespace audioPlayer
111-
} // namespace capabilityAgents
110+
} // namespace avs
111+
} // namespace avsCommon
112112
} // namespace alexaClientSDK
113113

114-
#endif // ALEXA_CLIENT_SDK_CAPABILITYAGENTS_AUDIOPLAYER_INCLUDE_AUDIOPLAYER_PLAYBEHAVIOR_H_
114+
#endif // ALEXA_CLIENT_SDK_AVSCOMMON_AVS_INCLUDE_AVSCOMMON_AVS_PLAYBEHAVIOR_H_

AVSCommon/AVS/src/DialogUXStateAggregator.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2017-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+
* Copyright 2017-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License").
55
* You may not use this file except in compliance with the License.
@@ -103,6 +103,7 @@ void DialogUXStateAggregator::onStateChanged(SpeechSynthesizerObserverInterface:
103103
setState(DialogUXStateObserverInterface::DialogUXState::SPEAKING);
104104
return;
105105
case SpeechSynthesizerObserverInterface::SpeechSynthesizerState::FINISHED:
106+
case SpeechSynthesizerObserverInterface::SpeechSynthesizerState::INTERRUPTED:
106107
tryEnterIdleState();
107108
return;
108109
case SpeechSynthesizerObserverInterface::SpeechSynthesizerState::LOSING_FOCUS:
@@ -162,7 +163,8 @@ void DialogUXStateAggregator::tryEnterIdleStateOnTimer() {
162163
m_executor.submit([this]() {
163164
if (m_currentState != sdkInterfaces::DialogUXStateObserverInterface::DialogUXState::IDLE &&
164165
m_audioInputProcessorState == AudioInputProcessorObserverInterface::State::IDLE &&
165-
m_speechSynthesizerState == SpeechSynthesizerObserverInterface::SpeechSynthesizerState::FINISHED) {
166+
(m_speechSynthesizerState == SpeechSynthesizerObserverInterface::SpeechSynthesizerState::FINISHED ||
167+
m_speechSynthesizerState == SpeechSynthesizerObserverInterface::SpeechSynthesizerState::INTERRUPTED)) {
166168
setState(sdkInterfaces::DialogUXStateObserverInterface::DialogUXState::IDLE);
167169
}
168170
});

AVSCommon/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ add_library(AVSCommon SHARED
6767
Utils/src/Logger/ModuleLogger.cpp
6868
Utils/src/Logger/ThreadMoniker.cpp
6969
Utils/src/MacAddressString.cpp
70+
Utils/src/MediaPlayer/PooledMediaPlayerFactory.cpp
7071
Utils/src/Metrics.cpp
7172
Utils/src/Network/InternetConnectionMonitor.cpp
7273
Utils/src/RequiresShutdown.cpp

AVSCommon/SDKInterfaces/include/AVSCommon/SDKInterfaces/Audio/EqualizerConfigurationInterface.h

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+
* Copyright 2018-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License").
55
* You may not use this file except in compliance with the License.
@@ -73,6 +73,13 @@ class EqualizerConfigurationInterface {
7373
*/
7474
virtual int getMaxBandLevel() const = 0;
7575

76+
/**
77+
* Returns the default value of band value changes.
78+
*
79+
* @return The default value of band value changes.
80+
*/
81+
virtual int getDefaultBandDelta() const = 0;
82+
7683
/**
7784
* Returns @c EqualizerState object defining default values for equalizer mode and band levels. These values should
7885
* be used when resetting any band to its default level.

AVSCommon/SDKInterfaces/include/AVSCommon/SDKInterfaces/DirectiveSequencerInterface.h

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2017-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+
* Copyright 2017-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License").
55
* You may not use this file except in compliance with the License.
@@ -92,6 +92,14 @@ class DirectiveSequencerInterface : public utils::RequiresShutdown {
9292
*/
9393
virtual void setDialogRequestId(const std::string& dialogRequestId) = 0;
9494

95+
/**
96+
* Returns the @c dialogRequestId currently in use for Directive handling. This may be the empty string if
97+
* Directives have either experienced errors, or have been cancelled.
98+
*
99+
* @return dialogRequestId The current dialog request id.
100+
*/
101+
virtual std::string getDialogRequestId() = 0;
102+
95103
/**
96104
* Sequence the handling of an @c AVSDirective. The actual handling is done by whichever @c DirectiveHandler
97105
* is associated with the @c AVSDirective's (namespace, name) pair.

0 commit comments

Comments
 (0)