[Solved] Kitt_ai wakeword engine still not working on Matrix VOICE

Yep - I had correct script.

../../KWD/KittAi/src/libKITTAI.so: undefined reference to `snowboy::SnowboyDetect::SetSensitivity(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
../../KWD/KittAi/src/libKITTAI.so: undefined reference to `snowboy::SnowboyDetect::SnowboyDetect(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
collect2: error: ld returned 1 exit status
SampleApp/src/CMakeFiles/SampleApp.dir/build.make:358: recipe for target 'SampleApp/src/SampleApp' failed
make[3]: *** [SampleApp/src/SampleApp] Error 1
CMakeFiles/Makefile2:8088: recipe for target 'SampleApp/src/CMakeFiles/SampleApp.dir/all' failed
make[2]: *** [SampleApp/src/CMakeFiles/SampleApp.dir/all] Error 2
CMakeFiles/Makefile2:8100: recipe for target 'SampleApp/src/CMakeFiles/SampleApp.dir/rule' failed
make[1]: *** [SampleApp/src/CMakeFiles/SampleApp.dir/rule] Error 2
Makefile:2084: recipe for target 'SampleApp' failed
make: *** [SampleApp] Error 2```

So this works on my 3B (some booting here & there):

firstly do a fresh Stretch install

curl https://apt.matrix.one/doc/apt-key.gpg | sudo apt-key add -
echo "deb https://apt.matrix.one/raspbian $(lsb_release -sc) main" | sudo tee /etc/apt/sources.list.d/matrixlabs.list
sudo apt-get update -y
sudo apt-get upgrade -y
sudo apt-get autoremove -y
echo "dtoverlay=matrixio" | sudo tee -a /boot/config.txt
echo "matrixio-everloop" | sudo tee -a /etc/modules
echo "audio_pwm_mode=1" | sudo tee -a /boot/config.txt
sudo apt install -y matrixio-creator-init
sudo apt install matrixio-kernel-modules
wget https://raw.githubusercontent.com/matrix-io/avs-device-sdk/yc/kitt_ai/tools/MatrixLabs/setup.sh
wget https://raw.githubusercontent.com/matrix-io/avs-device-sdk/ada5a8c0222e4af5a3310ffe49e306d6903b0be1/tools/MatrixLabs/config.txt
sudo bash setup.sh config.txt
sudo bash startauth.sh
open browser to finnish the authentication on local 3000
sudo bash startsample.sh

but I have not been able to change the wakeword or add sounds for recognising (or not) the wakeword…
Kitt_ai website talks about modifying “KittAiSnowboyWakeWordEngine.cpp”, but I dont seem to have it.

EDIT: this setup still uses Sensory… that is not my goal; so title valid: Kitt_ai still not working.

This shouldn’t be needed:

echo "dtoverlay=matrixio" | sudo tee -a /boot/config.txt
echo "matrixio-everloop" | sudo tee -a /etc/modules
echo "audio_pwm_mode=1" | sudo tee -a /boot/config.txt

Is great to hear it worked!

I will take a look at the adding sounds part.


echo “audio_pwm_mode=1” | sudo tee -a /boot/config.txt
It doesnt work for me.

Any hints on how to change the wakeword?

@yoelrc88 Hi, any updates to get kitt_ai to work?

Yes, https://github.com/matrix-io/avs-device-sdk has been updated with latest 1.7SDk from amazon and Kitt_ai wakeword engine is added as an option.

Follow here: https://github.com/matrix-io/avs-device-sdk/blob/master/tools/MatrixLabs/README.md

Is setup by defaut to use Sensory but to change it to Kitt_ai modify /tools/MatrixLabs/setup.sh line 46 before running this script:

Let me know how it goes.


Hi @yoelrc88,
First of all thank you for your efforts, secondly have you ever tested this from scratch?
I did and besides another lost evening, the result was utter failure - again:
“CMakeFiles/Makefile2:3687: recipe for target ‘SampleApp/src/CMakeFiles/SampleApp.dir/rule’ failed
make[1]: *** [SampleApp/src/CMakeFiles/SampleApp.dir/rule] Error 2
Makefile:992: recipe for target ‘SampleApp’ failed
make: *** [SampleApp] Error 2”
If you start from a fresh Stretch image and follow the instructions to the letter, it fails.
I posted the full output in your fork, issue 1, build issues (https://github.com/matrix-io/matrixio-alexa-sdk-guide/issues)

Main error: [ 56%] Building CXX object CapabilityAgents/PlaybackController/src/CMakeFiles/PlaybackController.dir/PlaybackController.cpp.o
c++: internal compiler error: Killed (program cc1plus).

Please test from scratch - I assume you have upgraded/downgraded the gcc etc…

Yes, I tested it. Just maybe not from complete scratch, I will try to reproduce this error starting from an empty SdCard.

Thank for the feedback.

Please check the output I posted, this compiler error is strange (new stretch image). Just tested again. Same result - it hangs at 56%

I am on it :slight_smile: … using 2018-04-18 Raspbian Stretch.

Mine hung at the same point. Same percentage of build, but different file. Mine was hung at settings.cpp. I cancelled, and rebooted. 2nd time it said it ran out of Virtual Memory. Rebooted again and it compiled just fine.

I’m not using a fresh install of Stretch.

@OPK, You are right, it stops around 56% I think is related to using -j4 (using all processors) when building, Virtual Memory issue probably. I am double-checking everything but if this is the problem you have to options:

  • using -j2 as the official repo does (i just changed this at some point to make it faster :slight_smile: ).
  • increase the swapfile size, see here.

After the test I will be changing it to -j2 too in master.


Thanks for testing too ! Did it finally work?

I was getting authorization errors and traced it back to not generating a new Client ID (can’t use the one from the device, have to generate a new one “Security Profiles - Other devices and platforms” ).

At least I’m hoping that is what the problem was.

I’m re-compiling now with the -j2 option instead of -j4.

The sampe config.txt file does not have a line for CLIENT_SECRET. I put mine in, assuming that it needs it.


1 Like

Thanks for pointing that out @gapdev.

You can also try to build your own models and use it, just need few changes in the script.


1 Like

Hmm, maybe the Rpi overheated while using j4. Ive seen that before.
@yoelrc88 Question: when using a new wakeword model, do you need to run setup.sh again?
Btw I also put the Client_Secret in.

@gapdev any luck with the authorisation? I get errors also (with the new Other Devices and Platforms codes):


CBLAuthDelegate:receiveTokenResponse:code=400,body={“error_description”:“The code pair has not been authorized”,“error”:“authorization_pending”}

That was the error I was having. I got the new Client ID from Security Profile, Other Devices, put it into config.txt, recompiled and got the same error. I then deleted everything and started from scratch with the new Client ID and it works.


I think that also happened to me at some point. I wanted to fix it without starting from scratch, removing the /db/cblAuthDelegate.db file did the trick.


No, just modify the script.

Re-build is needed just when switching between wakeword engines (Sensory and Kitt_ai).