diff --git a/CHANGELOG.md b/CHANGELOG.md index d878440..755f566 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/README.md b/README.md index aae9131..12b9817 100644 --- a/README.md +++ b/README.md @@ -2,12 +2,13 @@ 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 @@ -15,21 +16,22 @@ 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 @@ -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 @@ -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. @@ -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. @@ -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. @@ -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. diff --git a/auto_install.sh b/auto_install.sh index 08d455f..ce9bb23 100755 --- a/auto_install.sh +++ b/auto_install.sh @@ -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= @@ -34,7 +36,7 @@ usage() { done cat < [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 @@ -42,11 +44,13 @@ contain the following: "clientId": "" "productId": "" +The DEVICE-TYPE is the XMOS device to setup: $VALID_XMOS_DEVICES_DISPLAY_STRING + Optional parameters: -s 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 } @@ -58,12 +62,23 @@ 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 @@ -71,20 +86,6 @@ while getopts "$OPTIONS" opt ; do 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 @@ -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 @@ -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