obsproject / obsproject/obs-studio

aja: Avoid unconfiguring an aja device if it is in use

Open
#7,530 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C
Stars
76.4k
Forks
10.2k
Avg merge
4d 23h
Merged PRs (30d)
12

Description

Operating System Info

Windows 10

Other OS

No response

OBS Studio Version

28.0.3

OBS Studio Version (Other)

No response

OBS Studio Log URL
OBS Studio Crash Log URL

No response

Expected Behavior

If the aja device is already in use by other application, I would expect obs not changes anything from the current configuration. Not sure if the solution would be avoiding loading itself, or continuing the execution but not clearing the configuration.

Current Behavior

If the driver is installed, execution will run to CardEntry::Initialize, where it executes the following:

mCard->SetSuspendHostAudio(true);
mCard->ClearRouting();
if (NTV2DeviceCanDoMultiFormat(deviceID)) {
mCard->SetMultiFormatMode(true);
}
mCard->SetReference(NTV2_REFERENCE_FREERUN);

Among other commands. If OBS integration needs the current card to be in an explicit state, then the obs_module_load probably should return false if any installed card is in use (probably with AcquireStreamForApplication?):

https://github.com/obsproject/obs-studio/blob/77b11c16f1bb6a38abbc8e0e18308aa0c6466e41/plugins/aja/main.cpp#L16

pinging @paulh-aja here.

Thanks,

Steps to Reproduce
  1. Configure an aja output with another application
  2. Launch obs
  3. Check aja output is unconfigured
Anything else we should know?

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in plugins/aja/main.cpp and trace the CardEntry::Initialize path described in the report, including AcquireStreamForApplication. Reproduce the case with an AJA output configured by another application and determine how OBS can avoid clearing the device configuration. Done means launching OBS no longer unconfigures an in-use AJA device.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
audio-video-rtc
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.