Skip to content

Commit

Permalink
Merge pull request #41 from xmos/v2.3.0
Browse files Browse the repository at this point in the history
Merge v2.3.0
  • Loading branch information
xluciano authored Nov 8, 2021
2 parents 0aab04d + b194fe8 commit 741ad01
Show file tree
Hide file tree
Showing 3 changed files with 71 additions and 50 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# VocalFusion AVS Setup Change Log

## 2.3.0

* Added support for xvf3615
* Added support for KWD using GPIO2 pin

## 2.2.0

* Support for all xvf3600 master and slave products
Expand Down
61 changes: 34 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,34 +2,36 @@

This repository provides a simple-to-use automated script to install the Amazon AVS SDK on a Raspberry Pi and configure the Raspberry Pi to use the appropriate **xCORE VocalFusion Kit for Amazon AVS**.

The XMOS **xCORE VocalFusion Kit for Amazon AVS** provides far-field voice capture using one of the XMOS XVF3000, XVF3100, XVF3500 or XVF3510 voice processors.
The XMOS **xCORE VocalFusion Kit for Amazon AVS** provides far-field voice capture using one of the XMOS XVF3000, XVF3100, XVF3500, XVF3510 OR XVF3610 voice processors.

Combined with a Raspberry Pi running the Amazon Alexa Voice Service (AVS) Software Development Kit (SDK), these kits allow you to quickly prototype and evaluate talking with Alexa.

To find out more, visit: https://www.xmos.ai/vocalfusion-voice-interfaces/ (XVF3510/3500)
or https://www.xmos.ai/vocalfusion-conference-calling/ (XVF3100/3000)
To find out more, visit: https://www.xmos.ai/vocalfusion-voice-interfaces/ (XVF3610/3500),
https://www.xmos.ai/xvf3510/ (XVF3510)
or https://www.xmos.ai/vocalfusion-conference-calling/ (XVF3100/3000)
and: https://developer.amazon.com/alexa-voice-service

## Prerequisites
You will need:

- Either

**xCORE VocalFusion XVF3510 Kit for Amazon AVS**: XK-VF3510-L71, or
**xCORE VocalFusion Stereo 4-Mic Kit for Amazon AVS**: XK-VF3500-L33-AVS, or
**xCORE VocalFusion XVF6510 Kit for Amazon AVS**: XK-VOICE-L71, or
**xCORE VocalFusion XVF3510 Kit for Amazon AVS**: XK-VF3510-L71, or
**xCORE VocalFusion Stereo 4-Mic Kit for Amazon AVS**: XK-VF3500-L33-AVS, or
**xCORE VocalFusion 4-Mic Kit for Amazon AVS**: XK-VF3000-L33-AVS

- Either

Raspberry Pi 3 with Micro-USB power supply (min. 2A) and HDMI cable, or
Raspberry Pi 3 with Micro-USB power supply (min. 2A) and HDMI cable, or
Raspberry Pi 4 with USB-C power supply (min. 3A) and Micro HDMI to Standard HDMI (A/M) Cable

- MicroSD card (min. 16GB)
- Powered speakers with audio 3.5mm analogue plug

Stereo for the XVF3510 and XVF3500, or
Stereo for the XVF3610, XVF3510 and XVF3500, or
Mono for the XVF3100 and XVF3000

- Monitor with HDMI input
- USB keyboard and mouse
- Fast-Ethernet connection or WiFi with internet connectivity
Expand All @@ -39,19 +41,21 @@ You will also need an Amazon Developer account: https://developer.amazon.com
## Hardware Setup
Set up your hardware by following the **Hardware Setup Guide** for your product.

XVF3510: https://www.xmos.ai/file/xvf3510-dev-kit-setup-guides
XVF3500: https://www.xmos.ai/file/xvf3500-dev-kit-setup-guides
XVF3100: https://www.xmos.ai/file/xvf3000-3100-dev-kit-setup-guides
XVF3000: https://www.xmos.ai/file/xvf3000-3100-dev-kit-setup-guides
XVF3610: https://www.xmos.ai/file/xvf3610-dev-kit-setup-guides
XVF3510: https://www.xmos.ai/file/xvf3510-dev-kit-setup-guides
XVF3500: https://www.xmos.ai/file/xvf3500-dev-kit-setup-guides
XVF3100: https://www.xmos.ai/file/xvf3000-3100-dev-kit-setup-guides
XVF3000: https://www.xmos.ai/file/xvf3000-3100-dev-kit-setup-guides

## Firmware Upgrade
Once the hardware is setup, upgrade the firmware on your AVS development kit. The firmware can be found here:
Once the hardware is setup, upgrade the firmware on your AVS development kit. The firmware can be found here:

