Falcon - Intro

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 20

Raspberry Pi Environment

Falcon Demo

CONFIDENTIAL
Demo Unit: RPi environment
• 5 components to the RPi environment
• AVS code
- .asoundrc
• DOA LED code
• Trigger Engine
• Falcon - Linux Driver
• Host Demo Code
- Thin Client

© 2018 SYNAPTICS INCORPORATED CONFIDENTIAL 2


Raspberry Pi (RPi) Environment

© 2018 SYNAPTICS INCORPORATED CONFIDENTIAL 3


RPi Environment: AVS Device SDK
• The Alexa Voice Service (AVS) Device SDK is used to connect to Amazon’s
intelligent voice recognition and natural language understanding service.
• The AVS Device SDK provide C++ based libraries that leverage the AVS API
to create device software for Alexa-enabled products.
• For more information, please visit Amazon’s GitHub at:
• https://github.com/alexa/avs-device-sdk

© 2018 SYNAPTICS INCORPORATED CONFIDENTIAL 4


RPi Environment: AVS Device SDK
• Synaptics has its own GitHub, where it has Amazon’s SDK plus the additions
made in order to support our device’s features.
• Any updates to the AVS code and installation instructions are be posted on
our GitHub.
• https://github.com/conexant/avs-device-sdk
• For troubleshooting issues you may see related to the AVS code, refer to:
• https://github.com/alexa/avs-device-sdk/issues

• Currently, the code on our GitHub is the version 1.3 (while the code on
Alexa’s GitHub is version 1.6), and it doesn’t include the support for the
Falcon’s EVK, yet.

© 2018 SYNAPTICS INCORPORATED CONFIDENTIAL 5


RPi Environment: AVS Device SDK
• Currently, Synaptics’ GitHub has AVS 1.3. One of the major changes being
introduced in AVS 1.6, was the addition of Echo Spatial Perception (ESP)
support, but since our devices’ FW don’t support it, yet, we haven’t updated
our GitHub. This is currently a work in progress.
• Additional changes from AVS 1.3 to 1.6:
• Added Windows SDK support.
• Added support AU and NZ to the SampleApp.
• Added the Notifications Capability Agent.
• Added the ExternalMediaPlayer Capabitility Agent.
• For the full changelog, please visit:
• https://github.com/alexa/avs-device-sdk/blob/master/CHANGELOG.md

© 2018 SYNAPTICS INCORPORATED CONFIDENTIAL 6


RPi Environment: AVS Device SDK
The Advanced Linux Sound Architecture (ALSA) is a suite of hardware drivers,
libraries and utilities which provide audio and MIDI functionality for the Linux
operating system.

What is a .asoundrc file?


• This file is the configuration files for ALSA drivers. The main uses are:
- Add functionality such as routing and sample-rate conversion.
- Allows to create a personalized configuration for a sound card.
• Where could you find this file?
- Typically, it’s installed in the user’s home directory (‘/home/pi/’).

© 2018 SYNAPTICS INCORPORATED CONFIDENTIAL 7


RPi Environment: AVS Device SDK
Mic configuration:
• Selection of the capture card device.
• Sample rate: 16ksps.
• Number of channels: 2.
• Route the audio to the correct channel.

Separating the left and right data from the


audio stream

Speaker configuration:
• Selection of the playback card device.
• Set the left channel of the mics.

© 2018 SYNAPTICS INCORPORATED CONFIDENTIAL 8


Hands on!
• Installing the AVS code is done by using an installation script and answering
questions about the type of device you are installing the AVS code for.
• For installing the AVS code, please use the following commands:
1. Change the current directory to the AVS’ directory:
- cd avs
2. Execute the installation script:
- bash install.sh
3. Provide the Amazon account credentials:
- Client Secret
- Client ID
- Product ID

© 2018 SYNAPTICS INCORPORATED CONFIDENTIAL 9


Hands on!
5. Please select the following options:
• [3] 4-Mic EVK V2.0
• [3] GPIO
• [1] Single Stage
6. When the setup is complete, you will see a message prompting you to open a browser and go to
http://localhost:3000
• When you navigate to the page, you will be asked to login with your Amazon account
credentials.
7. Once you have logged in to your Amazon account, you should see the following message in the
terminal.
• You’re all done! Reboot and try running run.sh in your home directory.
8. You are done with the setup and ready to run the sample app!

© 2018 SYNAPTICS INCORPORATED CONFIDENTIAL 10


RPi Environment: DOA LED code
The Direction of Arrival (DOA) LED code for Galaxy is a feature that estimates
the location of the speech source. It uses a circular array of LEDs as a visual
indicator of the location.

© 2018 SYNAPTICS INCORPORATED CONFIDENTIAL 11


