josephdadams / midi-relay

Listens for HTTP request with JSON payload and relays MIDI/MSC commands on local ports.
MIT License
58 stars 9 forks source link

Crashes when loaded via Companion shell command #46

Open phillipkliewer opened 1 year ago

phillipkliewer commented 1 year ago

Midi-Relay v3.1.2 Companion v3.1.1 Windows 10 Pro

Midi-relay fails to control our Roland V8HD video switch after turning the switch off and back on, even though midi-relay sees the V8HD port.

We need to restart midi-relay to get it working again. Run a bat file via shell path that does the following via a companion button: taskkill /im midi-relay.exe /t /f timeout 10 "C:\Users\FBC Sound Booth\AppData\Local\Programs\midi-relay\midi-relay.exe"

This works for a while, but then midi-relay throws this error and crashes: Unhandled Error Error: EPIPE: broken pipe, write at Socket._write (node:internal/net:55:25) at writeOrBuffer (node:internal/streams/writable:389:12) at _write (node:internal/streams/writable:330:10) at Socket.Writable.write (node:internal/streams/writable:334:10) at console.value (node:internal/console/constructor:286:16) at console.log (node:internal/console/constructor:360:26) at F.<anonymous> (C:/Users/FBC Sound Booth/AppData/Local/Programs/midi-relay/resources/app.asar/midi.js:157:17) at F._and (C:/Users/FBC Sound Booth/AppData/Local/Programs/midi-relay/resources/app.asar/node_modules/jzz/javascript/JZZ.js:100:23) at F._R._exec (C:/Users/FBC Sound Booth/AppData/Local/Programs/midi-relay/resources/app.asar/node_modules/jzz/javascript/JZZ.js:42:12) at F._R._push (C:/Users/FBC Sound Booth/AppData/Local/Programs/midi-relay/resources/app.asar/node_modules/jzz/javascript/JZZ.js:45:96)

If we manually close midi-relay and open it, it works fine, but we need a way to automate the restarting of midi-relay 3+ that doesn't crash it

josephdadams commented 12 months ago

How long does it work before crashing? Does it crash every time?

phillipkliewer commented 11 months ago

How long does it work before crashing? Does it crash every time?

Yes, starting it with the script causes it to crash every time within 1-5 minutes.

However, if we add "start /d" in front of "C:\Users\FBC Sound Booth\AppData\Local\Programs\midi-relay\midi-relay.exe" it works just fine, no crashes - so maybe a CMD memory issue? Not sure.

rmk36 commented 7 months ago

+1 on this issue. Win 11, MR 3.3.0

I have a Companion trigger to kill (via a batch file) and relaunch midi-relay whenever my midi device joins the LAN (indicating it was just powered on). It initially appears to work just fine, but a later get a popup error shown below. Currently, I see no way to automate this as I also can't launch midi-relay.exe from CMD and then close the terminal window. As soon as I close the terminal window, the midi-relay process stops.

image_2024-03-29_125001324

Capture

Thanks Joseph for this awesome tool!

rmk36 commented 7 months ago

However, if we add "start /d" in front of "C:\Users\FBC Sound Booth\AppData\Local\Programs\midi-relay\midi-relay.exe" it works just fine, no crashes - so maybe a CMD memory issue? Not sure.

Ok, I tried adding this method and it seems to work fine for me now.