nrkno / sofie-atem-connection

Sofie ATEM Connection: A Part of the Sofie TV Studio Automation System
https://github.com/nrkno/Sofie-TV-automation/
MIT License
134 stars 36 forks source link

unhandled error event at first connection #69

Closed PeterMaes closed 4 years ago

PeterMaes commented 4 years ago

Trying to connect to the Atem Television Studio (the older one, not the HD version) but I get this error trown. Tried with different firmware on the TVS (Atem Software Control V7.5.2 and V8.1) both with the same result.

..... video.ME.0.programInput video.ME.0.previewInput video.ME.0.transitionProperties video.ME.0.transitionPreview video.ME.0.transition video.ME.0.transitionSettings.mix video.ME.0.transitionSettings.dip video.ME.0.transitionSettings.wipe events.js:183 throw er; // Unhandled 'error' event ^

Error: Number too small: 0 < 1 at Object.parseNumberBetween (/volume1/NodeJS/testatem/node_modules/atem-connection/dist/lib/atemUtil.js:30:19) at TransitionDVEUpdateCommand.deserialize (/volume1/NodeJS/testatem/node_modules/atem-connection/dist/commands/MixEffects/Transition/TransitionDVECommand.js:56:32) at AtemSocket._parseCommand (/volume1/NodeJS/testatem/node_modules/atem-connection/dist/lib/atemSocket.js:159:21) at AtemSocket._parseCommand (/volume1/NodeJS/testatem/node_modules/atem-connection/dist/lib/atemSocket.js:172:18) at AtemSocket._parseCommand (/volume1/NodeJS/testatem/node_modules/atem-connection/dist/lib/atemSocket.js:172:18) at AtemSocket._parseCommand (/volume1/NodeJS/testatem/node_modules/atem-connection/dist/lib/atemSocket.js:172:18) at AtemSocket._parseCommand (/volume1/NodeJS/testatem/node_modules/atem-connection/dist/lib/atemSocket.js:172:18) at AtemSocket._parseCommand (/volume1/NodeJS/testatem/node_modules/atem-connection/dist/lib/atemSocket.js:172:18) at AtemSocket._parseCommand (/volume1/NodeJS/testatem/node_modules/atem-connection/dist/lib/atemSocket.js:172:18) at AtemSocket._receiveSubprocessMessage (/volume1/NodeJS/testatem/node_modules/atem-connection/dist/lib/atemSocket.js:142:22)

Julusian commented 4 years ago

The quick fix is to add an error handler and ignore the 'error' eg

myAtem.on('error', function(err) {
  console.log(err);
});

This has been reported many times before and is something that we are aware needs fixing https://github.com/nrkno/tv-automation-atem-connection/issues/24 https://github.com/nrkno/tv-automation-atem-connection/issues/61 https://github.com/nrkno/tv-automation-atem-connection/issues/15

PeterMaes commented 4 years ago

quick fix applied :-) sorry for the issue report, seems I need to improve my skills :-)