Skip to content

Conversation

@rjmunro
Copy link
Contributor

@rjmunro rjmunro commented Sep 8, 2025

About the Contributor

This pull request is posted on behalf of the BBC.

Type of Contribution

This is a Feature

It's required for the following bugfix: Sofie-Automation/sofie-atem-state#37.

Current Behavior

Commands sent to an ATEM are batched where possible. You cannot control which batch they go in. Additionally the ATEM firmware sometimes seems to execute things out of order within a batch.. On some occasions, order is important, for example when setting up and switching on a key it's important not to switch it on until after it's input are all set. Also when switching it off, it's important not to make any other changes until after it has switched off.

New Behavior

You can set a runOrderGroup property on an ATEM command. This is a number. Commands will only be batched if they are in the same group. Groups will be run in numerical order. Default is 0, so you can use a positive number to run something after other commands (such as turning on a key after sending it's settings), or a negative number to ensure it happens first (such as turning off a key before changing settings).

Testing Instructions

This will be easiest to test in conjunction with the corresponding PR in ATEM-state.

Other Information

A minor version bump and release will be needed as this adds new API surface. It is backwards compatible as a default is provided which won't change behaviour.

VSCode was showing syntax problems for me because the build target for typescript was older than some of the library features being used, so I bumped the version to match @sofie-automation/code-standard-preset. I didn't upgrade the dependency on that project because that caused other issues which will need addressing.

Status

  • PR is ready to be reviewed.
  • The functionality has been tested by the author.
  • Relevant unit tests has been added / updated.
  • Relevant documentation (code comments, system documentation) has been added / updated.

@nytamin nytamin requested a review from a team September 8, 2025 13:25
@rjmunro rjmunro marked this pull request as ready for review September 9, 2025 12:53
Copy link
Contributor

@jstarpl jstarpl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, but test suites need updating to match the new structure before this can be merged.

@rjmunro rjmunro force-pushed the rjmunro/atem-run-order-groups branch from 29b2cf0 to fc1db88 Compare September 30, 2025 11:48
@rjmunro rjmunro force-pushed the rjmunro/atem-run-order-groups branch from fc1db88 to 7e786dd Compare October 7, 2025 22:50
@codecov-commenter
Copy link

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Only batch operations with the same runOrderGroup, then run them lowest
first. When not specified, defaults to 0, so to run before other commands
use a negative value.
@rjmunro rjmunro force-pushed the rjmunro/atem-run-order-groups branch 2 times, most recently from feaa0de to 0b66b34 Compare October 23, 2025 12:43
E.g. when used as a dependency like in yarn with something like:

	"resolutions": {
		"atem-connection": "github:Sofie-automation/sofie-atem-connection#branchname"
	},
@rjmunro rjmunro force-pushed the rjmunro/atem-run-order-groups branch from 0b66b34 to 5f63cd4 Compare November 11, 2025 14:10
@Julusian Julusian merged commit f3e5c35 into Sofie-Automation:main Nov 11, 2025
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants