justinlatimer / node-midi

A node.js wrapper for RtMidi providing MIDI I/O

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error macOS initialization error -50

tschiemer opened this issue · comments

Message from nodejs looks as follows:

MidiInCore::initialize: error creating OS-X MIDI client object (-50).

Can (possibly) randomly occur - depends on when/if RtMidi objects are deleted using the object destructors which is decided by the nodejs garbage collector.

Reproduce by running node --expose-gc XY.js of (no other macOS MIDI Clients active):

const midi = require('midi');

var i = 0;

// Close the port when done.
setInterval(function() {
  console.log(`Round ${++i}`);

  global.gc();

  var input = new midi.Input();

  delete input;

}, 1000);

Documented for informational purposes, underlying RtMidi problem on macOS systems, likely to be fixed in the future:

thestk/rtmidi#155

Updated RtMidi in 7c65943, published to npm in v2.0.0