Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

npm run sonus error UnhandledPromiseRejectionWarning after a while #22

Closed
shoten opened this issue Dec 1, 2016 · 5 comments
Closed
Labels

Comments

@shoten
Copy link

shoten commented Dec 1, 2016

Description :
Sonus is in the smart mirror project, in this project I have the error below after let's say 5 to 8 mn of running, the hotword detection works fine and I have no problem with the google speech api.

How to reproduce

pi@raspberrypi:~/smart-mirror-master $ npm run sonus

smart-mirror@0.0.6 sonus /home/pi/smart-mirror-master
node sonus.js
(node:31118) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: stdout maxBuffer exceeded

Comments
At first I thought it was an issue on the smart-mirror or in my config.js file, but then I ran
"npm run sonus" just to test the audio capture, just wait around 5 to 8 mn and to do nothing and the error occured too.

Configuration
For information, this is my configuration

pi@raspberrypi: ~/smart-mirror-master $ node -v
v6.9.1
pi@raspberrypi: ~/smart-mirror-master $ npm -v
3.10.8

Ideas
From what I have read around the web, it can be caused by two main things

  1. set the maxBuffer option when using child_process.exec
    stdout-buffer-issue-using-node-child-process

  2. a missing catch in a promise call
    promise-reject-possibly-unhandled-error

Do you have an idea ?

Laurent

@shoten shoten changed the title npm run sonus npm run sonus error UnhandledPromiseRejectionWarning after a while Dec 1, 2016
@sce9sc
Copy link

sce9sc commented Dec 1, 2016

this issue is with node-record-lpcm16 it uses execa

@evancohen
Copy link
Owner

evancohen commented Dec 2, 2016

Thanks for the detailed issue! I'll take a look at this over the weekend.

The Node.js Child Processes module (child_process) has two functions spawn and exec,
the difference between the two is in what they return - spawn returns a stream and exec returns a buffer. As @sce9sc mentioned, node-record-lpcm16 uses execa (which in turn uses exec) and actually converts the buffer that it gets from execa into a stream.

I'm going to look into creating a custom implementation for this, because it looks like node-record-lpcm16 doesn't meet our needs.

@Fijvect
Copy link

Fijvect commented Dec 6, 2016

Hey Evan! Any luck so far? I'm researching workarounds in the meantime... but am not having much luck :(

@evancohen
Copy link
Owner

This should be fixed with the most recent version of sonus 0.1.2 :)

Upgrade and reinstall dependencies and let me know if that works for you.

@Fijvect
Copy link

Fijvect commented Dec 6, 2016

Just updated everything and it's working perfectly! Thank you so much!! :D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants