bitfocus / companion-module-obs-studio

OBS Studio Module for Companion
MIT License
45 stars 28 forks source link

Automatic reconnection doesn't always work #111

Closed eric closed 2 years ago

eric commented 3 years ago

I've noticed that sometimes companion does not reconnect to OBS correctly after OBS has been closed for a while.

I don't see anything in the logs about it, but restarting companion fixes the issue.

bryce-seifert commented 3 years ago

How long would you say it is generally closed is before it exhibits this behavior? Also Mac or PC?

eric commented 3 years ago

I’ve left it turned off over night and came back to the issue.

Companion is running in macOS.

bryce-seifert commented 3 years ago

Thanks. And does the Mac go to sleep during this time? Or do you have it always on?

If the Mac does wake from sleep, do you see the "waking instance from sleep" in the logs

eric commented 3 years ago

No, the Mac was at the Lock Screen but never suspended.

eric commented 3 years ago

I haven’t seen anything in the logs about a failed connection or any such issue. Sometimes no commands work, other times the commands work but the feedback doesn’t update.

bryce-seifert commented 3 years ago

Trying to recreate this.

When you say " at the Lock Screen" do you mean at the log-in screen where you enter your password? For me that suspends the whole companion process while logged out.

eric commented 3 years ago

Yes, the screen where I enter my password. I haven’t checked if I can still use the Streamdeck while at that screen, but my concern has been with having the Streamdeck work again after the computer is unlocked.

bryce-seifert commented 3 years ago

For me, after I get to the login screen and log back in, Companion itself it suspended so I'm unable to use any actions / Streamdeck until I relaunch the app.

eric commented 3 years ago

I may have been wrong about what was causing the issues. I just found that when I change Scene Collections everything seems to stop working until I use the OBS reconnect command. Maybe there's an issue there...

bryce-seifert commented 3 years ago

Ok, yes I was able to recreate this. So I'm thinking that was the root of the issue, will continue to investigate

bryce-seifert commented 2 years ago

So it seems this issue lies with OBS websocket itself (https://github.com/obs-websocket/obs-websocket/issues/839) And they're hoping to fix it for version 5.0

In the meantime, in that latest beta I've added an attempt to disconnect from OBS when it gets a Scene Collection change message. It helps sometimes, but not all of the time.

Going to close this since it's a websocket issue, and keep an eye on it for when 5.0 is out of alpha to see if it's resolved.