From a679e7028475522d078f56bc2dbae99756f43255 Mon Sep 17 00:00:00 2001 From: Daniel Follent Date: Tue, 27 Mar 2018 10:47:48 +0100 Subject: [PATCH 1/4] Edited README.md to avoid common config mistakes. --- README.md | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 16ba56a..8fb8ee6 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ You will need: - HDMI cable - Fast-Ethernet connection with internet connectivity -You will also need an Amazon Developer account: https://developer.amazon.com +You will also need an Amazon Developer account: https://developer.amazon.com ## Hardware setup Setup your hardware by following the **Hardware Setup** at: https://xmos.com/vocalfusion-avs @@ -36,14 +36,11 @@ Brief instructions and additional notes are below: 2. Open a terminal on the Raspberry Pi and clone this respository: `cd ~; git clone https://github.com/xmos/vocalfusion-avs-setup` -3. Either: -create a new Alexa device by following: https://github.com/alexa/alexa-avs-sample-app/wiki/Create-Security-Profile +3. Create a new Alexa device by following: https://github.com/alexa/alexa-avs-sample-app/wiki/Create-Security-Profile (Note: the *Allowed Origins* and *Allowed Return URLs* should use **http**, not https.) -Or: -use an existing Alexa device by placing your `AlexaClientSDKConfig.json` file (with a valid refresh token) in the `~/vocalfusion-avs-setup/scripts/` folder. -4. Run the installation script: `source ~/vocalfusion-avs-setup/auto_install.sh` -If necessary, enter your Alexa device details (*ProductID*, *ClientID* and *ClientSecret*), a serial number and your location. +4. Run the installation script: `source ~/vocalfusion-stereo-avs-setup/auto_install.sh` +You will be prompted enter your Alexa device details (*ProductID*, *ClientID* and *ClientSecret*), a serial number and your location. Wait for the sensory (keyword detection) repository to clone, then read and accept the license agreement. Wait for the script to complete the installation. This can take a while, for example: - audio-setup: 4m40s From 4acda8c55246bb85ca264886bab6e359e8b5af53 Mon Sep 17 00:00:00 2001 From: Daniel Follent Date: Tue, 27 Mar 2018 10:48:55 +0100 Subject: [PATCH 2/4] Restructured repo --- auto_install.sh | 25 +++++- loader/Makefile | 5 -- loader/loader.c | 74 ---------------- resources/asoundrc | 76 ----------------- resources/panel | 173 -------------------------------------- scripts/avs-buildsdk.sh | 8 -- scripts/avs-config.sh | 13 --- scripts/avs-configsdk.sh | 26 ------ scripts/avs-getdepbin.sh | 6 -- scripts/avs-getdepsrc.sh | 9 -- scripts/avs-getsdk.sh | 14 --- scripts/avs-init.sh | 15 ---- scripts/avs-main.sh | 80 ------------------ scripts/avs-portaudio.sh | 9 -- scripts/avs-pyauth.sh | 15 ---- scripts/avs-sensory.sh | 16 ---- scripts/avs-userinput.sh | 40 --------- scripts/convert_times.py | 27 ------ scripts/i2s_i2c_setup.sh | 119 -------------------------- snd_driver/Makefile | 5 -- snd_driver/bclk_patch.txt | 14 --- 21 files changed, 22 insertions(+), 747 deletions(-) delete mode 100644 loader/Makefile delete mode 100644 loader/loader.c delete mode 100644 resources/asoundrc delete mode 100644 resources/panel delete mode 100755 scripts/avs-buildsdk.sh delete mode 100644 scripts/avs-config.sh delete mode 100755 scripts/avs-configsdk.sh delete mode 100755 scripts/avs-getdepbin.sh delete mode 100755 scripts/avs-getdepsrc.sh delete mode 100755 scripts/avs-getsdk.sh delete mode 100644 scripts/avs-init.sh delete mode 100755 scripts/avs-main.sh delete mode 100755 scripts/avs-portaudio.sh delete mode 100755 scripts/avs-pyauth.sh delete mode 100755 scripts/avs-sensory.sh delete mode 100644 scripts/avs-userinput.sh delete mode 100755 scripts/convert_times.py delete mode 100755 scripts/i2s_i2c_setup.sh delete mode 100644 snd_driver/Makefile delete mode 100644 snd_driver/bclk_patch.txt diff --git a/auto_install.sh b/auto_install.sh index d5cf472..afb022e 100644 --- a/auto_install.sh +++ b/auto_install.sh @@ -1,4 +1,23 @@ -SCRIPTS_DIR="$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")"/scripts +#!/usr/bin/env bash -# Execute (rather than source) the main -$SCRIPTS_DIR/avs-main.sh +SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" + +pushd . > /dev/null +cd $SCRIPT_DIR + +git clone git://github.com/xmos/vocalfusion-rpi-setup.git +git clone git://github.com/xmos/avs-sdk-setup.git + +RPI_SETUP_DIR=$SCRIPT_DIR/vocalfusion-rpi-setup +AVS_SETUP_DIR=$SCRIPT_DIR/avs-sdk-setup + +# Execute (rather than source) the setup scripts +$RPI_SETUP_DIR/setup.sh + +echo "Installing Amazon AVS SDK..." + +$AVS_SETUP_DIR/setup.sh + +echo "Type 'sudo reboot' below to reboot the Raspberry Pi and complete the audio setup." + +popd > /dev/null diff --git a/loader/Makefile b/loader/Makefile deleted file mode 100644 index e023675..0000000 --- a/loader/Makefile +++ /dev/null @@ -1,5 +0,0 @@ -obj-m := loader.o -KDIR := /lib/modules/$(shell uname -r)/build -PWD := $(shell pwd) -default: - $(MAKE) -C $(KDIR) SUBDIRS=$(PWD) modules diff --git a/loader/loader.c b/loader/loader.c deleted file mode 100644 index 3c2b414..0000000 --- a/loader/loader.c +++ /dev/null @@ -1,74 +0,0 @@ -#include -#include -#include -#include -#include -#include -/* -modified for linux 4.1.5 -inspired by https://github.com/msperl/spi-config -with thanks for https://github.com/notro/rpi-source/wiki -as well as Florian Meier for the rpi i2s and dma drivers - -to use a differant (simple-card compatible) codec -change the codec name string in two places and the -codec_dai name string. (see codec's source file) - -fmt flags are set for vanilla i2s with rpi as clock slave - -N.B. playback vs capture is determined by the codec choice -*/ - -void device_release_callback(struct device *dev) { /* do nothing */ }; - -static struct asoc_simple_card_info snd_rpi_simple_card_info = { - .card = "snd_rpi_simple_card", // -> snd_soc_card.name - .name = "simple-card_codec_link", // -> snd_soc_dai_link.name - .codec = "snd-soc-dummy", // -> snd_soc_dai_link.codec_name - .platform = "3f203000.i2s", - .daifmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBM_CFM, - .cpu_dai = { - .name = "3f203000.i2s", // -> snd_soc_dai_link.cpu_dai_name - .sysclk = 0 - }, - .codec_dai = { - .name = "snd-soc-dummy-dai", // -> snd_soc_dai_link.codec_dai_name - .sysclk = 0 - } -}; - -static struct platform_device snd_rpi_simple_card_device = { - .name = "asoc-simple-card", //module alias - .id = 0, - .num_resources = 0, - .dev = { - .release = &device_release_callback, - .platform_data = &snd_rpi_simple_card_info, // *HACK ALERT* - } -}; - -int hello_init(void) -{ - const char *dmaengine = "bcm2708-dmaengine"; //module name - int ret; - - ret = request_module(dmaengine); - pr_alert("request module load '%s': %d\n",dmaengine, ret); - ret = platform_device_register(&snd_rpi_simple_card_device); - pr_alert("register platform device '%s': %d\n",snd_rpi_simple_card_device.name, ret); - pr_alert("Hello World :)\n"); - return 0; -} - -void hello_exit(void) -{ - // you'll have to sudo modprobe -r the card & codec drivers manually (first?) - platform_device_unregister(&snd_rpi_simple_card_device); - pr_alert("Goodbye World!\n"); -} - -module_init(hello_init); -module_exit(hello_exit); -MODULE_DESCRIPTION("ASoC simple-card I2S setup"); -MODULE_AUTHOR("Plugh Plover"); -MODULE_LICENSE("GPL v2"); diff --git a/resources/asoundrc b/resources/asoundrc deleted file mode 100644 index 18ba436..0000000 --- a/resources/asoundrc +++ /dev/null @@ -1,76 +0,0 @@ -# -# The I2S hardware device. Refer to it by name as it will not always -# be the same card number in every system. -# -pcm.i2s_48k { - type hw - card sndrpisimplecar - device 0 - - # The device has fixed 32-bit samples - format S32_LE - - # The device runs at 48kHz - rate 48000 -} - -pcm.mix_i2s_48k { - type dmix - ipc_key 115 # Must be unique - slave { - pcm i2s_48k - } -} - -# -# Note that the name must contain "Master" for the task bar to find it -# -pcm.mix_vol { - type softvol - slave { - pcm mix_i2s_48k - } - control { - name "Playback" - card 0 - } -} - -pcm.snoop_i2s_48k { - type dsnoop - ipc_key 116 # Must be unique - slave { - pcm i2s_48k - } -} - -pcm.snoop_vol { - type softvol - slave { - pcm snoop_i2s_48k - } - control { - name "Record" - card 0 - } -} - -# -# Map the default audio playback and recording devices to the I2S device. -# - use plugs in order to support rate and format conversions. -# -pcm.!default { - type asym - playback.pcm { - type plug - slave { - pcm mix_vol - } - } - capture.pcm { - type plug - slave { - pcm snoop_vol - } - } -} diff --git a/resources/panel b/resources/panel deleted file mode 100644 index 0ea68e1..0000000 --- a/resources/panel +++ /dev/null @@ -1,173 +0,0 @@ -# lxpanel config file. Manually editing is not recommended. -# Use preference dialog in lxpanel to adjust config when you can. - -Global { - edge=top - allign=left - margin=0 - widthtype=percent - width=100 - height=36 - transparent=0 - tintcolor=#000000 - alpha=0 - autohide=0 - heightwhenhidden=2 - setdocktype=1 - setpartialstrut=1 - usefontcolor=0 - fontsize=12 - fontcolor=#ffffff - usefontsize=0 - background=0 - backgroundfile=/usr/share/lxpanel/images/background.png - iconsize=36 -} -Plugin { - type=space - Config { - Size=4 - } -} -Plugin { - type=menu - Config { - image=/usr/share/raspberrypi-artwork/launch.png - system { - } - separator { - } - item { - name=Run... - image=system-run - command=run - } - separator { - } - item { - name=Shutdown... - image=system-shutdown - command=logout - } - } -} -Plugin { - type=space - Config { - Size=8 - } -} -Plugin { - type=launchbar - Config { - Button { - id=lxde-x-www-browser.desktop - } - Button { - id=pcmanfm.desktop - } - Button { - id=lxterminal.desktop - } - Button { - id=wolfram-mathematica.desktop - } - Button { - id=wolfram-language.desktop - } - } -} -Plugin { - type=space - Config { - Size=8 - } -} -Plugin { - type=taskbar - expand=1 - Config { - tooltips=1 - IconsOnly=0 - ShowAllDesks=0 - UseMouseWheel=1 - UseUrgencyHint=1 - FlatButton=0 - MaxTaskWidth=200 - spacing=1 - GroupedTasks=0 - } -} -Plugin { - type=space - Config { - Size=2 - } -} -Plugin { - type=tray - Config { - } -} -Plugin { - type=bluetooth - Config { - } -} -Plugin { - type=space - Config { - Size=2 - } -} -Plugin { - type=dhcpcdui - Config { - } -} -Plugin { - type=space - Config { - Size=2 - } -} -#Plugin { -# type=volumealsabt -# Config { -# } -#} -Plugin { - type=space - Config { - Size=2 - } -} -Plugin { - type=cpu - Config { - ShowPercent=1 - Foreground=#a9a9a9a9a9a9 - Background=#d3d3d3d3d3d3 - } -} -Plugin { - type=dclock - Config { - ClockFmt=%R - TooltipFmt=%A %x - BoldFont=0 - IconOnly=0 - CenterText=0 - } -} -Plugin { - type=space - Config { - Size=2 - } -} -Plugin { - type=ejecter - Config { - } -} diff --git a/scripts/avs-buildsdk.sh b/scripts/avs-buildsdk.sh deleted file mode 100755 index 5985036..0000000 --- a/scripts/avs-buildsdk.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/usr/bin/env bash - -# Setup paths -SCRIPTS_DIR="$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")" -source $SCRIPTS_DIR/avs-config.sh - -cd $SDK_BUILD -make -j2 diff --git a/scripts/avs-config.sh b/scripts/avs-config.sh deleted file mode 100644 index 5357e7f..0000000 --- a/scripts/avs-config.sh +++ /dev/null @@ -1,13 +0,0 @@ -# -# Standard set of paths used by setup scripts -# -SDK_FOLDER=$HOME/sdk-folder -SOURCES_FOLDER=$SDK_FOLDER/sdk-source -SDK_SRC=$SOURCES_FOLDER/avs-device-sdk -SDK_BUILD=$SDK_FOLDER/sdk-build -THIRD_PARTY=$SDK_FOLDER/third-party -APPS_FILES=$SDK_FOLDER/application-necessities -SOUND_FILES=$APPS_FILES/sound-files - -# Choose DEBUG or RELEASE type -BUILD_TYPE=RELEASE diff --git a/scripts/avs-configsdk.sh b/scripts/avs-configsdk.sh deleted file mode 100755 index 0c680e8..0000000 --- a/scripts/avs-configsdk.sh +++ /dev/null @@ -1,26 +0,0 @@ -#!/usr/bin/env bash - -# Setup paths -SCRIPTS_DIR="$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")" -source $SCRIPTS_DIR/avs-config.sh - -source $SCRIPTS_DIR/avs-userinput.sh - -cd $SDK_BUILD -cmake $SDK_SRC \ - -DCMAKE_BUILD_TYPE=$BUILD_TYPE \ - -DSENSORY_KEY_WORD_DETECTOR=ON \ - -DSENSORY_KEY_WORD_DETECTOR_LIB_PATH=$THIRD_PARTY/alexa-rpi/lib/libsnsr.a \ - -DSENSORY_KEY_WORD_DETECTOR_INCLUDE_DIR=$THIRD_PARTY/alexa-rpi/include \ - -DGSTREAMER_MEDIA_PLAYER=ON \ - -DPORTAUDIO=ON \ - -DPORTAUDIO_LIB_PATH=$THIRD_PARTY/portaudio/lib/.libs/libportaudio.a \ - -DPORTAUDIO_INCLUDE_DIR=$THIRD_PARTY/portaudio/include - -if [ -e $SCRIPTS_DIR/AlexaClientSDKConfig.json ]; then - # If you have a cached copy, then use that - cp $SCRIPTS_DIR/AlexaClientSDKConfig.json $HOME/BUILD/Integration/AlexaClientSDKConfig.json -else - # Else substitute the values and cache this copy - envsubst < $SDK_SRC/Integration/AlexaClientSDKConfig.json > $SDK_BUILD/Integration/AlexaClientSDKConfig.json -fi diff --git a/scripts/avs-getdepbin.sh b/scripts/avs-getdepbin.sh deleted file mode 100755 index 07264ee..0000000 --- a/scripts/avs-getdepbin.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/usr/bin/env bash - -sudo apt-get update -sudo apt-get -y install git gcc cmake build-essential libsqlite3-dev libcurl4-openssl-dev libfaad-dev libsoup2.4-dev libgcrypt20-dev libgstreamer-plugins-bad1.0-dev gstreamer1.0-plugins-good libasound2-dev - -sudo apt-get -y install doxygen diff --git a/scripts/avs-getdepsrc.sh b/scripts/avs-getdepsrc.sh deleted file mode 100755 index c5f800c..0000000 --- a/scripts/avs-getdepsrc.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/usr/bin/env bash - -# Setup paths -SCRIPTS_DIR="$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")" -source $SCRIPTS_DIR/avs-config.sh - -cd $THIRD_PARTY -wget -c http://www.portaudio.com/archives/pa_stable_v190600_20161030.tgz -tar zxf pa_stable_v190600_20161030.tgz diff --git a/scripts/avs-getsdk.sh b/scripts/avs-getsdk.sh deleted file mode 100755 index f59fbb4..0000000 --- a/scripts/avs-getsdk.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/usr/bin/env bash - -# Setup paths -SCRIPTS_DIR="$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")" -source $SCRIPTS_DIR/avs-config.sh - -cd $SOURCES_FOLDER -git clone -b xmos_v1.2 git://github.com/xmos/avs-device-sdk.git - -cd $SOUND_FILES -wget -c https://images-na.ssl-images-amazon.com/images/G/01/mobile-apps/dex/alexa/alexa-voice-service/docs/audio/states/med_system_alerts_melodic_02._TTH_.mp3 -O timer.wav -wget -c https://images-na.ssl-images-amazon.com/images/G/01/mobile-apps/dex/alexa/alexa-voice-service/docs/audio/states/med_system_alerts_melodic_02_short._TTH_.wav -O timer_short.wav -wget -c https://images-na.ssl-images-amazon.com/images/G/01/mobile-apps/dex/alexa/alexa-voice-service/docs/audio/states/med_system_alerts_melodic_01._TTH_.mp3 -O alarm.wav -wget https://images-na.ssl-images-amazon.com/images/G/01/mobile-apps/dex/alexa/alexa-voice-service/docs/audio/states/med_system_alerts_melodic_01_short._TTH_.wav -O alarm_short.wav diff --git a/scripts/avs-init.sh b/scripts/avs-init.sh deleted file mode 100644 index 321b88a..0000000 --- a/scripts/avs-init.sh +++ /dev/null @@ -1,15 +0,0 @@ -# Setup paths -SCRIPTS_DIR="$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")" -source $SCRIPTS_DIR/avs-config.sh - -ALIASES=$HOME/.bash_aliases -echo "export PATH=$SDK_BUILD/bin:$PATH" >> $ALIASES -echo "export PKG_CONFIG_PATH=$SDK_BUILD/lib/pkgconfig:$PKG_CONFIG_PATH" >> $ALIASES -echo "alias avsmake=\"cd ~ && . $SCRIPTS_DIR/../auto_install.sh\"" >> $ALIASES -echo "alias avsrun=\"LD_LIBRARY_PATH=$SDK_BUILD/lib:$LD_LIBRARY_PATH TZ=UTC $SDK_BUILD/SampleApp/src/SampleApp $SDK_BUILD/Integration/AlexaClientSDKConfig.json $SDK_BUILD/models\"" >> $ALIASES -echo "alias avsunit=\"LD_LIBRARY_PATH=$SDK_BUILD/lib:$LD_LIBRARY_PATH pushd $SDK_BUILD && sudo make all test && popd\"" >> $ALIASES -echo "alias avsintegration=\"LD_LIBRARY_PATH=$SDK_BUILD/lib:$LD_LIBRARY_PATH pushd $SDK_BUILD && sudo make all integration && popd\"" >> $ALIASES -echo "echo \"Available AVS aliases:\"" >> $ALIASES -echo "echo -e \"\tavsmake, avsrun, avsunit, avsintegration\"" >> $ALIASES -echo "echo \"If authentication fails, please check $SDK_BUILD/Integration/AlexaClientSDKConfig.json\"" >> $HOME/.bash_aliases -echo "echo \"remove .bash_aliases and open a new terminal to remove bindings\"" >> $ALIASES diff --git a/scripts/avs-main.sh b/scripts/avs-main.sh deleted file mode 100755 index 053f4ff..0000000 --- a/scripts/avs-main.sh +++ /dev/null @@ -1,80 +0,0 @@ -#!/usr/bin/env bash - -SCRIPTS_DIR="$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")" -source $SCRIPTS_DIR/avs-config.sh - -SENSORY_MODEL_HASH_1=a8befe708af1aa80c32bce5219312a4ec439a0b0 -SENSORY_MODEL_HASH_2=ddbc9040e24ed06aafe402017fa640b86d3520b3 -SENSORY_MODEL_HASH_3=43b5cb246cb8422a8f39ae92d3e372dc19b98243 - -# Select Sensory version to use (default is 2) -SENSORY_MODEL_HASH=$SENSORY_MODEL_HASH_2 - -pushd . > /dev/null - -# Set environment variables and create folders -grep avsrun ~/.bash_aliases > /dev/null 2>&1 -init_needed=$? -if [ $init_needed != 0 ]; then - source $SCRIPTS_DIR/avs-init.sh -fi - -mkdir -p $SOURCES_FOLDER -mkdir -p $SDK_BUILD -mkdir -p $THIRD_PARTY -mkdir -p $SOUND_FILES - -# Prompt the user for settings at the start -source $SCRIPTS_DIR/avs-userinput.sh - -# Clone sensory and complete license -if [ ! -d $THIRD_PARTY/alexa-rpi ]; then - cd $THIRD_PARTY - git clone git://github.com/Sensory/alexa-rpi.git - cd alexa-rpi - git checkout $SENSORY_MODEL_HASH -- models/spot-alexa-rpi-31000.snsr -fi -if [ -e $THIRD_PARTY/alexa-rpi/bin/license.sh ]; then - bash $THIRD_PARTY/alexa-rpi/bin/license.sh -fi - -TIMES_FILE=$SCRIPTS_DIR/time_taken.txt -SECONDS=0 -$SCRIPTS_DIR/i2s_i2c_setup.sh | sed "s/^/[audio setup] /" -echo "audio-setup: $SECONDS" > $TIMES_FILE -$SCRIPTS_DIR/avs-getdepbin.sh | sed "s/^/[apt-get dependencies] /" -echo "apt-get deps: $SECONDS" >> $TIMES_FILE -$SCRIPTS_DIR/avs-getdepsrc.sh | sed "s/^/[get sources] /" -echo "getsrc: $SECONDS" >> $TIMES_FILE -$SCRIPTS_DIR/avs-portaudio.sh | sed "s/^/[portaudio] /" -echo "portaudio: $SECONDS" >> $TIMES_FILE -$SCRIPTS_DIR/avs-sensory.sh | sed "s/^/[sensory] /" -echo "sensory: $SECONDS" >> $TIMES_FILE - -if [ -e /usr/share/alsa/pulse-alsa.conf ] ; then - # Rename existing file - sudo mv /usr/share/alsa/pulse-alsa.conf /usr/share/alsa/pulse-alsa.conf.bak - sudo mv ~/.config/lxpanel/LXDE-pi/panels/panel ~/.config/lxpanel/LXDE-pi/panels/panel.bak -fi - -$SCRIPTS_DIR/avs-getsdk.sh | sed "s/^/[sdk download] /" -echo "getsdk: $SECONDS" >> $TIMES_FILE -$SCRIPTS_DIR/avs-configsdk.sh | sed "s/^/[sdk config] /" -echo "configsdk: $SECONDS" >> $TIMES_FILE -$SCRIPTS_DIR/avs-buildsdk.sh | sed "s/^/[sdk build] /" -echo "buildsdk: $SECONDS" >> $TIMES_FILE - -echo "####~~~~BUILD TIMES~~~~####" -$SCRIPTS_DIR/convert_times.py $TIMES_FILE - -$SCRIPTS_DIR/avs-pyauth.sh | sed "s/^/[authorisation] /" - -popd > /dev/null - -echo Available aliases: -echo +++ avsmake -echo +++ avsrun -echo +++ avsunit -echo +++ avsintegration -echo To enable the i2s device, this pi must now be rebooted -echo type 'sudo reboot' below to do this diff --git a/scripts/avs-portaudio.sh b/scripts/avs-portaudio.sh deleted file mode 100755 index 3df9726..0000000 --- a/scripts/avs-portaudio.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/usr/bin/env bash - -# Setup paths -SCRIPTS_DIR="$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")" -source $SCRIPTS_DIR/avs-config.sh - -cd $THIRD_PARTY/*portaudio*/ -./configure --without-jack -make -j3 diff --git a/scripts/avs-pyauth.sh b/scripts/avs-pyauth.sh deleted file mode 100755 index ea98bd1..0000000 --- a/scripts/avs-pyauth.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/usr/bin/env bash - -# Setup paths -SCRIPTS_DIR="$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")" -source $SCRIPTS_DIR/avs-config.sh - -cd $SDK_BUILD -sudo apt-get install -y python-flask python-requests | sed "s/^/[py packages] /" -sudo fuser -k -TERM -n tcp 3000 -python AuthServer/AuthServer.py | grep -v '400' & -chromium-browser http://localhost:3000 > /dev/null 2>&1 -wait - -# Take a backup -cp $SDK_BUILD/Integration/AlexaClientSDKConfig.json $SCRIPTS_DIR/ diff --git a/scripts/avs-sensory.sh b/scripts/avs-sensory.sh deleted file mode 100755 index 9cdc159..0000000 --- a/scripts/avs-sensory.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/usr/bin/env bash - -# Setup paths -SCRIPTS_DIR="$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")" -source $SCRIPTS_DIR/avs-config.sh - -cd $THIRD_PARTY -sudo chown -R $USER $SDK_BUILD - -mkdir -p $SDK_BUILD/lib -mkdir -p $SDK_BUILD/include -mkdir -p $SDK_BUILD/models - -cp alexa-rpi/lib/libsnsr.a $SDK_BUILD/lib -cp alexa-rpi/include/snsr.h $SDK_BUILD/include -cp alexa-rpi/models/spot-alexa-rpi-31000.snsr $SDK_BUILD/models diff --git a/scripts/avs-userinput.sh b/scripts/avs-userinput.sh deleted file mode 100644 index 1963414..0000000 --- a/scripts/avs-userinput.sh +++ /dev/null @@ -1,40 +0,0 @@ -if [[ (! -z $SDK_CONFIG_CLIENT_ID) || (-e $SCRIPTS_DIR/AlexaClientSDKConfig.json) ]]; then - return -fi - -while [[ -z $SDK_CONFIG_CLIENT_ID ]] ; do - echo "Enter your ClientId:" - read SDK_CONFIG_CLIENT_ID - export SDK_CONFIG_CLIENT_ID -done -while [[ -z $SDK_CONFIG_CLIENT_SECRET ]] ; do - echo "Enter your ClientSecret:" - read SDK_CONFIG_CLIENT_SECRET - export SDK_CONFIG_CLIENT_SECRET -done -while [[ -z $SDK_CONFIG_PRODUCT_ID ]] ; do - echo "Enter your ProductId:" - read SDK_CONFIG_PRODUCT_ID - export SDK_CONFIG_PRODUCT_ID -done -while [[ -z $SDK_CONFIG_DEVICE_SERIAL_NUMBER ]] ; do - echo "Enter your deviceSerialNumber (this can be any number):" - read SDK_CONFIG_DEVICE_SERIAL_NUMBER - export SDK_CONFIG_DEVICE_SERIAL_NUMBER -done -while [[ ( "$SETTING_LOCALE_VALUE" != "en-US" ) && \ - ( "$SETTING_LOCALE_VALUE" != "en-GB" ) && \ - ( "$SETTING_LOCALE_VALUE" != "de-DE" ) ]] ; do - echo "Enter your desired locale (valid values are en-US, en-GB, de-DE):" - read SETTING_LOCALE_VALUE - export SETTING_LOCALE_VALUE -done - -export SDK_SQLITE_DATABASE_FILE_PATH=$APPS_FILES/alerts.db -export SDK_ALARM_DEFAULT_SOUND_FILE_PATH=$SOUND_FILES/alarm.wav -export SDK_ALARM_SHORT_SOUND_FILE_PATH=$SOUND_FILES/alarm_short.wav -export SDK_TIMER_DEFAULT_SOUND_FILE_PATH=$SOUND_FILES/timer.wav -export SDK_TIMER_SHORT_SOUND_FILE_PATH=$SOUND_FILES/timer_short.wav - -export SDK_SQLITE_SETTINGS_DATABASE_FILE_PATH=$APPS_FILES/settings.db -export SDK_CERTIFIED_SENDER_DATABASE_FILE_PATH=$APPS_FILES/certifiedSender.db diff --git a/scripts/convert_times.py b/scripts/convert_times.py deleted file mode 100755 index c4ba948..0000000 --- a/scripts/convert_times.py +++ /dev/null @@ -1,27 +0,0 @@ -#! /usr/bin/env python -import os -import sys -from pprint import pprint - -if len(sys.argv) < 2: - print "Please specify the times file" - sys.exit(1) - -times_file=sys.argv[1] - -with open(os.path.join(times_file), "r") as f: - lines = f.read().splitlines() - -results = [] -prev = 0 -for line in lines: - key, val = line.split(": ") - m, s = divmod((int(val) - prev), 60) - results.append("{}: {}m{}s".format(key, m, s)) - prev = int(val) - total = prev - -pprint(results) -m, s = divmod(prev, 60) -h, m = divmod(m, 60) -print("TOTAL: {}h{}m{}s".format(h, m, s)) diff --git a/scripts/i2s_i2c_setup.sh b/scripts/i2s_i2c_setup.sh deleted file mode 100755 index dcf8895..0000000 --- a/scripts/i2s_i2c_setup.sh +++ /dev/null @@ -1,119 +0,0 @@ -#!/usr/bin/env bash - -# Setup paths -SCRIPTS_DIR="$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")" -source $SCRIPTS_DIR/avs-config.sh - -# The working directory is the parent of the scripts -I2S_ROOT=$(dirname $SCRIPTS_DIR) - -# -# Define folders -# -pushd $(dirname "$0") > /dev/null -popd > /dev/null - -# -# Disable the built-in audio output so there is only one audio -# device in the system -# -sudo sed -i -e 's/dtparam=audio=on/#dtparam=audio=on/' /boot/config.txt - -# -# Enable the i2s device tree -# -sudo sed -i -e 's/#dtparam=i2s=on/dtparam=i2s=on/' /boot/config.txt - -# Add modules to enable the I2C Peripherals and Direct Memory Access -# Controller modules that the sound card driver depends on -sudo sh -c 'echo snd_soc_bcm2708 >> /etc/modules' -sudo sh -c 'echo snd_soc_bcm2708_i2s >> /etc/modules' -sudo sh -c 'echo bcm2708_dmaengine >> /etc/modules' - -# Download kernal source - this will take some time -cd $I2S_ROOT -sudo apt-get -y install bc -sudo apt-get -y install libncurses5-dev -if [ ! -d rpi-source ] ; then - git clone git://github.com/notro/rpi-source.git -fi -pushd $I2S_ROOT/rpi-source > /dev/null -python rpi-source --skip-gcc -popd > /dev/null - -# -# Build simple sound card driver -# Modify the driver source to have the correct BCLK ratio -# -pushd $I2S_ROOT/snd_driver > /dev/null -cp ~/linux/sound/soc/generic/simple-card.c ./asoc_simple_card.c -patch -p1 asoc_simple_card.c < bclk_patch.txt -make -popd > /dev/null - -# -# Build loader and insert it into the kernel -# -pushd $I2S_ROOT/loader > /dev/null -make -popd > /dev/null - -if [ -e ~/.asoundrc ] ; then - cp ~/.asoundrc ~/.asoundrc.bak - chmod a+w ~/.asoundrc -fi - -cp $I2S_ROOT/resources/asoundrc ~/.asoundrc -cp $I2S_ROOT/resources/panel ~/.config/lxpanel/LXDE-pi/panels/panel - -# -# Make the asoundrc file read-only otherwise lxpanel rewrites it -# as it doesn't support anything but a hardware type device -# -chmod a-w ~/.asoundrc - -# Apply changes -sudo /etc/init.d/alsa-utils restart - -# -# Create the script to run after each reboot and make the soundcard available -# -i2s_driver_script=$I2S_ROOT/resources/load_i2s_driver.sh -echo "cd $I2S_ROOT" > $i2s_driver_script -echo "sudo insmod loader/loader.ko" >> $i2s_driver_script - -# -# Configure the I2C - disable the default built-in driver -# -sudo sed -i -e 's/#\?dtparam=i2c_arm=on/dtparam=i2c_arm=off/' /boot/config.txt -sudo sh -c 'echo i2c-bcm2708 >> /etc/modules-load.d/modules.conf' -sudo sh -c 'echo "options i2c-bcm2708 combined=1" >> /etc/modprobe.d/i2c.conf' - -# -# Build a new I2C driver -# -cd $I2S_ROOT -git clone git://github.com/kadamski/i2c-gpio-param.git -pushd $I2S_ROOT/i2c-gpio-param > /dev/null -make -popd > /dev/null - -# -# Create script to insert module into the kernel -# -i2c_driver_script=$I2S_ROOT/resources/load_i2c_gpio_driver.sh - -echo "cd $I2S_ROOT/i2c-gpio-param" > $i2c_driver_script -echo "# Load the i2c bit banged driver" >> $i2c_driver_script -echo "sudo insmod i2c-gpio-param.ko" >> $i2c_driver_script -echo "# Instantiate a driver at bus id=1 on same pins as hw i2c with 1sec timeout" >> $i2c_driver_script -echo "sudo sh -c 'echo "1 2 3 5 100 0 0 0" > /sys/class/i2c-gpio/add_bus'" >> $i2c_driver_script -echo "# Remove the default i2c-gpio instance" >> $i2c_driver_script -echo "sudo sh -c 'echo 7 > /sys/class/i2c-gpio/remove_bus'" >> $i2c_driver_script - -# -# Setup the crontab to restart I2S/I2C at reboot -# -echo "@reboot sh $i2s_driver_script" > $I2S_ROOT/resources/crontab -echo "@reboot sh $i2c_driver_script" >> $I2S_ROOT/resources/crontab -crontab $I2S_ROOT/resources/crontab diff --git a/snd_driver/Makefile b/snd_driver/Makefile deleted file mode 100644 index 1bdea7c..0000000 --- a/snd_driver/Makefile +++ /dev/null @@ -1,5 +0,0 @@ -obj-m := asoc_simple_card.o -KDIR := /lib/modules/$(shell uname -r)/build -PWD := $(shell pwd) -default: - $(MAKE) -C $(KDIR) SUBDIRS=$(PWD) modules diff --git a/snd_driver/bclk_patch.txt b/snd_driver/bclk_patch.txt deleted file mode 100644 index 322e146..0000000 --- a/snd_driver/bclk_patch.txt +++ /dev/null @@ -1,14 +0,0 @@ -*************** static int asoc_simple_card_dai_init(str -*** 205,210 **** ---- 205,215 ---- - if (ret < 0) - return ret; - -+ ret = snd_soc_dai_set_bclk_ratio(cpu, 64); -+ if (ret < 0) -+ return ret; -+ pr_alert("BCLK ratio set to 64!\n"); -+ - return 0; - } - From 57b9e9873ab8aa388af3ca149d90ca5227306160 Mon Sep 17 00:00:00 2001 From: Daniel Follent Date: Wed, 28 Mar 2018 10:05:58 +0100 Subject: [PATCH 3/4] Removed gitignore --- .gitignore | 6 ------ 1 file changed, 6 deletions(-) delete mode 100644 .gitignore diff --git a/.gitignore b/.gitignore deleted file mode 100644 index 0e577e7..0000000 --- a/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -*.o.cmd -*.o -*.ko -*.order -AlexaClientSDKConfig* -time_taken.txt From 68763515e95148e3057558a85d837caca46a972e Mon Sep 17 00:00:00 2001 From: Daniel Follent Date: Wed, 28 Mar 2018 14:56:35 +0100 Subject: [PATCH 4/4] Correction to README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 8fb8ee6..74a1b37 100644 --- a/README.md +++ b/README.md @@ -39,7 +39,7 @@ Brief instructions and additional notes are below: 3. Create a new Alexa device by following: https://github.com/alexa/alexa-avs-sample-app/wiki/Create-Security-Profile (Note: the *Allowed Origins* and *Allowed Return URLs* should use **http**, not https.) -4. Run the installation script: `source ~/vocalfusion-stereo-avs-setup/auto_install.sh` +4. Run the installation script: `source ~/vocalfusion-avs-setup/auto_install.sh` You will be prompted enter your Alexa device details (*ProductID*, *ClientID* and *ClientSecret*), a serial number and your location. Wait for the sensory (keyword detection) repository to clone, then read and accept the license agreement. Wait for the script to complete the installation. This can take a while, for example: