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 the RELEASE flag and adds optimizations with the -Os flag for a smaller build size.

A4B

Use the following CMake parameters to enable Alexa for Business (A4B).

Syntax:

cmake [absolute path to source] -DA4B=[ON|OFF]                                      

Parameters:

-DA4B=
Enable or disable A4B. Possible Values: ON,OFF. Default value: OFF. Turning on enables A4B, including support for RevokeAuthorization directives.

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 with DEBUG build enabled.

Wake word

Use the following CMake parameters to customize the wake word used by the SDK. The SDK supports the Sensory wake word engine.

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