Closed chenguoguo closed 7 years ago
Hello, I've got a similar problem. I'm using Raspberry Pi 2 Model B with Node v4. 6.2 (arm7). But in my case RAM is increasing and snowboy stops detecting (actually freezing) everytime RaspPi reaches 137000 KB of RAM. When executed my node snowboy. js, ps aux shows it uses around 126M of memory and it increases quite fast depending on noises but it freezes everytime when 138M is reached. My free RAM is around 700M on my Rasbian Jessie. Did not check Python though.
Greetings Nycon
@DeusRa you're likely experiencing something slightly different. Your issue is likely due to a recent change in the recording library that we're using: gillesdemey/node-record-lpcm16#15
I think we've found a viable solution, so hopefully this will be fixed shortly.
@chenguoguo I'm also seeing a similar problem. I've upgraded node-record-lpcm16
to 0.1.8, but it definitely seems to slow down from ~1 second between detections to ~4 seconds between detections. I'm running Node.js with Ubuntu 14.04.
thanks for reporting @mevatron . @evancohen is working on a fix, i'll give it a shot when i get time too
I may have a fix for this now, but I'll need to do some more testing evancohen/sonus#27
Ok. I think I finally figured out what is going on here, not by understanding what the issue is, but by finding what appears to be the solution: Don't use sox. Instead, use arecord.
https://github.com/evancohen/sonus/pull/30
With this change I've seen ~2-3x performance boost in detection using the node library on the Pi.
@telarium and @mevatron can you test the latest version of Sonus and use arecord
?
I can confirm that using arecord solves this issue.
Email from hudreous@gmail.com:
It happens pretty early for me... usually after about 6 hotword detections, the lag between the spoken word and the detection becomes around 2 seconds. I have only tried it with Node so far, since the Python example doesn't seem to work on my Ubuntu 16.04 installations and I can't seem to make the C++ example successfully.
I didn't notice any CPU or RAM increases with node as the lag became an issue. Killing all node processes doesn't seem to help.
I was just able to fully test the Python example. It does not have this problem.