nrkno / sofie-atem-connection Goto Github PK
View Code? Open in Web Editor NEWSofie ATEM Connection: A Part of the Sofie TV Studio Automation System
Home Page: https://github.com/nrkno/Sofie-TV-automation/
License: MIT License
Sofie ATEM Connection: A Part of the Sofie TV Studio Automation System
Home Page: https://github.com/nrkno/Sofie-TV-automation/
License: MIT License
From where do you know that byte 8 describes the DVE
's?
My Atem 1 M/E Production Studio 4K gives me 04
for this value. And I know that this atem only has one DVE. So I think this is incorrect.
Hi,
listVisibleInputs is not working properly when MEs and supersource are nested.
For example :
You have SuperSource on your ME1
You have Input 1 on your ME2
In Box1 of your supersource, you have ME2
listVisibleInputs does not return input1, but it should.
Thank you very much !
I'm submitting a ...
[x] bug report
[ ] feature request
[ ] question about the decisions made in the repository
[ ] question about how to use this project
Summary
Child process keeps dying and spamming errors
Node v12.9.1
OS: MacOS
ATEM: 8.0.3
I get this error spammed into the console. Unfortunately no further info.
err: {
"type": "Error",
"message": "The socket process unexpectedly closed (code: \"1\", signal: \"null\")",
"stack":
Error: The socket process unexpectedly closed (code: "1", signal: "null")
at /Users/ronagy/GitHub/nxtedition/nxt/event/node_modules/atem-connection/dist/lib/atemSocket.js:102:36
at processTicksAndRejections (internal/process/task_queues.js:75:11)
}
Q: Why is a child process used here?
I'm submitting a ...
Summary
I'm using my ATEM Mini Pro with my Bitfocus Companion that uses this project.
If it's possible to control the new functionality would be nice, but at least controlling the Pro like the ATEM Mini would be a great start.
I'm submitting a ...
[*] bug report
Summary
I appear to have had another possible occurrence of #30. I noticed my cpu fan running pretty high and turns out I have 2 atem-connections still open and maxing out a core each.
Other information
Running v0.8.0
I had playout-gateway crash a couple of times on me earlier on today, this could have been caused by that, but the stack trace is unrelated
I found I could attach a debugger to the process (https://hackernoon.com/debugging-node-without-restarting-processes-bd5d5c98f200), and the console is being flooded with:
warning.js:18 (node:8448) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'emit' of undefined
at log (/home/julus/Projects/tv-automation-playout-gateway/node_modules/atem-connection/dist/lib/atemSocketChild.js:80:14)
at Object.onFailedAttempt (/home/julus/Projects/tv-automation-playout-gateway/node_modules/atem-connection/dist/lib/atemUtil.js:74:21)
at Promise.resolve.then.then.error (/home/julus/Projects/tv-automation-playout-gateway/node_modules/p-retry/index.js:44:14)
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:189:7)
warning.js:18 (node:8448) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 30132)
And a cpu profile: CPU-20181203T211452.zip
I cant think of anything else I can look at to get more info
I'm submitting a ...
[ ] bug report
[ ] feature request
[ ] question about the decisions made in the repository
[x] question about how to use this project
Summary
I am trying to get the real tally info of this module, but could not find the right info so far.
During transitions the tally info is showing a red indication on the Preview button (in Atem Software Control).
I am using state.video.ME[0].programInput and state.video.ME[0].previewInput to get program and preview state. But during transition these values do not represent the right info.
Below the info I have logged (timestamp in front)
Immediatly after sending the AutoTransition action I got an event that repeats the previewInput state. To me it seems this is wrong, but maybe I am missing some details here.
1586875643417 state.video.ME[0].programInput= 2
1586875643419 state.video.ME[0].previewInput= 1
1586875652282 KeyPress= AUTO/CUT
1586875652322 state.video.ME[0].previewInput= 1
--- transitions is happening here ---
1586875654302 state.video.ME[0].programInput= 1
1586875654303 state.video.ME[0].previewInput= 2
(In disconnect) The timers should be stopped even if the connection has not been established. The clearing of timers should be moved to above the "if (this._connectionState === ConnectionState.Established)
" check. ( or in the else if you want :P )
If I run disconnect() on the instance that has not connected, because I am going to delete the instance, there will be freerunning timers that I have no way to stop.
I'm submitting a ...
[x] bug report
[ ] feature request
[ ] question about the decisions made in the repository
[ ] question about how to use this project
Summary
I am trying to use atem-connection to connect to a Atem TVS using this code:
const { Atem } = require('atem-connection');
const myAtem = new Atem({ debug: true, externalLog: console.log });
myAtem.connect('10.0.0.35');
If the mixer is off, node is logging 'reconnect' every second,
but if the mixer is on node crashes with this error:
events.js:183
throw er; // Unhandled 'error' event
^
Error: Number too small: 0 < 1
at Object.parseNumberBetween ( - - - \node_modules\atem-connection\dist\lib\atemUtil.js:23:19)
at TransitionDVECommand.deserialize ( - - - \node_modules\atem-connection\dist\commands\MixEffects\Transition\TransitionDVECommand.js:17:32)
at AtemSocket._parseCommand ( - - - \node_modules\atem-connection\dist\lib\atemSocket.js:162:21)
at AtemSocket._parseCommand ( - - - \node_modules\atem-connection\dist\lib\atemSocket.js:171:18)
at AtemSocket._parseCommand ( - - - \node_modules\atem-connection\dist\lib\atemSocket.js:171:18)
at AtemSocket._parseCommand ( - - - \node_modules\atem-connection\dist\lib\atemSocket.js:171:18)
at AtemSocket._parseCommand ( - - - \node_modules\atem-connection\dist\lib\atemSocket.js:171:18)
at AtemSocket._receivePacket ( - - - \node_modules\atem-connection\dist\lib\atemSocket.js:130:18)
at Socket._socket.on ( - - - \node_modules\atem-connection\dist\lib\atemSocket.js:110:60)
at emitTwo (events.js:126:13)
I'm submitting a ...
[x] bug report
Summary
From: bitfocus/companion-module-bmd-atem#50
After reconnecting, the connected event can sometimes be emitted at least once a second
I'm submitting a ...
[x] bug report
[ ] feature request
[ ] question about the decisions made in the repository
[ ] question about how to use this project
Summary
I'm running a Atem Mini Pro. It is updated to 8.2.3. Its videoMode
(this.state.settings.videoMode
) is set to 27
, while atemUtil_1.Util.getResolution
only has an array of 20 elements. As a result, I am unable to upload stills.
Other information (e.g. detailed explanation, stacktraces, related issues, suggestions how to fix, links for us to have context, eg. StackOverflow, personal fork, etc.)
The array in atemUtil.ts should probably be extended to fix this.
These are the modes I was able to identify with my AMP:
Tasks:
I'm submitting a ...
[*] bug report
Summary
https://github.com/nrkno/tv-automation-atem-connection/blob/fd3d045f8c2fcfb4ba4e12179ac50b3305f242b6/src/lib/atemSocketChild.ts#L157-L160
This acking strategy is dodgey. When you ack a packet, you are also acking any previous packets, meaning that if we dont get #101, but send an ack for #102, the atem thinks we received #101.
Something worth noting is that the atem appears to send acks on a timer instead of immediately, sending an ack for at most 16 packets at a time, with a max delay of a few ms. This could be good to do as a later perf improvement, as it will reduce the number of packets we need to send when receving a lot at once.
Depending on how the atem handles acks internally, it could also cause some confusion if we ack #102 then #101, as it is possible it could resend #102, although I am not sure if that happens or would be a problem for us.
The strategy I am using is to track the last packet, and if the received id is not the next number, then I discard it (knowing that id will be retransmitted) and I will batch the acking by the same rules as the atem uses.
This retransmit strategy doesnt appear to work. (this looks to be new in feature/upload and 0.6.0 looks fine, so probably just needs a revert)
As far as I am aware, if the atem doesn't ack a packet, then it needs to be retransmitted with the same id (along with anything sent after it?). If the sequence it receives skips a number it will wait for that missing one to be received before continuing.
Julusian@c8caeaa
A crude example for simulating a packet drop by making the sending code skip an id. It gets stuck trying to resend the last command, until it times out. And the command is never processed by the atem.
I'm submitting a ...
[ ] bug report
[X] feature request
[ ] question about the decisions made in the repository
[X] question about how to use this project
Summary
I am trying to find a way to set the X/Y position and scale of a Upstream Flying Key, however I cannot find which Command to use for it.
I'm submitting a ...
[ ] bug report
[ ] feature request
[ ] question about the decisions made in the repository
[ X] question about how to use this project
Summary
I want to listen to the Atem so i can get the current level of an audio input.
Other information (e.g. detailed explanation, stacktraces, related issues, suggestions how to fix, links for us to have context, eg. StackOverflow, personal fork, etc.)
I'm submitting a ...
[*] bug report
Summary
https://github.com/nrkno/tv-automation-atem-connection/blob/master/src/atem.ts#L103
When we call sendCommand(...)
, we internally track the command in _sentQueue
.
If the call to this.socket._sendCommand(...)
fails, then we reject the promise, but don't remove the command from _sentQueue
, and so will leak some commands.
Additionally, if the atem disconnects before a command is acked, I think we wont resolve or reject the promises remaining in _sentQueue
, again leaking them and leading to unresolved promises which could cause logic errors in library consumers.
Hi,
When you start a connection with an atem which have a supersource active and immediatly do a listVisibleInputs, Supersources Objects are not populated and the function listVisibleInput do crash
TypeError: Cannot read property 'artFillSource' of undefined
at Object.listVisibleInputs (atem-connection/dist/lib/tally.js:42:48)
Steps to reproduce :
Put Supersource in ME1
atemclient.on('stateChanged', function(err, state) {
console.log(atemclient.listVisibleInputs("program"))
});
Establish a connection with the atem.
Suggestion :
Check if supersource is populated during listVisibleInputs
atem-connection/dist/lib/tally.js at line 36, ssrc can return :
SuperSource { boxes: {}, index: 0 }
We need to check the existence of ssrc.properties before moving on.
Thank you very much !
I'm submitting a ...
[*] bug report
Affected
Constellation in v8.0.2
TV Studio HD in v7.5.2
2ME in v8.0.2
Unaffected
Atem Mini Pro ISO v8.6.4
Atem Mini Extreme ISO v8.6.4
(It is assumed that all of the mini range are unaffected by this)
Summary
Using setInputSettings
to set the longName of a source does not update the multiviewer.
Other connected clients picks up the new device name, so the set command does work successfully. But atem client is sending an encoded image with the new name, which we are not doing.
Notes
It is the same process as a stills upload, with the following differences:
storeId = 0xffff
mode (TransferMode) = 0x0201
transferIndex = sourceId
filename = 'Label'
description = ''
hash = 0x00
The image appears to be 8bit per pixel, with some unknown encoding. Viewing in greyscale looks weird, but is recognisable.
RLE encoding can be used during the upload.
For one model, the image is 640 x 190, and contains a render for each of 4k?, 1080, and 720. But this varies based on device capabilities.
WARNING
We found that sending images with a full gradient of grey would crash the ATEM, so this needs extensive testing to ensure that our implementation is safe.
Other information
Wireshark of example atem-set-source-name-does-upload.zip
Image extracted from wireshark capture: ripped-from-wireshark.zip
I'm submitting a ...
[ ] bug report
[x] feature request
[ ] question about the decisions made in the repository
[ ] question about how to use this project
Summary
I'm running this lib in a simple script on a relatively low performance Raspberry PI and after a week of runtime I noticed that the node processes using atem-connection
has high (8% average) overall CPU usage. Here is my proposal.
I dug down deep and found that this timer called _retransmitTimer
fires every 10 milliseconds a function called _checkForRetransmit
to check if there is any packets to resend (or reconnect if stuck, etc).
Since all its logic depends on the members of the _inFlight
array, I would kindly ask to enable the timer only when there are actual packets referenced in this array, and close() it once all packets are sent. This would also affect the startTimers
function which creates this timer right after connecting. This way we can spare CPU time.
If busy I'm happy to create a PR later but first I'll have to get familiar with TS.
[x ] bug report
[ ] feature request
[ ] question about the decisions made in the repository
[x ] question about how to use this project
Sorry for my english, i'm french
Here is our code used:
const Atem = require('atem-connection')
const myAtem = new Atem()
myAtem.on('info', console.log)
myAtem.on('error', console.error)
myAtem.connect('192.168.1.116')
myAtem.on('connected', () => {
myAtem.changeProgramInput(2).then(() => {
// Fired once the atem has acknowledged the command
// Note: the state likely hasnt updated yet, but will follow shortly
console.log('Program input set')
})
myAtem.setAudioMixerInputMixOption(1, 2).then(() => {
console.log('test')
})
})
I am currently working on this. Not sure if anyone else is, so I'd like to be careful about doubling up. There is some discussion in the #blackmagic Slack channel for Companion.
We can use this as an open discussion as well since I'm not going to drop a PR until I work through everything.
Currently major changes in the protocol are for SuperSource, which is to be expected since the new switcher supports two. The byte shifts are not awful and adding ssrcId = 0
as a parameter to existing calls seems ok. The main concern is that SSrc/CSSc has been split where SSrc maintains the existing structure (with ssrcId added) but all border related properties have moved to SSBd/CSBd. This would appear to break setSuperSourceProperties(..)
as any calls to that for border properties would move to setSuperSourceBorder(..)
. Or there may be some trickery I'm not seeing to not break that.
Open question is how to handle a release for v8 since there would be an expectation that all users of downstream software need to update their switchers to v8 to maintain compatibility. For me, if it weren't for us buying a Constellation all of our switchers would remain on v7.5.2 for some time until a v8.0.x were to come out. Certainly downstream software can elect to wait for a period to add this support regardless of a release adding it. Not sure if there should be a branch for a period to allow bug fixes for v7.5.2?
WIP code is visible in this repo: https://github.com/krocheck/internal-dev/tree/master/_node_/atem-connection/src
From where do you know that byte 8 describes the DVE
's?
My Atem 1 M/E Production Studio 4K gives me 04
for this value. And I know that this atem only has one DVE. So I think this is incorrect.
Because of an invalid parameter to Nanotimer, the retransmit timer is called on every tick. This makes the spawed client process utilize 100% cpu on a core.
The reason is that the interval argument should have been '10m' not '10ms'.
I'm submitting a ...
[ ] bug report
[ ] feature request
[ ] question about the decisions made in the repository
[X] question about how to use this project
Summary
I am writing an automation using this library, and need a way to automatically reconnect. There might be a case where there happens one of the following:
I need to make sure that the connection is automatically established (not only on server start). What would be the best pattern to do this?
I'm submitting a ...
[ ] bug report
[ ] feature request
[ ] question about the decisions made in the repository
[*] question about how to use this project
Summary
I'm changing an input's longName with myAtem.setInputSettings({longName: 'hey'}, 2)
This is functional, but does not propagate to the multiview labels. How is that meant to be done?
I'm submitting a ...
[ ] bug report
[x] feature request
[ ] question about the decisions made in the repository
[ ] question about how to use this project
Summary
On low-powered devices such as the Tessel 2, the default freezeLimit of 200ms is too aggressive, and causes the startup sequence to fail.
Other information (e.g. detailed explanation, stacktraces, related issues, suggestions how to fix, links for us to have context, eg. StackOverflow, personal fork, etc.)
It seems to take about 15 seconds to complete the initial socket creation and handshakes, but after that it is fine and seems to run relatively normally. That itself might be indicative of a bug.
I'm submitting a ...
[ ] bug report
[x] feature request
[ ] question about the decisions made in the repository
[ ] question about how to use this project
Summary
Please implement command for Macro Start Recording
I'm submitting a ...
[x?] bug report
[ ] feature request
[x] question about the decisions made in the repository
[ ] question about how to use this project
Summary
Im playing around with an ATEM Mini (Firmware: 8.2.3). Both AudioMixerInput- and AudioMixerMasterCommand do not work as expected (i.e. nothing noticably changes, ATEM does not send any response).
I've been playing around with the CFSP command to send audio options successfully and FASP command to receive them successfully as well. One thing I stumbled upon is the AudioMixOption
-enum which maps off to 0, on to 1 and afv to 2.
As far as I was able to reverse-engineer said commands I found that off equals 1, on equals 2 and afv equals 4.
Does the API use different mappings for the same keys, are AudioMixerInputCommands restricted to other ATEM devices or are the existing commands deprecated?
I'm submitting a ...
[ ] bug report
[x] feature request
[ ] question about the decisions made in the repository
[ ] question about how to use this project
Summary
I'm trying to dig into the Blackmagic Developer documentation and all I can see in the manual are the SDI camera control docs, however, the ATEM software now can control cameras over HDMI (BMPCC 4K, etc). I'm wondering if it is possible to add camera control support to this package.
I'll try throwing some commands at my ATEM Mini connected to a BMPCC 4K and see if I can get anything to work.
I would like the feature if possible. It would be so handy to do simple things like autofocus over a network command.
I'm submitting a ...
[ ] bug report
[x] feature request
[ ] question about the decisions made in the repository
[ ] question about how to use this project
Summary
Please implement command for Macro Run Change Properties for looping setting
Currently the media uploading in this library is significantly slower than the atem software. There appear to be a couple of factors that could be improved in the library in that regard.
The amount of packets sent per tick are limited by this constant https://github.com/nrkno/tv-automation-atem-connection/blob/master/src/dataTransfer/index.ts#L10
Doing some testing under node 8 with the strict-config branch reveals that setting this property to 40 can reduce upload speeds from ~1800ms to ~1400ms. Setting it higher (80) gives little benefit and setting it too high (160) gave many packet resends. Possibly this value should not be constant but instead be variable based on how many packets are resent.
Disabling multi threading in the strict-config branch gives me another 300-400ms benefit. Combining this with the aforementioned max packets constant optimization I can reach sub second transfers, which is an almost 2x improvement
The atem software applies RLE encoding as an optimization. I don't know how much faster that would make our transfers but it would optimize things where a lot of black is included such as lower thirds and logo bugs.
I'm submitting a ...
[x] bug report
[ ] feature request
[ ] question about the decisions made in the repository
[ ] question about how to use this project
Summary
At src/lib/atemSocket.ts#L114
, the name
of the AtemSocketChild
class can sometimes be a mangled/minified string, such as the single letter c
.
Later, when threadedClass@src/internalApi.ts#L296
loads the same module, it tries to find a class named c
on the module export, which does not exist, because the actual class name is AtemSocketChild
. This results in the following error being printed:
INIT error {}
Other information
This is when running on a Tessel 2 which runs Node v8.11.3, I haven't tested any other platforms or Node versions.
I don't actually know how or where this mangling of the class name occurs, nor why.
I'm submitting a ...
[X] bug report
[ ] feature request
[ ] question about the decisions made in the repository
[ ] question about how to use this project
Summary
Some strange data sent from my ATEM Television Studio causes the state to go bananas.
Other information
Among others, this data is sent into MixEffectKeyFlyPropertiesGetCommand.deserialize():
Buffer(0x509be28400000000)
this creates
this.mixEffect = 80
which in turn when calling state.video.getMe(this.mixEffect)
creates ME[80], effectively making ME into a sparse array, causing problems further down the line
I'm appending a wireshark trace, there are some other trange data in there as well, causing the state.video.ME[] to become [ [Object], <72 empty items>, [Object], <6 empty items>, [Object], <26 empty items>, [Object] ]
on the indexes [ '0', '73', '80', '107' ]
I'm submitting a ...
[X] bug report
[ ] feature request
[ ] question about the decisions made in the repository
[ ] question about how to use this project
Summary
After updating the Atem to Version 8.0.1 we had several errors. A downgrade to version 7.5.2 is not working either. There are still he same errors. Seems that i has something to to with the missing DVE.
I modified the atemUtil.ts to output all errors. So there may be subsequent parsing errors.
Number too small -871665072 -1000000 1000000 (commands\MixEffects\Key\MixEffectKeyDVECommand.ts:97:20)
Number too big 1768187213 -1000000 1000000 (commands\MixEffects\Key\MixEffectKeyDVECommand.ts:98:20)
Number too big 1817190497 -332230 332230 (commands\MixEffects\Key\MixEffectKeyDVECommand.ts:99:19)
Value 101 is not a valid option in enum (DVEEffect Enum; MixEffectKeyDVECommand.ts)
Number too big 12832 0 1600 (commands\MixEffects\Key\MixEffectKeyDVECommand.ts:104:27)
Number too small -72 0 100 (commands\MixEffects\Key\MixEffectKeyDVECommand.ts:106:30)
Number too big 34305 0 1000 (commands\MixEffects\Key\MixEffectKeyDVECommand.ts:113:27)
Number too big 97 0 3 (commands\MixEffects\Key\MixEffectKeyFlyPropertiesGetCommand.ts:13:25)
Number too big 121 0 3 (commands\MixEffects\Key\MixEffectKeyFlyPropertiesGetCommand.ts:14:31)
Number too big 15 0 3 (commands\MixEffects\Key\MixEffectKeyFlyKeyframeGetCommand.ts:13:25)
Number too big 170 0 3 (commands\MixEffects\Key\MixEffectKeyFlyKeyframeGetCommand.ts:14:31)
Number too big 75 1 2 (commands\MixEffects\Key\MixEffectKeyFlyKeyframeGetCommand.ts:16:21)
Number too big 1296389120 -32768000 32768000 (commands\MixEffects\Key\MixEffectKeyFlyKeyframeGetCommand.ts:22:20)
Number too big 1869762592 -32768000 32768000 (commands\MixEffects\Key\MixEffectKeyFlyKeyframeGetCommand.ts:23:20)
Number too big 827159908 -332230 332230 (commands\MixEffects\Key\MixEffectKeyFlyKeyframeGetCommand.ts:24:19)
Number too small -28141 -9000 9000 (commands\MixEffects\Key\MixEffectKeyFlyKeyframeGetCommand.ts:42:18)
Number too big 21316 -9000 9000 (commands\MixEffects\Key\MixEffectKeyFlyKeyframeGetCommand.ts:43:21)
We have several ATEM 2 M/E Production Studio 4K devices where we can downgrade the firmware without any other issues. Then it is possible to use the Old 0.10.0 version.
Do you have any current version of the protocol? The skaarhoj documentation does not support the new 8.0.1 version. With these informations i could fix the issues.
I'm submitting a ...
[x] bug report
[ ] feature request
[ ] question about the decisions made in the repository
[ ] question about how to use this project
Summary
ATEM: ATEM 4 M/E Broadcast studio 4
ATEM FIRMWARE: 8.0.3
There are a log of reconnect
logging and all commands throw error
How far along is 8.0.x firmware support?
Hi,
I've been playing around with atem-connection and it works perfectly on the old ATEM 2 M/E Production Switcher. But I can't find anything about FTB, I found followFadetoBlack under AudioMixerMasterCommand or is it hidden somewhere? It would be nice to be able to check if FTB is on and to enable/disable it...
Thanks in advance!
Best regards
Nicke
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)
I'm submitting a ...
[X] bug report
[ ] feature request
[ ] question about the decisions made in the repository
[ ] question about how to use this project
Summary
There is no way of stopping the module from retrying connections. So if you want to remove the connection, or disconnect. It will continue to try to reconnect, even after removing the reference to the module.
I'm submitting a ...
[x] bug report
[ ] feature request
[ ] question about the decisions made in the repository
[ ] question about how to use this project
Summary
Throwing error while parsing commands KKFP and KeFS.
I am using ATEM Television Studio, firmware version 8.2.3
Other information
COMMAND KKFP(60) <Buffer 00 3c 59 70 4b 4b 46 50 50 16 42 4c 4b 00 01 28 01 00 01 00 01 00 12 01 00 2c a2 80 49 6e 50 72 00 01 54 69 74 75 6c 6b 79 00 00 00 50 4f 0b 90 50 13 ... 10 more bytes>
atem error Error: Number too big: 80 > 3
at Object.parseNumberBetween (/Users/fhanes/projects/atem-live-controller/node_modules/.pnpm/registry.npmjs.org/atem-connection/1.3.3/node_modules/atem-connection/dist/lib/atemUtil.js:28:19)
at MixEffectKeyFlyKeyframeGetCommand.deserialize (/Users/fhanes/projects/atem-live-controller/node_modules/.pnpm/registry.npmjs.org/atem-connection/1.3.3/node_modules/atem-connection/dist/commands/MixEffects/Key/MixEffectKeyFlyKeyframeGetCommand.js:11:35)
at AtemSocket._parseCommand (/Users/fhanes/projects/atem-live-controller/node_modules/.pnpm/registry.npmjs.org/atem-connection/1.3.3/node_modules/atem-connection/dist/lib/atemSocket.js:159:21)
COMMAND KeFS(16) <Buffer 00 10 50 72 4b 65 46 53 61 63 6b 00 50 bc 4e 90>
atem error Error: Number too big: 97 > 3
at Object.parseNumberBetween (/Users/fhanes/projects/atem-live-controller/node_modules/.pnpm/registry.npmjs.org/atem-connection/1.3.3/node_modules/atem-connection/dist/lib/atemUtil.js:28:19)
at MixEffectKeyFlyPropertiesGetCommand.deserialize (/Users/fhanes/projects/atem-live-controller/node_modules/.pnpm/registry.npmjs.org/atem-connection/1.3.3/node_modules/atem-connection/dist/commands/MixEffects/Key/MixEffectKeyFlyPropertiesGetCommand.js:11:35)
at AtemSocket._parseCommand (/Users/fhanes/projects/atem-live-controller/node_modules/.pnpm/registry.npmjs.org/atem-connection/1.3.3/node_modules/atem-connection/dist/lib/atemSocket.js:159:21)
COMMAND KKFP(60) <Buffer 00 3c 00 02 4b 4b 46 50 00 2c 00 01 49 6e 50 72 00 02 56 69 64 65 6f 20 50 43 00 00 50 13 08 34 00 10 08 34 4d 50 56 49 44 00 00 00 00 02 00 02 00 00 ... 10 more bytes>
atem error Error: Number too big: 44 > 3
at Object.parseNumberBetween (/Users/fhanes/projects/atem-live-controller/node_modules/.pnpm/registry.npmjs.org/atem-connection/1.3.3/node_modules/atem-connection/dist/lib/atemUtil.js:28:19)
at MixEffectKeyFlyKeyframeGetCommand.deserialize (/Users/fhanes/projects/atem-live-controller/node_modules/.pnpm/registry.npmjs.org/atem-connection/1.3.3/node_modules/atem-connection/dist/commands/MixEffects/Key/MixEffectKeyFlyKeyframeGetCommand.js:12:41)
at AtemSocket._parseCommand (/Users/fhanes/projects/atem-live-controller/node_modules/.pnpm/registry.npmjs.org/atem-connection/1.3.3/node_modules/atem-connection/dist/lib/atemSocket.js:159:21)
I'm submitting a ...
[X] bug report
Summary
We seem to have problems controlling more than 3 aux outputs. I do not have access to an atem with more than 3 auxes myself, but several users has reported that 4,5,6 does not work.
I am just using setAuxSource with auxbus 0-5. Are the indexes non-linear?
I'm submitting a ...
[x] bug report?
Summary
version: 2.0.0-nightly-20200117-174823-3f8cfe7.0
I'm intermittently getting infinitely repeated "child missed 3 pings, exiting process!" followed by reconnection notices. All commands sent still seem to work and state updates received seem to be still be correct. I have had some unexplained things happen that could have been caused by incorrect state information, but every time I've checked, it's been correct.
Possibly related to #76
I'm submitting a ...
[ ] bug report
[X] feature request
[ ] question about the decisions made in the repository
[ ] question about how to use this project
Summary
Hi there - just wondering if the library does / will support the ATEM Mini?
I'm submitting a ...
[ ] bug report
[ ] feature request
[ ] question about the decisions made in the repository
[x] question about how to use this project
Summary
I am building a dmx tally light solution for atem switchers. When I just cut between two cameras there is one state transmitted which has previous preview as program so preview and program are identical for one state. This results in the previous program tally switching off before switching to green again. (flickering)
In this example I am only showing camera 1 tally information to make it easier to understand:
Is there any way to catch this case or directly extract tally light information for example for one input with the atem-connection library?
Thank you all in advance for your help and this awesome open source library!
Kind regards
@lukas-runge
listVisibleInputs()
on the switcher object) and some ways to prevent weird states messing up my readout.Here is my current code ๐ฝ
image created with Polacode for Visual Studio Code
this.switcher.on('stateChanged', (state: any) => {
// State does not always contain ME video data; Return if necessary data is missing.
if(!state || !state.video || !state.video.ME || !state.video.ME[0])
return;
// There is some weird state change after a transition that I am able to catch with my glitch variable here
if (state.video.ME[0].inTransition) {
state.video.ME[0].transitionPosition == 0 || state.video.ME[0].transitionPosition == 10000 ? glitch = true : null;
} else {
glitch = false;
}
// checking out current preview and program information
let new_preview = this.switcher.listVisibleInputs("preview", 0)
let new_program = this.switcher.listVisibleInputs("program", 0)
// comparing to old preview information, updating if changed
if (_.isEqual(this.preview, new_preview) == false && glitch == false) {
console.log(`PREVIEW: ${new_preview}`)
this.preview = new_preview
update_now = true
}
// comparing to old program information, updating if changed
if (_.isEqual(this.program, new_program) == false && glitch == false) {
console.log(`PROGRAM: ${new_program}`)
this.program = new_program
update_now = true
}
// notifing tallys ("Inputs") if there are changes
if (update_now == true) {
this.notifyInputs();
update_now = false
}
});
I'm submitting a ...
[ ] bug report
[ ] feature request
[ x] question about the decisions made in the repository
[x ] question about how to use this project
Summary
When the state changed event is fired, the pathtoChanged array does not contain valid paths into the object. Should you not be able to do state[pathToChanged] to get the value of what has changed?
Why is it video.ME.0.programInput?
Is there a function that will translate the path into the actual value / object that was changed?
I'm submitting a ...
[ ] bug report
[ ] feature request
[ ] question about the decisions made in the repository
[x] question about how to use this project
First of all, thanks for a great library!
I've started receiving the following console error when attempting to use the 'changeProgramInput' command:
(node:16276) UnhandledPromiseRejectionWarning: #<ProgramInputCommand>
(node:16276) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:16276) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
My code follows:
myAtem = new Atem();
myAtem.on('connected', () => {
myAtem.changeProgramInput(2);
});
myAtem.connect(IP_ADDRESS);
If I add a catch:
myAtem = new Atem();
myAtem.on('connected', () => {
myAtem.changeProgramInput(2)
.catch((resp) => {
console.log(resp);
});
});
myAtem.connect(IP_ADDRESS);
I get this in the console:
ProgramInputCommand {
flag: 0,
rawName: 'CPgI',
mixEffect: 0,
properties: { source: 2 },
resolve: [Function],
reject: [Function] }
Here's the full console debug:
PAYLOAD <Buffer 00 0c 00 00 43 50 67 49 00 00 00 02>
RESEND: { packetId: 2,
trackingId: 2,
lastSent: 1573457567109,
packet:
<Buffer 08 18 80 1a 00 00 00 00 00 00 00 02 00 0c 00 00 43 50 67 49 00 00 00 02>,
resent: 1 }
RESEND: { packetId: 2,
trackingId: 2,
lastSent: 1573457567140,
packet:
<Buffer 08 18 80 1a 00 00 00 00 00 00 00 02 00 0c 00 00 43 50 67 49 00 00 00 02>,
resent: 2 }
RESEND: { packetId: 2,
trackingId: 2,
lastSent: 1573457567171,
packet:
<Buffer 08 18 80 1a 00 00 00 00 00 00 00 02 00 0c 00 00 43 50 67 49 00 00 00 02>,
resent: 3 }
RESEND: { packetId: 2,
trackingId: 2,
lastSent: 1573457567203,
packet:
<Buffer 08 18 80 1a 00 00 00 00 00 00 00 02 00 0c 00 00 43 50 67 49 00 00 00 02>,
resent: 4 }
RESEND: { packetId: 2,
trackingId: 2,
lastSent: 1573457567234,
packet:
<Buffer 08 18 80 1a 00 00 00 00 00 00 00 02 00 0c 00 00 43 50 67 49 00 00 00 02>,
resent: 5 }
RESEND: { packetId: 2,
trackingId: 2,
lastSent: 1573457567266,
packet:
<Buffer 08 18 80 1a 00 00 00 00 00 00 00 02 00 0c 00 00 43 50 67 49 00 00 00 02>,
resent: 6 }
TIMED OUT: <Buffer 08 18 80 1a 00 00 00 00 00 00 00 02 00 0c 00 00 43 50 67 49 00 00 00 02>
All of that said, the actual command works fine, since I can see the input sources being changed as expected. I know I can just add an empty catch, but I'm not sure why there's a reject in the first place? If you need any other info, please let me know and I'll add to the thread.
Thanks!
Other information
I'm submitting a ...
[*] bug report
Summary
I noticed today that I had a few socket-child processes running on my system with no node processes running that would be utilising an atem-connection.
I have tried to reproduce this and have managed to do so if the parent application crashes with an unhandled exception, but there could be other ways of achieving the same result.
I'm not sure how the memory usage got so high. I suspect that they have been running for a few days and have a huge number of commands to send to the parent buffered.
I'm submitting a ...
[*] feature request
Summary
It can be quite tedious as a user of this library to give each audio input a name, as it requires knowledge of each input type and translating the ids etc.
There should be a function to generate/find the name of an input so that this doesnt have to figure out for each consuming project.
This should be based on https://github.com/bitfocus/companion-module-bmd-atem/blob/1080a0f893463638887ecb5a030996e5f006489a/src/choices.ts#L266
I'm submitting a ...
[ ] bug report
[x] feature request (I'll code it and open a PR if we think its a good idea)
[ ] question about the decisions made in the repository
[ ] question about how to use this project
Summary
A common task is writing code which reacts to which Inputs are present in PGM and/or PVW. This is harder than it seems at first glance, because we can't simply use the previewInput
/programInput
property of the ME state object, because that wouldn't account for keyers and SuperSources. To figure out what Inputs are actually displaing in PVW/PGM right now, we have to loop through all keyers and SuperSources.
This is a common enough task that I think it should be provided by this library. This is my first thought at what this API would look like:
atem.on('stateChanged', state => {
const me = state.video.getMe(0);
// This includes the following Inputs:
// 1. The current `programInput`
// 2. If `programInput` is a SuperSource, then it also includes all inputs being used by that SS (recursively)
// 3. Any inputs currently being shown as DSKs or USKs
console.log(me.getVisibleInputs('program')); // => logs an array of numbers
// Same as above but for PVW instead of PGM.
console.log(me.getVisibleInputs('preview')); // => logs an array of numbers
});
I'm not completely married to this API design, and am very open to feedback and suggestions.
cc @baltedewit and @Julusian for their thoughts
I'm submitting a ...
[x] bug report
[ ] feature request
[ ] question about the decisions made in the repository
[ ] question about how to use this project
Summary
The _createSocket
method currently relies on Math.random
to choose its port (src/lib/atemSocket.ts#L130
). This is not guaranteed to work, and could result in startup errors if it chooses a port already in use.
Other information (e.g. detailed explanation, stacktraces, related issues, suggestions how to fix, links for us to have context, eg. StackOverflow, personal fork, etc.)
A better solution would be to use a library such as get-port
. However, this would make the _createSocket
method become asynchronous.
I'm submitting a ...
[ ] bug report
[ ] feature request
[ ] question about the decisions made in the repository
[x] question about how to use this project
Summary
Up until yesterday I've been using a $previous version I installed from npm like 3 weeks ago. Now I use the recently published 2.1.0. There must have been some significant changes which made my simple node script fail.
I got the following problems:
Major: The stateChange
event gets emitted for tree item video.ME.0.programInput
. I use the object-path
to get the referenced tree item that returns undefined as the state tree has changed the name for ME
leaf to mixEffects
so the correct path would be video.mixEffects.0.programInput
. My workaround is that now I replace .ME.
in the emitted path string to .mixEffects.
which is.. unprofessional. :)
Minor: Formerly upon startup every state 'final' path node have emitted a stateChange
event and using that I could fill up my macro and input variables. Now I have to use .on('connected')
and fetch those values manually. Is it should be done this way from now on?
stateChange now emits an array of state tree paths instead of a single path as before. Workaround is to use a .forEach()
on the paths.
I guess ME->mixEffects is a thing in transition. No idea about the others, pls confirm if things will go this way from now on and I'll adapt.
And as always, thank you very much for this lib. Keep up the good work! ๐
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.