AVS Device SDK CMake Parameters
CMake is a build tool that manages app dependencies and creates native make
files suitable for your Alexa Voice Service (AVS) Device SDK project.
This reference describes all the CMake parameters supported on the AVS Device SDK to customize how the SDK builds. Before you use these CMake commands, make sure you have set up your system with the required dependencies to build the AVS Device SDK.
Android
Use the following CMake parameters to enable and customize a build for Android.
ANDROID
Enables an Android build on an Android device or emulator.
Syntax:
cmake [absolute path to source] -DANDROID=[ON|OFF]
Parameters:
- -DANDROID=
- Enable or disable an Android build. Possible Values:
ON
,OFF
. Default value:ON
.
ANDROID_LOGGER
Publishes logs using the Android logging facility.
Syntax:
cmake [absolute path to source] -DANDROID_LOGGER=[ON|OFF]
Parameters:
- -DANDROID_LOGGER=
- Enable or disable Android logs. Possible Values:
ON
,OFF
. Default value:ON
.
ANDROID_MICROPHONE
Enable the Android Native Development Kit (NDK) Android microphone.
Syntax:
cmake [absolute path to source] -DANDROID_MICROPHONE=[ON|OFF]
Parameters:
- -DANDROID_MICROPHONE=
- Enable or disable the Android microphone. Possible Values:
ON
,OFF
. Default value:ON
.
ANDROID_DEVICE_INSTALL_PREFIX
The SDK installation path for the Android device or emulator.
Syntax:
cmake [absolute path to source] -DANDROID_DEVICE_INSTALL_PREFIX=[ON|OFF]
Parameters:
- -DANDROID_DEVICE_INSTALL_PREFIX=
- Possible Values:
ON
,OFF
. Default value:ON
.
Audio
Use the following CMake parameters to control audio in the SDK.
GSTREAMER
Enables a reference implementation of GStreamer to control media content, such as Amazon Music.
Syntax:
cmake [absolute path to source] -DGSTREAMER_MEDIA_PLAYER=[ON|OFF]
-DCMAKE_PREFIX_PATH=[absolute path to Gstreamer build]
Parameters:
- -DGSTREAMER_MEDIA_PLAYER=
- Enable or disable GStreamer. Possible Values:
ON
,OFF
. Default value:OFF
. - -DCMAKE_PREFIX_PATH=
- Optional. The absolute path to your GStreamer instance if you installed from source.
PORTAUDIO
Use the following CMake parameters to enable PortAudio so your microphone can capture data.
Syntax:
cmake [absolute path to source] -DPORTAUDIO=[ON|OFF]
-DPORTAUDIO_LIB_PATH=[path to the PortAudio library]
-DPORTAUDIO_INCLUDE_DIR=[path to the PortAudio directory]
Parameters:
- -DPORTAUDIO=
- Enable or disable PortAudio. Possible Values:
ON
,OFF
. Default value:ON
. - -DPORTAUDIO_LIB_PATH=
- The path to your PortAudio library. For example,
/home/pi/sdk-folder/third-party/portaudio/lib/.libs/libportaudio.a
- -DPORTAUDIO_INCLUDE_DIR=
- The path to your PortAudio library include directory. For example,
/home/pi/sdk-folder/third-party/portaudio/include
OPUS
Use the following CMake parameters to enable Opus – an interactive audio codec. To enable, you must install the libopus library.
Syntax:
cmake [absolute path to source] -DOPUS=[ON|OFF]
Parameters:
- -DOPUS=
- Enable or disable PortAudio. Possible Values:
ON
,OFF
. Default value:ON
.
ENABLE_SAMPLE_AES
Use the following CMake parameters to enable SAMPLE-AES decryption for HLS playlists. To enable, you must install the FFMPEG dependency.
Syntax:
cmake [absolute path to source] -DENABLE_SAMPLE_AES[ON|OFF]
-DFFMPEG_LIB_PATH=[absolute path to ffmpeg library]
-DFFMPEG_INCLUDE_DIR=[absolute path to ffmpeg include directory]
Parameters:
- -DENABLE_SAMPLE_AES=
- Enable or disable SAMPLE-AES decryption. Possible Values:
ON
,OFF
. Default value:OFF
. - -DFFMPEG_LIB_PATH=
- The path to your ffmpeg library.
- -DFFMPEG_INCLUDE_DIR=
- The path to your ffmpeg library include directory.
Bluetooth
Use the following CMake parameters to enable Bluetooth.
BLUETOOTH_BLUEZ
Bluetooth is optional and only available for Linux and Raspberry Pi. You must install the required dependencies before building with Bluetooth. Bluetooth builds using the BlueZ stack.
Syntax:
cmake [absolute path to source] -DBLUETOOTH_BLUEZ=[ON|OFF]
-DBLUETOOTH_BLUEZ_PULSEAUDIO_OVERRIDE_ENDPOINTS=[ON|OFF]
Parameters:
- -DBLUETOOTH_BLUEZ=
- Enable or disable the BlueZ Bluetooth stack. Possible Values:
ON
,OFF
. Default value:OFF
. - -DBLUETOOTH_BLUEZ_PULSEAUDIO_OVERRIDE_ENDPOINTS=
- Optional. Automates the loading and unloading of PulseAudio Bluetooth modules. If you enable this option, the SDK modifies the PulseAudio app. Possible Values:
ON
,OFF
. Default value:OFF
.
Build
Use the following CMake parameters to control how the SDK builds.
CMAKE_BUILD_TYPE
Choose the appropriate build type that best fits your requirements.
Syntax:
cmake [absolute path to source] -DCMAKE_BUILD_TYPE=[DEBUG|RELEASE|MINSIZEREL]
Parameters:
- -DCMAKE_BUILD_TYPE=
- Sets the build type. Possible Values:
DEBUG
,RELEASE
,MINSIZEREL
. Default value:RELEASE
.
•DEBUG
– Enables debug mode. Displays DEBUG logs by using the-g
compiler flag.
•RELEASE
– Enables release mode. Adds the-O2
optimization flag and removes the-g
logging flag.
•MINSIZEREL
– Compiles with theRELEASE
flag and adds optimizations with the-Os
flag for a smaller build size.
Captions
Use the following CMake parameters to enable captions through the Speak
Directive.
CAPTIONS
To use captions, you must also install the libwebvtt parsing library.
Syntax:
cmake [absolute path to source] -DCAPTIONS=[ON|OFF]
-DLIBWEBVTT_LIB_PATH[absolute path to webvtt library]
-DLIBWEBVTT_INCLUDE_DIR[absolute path to webvtt include]
Parameters:
- -DCAPTIONS=
- Enable or disable Captions. Possible Values:
ON
,OFF
. Default value:OFF
. IfCAPTIONS=ON
, you must also defineLIBWEBVTT_LIB_PATH
andLIBWEBVTT_INCLUDE_DIR
. - -DLIBWEBVTT_LIB_PATH=
- The absolute path to the directory containing the C header files of the libwebvtt library. For example,
webvtt/build/src/webvtt/libwebvtt.a
. - -DLIBWEBVTT_INCLUDE_DIR=
- The absolute path to the prebuilt static library for libwebvtt. For example,
webvtt/include
.
Endpoints
Use the following CMake parameters to enable endpoint controller capabilities in your build.
ENABLE_ALL
Syntax:
cmake [absolute path to source] -DENABLE_ALL_ENDPOINT_CONTROLLERS=[ON|OFF]
Parameters:
- -DENABLE_ALL_ENDPOINT_CONTROLLERS=
- Enable or disable all endpoints. Possible Values:
ON
,OFF
. Default value:OFF
. You must always toggle this command toON
, even if you only want to turn on a single endpoint.
TOGGLE_CONTROLLER
Syntax:
cmake [absolute path to source] -DENABLE_ALL_ENDPOINT_CONTROLLERS=[ON|OFF]
-DENDPOINT_CONTROLLERS_TOGGLE_CONTROLLER=[ON|OFF]
Parameters:
- -DENABLE_ALL_ENDPOINT_CONTROLLERS=
- Enable or disable endpoints. Possible Values:
ON
,OFF
. Default value:OFF
. - -DENDPOINT_CONTROLLERS_TOGGLE_CONTROLLER=
- Enable or disable capability controller endpoints. Possible Values:
ON
,OFF
. Default value:OFF
.
MODE_CONTROLLER
Syntax:
cmake [absolute path to source] -DENABLE_ALL_ENDPOINT_CONTROLLERS=[ON|OFF]
-DENDPOINT_CONTROLLERS_MODE_CONTROLLER=ON=[ON|OFF]
Parameters:
- -DENABLE_ALL_ENDPOINT_CONTROLLERS=
- Enable or disable endpoints. Possible Values:
ON
,OFF
. Default value:OFF
. - -DENDPOINT_CONTROLLERS_MODE_CONTROLLER=ON=
- Enable or disable mode controller endpoints. Possible Values:
ON
,OFF
. Default value:OFF
.
RANGE_CONTROLLER
Syntax:
cmake [absolute path to source] -DENABLE_ALL_ENDPOINT_CONTROLLERS=[ON|OFF]
-DENDPOINT_CONTROLLERS_RANGE_CONTROLLER=[ON|OFF]
Parameters:
- -DENABLE_ALL_ENDPOINT_CONTROLLERS=
- Enable or disable endpoints. Possible Values:
ON
,OFF
. Default value:OFF
. - -DENDPOINT_CONTROLLERS_RANGE_CONTROLLER=
- Enable or disable range controller endpoints. Possible Values:
ON
,OFF
. Default value:OFF
.
POWER_CONTROLLER
Syntax:
cmake [absolute path to source] -DENABLE_ALL_ENDPOINT_CONTROLLERS=[ON|OFF]
-DENDPOINT_CONTROLLERS_POWER_CONTROLLER=[ON|OFF]
Parameters:
- -DENABLE_ALL_ENDPOINT_CONTROLLERS=
- Enable or disable all endpoints. Possible Values:
ON
,OFF
. Default value:OFF
- -DENDPOINT_CONTROLLERS_POWER_CONTROLLER=
- Enable or disable power controller endpoints. Possible Values:
ON
,OFF
. Default value:OFF
.
Logs
Use the following CMake parameters to control how the SDK manages logs.
To specify a debug log level, append the DEBUG
command when you invoke the sample app. You can set a DEBUG
value from 1
to 9
.
For example
./SampleApp/src/SampleApp ./Integration/AlexaClientSDKConfig.json DEBUG9
EMIT_SENSITIVE_LOGS
Syntax:
cmake [absolute path to source] -DACSDK_EMIT_SENSITIVE_LOGS=[ON|OFF]
Parameters:
- -DACSDK_EMIT_SENSITIVE_LOGS=
- Enable of disable logging of sensitive data. For example, usernames, client IDs, or refresh tokens. Possible Values:
ON
,OFF
. Default value:OFF
. Only available withDEBUG
build enabled.
EMIT_CURL_LOGS
Syntax:
cmake [absolute path to source] -DACSDK_EMIT_CURL_LOGS=[ON|OFF]
Parameters:
- -DACSDK_EMIT_CURL_LOGS=
- Enable or disable the CURL. Possible Values:
ON
,OFF
. Default value:OFF
. Only available withDEBUG
build enabled.
Metrics
METRICS
Syntax:
cmake [absolute path to source] -DMETRICS=[ON|OFF]
Parameters:
- -DMETRICS=
- Enable metrics. Possible Values:
ON
,OFF
. Default value:OFF
.
Wake word
Use the following CMake parameters to customize the wake word used by the SDK.
KEY_WORD_DETECTOR
Syntax:
cmake [absolute path to source] -DSENSORY_KEY_WORD_DETECTOR=ON
-DSENSORY_KEY_WORD_DETECTOR_LIB_PATH=[absolute path to library]
-DSENSORY_KEY_WORD_DETECTOR_INCLUDE_DIR=[absolute path to include directory]
Parameters:
- -DSENSORY_KEY_WORD_DETECTOR=
- Enable or disable the Sensory wake word engine. Possible Values:
ON
,OFF
. Default value:OFF
. - -DSENSORY_KEY_WORD_DETECTOR_LIB_PATH=
- Path to the sensory wake word detector library.
- -DSENSORY_KEY_WORD_DETECTOR_INCLUDE_DIR=
- Path to the sensory wake word detector include directory
Last updated: Oct 07, 2021