evancohen / sonus

:speech_balloon: /so.nus/ STT (speech to text) for Node with offline hotword detection
MIT License
619 stars 79 forks source link

Sonus not installing on raspberry pi3 #29

Closed shekit closed 7 years ago

shekit commented 7 years ago

Hey, having a problem installing sonus on:

RPi3 Debian Jessie with Pixel Version January 2017 Sonus version - 0.1.4 Node v7.4.0 npm v4.0.5

All dependencies installed

When I run npm install for sonus to install from package - it fails at grpc@0.15.0 install: 'node-pre-gyp install fallback-to-build'

It does not create a folder for sonus in the node modules. When I run the Electron app (v1.4.14), it says module sonus cannot be found. This is my barebones app - https://github.com/shekit/small-peeqo-tests/tree/master/sonustest

I was able to successfully install grpc separately using the --unsafe-perm flag but when I try to install sonus it fails at the same point.

evancohen commented 7 years ago

Currently Node 7.x isn't supported. Can you try Node 6.x?

shekit commented 7 years ago

Great! Works in Node 6.x!

Node - 6.9.4 Npm - 3.10.10

hvaddi9 commented 7 years ago

Hey, I'm having a problem in running sonus

I tried to install sonus in Node 6.10.0 npm 3.10.0 and I got these errors during installation

node-pre-gyp ERR! Tried to download(404): https://storage.googleapis.com/grpc-precompiled-binaries/node/grpc/v1.1.2/node-v48-linux-arm.tar.gz 
node-pre-gyp ERR! Pre-built binaries not found for grpc@1.1.2 and node@6.10.0 (node-v48 ABI) (falling back to source compile with node-gyp) 
.
.
.
.
.
[snowboy] Success: "/home/pi/node_modules/snowboy/lib/node/binding/Release/node-v48-linux-arm/snowboy.node" is installed via remote
npm WARN saveError ENOENT: no such file or directory, open '/home/pi/package.json'
.
.
.
.
.
npm WARN enoent ENOENT: no such file or directory, open '/home/pi/package.json'
npm WARN pi No description
npm WARN pi No repository field.
npm WARN pi No README data
npm WARN pi No license field.

Then i tried to run the example.js from examples directory and this happened

pi@raspberrypi:~/node_modules/sonus/examples $ node example.js
ERROR (Input():snowboy-io.cc:266) Fail to open input file "node_modules/snowboy/resources/common.res"
terminate called after throwing an instance of 'std::runtime_error'
  what():  ERROR (Input():snowboy-io.cc:266) Fail to open input file "node_modules/snowboy/resources/common.res"

[stack trace: ]
/home/pi/node_modules/snowboy/lib/node/binding/Release/node-v48-linux-arm/snowboy.node(_ZN7snowboy13GetStackTraceEv+0x34) [0x748a1ff8]
/home/pi/node_modules/snowboy/lib/node/binding/Release/node-v48-linux-arm/snowboy.node(_ZN7snowboy13SnowboyLogMsgD1Ev+0x4b8) [0x748a2638]
/home/pi/node_modules/snowboy/lib/node/binding/Release/node-v48-linux-arm/snowboy.node(_ZN7snowboy5InputC1ERKSs+0x264) [0x74897194]
/home/pi/node_modules/snowboy/lib/node/binding/Release/node-v48-linux-arm/snowboy.node(_ZN7snowboy22UnpackPipelineResourceERKSsPSs+0x28) [0x7488eb18]
/home/pi/node_modules/snowboy/lib/node/binding/Release/node-v48-linux-arm/snowboy.node(_ZN7snowboy13SnowboyDetectC1ERKSsS2_+0x1d4) [0x7487d44c]
/home/pi/node_modules/snowboy/lib/node/binding/Release/node-v48-linux-arm/snowboy.node(_ZN13SnowboyDetectC1ERKSsS1_+0x54) [0x7487bc70]
/home/pi/node_modules/snowboy/lib/node/binding/Release/node-v48-linux-arm/snowboy.node(_ZN13SnowboyDetect3NewERKN3Nan20FunctionCallbackInfoIN2v85ValueEEE+0x428) [0x7487c148]
/home/pi/node_modules/snowboy/lib/node/binding/Release/node-v48-linux-arm/snowboy.node(+0x19934) [0x74879934]

