|
||
---|---|---|
.. | ||
ACL | ||
ADSL | ||
AFML | ||
AVSCommon | ||
AVSGatewayManager | ||
ApplicationUtilities | ||
BluetoothImplementations | ||
CapabilitiesDelegate | ||
CapabilityAgents | ||
Captions | ||
CertifiedSender | ||
ContextManager | ||
Diagnostics | ||
Endpoints | ||
Integration | ||
InterruptModel | ||
MediaPlayer | ||
Metrics | ||
PlaylistParser | ||
SampleApp | ||
Settings | ||
SpeechEncoder | ||
Storage | ||
SynchronizeStateSender | ||
ThirdParty | ||
applications | ||
capabilities | ||
cmakeBuild | ||
core | ||
doc | ||
extension | ||
shared | ||
tools | ||
CHANGELOG.md | ||
CMakeLists.txt | ||
CONTRIBUTING.md | ||
LICENSE.txt | ||
NOTICE.txt | ||
README.md | ||
SECURITY.md | ||
issue_template.md | ||
pkg-config.pc.cmake |
README.md
CMake configure command(with wake word sdk):
cmake $HOME/avs-dev/avs-device-sdk -DCMAKE_INSTALL_PREFIX=/data/avs \
-DGSTREAMER_MEDIA_PLAYER=ON \
-DASPMIC=ON \
-DCMAKE_BUILD_TYPE=DEBUG \
-DPKCS11=OFF \
-DASPMIC_INCLUDE_DIR=../avs-device-sdk/extension/mic-asp-sdk/include \
-DCURL_INCLUDE_DIR=/usr/local/oecore-x86_64/sysroots/aarch64-poky-linux/usr/include/curl \
-DCURL_LIBRARY=/usr/local/oecore-x86_64/sysroots/aarch64-poky-linux/usr/lib64/libcurl.so \
-DLibArchive_INCLUDE_DIR=/usr/local/oecore-x86_64/sysroots/aarch64-poky-linux/usr/include \
-DLibArchive_LIBRARY=/usr/local/oecore-x86_64/sysroots/aarch64-poky-linux/usr/lib64/libarchive.so \
-DAMAZONLITE_KEY_WORD_DETECTOR=ON \
-DAMAZONLITE_KEY_WORD_DETECTOR_LIB_PATH=$HOME/avs-dev/avs-device-sdk/extension/avs-weakup-sdk/aarch64-tuya-mt8516/PRL2000/libpryon_lite-PRL2000.a \
-DAMAZONLITE_KEY_WORD_DETECTOR_INCLUDE_DIR=$HOME/avs-dev/avs-device-sdk/extension/avs-weakup-sdk/aarch64-tuya-mt8516 \
-DEXTENSION_PATH=$HOME/avs-dev/avs-device-sdk/extension/avs-cpp-sdk/KWD
CMake configure for Clion(with wake word sdk):
- aarch64-poky-linux Platform
-DCMAKE_INSTALL_PREFIX=/data/avs
-DBUILD_TESTING=OFF
-DGSTREAMER_MEDIA_PLAYER=ON
-DASPMIC=ON
-DCMAKE_BUILD_TYPE=DEBUG
-DPKCS11=ON
-DBUILD_TESTING=OFF
-DAUTH_MANAGER=ON
-DASSET_MANAGER=ON
-DCOMPANION_APP_AUTH=ON
-DASPMIC_INCLUDE_DIR=../srcs/extension/mic-asp-sdk/include
-DCURL_INCLUDE_DIR=/usr/local/oecore-x86_64/sysroots/aarch64-poky-linux/usr/include/curl
-DCURL_LIBRARY=/usr/local/oecore-x86_64/sysroots/aarch64-poky-linux/usr/lib64/libcurl.so
-DLibArchive_INCLUDE_DIR=/usr/local/oecore-x86_64/sysroots/aarch64-poky-linux/usr/include
-DLibArchive_LIBRARY=/usr/local/oecore-x86_64/sysroots/aarch64-poky-linux/usr/lib64/libarchive.so
-DAMAZONLITE_KEY_WORD_DETECTOR=ON
-DAMAZONLITE_KEY_WORD_DETECTOR_LIB_PATH=../srcs/extension/avs-weakup-sdk/aarch64-tuya-mt8516/PRL2000/libpryon_lite-PRL2000.a
-DAMAZONLITE_KEY_WORD_DETECTOR_INCLUDE_DIR=../srcs/extension/avs-weakup-sdk/aarch64-tuya-mt8516
-DEXTENSION_PATH=../srcs/extension/avs-cpp-sdk/KWD
- x86_64 Platform
-DCMAKE_INSTALL_PREFIX=/data/avs_x86
-DGSTREAMER_MEDIA_PLAYER=ON
-DCOMPANION_APP_AUTH=ON
-DBUILD_TESTING=OFF
-DPORTAUDIO=ON
-DPKCS11=ON
-DCMAKE_BUILD_TYPE=DEBUG
-DPORTAUDIO_LIB_PATH=/usr/local/lib/libportaudio.so
-DPORTAUDIO_INCLUDE_DIR=/home/hx/development/avs-device-sdk-x86/my_project/third-party/portaudio/include
-DCURL_INCLUDE_DIR=/home/hx/development/avs-device-sdk-x86/my_project/third-party//curl-7.83.1/include/curl
-DCURL_LIBRARY=/usr/local/lib/libcurl.so
Step support AVS SoftHSM PCKS11 manager token security?
- Setup softhsm2 work directory.
mkdir -p /data/.softhsm2/tokens chmod -R 700 /data/.softhsm2 echo "directories.tokendir = /data/.softhsm2/tokens" > /data/.softhsm2/softhsm2.conf
- Set environment variable to configure token environment, change the ACSDK_PKCS11_TOKEN, ACSDK_PKCS11_MAIN_KEY, ACSDK_PKCS11_SO_PIN, ACSDK_PKCS11_PIN value by yourself.
export SOFTHSM_PATH=/usr/lib64/softhsm/libsofthsm2.so export SOFTHSM2_CONF="/data/.softhsm2/softhsm2.conf" export ACSDK_PKCS11_TOKEN=ACSDKTOKEN export ACSDK_PKCS11_MAIN_KEY=ACSDK1260 export ACSDK_PKCS11_SO_PIN=avs126 export ACSDK_PKCS11_PIN=12345678
- Initialize the SoftHSM token using softhsm2-util CLI command as follows
softhsm2-util --init-token --slot 0 --label $ACSDK_PKCS11_TOKEN --so-pin $ACSDK_PKCS11_SO_PIN --pin $ACSDK_PKCS11_PIN
- Verify the SoftHSM and list the initialized token slot using OpenSC pkcs11-tool
pkcs11-tool --module $SOFTHSM_PATH --list-slots
- To generate the AES-256 key
pkcs11-tool --module $SOFTHSM_PATH --login \ --pin $ACSDK_PKCS11_PIN \ --token-label $ACSDK_PKCS11_TOKEN --keygen \ --key-type aes:32 --private --sensitive \ --label $ACSDK_PKCS11_MAIN_KEY
- To verify the generated master key object residing in the SoftHSM keystore (PKCS#11 slot)
pkcs11-tool --module $SOFTHSM_PATH \ --login --pin $ACSDK_PKCS11_PIN \ --token-label $ACSDK_PKCS11_TOKEN -LO
- Set CMake compiler options "-DPKCS11=ON", reconfigure project and build it.
- Modify AlexaClientSDKConfig.json file, add pcks11 item:
"pkcs11Module":{ "libraryPath":"/usr/lib64/softhsm/libsofthsm2.so", "tokenName":"ACSDKTOKEN", "userPin":"12345678", "defaultKeyName":"ACSDK1260" },
How to use message middleware for avs SampleApp and config_app
x86_64 platform
sudo apt install libzmq3-dev
aarch64 mt8516 device
- Download newest image and burn it to device.
- Download newest cross compile tools and install it.
- Select one of SampleApp and config_app for server, then the other is client.
- Reference demo how to use.
- Sample Code
- Client Sample
int nSend = 0, nRecv = 0; int ret; ret = msg_client_init(); if(ret != ERR_MSG_OK) { printf("msg_client_init error: %d\n", ret); return -1; } while (1) { unsigned char* pMsg = NULL; char buf[1024]; memset(buf, 0, 1024); sprintf(buf, "client: send message time %d", nSend++); client_send_msg((const unsigned char*)buf, (int)strlen(buf)); client_recv_msg(&pMsg, &nRecv); if (nRecv > 0) { memcpy(buf, pMsg, nRecv); buf[nRecv] = 0; printf("client: Receive [%s]\n", buf); } if (pMsg) { free(pMsg); } sleep(1); }
- Server Sample
int nSend = 0, nRecv = 0; int ret; ret = msg_server_init(); if(ret != ERR_MSG_OK) { printf("msg_server_init error: %d", ret); return -1; } while (1) { unsigned char* pMsg = NULL; char buf[1024]; memset(buf, 0, 1024); sprintf(buf, "server: send message time %d", nSend++); server_send_msg((const unsigned char*)buf, (int)strlen(buf)); server_recv_msg(&pMsg, &nRecv); if (nRecv > 0) { memcpy(buf, pMsg, nRecv); buf[nRecv] = 0; printf("server: Receive [%s]\n", buf); } if (pMsg) { free(pMsg); } sleep(1); }
What is the Alexa Voice Service (AVS)?
The Alexa Voice Service (AVS) enables developers to integrate Alexa directly into their products, bringing the convenience of voice control to any connected device. AVS provides developers with access to a suite of resources to build Alexa-enabled products, including APIs, hardware development kits, software development kits, and documentation.
What is the AVS Device SDK
The Alexa Voice Service (AVS) Device SDK provides you with a set of C ++ libraries to build an Alexa Built-in product, meaning your device has direct access to cloud-based Alexa capabilities to receive voice responses instantly. Your device can be almost anything – a smartwatch, a speaker, headphones – the choice is yours.
Release Notes and Known Issues
Feature enhancements, updates, and resolved issues from all releases are available on the Amazon developer portal.
Get Started
You can set up the SDK on the following platforms:
SDK Architecture
The SDK is modular and abstract. It provides separate components to handle necessary Alexa functionality including processing audio, maintaining persistent connections, and managing Alexa interactions. Each component exposes Alexa APIs to customize your device integrations as needed. The SDK also includes a Sample App, so you can test interactions before integration.
API References
View the C++ API References for detailed information about implementation.
Security Best Practices and Important Considerations
All Alexa products should adopt the Security Best Practices for Alexa.
When building Alexa with the SDK, you should also adhere to the following security principles.