bitfocus / companion-module-obs-studio

OBS Studio Module for Companion
MIT License
46 stars 29 forks source link

[BUG] Long delay/hang when loading Companion/changing OBS scene collections #195

Open cattywampus04 opened 1 year ago

cattywampus04 commented 1 year ago

Is this a bug in companion itself or a module?

Is there an existing issue for this?

Describe the bug

Hi,

I have been trying to get OBS updated beyond version 27.2.4. I use various plugins - and it's been a bit of a slog trying to get them working in OBS 28 - which I am to understand is a pretty big revision under the hood.

One of the problems I'm having is with Companion. Version 2.3.1 which I had been using doesn't work with OBS 28, even when using a Websocket 4.9.1 compatibility plugin - the log says I must use Websocket version 5.0.0. Upgrading to version 2.4.1 gets things working again - but there seems to be something different in how Companion is handling sources?

On OBS 27.x and Companion 2.3.1 - I would load things up and everything would be immediately useable. With 2.4.1 and OBS 28, there is an long initial delay before I can use Companion. After some troubleshooting, I found out that on loading Companion, the CPU usage is high - and it stays that way for over 2 minutes on my setup, and the entire time I cannot access the Companion GUI. On a scene collection with no scenes or sources, this initial hang does not happen.

I cloned my scene collection and slowly started removing scenes and sources to see whether there was a specific item that was causing the problem. It turns out that the length of time for Companion to become usable depends how many scenes/sources it has to "enumerate" (can't think of a better word lol). Once it's done it, everything seems to work.

Is this behaviour normal? I've tried to find documentation about it but nothing. I couldn't find any mention of the websockets 4 to 5 either in the change logs.

Thanks

Steps To Reproduce

No response

Expected Behavior

No response

Environment (please complete the following information)

- OS: Windows 10 and 11
- Browser: Chrome
- Companion Version: 2.3.1/2.4.1

Additional context

No response

Yinxo commented 6 months ago

Still the same for me. I just made a button to reset connection (System only shuts down on weekends).

I gave up the hope for a fix maybe sometimes in the future xD

Itaku commented 6 months ago

@Joelsuperstar Are you using Windows or Mac for the machines OBS and Companion are running on?

I just checked on my end using a MacBook Pro M3 with both OBS and Companion running on it and it launched fine, however, there are times where the connection between OBS and Companion "freezes" - but a simple button to refresh the connection fixes the problem for me - way better than what it used to do where OBS and Companion had to restart. When this happens next I'll try to peek at my logs.

Joelsuperstar commented 6 months ago

@Itaku that computer runs windows.

I also tried to replicated it on a virtual windows computer at home. But I couldn't replicate the exact problem.

It is indeed something that the connection "freezes". But companion will think that it is still connected to OBS, which is not the case.. But the fix that you are saying is also indeed what I try to do with a trigger. But it is still annoying that the connection freezes..

Itaku commented 6 months ago

My video crew just mentioned to me they run into this problem usually when Companion is started before OBS. Just ran through a full show today without having to reset the obs connection, but we didn’t add any scenes or sources to setup which is usually when we have to reset the connection.