Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Monitoring plugins not properly supporting shared inputs #257

Closed
firthm01 opened this issue Oct 30, 2023 · 2 comments · Fixed by #258
Closed

Monitoring plugins not properly supporting shared inputs #257

firthm01 opened this issue Oct 30, 2023 · 2 comments · Fixed by #258

Comments

@firthm01
Copy link
Collaborator

firthm01 commented Oct 30, 2023

Original Title: Monitoring issue when a DS layout is changed

E.g,

  • Import ESC_short_ADM.wav with EAR
  • Without opening the Scene, hit play - sounds correct (bed + eng comm in centre as that the default programme)
  • Change the layout of the bed in the DS plugin to 22.2 - we expect some oddity as we're now telling the scene that channels 1-24 are all for the bed, where as actually it's receiving eng com on 11 and ger comm on 12 - so they're going to get treated as legs of the 22.2 bed.
  • Open the Scene. Notice how the panning of the commentary changes - something has triggered an update to the monitoring plugins.

EDIT: This reasoning is not entirely correct - see later comments

This is because routing changes are currently only detected if the routing parameter changes (i.e, starting channel). A change of layout is not detected as a routing change, even though it should be. See this bit of code;

auto routingChanged = item->routing() != inputItem.routing();
setMonitoringItemFrom(*item, inputItem);
if(routingChanged) {
flagOverlaps();
}

This triggers flagOverlaps which adds all of the items to the itemsChangedSinceLastSend vector, making sure the monitoring plugins update their state for all items (we kept it simple here rather than trying to figure out exactly which items are affected).
Opening the Scene plugin triggers flagOverlaps via another code route which is why we hear the correction only when the Scene plugin is opened.

@firthm01
Copy link
Collaborator Author

firthm01 commented Oct 30, 2023

Regardless, the affected item should have it's change flag set by the input plugin, and so this should acted upon by the monitoring plugins - to check.
EDIT: The change flag is set and is received by the monitoring plugins as expected.

@firthm01
Copy link
Collaborator Author

firthm01 commented Oct 31, 2023

The problem is that the SceneGainsCalculator expects only one use of an input channel. When metadata for an AudioObject is received, the matrix (direct_ vector) for those input channels are updated. If another AudioObject also uses those input channels and sends metadata, the matrix is then updated to represent that AudioObject, overwriting the previous values.

This section of code runs once for every piece of AudioObject metadata received;

for(int i = 0; i < routing->inputChannelCount; i++) {
auto inputChannel = routing->inputStartingChannel + i;
if(inputChannel >= 0 && inputChannel < direct_.size()) {
directSpeakersCalculator_.calculate(earMetadata.at(i),
direct_[inputChannel]);
}
}

You can see how it would overwrite whatever was previously stored in direct_[inputChannel] if inputChannel is reused between AudioObjects.
Gains should be a summation of calculations for all AudioObjects using that input channel - perhaps we need to do per-object calculations and then sum whenever the direct or diffuse matrices are requested by the audio processing backend.

@firthm01 firthm01 changed the title Monitoring issue when a DS layout is changed Monitoring plugins not properly supporting shared inputs Oct 31, 2023
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 a pull request may close this issue.

1 participant