Aborted

I tried to run microphone.js in snowboy's examples. It didn't work either

pi@raspberrypi:~/node_modules/snowboy/examples/Node $ node microphone.js
Recording with sample rate 16000...
End Recording: 139.018ms

I'm using Raspberry PI 3 Model B. OS: Raspbian Jessie with Pixel I'm using Playstation Eye as microphone and the device is detected (checked it in arecord -l) What do I do now? Did I miss something?

evancohen commented 7 years ago

@hvaddi9 it looks like something is funky with your installation. Can you describe how you got into this state (how did you get Sonus and the dependencies on your Pi)

evancohen commented 7 years ago

From the error you provided it looks like you tried to install sonus into your users home directory (which in this case isn't an npm project)

hvaddi9 commented 7 years ago

@evancohen I installed these dependencies first

sudo apt-get install swig3.0 python-pyaudio python3-pyaudio sox libsox-fmt-all
pip install pyaudio
sudo apt-get install libatlas-base-dev

then i installed sonus pi@raspberrypi:~ $ npm install --save sonus

evancohen commented 7 years ago

Ah, you aren't installing it into a npm project. You have two options:

You may also want to copy the example to the root of your newly created project (and make the nessesary changes to require('sonus') instead of a relative path)

On Sun, Mar 5, 2017, 4:04 AM Hemanth Sandesh Vaddi notifications@github.com wrote:

@evancohen https://github.com/evancohen I installed these dependencies first

sudo apt-get install swig3.0 python-pyaudio python3-pyaudio sox libsox-fmt-all pip install pyaudio sudo apt-get install libatlas-base-dev

then i installed sonus pi@raspberrypi:~ $ npm install --save sonus

— You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub https://github.com/evancohen/sonus/issues/29#issuecomment-284223352, or mute the thread https://github.com/notifications/unsubscribe-auth/ABJJHWNI3el1Xr1pDHD-OLU1x37rqf-sks5riqSzgaJpZM4Lnob7 .

--

//mobile

hvaddi9 commented 7 years ago

I created a new project, installed sonus and i've run example.js from the root of project . Now it runs and terminates immediately.

**@*****:~/Documents/*** $ node example.js
Say "sonus"...
**@*****:~/Documents/*** $ 
evancohen commented 7 years ago

Silent failure, that's not fun... looks like the detector isn't running. How is your microphone configured on the Pi?

You probably want to have it set up like this: https://docs.smart-mirror.io/docs/configuring-sound.html#Scripted_Audio_Configuration

On Sun, Mar 5, 2017, 4:37 AM Hemanth Sandesh Vaddi notifications@github.com wrote:

I created a new project, installed sonus and i've run example.js from the root of project . Now it runs and terminates immediately.

@****:~/Documents/ $ node example.js Say "sonus"... @****:~/Documents/ $

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/evancohen/sonus/issues/29#issuecomment-284225055, or mute the thread https://github.com/notifications/unsubscribe-auth/ABJJHTXBA6-EKVhuFhu4k8Dy2jW2K05Hks5riqyTgaJpZM4Lnob7 .

--

//mobile

hvaddi9 commented 7 years ago

OMG! Its working. I did not replace the contents of sound config file

I was told to configure it but i couldn't find the command anywhere. Finally found it in your docs rm -f ~/.asoundrc && nano ~/.asoundrc

Thank you very much @evancohen . Big fan of your work

alightedlamp commented 6 years ago

I was also getting this error:

ERROR (Input():snowboy-io.cc:266) Fail to open input file "node_modules/snowboy/resources/common.res"
terminate called after throwing an instance of 'std::runtime_error'
  what():  ERROR (Input():snowboy-io.cc:266) Fail to open input file "node_modules/snowboy/resources/common.res"

I had my project files in a src directory, moving them up to the project's root fixed it.