XVF3610: https://www.xmos.ai/file/xvf3610-int-release
XVF3510: https://www.xmos.ai/file/xvf3510-int-release
XVF3500: https://www.xmos.ai/file/vocalfusion-stereo-evaluation-binaries
XVF3100: https://www.xmos.ai/file/vocalfusion-speaker-evaluation-binaries
XVF3000: https://www.xmos.ai/file/vocalfusion-speaker-evaluation-binaries

XVF3510: https://www.xmos.ai/file/xvf3510-int-release
XVF3500: https://www.xmos.ai/file/vocalfusion-stereo-evaluation-binaries
XVF3100: https://www.xmos.ai/file/vocalfusion-speaker-evaluation-binaries
XVF3000: https://www.xmos.ai/file/vocalfusion-speaker-evaluation-binaries

To upgrage the firmware you will need the XMOS xTAG adapter https://www.xmos.ai/xtag-debug-adapter/

## Create a Raspberry Pi system disk
Expand All @@ -65,12 +69,12 @@ Then, install the Raspberry Pi Imager on a host computer. Raspberry Pi Imager is

https://www.raspberrypi.org/software/

Run the Raspberry Pi Imager, and select the 'CHOOSE OS' button. Scroll to the bottom of the displayed list, and select "Use custom".
Run the Raspberry Pi Imager, and select the 'CHOOSE OS' button. Scroll to the bottom of the displayed list, and select "Use custom".
Then select the file downloaded above (2020-02-13-raspbian-buster.zip) and select "Open". The archive file does not have to be unzipped, the imager software will do that.

Select the CHOOSE SD CARD button to which to download the image, and then select the "WRITE" button.

When prompted, remove the written SD card and insert it into the Raspberry Pi.
When prompted, remove the written SD card and insert it into the Raspberry Pi.

Connect up the keyboard, mouse, speakers and display to the Raspberry Pi and power up the system. Refer to the **Getting Started Guide** for your platform.

Expand All @@ -91,7 +95,7 @@ When the Raspberry Pi boots up, give these answers to the following questions:
1. Open a terminal window on the Raspberry Pi desktop and clone the vocalfusion-avs-setup repository:

```git clone https://github.com/xmos/vocalfusion-avs-setup```

**DO NOT** use the command 'apt update' to update the software database. This will cause the installation to fail. **DO NOT** update the kernel, as this will cause the audio sub-sytem to fail.

2. Register an AVS product, create a security profile and save a *config.json* file by following https://developer.amazon.com/en-US/docs/alexa/alexa-voice-service/register-a-product.html. It is strongly recommended that the config.json file should be saved onto a USB memory stick for future use.
Expand All @@ -105,12 +109,15 @@ When the Raspberry Pi boots up, give these answers to the following questions:
``` cd vocalfusion-avs-setup```

And then either

XVF3510: ```./auto_install.sh xvf3510```
XVF3500: ```./auto_install.sh xvf3500```
XVF3100: ```./auto_install.sh xvf3100```

XVF3610: ```./auto_install.sh xvf3610```
XVF3510: ```./auto_install.sh xvf3510```
XVF3500: ```./auto_install.sh xvf3500```
XVF3100: ```./auto_install.sh xvf3100```
XVF3000: ```./auto_install.sh xvf3100```

If you need to use the keyword detection using the GPIO2 pin, use the flag '-g' after the device name. If this option is not selected, the Sensory engine is used.

Read and accept the AVS Device SDK license agreement.

6. You will be asked whether you want the Sample App to run automatically when the Raspberry Pi boots. It is recommended that you respond "yes" to this option.
Expand All @@ -133,8 +140,8 @@ The automated installation script creates a number of aliases which can be used

## Changing Sensory operating point

To change to operating point of the Sensory keyword engine, edit the shell script run by the `avsrun` alias:
To change to operating point of the Sensory keyword engine, edit the shell script run by the `avsrun` alias:

`~/sdk-folder/avs-device-sdk/tools/Install/.avsrun-startup.sh`

and change the third argument to SampleApp from the default value of `12` to the desired value.
55 changes: 32 additions & 23 deletions auto_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,18 @@ RPI_SETUP_REPO=vocalfusion-rpi-setup
RPI_SETUP_DIR=$SETUP_DIR/$RPI_SETUP_REPO
RPI_SETUP_SCRIPT=$RPI_SETUP_DIR/setup.sh

RPI_SETUP_TAG="v4.2.0"
AVS_DEVICE_SDK_TAG="v1.21.0"
RPI_SETUP_TAG="v4.3.1"
AVS_DEVICE_SDK_TAG="v1.25.0.1"
AVS_SCRIPT="setup.sh"

# Valid values for XMOS device
VALID_XMOS_DEVICES="xvf3100 xvf3500 xvf3510 xvf3600-slave xvf3600-master xvf3610"
VALID_XMOS_DEVICES="xvf3100 xvf3500 xvf3510 xvf3600-slave xvf3600-master xvf3610 xvf3615"
XMOS_DEVICE=

