Advanced Scene Switcher

Advanced Scene Switcher 1.28.1

mikexilva

New Member
Maybe it would be more efficient and elegant to set one variable per audio source and then just use them on the IF's comparisons... instead of "measuring" audio levels so many times repeatedly with all macros running at the same time, although I don't know if this adds too much complexity...
Hello, I was checking out the newer version 1.20.1 but I think there is still no way to compare audio volume from different sources right?
 

Warmuptill

Active Member
Any update on this?
Running the latest version the plug-in and issue persists.
Unfortunately I didn't manage to get this to work yet. :(

I think I found a regression bug. My three Websocket conditions seem to match on every event, not filtered, so that all three macros run regardless. (they're identical, except to replace the name as appropriate, and change the audio mix) The highlighting confirms that they are indeed all running. The sending end does work correctly, using the Current Scene Match condition.
View attachment 90837
I am not able to reproduce this issue.
Only websocket messages matching the given string result in the condition being true.
Can you enable verbose logging and share a corresponding log file?

Hello, I was checking out the newer version 1.20.1 but I think there is still no way to compare audio volume from different sources right?
That should now be possible using variables and a setup similar to the following:

SetVar1.PNG
SetVar2.PNG
Compare.PNG
Inverse.PNG


The first two macros are used to set the value of variables to the volume level value of the two audio sources.
The Compare macro compares the values of the two variables, and if the first audio source (Desktop Audio) is louder than the second (Mic/Aux) it will switch to the scene "test".
The last macro will switch to scene "Scene 1" if the opposite is true.

I also added a duration modifier to the "Compare" macro so the scene switches will not happen too frequently.

Let me know if you have any questions!
 

AaronD

Active Member
I am not able to reproduce this issue.
Only websocket messages matching the given string result in the condition being true.
Can you enable verbose logging and share a corresponding log file?
Here you go:
Master: https://obsproject.com/logs/yIuThXGdBuflLQUj
Slave: https://obsproject.com/logs/EpQfUuwTmKX6oswD
The highlighting says that the Master is operating correctly while the Slave is running all of them, but I included both just in case.

I've also attached the settings from AdvSS, exported just now.
 

Attachments

  • adv-ss-Meeting_Slave-2023.01.19.15.43.01.txt
    6.3 KB · Views: 13
  • adv-ss-Meeting_Master-2023.01.19.15.42.18.txt
    6.9 KB · Views: 9

AaronD

Active Member
Here you go:
Master: https://obsproject.com/logs/yIuThXGdBuflLQUj
Slave: https://obsproject.com/logs/EpQfUuwTmKX6oswD
The highlighting says that the Master is operating correctly while the Slave is running all of them, but I included both just in case.

I've also attached the settings from AdvSS, exported just now.
I didn't see the usual OBS-closing messages in there, so here's another run (attached) that captures the terminal spew instead.
obs --disable-updater --multi --studio-mode --profile "Meeting_Master" --collection "Meeting_Master" --startvirtualcam > /home/aaron/Master.log 2>&1 &
obs --disable-updater --multi --studio-mode --profile "Meeting_Slave" --collection "Meeting_Slave" > /home/aaron/Slave.log 2>&1 &
Still don't see the usual closing messages. Oh well I guess. I hope it still captured everything.

  1. Start both instances of OBS, Master first and then Slave, and wait for the Master's Init macro to run
  2. Switch cameras from the "safety net" that's always there ("Camera - Selfie"), to the primary ("Camera - Camcorder")
  3. Switch scenes to play a video ("Feature - Test1")
  4. Manually switch back early ("Camera - Camcorder")
  5. Play that video again ("Feature - Test1")
  6. Skip the playhead to the end, so that the macro switches back instead ("Camera - Camcorder")
  7. Send the -TERM signal to both instances of OBS, Slave first and then Master

And the script that does it too.
 

Attachments

  • Setup.sh.txt
    12 KB · Views: 7
  • Master.log
    627.8 KB · Views: 9
  • Slave.log
    356.4 KB · Views: 13

phillymantis

New Member
through trial and error using the "podcast" example ive found that

if variable value changed macro doesnt always fire....when you manually "run macro" then it actually switches the scene....

i changed it to "timer" and set it for 0 seconds....and now scene switching works via audio levels for me but is super delayed obviously
 
Just a heads-up:

If you have Windows 10's Sandbox installed, it may break Advanced Scene Switcher's network support. Sandbox apparently adds a bunch of TCP/UDP port exclusions on both IPv4 and IPv6, keeping some programs, such as OBS Studio with the plugin installed, from listening to ports in that range, with 55555 (the default port) falling in one of those ranges.

Assigning another listening port that isn't excluded, removing the exclusion, or uninstalling Windows Sandbox will fix it.

To list the exclusions in your system, use the following command:

Code:
C:\Windows>netsh int ipv4 show excludedportrange protocol=tcp

Replace "ipv4" with "ipv6" to see ipv6 exclusions; replace "tcp" with "udp" to view UDP exclusions.

Hope this helps.

--Katt. =^.^=
 

youjiman

New Member
Hello Warmuptill, I found a bug. When a macro folder is placed at the end of the macro list and try to create or duplicate a macro, then it acting weird, like a new macro is looks like a folder that was placed at he end.

Also, I found if I select an area for video pattern matching, then OBS will crash easily. This won't happen if I don't select an area. I'm using OBS 28 on Intel Mac with the newest version of ASS, which is 1.20.1.
 

Warmuptill

Active Member
I didn't see the usual OBS-closing messages in there, so here's another run (attached) that captures the terminal spew instead.
obs --disable-updater --multi --studio-mode --profile "Meeting_Master" --collection "Meeting_Master" --startvirtualcam > /home/aaron/Master.log 2>&1 &
obs --disable-updater --multi --studio-mode --profile "Meeting_Slave" --collection "Meeting_Slave" > /home/aaron/Slave.log 2>&1 &
Still don't see the usual closing messages. Oh well I guess. I hope it still captured everything.

  1. Start both instances of OBS, Master first and then Slave, and wait for the Master's Init macro to run
  2. Switch cameras from the "safety net" that's always there ("Camera - Selfie"), to the primary ("Camera - Camcorder")
  3. Switch scenes to play a video ("Feature - Test1")
  4. Manually switch back early ("Camera - Camcorder")
  5. Play that video again ("Feature - Test1")
  6. Skip the playhead to the end, so that the macro switches back instead ("Camera - Camcorder")
  7. Send the -TERM signal to both instances of OBS, Slave first and then Master

And the script that does it too.
Thank you!
I was now able to reproduce the problem and will prepare a fix.
I will release a fixed version later today.

through trial and error using the "podcast" example ive found that

if variable value changed macro doesnt always fire....when you manually "run macro" then it actually switches the scene....

i changed it to "timer" and set it for 0 seconds....and now scene switching works via audio levels for me but is super delayed obviously
A timer of 0s will fire every interval, so as quickly as the time you have configured at the top of the General tab.
So I assume something else might be causing the delay you are experiencing.

Would you mind sharing the settings you are using? (You can find the option to export them to a file on the General tab)

Hello Warmuptill, I found a bug. When a macro folder is placed at the end of the macro list and try to create or duplicate a macro, then it acting weird, like a new macro is looks like a folder that was placed at he end.

Also, I found if I select an area for video pattern matching, then OBS will crash easily. This won't happen if I don't select an area. I'm using OBS 28 on Intel Mac with the newest version of ASS, which is 1.20.1.
I am not able to reproduce the macro folder problem.
Can you maybe share a screenshot of the situation before the issue occurs and one after?

I will try to investigate potential issues with the area selection.
Would you be able to share the crashlog in the meantime?
 

youjiman

New Member
I am not able to reproduce the macro folder problem.
Can you maybe share a screenshot of the situation before the issue occurs and one after?

I will try to investigate potential issues with the area selection.
Would you be able to share the crashlog in the meantime?
Thank you for the reply.

It's weird that I can't reproduce the folder issue anymore. The cause was not accurate, but I'll let you know if that happens again.

I'm sorry. Can you tell me how to share the crash log? I know how to upload a regular log file, but is that different?
 

mikexilva

New Member
Hello, I was checking out the newer version 1.20.1 but I think there is still no way to compare audio volume from different sources right?
That should now be possible using variables and a setup similar to the following:

View attachment 90865View attachment 90866View attachment 90867View attachment 90868

The first two macros are used to set the value of variables to the volume level value of the two audio sources.
The Compare macro compares the values of the two variables, and if the first audio source (Desktop Audio) is louder than the second (Mic/Aux) it will switch to the scene "test".
The last macro will switch to scene "Scene 1" if the opposite is true.

I also added a duration modifier to the "Compare" macro so the scene switches will not happen too frequently.

Let me know if you have any questions!
Wow, never thought you would be so quick ! ;)
I need to test this feature with all MIC's exactly same model, and make a few experiences to also have a general scene when no one is talking for a few seconds (or when more than 2 are talking at the same time.. maybe this is trickier just comparing..) many thanks Warmuptill
 

