Error handling in nodejs native client

I am trying to run the nodejs examples.
The single file example transcribes a short audio sample fine but crashes on a longer audio file.
The streaming example crashes when sctx = model.setupStream(150,16000); is called for a second time after the transcription.

In both cases the node process dies immediately on error. I can’t find a way to handle the error coming up from node-gyp and continue. I can only think to spawn a child process for the transcoder that can die. Messy.

  1. Any suggestions on handling errors coming from the module?
  2. Would the python client also suffer from this problem?
  3. What’s the first parameter in setupStream? Second parameter 16000 I presume is sample rate.

Error transcript for the single file sample (with a large audio file) follows

# model parameters hacked into index.js
nodejs index.js --audio name.wav     
Loading model from file /models/output_graph.pbmm
TensorFlow: v1.12.0-10-ge232881
DeepSpeech: v0.4.1-0-g0e40db6
2019-01-24 23:21:22.334963: I tensorflow/core/platform/cpu_feature_guard.cc:141] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA
Loaded model in 0.005761s.
Running inference.
Transcription:  ing to bat a morrow i could decide what to wear to night and lay ut my clothes
Inference took 2.202s.

nodejs: symbol lookup error: /media/stever/Data/projects/DeepSpeech/examples/ffmpeg_vad_streaming/node_modules/deepspeech/lib/binding/v0.4.1/linux-x64/node-v57/deepspeech.node: undefined symbol: _ZN2v87Isolate19CheckMemoryPressureEv

Are we talking about the symbol loookup error ? If so, I don’t really know, it’s dlopen() that fails … It should not even happen.

No idea, test?

It would help if you could be more specific on your system specs and what you call “large audio file”. Also, you are hacking around with the ffmpeg_vad_streaming, not directly the NodeJS bindings.

FYI @syntithenai, checking here:

$ objdump -tTC package/lib/binding/v0.5.0-alpha.0/linux-x64/node-v57/deepspeech.node | grep CheckMemoryPressure
0000000000000000         *UND*  0000000000000000              v8::Isolate::CheckMemoryPressure()
0000000000000000      D  *UND*  0000000000000000              v8::Isolate::CheckMemoryPressure()
$ objdump -tT package/lib/binding/v0.5.0-alpha.0/linux-x64/node-v57/deepspeech.node | grep CheckMemoryPressure
0000000000000000         *UND*  0000000000000000              _ZN2v87Isolate19CheckMemoryPressureEv
0000000000000000      D  *UND*  0000000000000000              _ZN2v87Isolate19CheckMemoryPressureEv

So the missing symbol is something that should be exposed by v8, i.e., NodeJS, v57 means it’s NodeJS v8.15.

On my system, the symbol is properly exposed by /usr/bin/nodejs:

$ objdump -tT /usr/bin/nodejs | grep Isolate.*CheckMemoryPressure
0000000000a86970 g     F .text  000000000000000e              _ZN2v87Isolate19CheckMemoryPressureEv
0000000000a86970 g    DF .text  000000000000000e  Base        _ZN2v87Isolate19CheckMemoryPressureEv

Where is your nodejs coming from ?

node -v
v8.11.4
root@stever-GT62VR-6RD:/projects/DeepSpeech/examples/ffmpeg_vad_streaming# uname -r
4.18.0-13-generic

ta
S

Node from the system packager? Try to install from nodejs directly, we only support those.

that did it, thank you.

cheers

S