univrsal / tuna

Song information plugin for obs-studio
GNU General Public License v2.0
717 stars 57 forks source link

Processing won't start when using nested scenes. #165

Closed ragnos closed 5 months ago

ragnos commented 2 years ago

Describe the bug After the launch of obs-studio: If the VLC source in question is brought to the PGM using a nested Scene source tuna won't recognize the started playback. It needs a switch to the original scene containing the VLC source for tuna to pick things up again. This has been introduced with commit https://github.com/univrsal/tuna/commit/1ec305f569803f47dd1df7052ceece656942fde8.

To Reproduce Steps to reproduce the behavior:

  1. Create a set of scenes: "Music" with a VLC source for playback, "Nested" with the previously created "Music" scene added, and "Empty" so you can switch to something without an active VLC source.
  2. Add the Scene mapping via the tuna menu. Notice that you can't map a VLC source to a scene it has been nested into using a Scene source.
  3. Set "Nested" or "Empty" as your active Scene, then restart obs-studio. tuna won't feel any obligation to start it's operations until you made a switch to the "music" scene once.
  4. Make the switch to the "music" scene. After that, it operates correctly even after restarting obs-studio if the "music" scene is still active..

Expected behavior tuna should recognize a active VLC source immediately after startup, and without having to switch to the original scene first.

Log https://obsproject.com/logs/-FKi1L8z2HN0BCLq

Additional context I believe there might be a unexpected use-case where multiple scenes can be active at once using scene nesting. This might have a impact on the fix of this issue. For example, i've setup a scene "music" in which I'm organizing my music playback, including filters etc. Each scene which needs background music will reference this scene using a Scene source instead of adding vlc sources to each of those scenes. (Using a "Source Mirror" source from the StreamFX plugin could achive the same by the way.) During normal operation, I don't have any reason to take a look at this scene at all.

In the same way, you could create multiple scenes containing VLC sources. If you reference two or more of these scenes using Scene nesting, which of the vlc sources take precedence once the combined scene goes active? This kind of colision has been anticipated for multiple VLC sources within one scene, but not for multiple scenes. I think it's highly unlikely to find that kind of setup in real world scenarios, but technically this is easily possible.

A possible solution for this colision as well for this issue might be the possisbility to create mappings between scenes and VLC sources introduced via nesting.

Another possible solution for the issue might be a fallback to the behaviour from v1.5.5, where the user defines a single VLC source. This could be kept as a default/fallback setting in case no per-scene mappings are applicable, including the case where no mappings have been made in the first place.

univrsal commented 5 months ago

Should be fixed in 2a71585