Warmuptill

Active Member
Thank you for the reply.

It's weird that I can't reproduce the folder issue anymore. The cause was not accurate, but I'll let you know if that happens again.

I'm sorry. Can you tell me how to share the crash log? I know how to upload a regular log file, but is that different?
Sorry, I just noticed that on MacOS there does not seem to be an option to share recent crash logs of OBS.
So you didn't miss anything.

I will release a fixed version later today.
@AaronD new version is now released.
Thanks again for finding this issue!
Let me know if you find anything else! :)
 

jegadk

Member
Hi.

Thanks for a nice plugin.

I need to turn macro on/off. Have one macro when start stream and play start video. After video it change scene to "Game Scene Center", enables arena scene and then logo scene.

After period break i need to turn off this macro and turn on another, that only goes from video to game scene center.

need to du it from my streamdeck.

Any help to that. ??

Regards Jesper - Denmark
 

Warmuptill

Active Member
Now the Slave doesn't run at all. Master still seems to work correctly. More logs:

Master: https://obsproject.com/logs/3ezEAQdkLBO6GvRJ
Slave: https://obsproject.com/logs/YHqeB7GTxcskxlPm

Same procedure.
Sorry if I am simply misunderstanding something, but in the log everything seems fine:

Code:
Master:
...
info: [adv-ss] sent event "Camera" to connected clients
info: [adv-ss] sent event "Camera" to connected clients
...
Slave:
info: [adv-ss] received event msg "Camera"
info: [adv-ss] received event msg "Camera"
info: [adv-ss] condition websocket returned 1
info: [adv-ss] Macro Camera returned 1
...