RPi Environment: DOA LED code
• The DOA LED code is made by Synaptics, and is included as part of the
AVS code on our GitHub.
• The code is responsible for displaying the DOA information received from
Galaxy FW and the animations depending on the state of the AVS code.
• For example, in the ‘Thinking’ state, the LEDs go around the board and in the ‘Speaking’ state,
the LEDs dim and brighten.

© 2018 SYNAPTICS INCORPORATED CONFIDENTIAL 12


RPi Environment: DOA LED Code
• The MIC/LED board used in the demo unit (EVK V2.0) is not the same as
what was used for the EVK V1.0, so the LED code is also different.
4-MIC EVK V2.0 4-MIC EVK V1.0
24 32
LED LED

© 2018 SYNAPTICS INCORPORATED CONFIDENTIAL 13


RPi Environment: DOA LED Code
• Galaxy’s FW is sending the position information through the PWM
RPi.GPIO, where the Host Demo Code is processing this data, and sending
a command to the DOA LED Code about where the speech source is
located.
• This Host Demo Code is different as the one for Falcon. This is meant for
Galaxy and Nebula, where is may also:
• Get current mode.
• List of available tune modes
• Get FW version number
• Get product serial number
• Switch mode

© 2018 SYNAPTICS INCORPORATED CONFIDENTIAL 14


RPi Environment: Trigger Engine
• The trigger engine is responsible for detecting/recognizing the keyword, in
this case, ‘Alexa’. The keyword may be embedded in sentences and
surrounded by noise.
• Current options for the trigger are:
• Sensory running on Nebula/Galaxy FW or SW.
• Snowboy running on SW.
• Aurora running on Nebula/Galaxy FW or SW.
• In the demo unit, we will use our trigger engine “Aurora”, which is running on
the RPi (SW). In the future, it’s going to be embedded in the Galaxy FW and
the detection will be via a GPIO Trigger Event.

© 2018 SYNAPTICS INCORPORATED CONFIDENTIAL 15


RPi Environment: Falcon-Linux Driver
• The driver is the interface between the Falcon device and the Linux
environment (in this case, RPi).
• It’s needed to initialize “Falcon” through the I2C connection between the device and the RPi.
• Also exposes the “Falcon” device as an playback I2S audio codec.
• The Falcon device and Linux driver communicate:
• I2C: Host Control Interface, used to access registers within the device.
• I2S: Host Audio Interface:
- Audio speaker stream (from host)
- Audio AEC reference stream (to “Galaxy”)

© 2018 SYNAPTICS INCORPORATED CONFIDENTIAL 16


RPi Environment: Falcon-Linux Driver
• The Linux driver created for Falcon is different from the driver for Solana
• Different register addresses.
• The new driver module is being compiled with kernel header, instead of the whole kernel tree
as before.
• Falcon’s Linux Driver installation takes about 5 minutes, meanwhile,
Solana’s Linux Driver installation may take about 2 hours!
• The driver will be built on the RPi, no other Linux environment is necessary.
• The caf_tuning tool can communicate with the driver and be used to
configure/tune Falcon through a graphical interface.

© 2018 SYNAPTICS INCORPORATED CONFIDENTIAL 17


Hands on!
• In the future, the Falcon-Linux driver will be on our GitHub.
• For installing the Falcon Linux Driver, please use the following commands:
1. Change the current directory to the Falcon’s Linux Driver directory:
- cd cx9000_install
2. Execute the installation script:
- bash install_drv.sh
3. Wait until the installation is done, then Reboot.
4. Open a terminal (Ctrl + Alt + t)
5. To verify that the driver was actually installed, run the command:
- aplay –l
- You should see the audio playback device as:
**** List of PLAYBACK Hardware Devices ****
card 0: cxsmartspeaker2 [cx-smart-speaker2], device 0: bcm2835-i2s-cx9000-amplifier
cx9000-amplifier-0 []
Subdevices: 1/1
Subdevice #0: subdevice #0

© 2018 SYNAPTICS INCORPORATED CONFIDENTIAL 18


RPi Environment: Thin Client
• This tool translates golem commands received via TCP/IP interface and
sends the appropriate control commands to Synaptics DSP chip and/or
Synaptics Codec chip.
• Basically, it’s the bridge between the Tuning GUI and the Linux Driver.

© 2018 SYNAPTICS INCORPORATED CONFIDENTIAL 19


Hands on!
• You are going to receive a package such as:

• After uncompressing the package, you will have the following folders:

• Transfer the entire host_demo_code directory over to the Linux host side.
• Instructions for installing the host demo code can be found in
/host_demo_code/thin_client/README.txt

© 2018 SYNAPTICS INCORPORATED CONFIDENTIAL 20

You might also like