Yellow-Dog-Man / Resonite-Issues

Issue repository for Resonite.
https://resonite.com
141 stars 2 forks source link

Broken inspector UI and session crashes when changing speed of driven audio playback #2632

Open mpmxyz opened 4 months ago

mpmxyz commented 4 months ago

Describe the bug?

A playback driven by a PlaybackSynchronizer breaks inspector UI or crashes your session when attempting to change the speed of the driven playback.

To Reproduce

resrec:///U-TheAutopilot/R-8cc4aa3d-b257-4847-9d52-e0f1168a34cf

  1. Spawn the item. (Don't start the playback unless you want to hear my extra-annoying voice!)
  2. Inspect "Target" and go to its slot "AudioPlayer is here."!
  3. Change the playback speed of its AudioPlayer component and interact with the playback position of the source! The UIX slider visual will be frozen now.
  4. Change the playback speed from the UI of the "Target"! You have crashed your session.

Expected behavior

The driven property should resist changes without errors.

Screenshots

No response

Resonite Version Number

2024.7.19.1211

What Platforms does this occur on?

Windows

What headset if any do you use?

No response

Log Files

Anonymous - 2024.7.19.1211 - 2024-07-20 01_02_12.log Contains the following actions:

Additional Context

No response

Reporters

No response

shiftyscales commented 4 months ago

I simplified your replication object down to just the AudioClipPlayer and PlaybackSynchronizer components, and I am not able to replicate the crash, @mpmxyz. If I change the speed on the target, the driving temporarily breaks / stops playback entirely, but if I adjust the source at all, either changing its speed or playback position, it will synchronize again as expected- but no crash occurs.

image

There are still things that can be addressed here, e.g. the PlaybackSynchronizer should also drive the speed / other controls on the AudioClipPlayer component to prevent them from being modified that way.

Otherwise, I suspect that this could be yet another issue caused by the asset being linked in a dyanmic variable instead of statically. E.g. likely having a common origin with #156 / #1296 / #1347 and other similar issues.

Would you mind also trying to replicate the issue with statically linked assets / minimizing your replication object to see if you can further isolate what in specific causes the crash to occur, @mpmxyz?

mpmxyz commented 4 months ago

FYI, the exception is not related to any dynamic variables at all and it is not the playback drive that breaks but the inspector UI where you tried to change the speed. (Spawn two inspectors looking at "Target"!)

For emphasis I attached the exception that occurs when I follow your instructions and break the inspector UI. (resrec:///U-TheAutopilot/R-92bd3c94-ec33-435a-8e87-0c6b18f6f0d5)

``` 19:09:25.454 ( 60 FPS) Exception when Updating object: Element: IDCF16500, Type: FrooxEngine.SyncPlaybackEditor, World: Local, IsRemoved: False, IsDestroyed: False, IsDisposed: False, Enabled: True Element: IDCF04D00, Type: FrooxEngine.Slot, World: Local, IsRemoved: False, Slot name: Field, T: [0; 0; 0], R: [0; 0; 0; 1], S: [1; 1; 1], ActiveSelf: True, IsDestroyed: False Element: IDCF02C00, Type: FrooxEngine.Slot, World: Local, IsRemoved: False, Slot name: Panel, T: [0; 0; 0], R: [0; 0; 0; 1], S: [1; 1; 1], ActiveSelf: True, IsDestroyed: False Element: IDCE73600, Type: FrooxEngine.Slot, World: Local, IsRemoved: False, Slot name: Vertical Layout, T: [0; 0; 0], R: [0; 0; 0; 1], S: [1; 1; 1], ActiveSelf: True, IsDestroyed: False Element: IDC750500, Type: FrooxEngine.Slot, World: Local, IsRemoved: False, Slot name: ComponentRoot, T: [0; 0; 0], R: [0; 0; 0; 1], S: [1; 1; 1], ActiveSelf: True, IsDestroyed: False Element: ID10ED900, Type: FrooxEngine.Slot, World: Local, IsRemoved: False, Slot name: Content, T: [0; 0; 0], R: [0; 0; 0; 1], S: [1; 1; 1], ActiveSelf: True, IsDestroyed: False Element: ID10EB200, Type: FrooxEngine.Slot, World: Local, IsRemoved: False, Slot name: Scroll Area, T: [0; 0; 0], R: [0; 0; 0; 1], S: [1; 1; 1], ActiveSelf: True, IsDestroyed: False Element: ID10E6900, Type: FrooxEngine.Slot, World: Local, IsRemoved: False, Slot name: Content, T: [0; 0; 0], R: [0; 0; 0; 1], S: [1; 1; 1], ActiveSelf: True, IsDestroyed: False Element: ID10E5500, Type: FrooxEngine.Slot, World: Local, IsRemoved: False, Slot name: Content, T: [0; 0; 0], R: [0; 0; 0; 1], S: [1; 1; 1], ActiveSelf: True, IsDestroyed: False Element: ID10E1F00, Type: FrooxEngine.Slot, World: Local, IsRemoved: False, Slot name: Image, T: [0; 0; 0], R: [0; 0; 0; 1], S: [1; 1; 1], ActiveSelf: True, IsDestroyed: False Element: ID10D4900, Type: FrooxEngine.Slot, World: Local, IsRemoved: False, Slot name: Split, T: [0; 0; 0], R: [0; 0; 0; 1], S: [1; 1; 1], ActiveSelf: True, IsDestroyed: False Element: ID10D2100, Type: FrooxEngine.Slot, World: Local, IsRemoved: False, Slot name: Panel, T: [0; 0; 0], R: [0; 0; 0; 1], S: [1; 1; 1], ActiveSelf: True, IsDestroyed: False Element: ID10B5300, Type: FrooxEngine.Slot, World: Local, IsRemoved: False, Slot name: Content, T: [0; 0; 0], R: [0; 0; 0; 1], S: [1; 1; 1], ActiveSelf: True, IsDestroyed: False Element: ID10B1C00, Type: FrooxEngine.Slot, World: Local, IsRemoved: False, Slot name: Image, T: [0; 0; 0], R: [0; 0; 0; 1], S: [1; 1; 1], ActiveSelf: True, IsDestroyed: False Element: ID10A9800, Type: FrooxEngine.Slot, World: Local, IsRemoved: False, Slot name: Inspector, T: [-1,0088; 1,255491; 1,990163], R: [0.000471899; 0.4601771; -0.0002446016; 0.8878271], S: [0,0005; 0,0005; 0,0005], ActiveSelf: True, IsDestroyed: False Element: ID11D700, Type: FrooxEngine.Slot, World: Local, IsRemoved: False, Slot name: SpawnPoint, T: [0; 0; 0], R: [0; 0; 0; 1], S: [1; 1; 1], ActiveSelf: True, IsDestroyed: False Element: ID2300, Type: FrooxEngine.Slot, World: Local, IsRemoved: False, Slot name: Root, T: [0; 0; 0], R: [0; 0; 0; 1], S: [1; 1; 1], ActiveSelf: True, IsDestroyed: False Element: ID0, Type: FrooxEngine.World, World: Local, IsRemoved: False Exception: System.Exception: The playback (IDD12000 - FrooxEngine.SyncPlayback) element on FrooxEngine.AudioClipPlayer (IDD11B00) is currently being driven by Target (IDD14400 - FrooxEngine.DriveRef`1[FrooxEngine.SyncPlayback]) on FrooxEngine.PlaybackSynchronizer (IDD13C00) and can be modified only through the drive reference. at FrooxEngine.SyncElement.BeginModification (System.Boolean throwOnError) [0x001be] in <634bd218eb2e49fc99b084fbe75a63ea>:0 at FrooxEngine.SyncPlayback.InternalSetState (System.Nullable`1[T] play, System.Nullable`1[T] loop, System.Nullable`1[T] offset, System.Nullable`1[T] speed, System.Nullable`1[T] maxError, System.Boolean sync, System.Boolean change) [0x00000] in <634bd218eb2e49fc99b084fbe75a63ea>:0 at FrooxEngine.SyncPlayback.set_Speed (System.Single value) [0x00083] in <634bd218eb2e49fc99b084fbe75a63ea>:0 at FrooxEngine.SyncPlaybackEditor.OnCommonUpdate () [0x000cc] in <634bd218eb2e49fc99b084fbe75a63ea>:0 at FrooxEngine.ComponentBase`1[C].InternalRunUpdate () [0x0001f] in <634bd218eb2e49fc99b084fbe75a63ea>:0 at FrooxEngine.UpdateManager.RunUpdates () [0x0007c] in <634bd218eb2e49fc99b084fbe75a63ea>:0 ```

The different behaviour between the asset's UI and the inspector UI is because the former uses ProtoFlux to change the speed. This results in an abortion of impulse execution if you trigger it directly and a session crash if you trigger it indirectly via FireOnX.