ebu / ear-production-suite

The EAR Production Suite is a set of VST® plugins and tools for producing immersive and personalizable audio content suitable for any Next Generation Audio codec. It is based on the Audio Definition Model (ITU-R BS.2076) and the ITU ADM Renderer (ITU-R BS.2127) and enables monitoring on any ITU-R BS.2051 loudspeaker configuration.
https://ear-production-suite.ebu.io/
GNU General Public License v3.0
102 stars 20 forks source link

Monitoring plugins not properly supporting shared inputs #257

Closed firthm01 closed 11 months ago

firthm01 commented 1 year ago

Original Title: Monitoring issue when a DS layout is changed

E.g,

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; https://github.com/ebu/ear-production-suite/blob/9a5c788421e242a47364567258b1b3b304f12cfe/ear-production-suite-plugins/lib/src/scene_store.cpp#L90-L94 ~~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 commented 1 year ago

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 commented 1 year ago

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; https://github.com/ebu/ear-production-suite/blob/9a5c788421e242a47364567258b1b3b304f12cfe/ear-production-suite-plugins/lib/src/scene_gains_calculator.cpp#L123-L129 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.