If you are having issues with your "Feature" Macro on the "Slave" side I would guess that this is caused by the websocket condition containing an additional tab in the message.
So the "Slave" expects Feature while the Master sends Feature.

Hi.

Thanks for a nice plugin.

I need to turn macro on/off. Have one macro when start stream and play start video. After video it change scene to "Game Scene Center", enables arena scene and then logo scene.

After period break i need to turn off this macro and turn on another, that only goes from video to game scene center.

need to du it from my streamdeck.

Any help to that. ??

Regards Jesper - Denmark
Unfortunately I am not really familiar with what can be done with a streamdeck in regards to the communication with the advanced scene switcher.
If the streamdeck is able to simulate key presses you can simply register a hotkey to pause the given macros.

Pause.PNG
 

Enma

New Member
I've had an issue where my OBS would always crash on close. That started quite a while ago and just tonight, after a lot of troubleshooting, I found out that what is causing the crash is to have the advanced scene switcher active when closing OBS. The crashes stopped happening completely when I started manually stopping the pluggin before closing OBS.

I tried making a macro that triggers on shutdown and stops the plugin, but that doesn't seem to work, I'm assuming OBS is closing before the plugin can actually stop, so I have to stop it manually.

Otherwise I absolutely LOVE this plugin, big fan!!
 
Last edited:

Warmuptill

Active Member
I've had an issue where my OBS would always crash on close. That started quite a while ago and just tonight, after a lot of troubleshooting, I found out that what is causing the crash is to have the advanced scene switcher active when closing OBS. The crashes stopped happening completely when I started manually stopping the pluggin before closing OBS.

I tried making a macro that triggers on shutdown and stops the plugin, but that doesn't seem to work, I'm assuming OBS is closing before the plugin can actually stop, so I have to stop it manually.

Otherwise I absolutely LOVE this plugin, big fan!!
Can you share a crashlog?
Which version of the plugin are you using?
 

Enma

New Member
Can you share a crashlog?
Which version of the plugin are you using?
I'm using the newest version, 1.20.2
And here's a crash report where I replicated the issue on a brand new scene collection with only two scenes containing nothing but two colour sources and text and and active advanced scene switcher. Like I said earlier, it crashes on close if I leave it active, and it stops crashing if I stop it before closing OBS.
 

Attachments

  • Crash 2023-01-22 07-17-04.txt
    113.8 KB · Views: 10

AaronD

Active Member
Sorry if I am simply misunderstanding something, but in the log everything seems fine:

Code:
Master:
...
info: [adv-ss] sent event "Camera" to connected clients
info: [adv-ss] sent event "Camera" to connected clients
...
Slave:
info: [adv-ss] received event msg "Camera"
info: [adv-ss] received event msg "Camera"
info: [adv-ss] condition websocket returned 1
info: [adv-ss] Macro Camera returned 1
...

If you are having issues with your "Feature" Macro on the "Slave" side I would guess that this is caused by the websocket condition containing an additional tab in the message.
So the "Slave" expects Feature while the Master sends Feature.
I have no idea how that happened, but you're right, that was it. I know it worked before, and I didn't change it since. Just updated.

Anyway, I took the tab off, and it works now. Thanks!



I looked at the settings file that I posted to say that they were all running, and the tab is in there too. So either it was added somehow during the upgrade (I doubt it), or I put it there by accident originally (far more likely) and the custom build that I had before worked anyway. (which probably should be called a bug in that build, and is clearly fixed in this release :-) )
 
Last edited:

Nesonica

New Member
Hi @Warmuptill , thank you for this gorgeous plugin! I wanted to trigger a message on my Discord Announcement Channel when starting a specific scene of my OBS Studio. is that possible?
 

AaronD

Active Member
I wanted to trigger a message on my Discord Announcement Channel when starting a specific scene of my OBS Studio. is that possible?
Probably not directly, but there is the Run action, which can be used to start an external "something". If you can write or copy a script (Windows batch, Linux bash, Python, etc.) that sends a message to Discord, then you can trigger that script from the Run action in AdvSS.
 
Top