# Default device serial number if nothing is specified
DEVICE_SERIAL_NUMBER="123456"
# Disable GPIO keyword detector by default
GPIO_KEY_WORD_DETECTOR_FLAG=""

usage() {
local VALID_XMOS_DEVICES_DISPLAY_STRING=
Expand All @@ -34,19 +36,21 @@ usage() {
done

cat <<EOT
usage: auto_install.sh [OPTIONS] [DEVICE-TYPE]
usage: auto_install.sh <DEVICE-TYPE> [OPTIONS]
A JSON config file, config.json, must be present in the current working
directory. The config.json can be downloaded from developer portal and must
contain the following:
"clientId": "<Auth client ID>"
"productId": "<your product name for device>"
The DEVICE-TYPE is the XMOS device to setup: $VALID_XMOS_DEVICES_DISPLAY_STRING
Optional parameters:
-s <serial-number> If nothing is provided, the default device serial number
is 123456
-g Flag to enable keyword detector on GPIO interrupt
-h Display this help and exit
DEVICE-TYPE XMOS device to setup: $VALID_XMOS_DEVICES_DISPLAY_STRING
EOT
}

Expand All @@ -58,33 +62,30 @@ if [ ! -f "$CONFIG_JSON_FILE" ]; then
exit 1
fi

OPTIONS=s:h
if [ $# -lt 1 ] || [ $1 == '-h' ]; then
usage
exit 1
fi

XMOS_DEVICE=$1
shift 1

OPTIONS=s:gh
while getopts "$OPTIONS" opt ; do
case $opt in
s )
DEVICE_SERIAL_NUMBER="$OPTARG"
;;
g )
GPIO_KEY_WORD_DETECTOR_FLAG="-g"
;;
h )
usage
exit 1
;;
esac
done

shift $(( OPTIND - 1 ))

if [[ $# -ge 1 ]]; then
XMOS_DEVICE=$1
else
echo No device specified.
PS3="Type the number corresponding to one of the above devices: "
select XMOS_DEVICE in $VALID_XMOS_DEVICES; do
if [[ -n "$XMOS_DEVICE" ]]; then
break;
fi
done
fi

# validate XMOS_DEVICE value
validate_device() {
local DEV=$1
Expand Down Expand Up @@ -120,10 +121,18 @@ fi
mkdir $SDK_DIR

if [ -d $RPI_SETUP_DIR ]; then
echo "Delete $RPI_SETUP_DIR directory"
rm -rf $RPI_SETUP_DIR
fi

git clone -b $RPI_SETUP_TAG https://github.com/xmos/$RPI_SETUP_REPO.git

# Convert xvf3615 device into xvf3610 device and '-g' argument
if [[ "$XMOS_DEVICE" == "xvf3615" ]]; then
XMOS_DEVICE="xvf3610"
GPIO_KEY_WORD_DETECTOR_FLAG="-g"
fi

# Execute (rather than source) the setup scripts
echo "Installing VocalFusion ${XMOS_DEVICE:3} Raspberry Pi Setup..."
if $RPI_SETUP_SCRIPT $XMOS_DEVICE; then
Expand All @@ -132,14 +141,14 @@ if $RPI_SETUP_SCRIPT $XMOS_DEVICE; then
# E: Repository 'http://raspbian.raspberrypi.org/raspbian buster InRelease' changed its 'Suite' value from 'testing' to 'stable'
# N: This must be accepted explicitly before updates for this repository can be applied. See apt-secure(8) manpage for details.
sudo apt update --allow-releaseinfo-change

echo "Installing Amazon AVS SDK..."
wget -O $AVS_SCRIPT https://raw.githubusercontent.com/xmos/avs-device-sdk/$AVS_DEVICE_SDK_TAG/tools/Install/$AVS_SCRIPT
wget -O pi.sh https://raw.githubusercontent.com/xmos/avs-device-sdk/$AVS_DEVICE_SDK_TAG/tools/Install/pi.sh
wget -O genConfig.sh https://raw.githubusercontent.com/xmos/avs-device-sdk/$AVS_DEVICE_SDK_TAG/tools/Install/genConfig.sh
chmod +x $AVS_SCRIPT

if ./$AVS_SCRIPT $CONFIG_JSON_FILE $AVS_DEVICE_SDK_TAG -s $DEVICE_SERIAL_NUMBER -x $XMOS_DEVICE; then
AVS_CMD="./${AVS_SCRIPT} ${CONFIG_JSON_FILE} ${AVS_DEVICE_SDK_TAG} -s ${DEVICE_SERIAL_NUMBER} -x ${XMOS_DEVICE} ${GPIO_KEY_WORD_DETECTOR_FLAG}"
echo "Running command ${AVS_CMD}"
if $AVS_CMD; then
echo "Type 'sudo reboot' below to reboot the Raspberry Pi and complete the AVS setup."
fi
fi
Expand Down

0 comments on commit 741ad01

Please sign in to comment.