-
Notifications
You must be signed in to change notification settings - Fork 610
Linux Reference Guide
This guide assumes familiarity with Linux and requires you to build dependencies from source.
Follow these steps:
-
Register an AVS Product and Create a Security Profile, if you haven't already. It must be enabled for Code-Based Linking.
-
Install the Dependencies.
-
Set up your build environment by creating these folders: build, source, third-party, application-necessities > sound-files. Note: the SDK must be built out-of-source.
-
Clone the AVS Device SDK into your source folder:
git clone https://github.com/alexa/avs-device-sdk.git
Then proceed to build the AVS Device SDK.
Navigate to your build folder, and use Came to configure and build the SDK. You can customize your build of the SDK by introducing different Cmake parameters for a additional configuration options.
In the following build example:
- It declares that PortAudio is used to capture microphone data and points to its lib path and directory.
- It declares that gstreamer is installed and will be used when you build the sample app.
- It declares that the wake word detector is OFF.
cmake /{source}/avs-device-sdk \
-DSENSORY_KEY_WORD_DETECTOR=OFF \
-DGSTREAMER_MEDIA_PLAYER=ON \
-DPORTAUDIO=ON \
-DPORTAUDIO_LIB_PATH=/{PATH TO PORTAUDIO}/lib/.libs/libportaudio.a \
-DPORTAUDIO_INCLUDE_DIR=/{PATH TO PORTAUDIO}/include
make
Linux supports wake word detectors from Sensory and Kitt.ai. Each requires a license from the provider. For instructions to build with a wake word detector, please see Cmake parameters.
Building with Bluetooth is optional, and is currently limited to Linux and Raspberry Pi. The A2DP-SINK
, A2DP-SOURCE
, AVRCPTarget
, and AVRCPController
profiles are supported for Linux/Ubuntu.
To enable Bluetooth on Linux, follow these steps:
- Install dependencies: In order to use Bluetooth, you must install these dependencies:
- Core Bluetooth dependencies
- libpulse-dev
- PulseAudio
- PulseAudio bluetooth modules:
sudo apt-get install pulseaudio-module-bluetooth
- Include the following CMake option in your build:
BLUETOOTH_BLUEZ_PULSEAUDIO_OVERRIDE_ENDPOINTS
- AVRCPTarget (if applicable)
If you are using the AVRCPTarget
profile, you'll need to enable permissions for BlueZ to interact with "org.mpris.MediaPlayer2.Player"
.
To do this, open /etc/dbus-1/system.d/bluetooth.conf and add <allow send_interface="org.mpris.MediaPlayer2.Player"/>
to your root policy.
For example:
<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
"http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
<busconfig>
<!-- ../system.conf have denied everything, so we just punch some holes -->
<policy user="root">
...
<allow send_interface="org.mpris.MediaPlayer2.Player"/>
</policy>
...
</busconfig>
Debug logs are available in Debug builds. You can enable them by including Cmake variable:
cmake < other cmake parameters > -DCMAKE_BUILD_TYPE=DEBUG
An additional sample app command line parameter allows you to select the level of debug logging to be output. The allowed values are DEBUG0, DEBUG1, ... DEBUG9, where DEBUG9 provides the most information. For example:
./SampleApp/src/SampleApp ./Integration/Integration/AlexaClientSDKConfig.json DEBUG9
After you have built the SDK, you'll need to configure and authorize it to access AVS using Login with Amazon (LWA). To do this, follow these authorization instructions.
After you've authorized your sample app, run integration and unit tests to ensure that the AVS Device SDK is functioning as designed.
- Use this command to run integration tests:
make all integration
- Use this command to run unit tests:
make all test
For additional details, see Unit and Integration Tests.
You can designate aliases to launch the sample app. To do this:
- Open
~/.bash_profile
, and add these aliases and save:
IMPORTANT: Make sure you update the paths to match your folder structure.alias alexac="{path_to}/{build}/SampleApp/src/SampleApp {path_to}/{build}/Integration/AlexaClientSDKConfig.json" alias alexacdebug="{path_to}/{build}/SampleApp/src/SampleApp {path_to}/{build}/Integration/AlexaClientSDKConfig.json DEBUG9"
- After you've added these aliases, make sure to activate your
~/.bash_profile
:source ~/.bash_profile
- Now to launch the sample app, you can run this command:
alexac
API Reference
Quick-start Guides
- All Quick-start Guides
- For Android
- Cross-compile for iOS
- Generic Linux
- For macOS
- For Raspberry Pi
- For Ubuntu Linux
- For Windows 64-bit
Other Guides + Optimizations
- Authorizing AVS Device SDK Software with AVS
- Build libcurl with mbed TLS and nghttp2
- Build libcurl with nghttp2 for macOS
- Optimize libcurl for Size
- Runtime Configuration for CA Certificates
- Updating the SDK
Development Kits
Resources