bitfocus / companion-module-obs-studio

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

OBS Companion keeps disconnecting and reconnecting #194

Closed Jmwhite45 closed 1 year ago

Jmwhite45 commented 1 year ago

Describe the bug Companion keeps disconnecting from and then reconnecting to OBS. It is successful with its reconnect but that lasts only a few seconds before it disconnects again.

I can connect to OBS via OBS Blade and stay connected so I know its an issue with companion/OBS Companion module but I dont know what is causing the issue. The weird thing it that it was working fine this morning during a livestream but afterwards it stopped worked. Only modification to my computer I made after the stream that I can think of it is I installed new Realtek Audio drivers. I have since uninstalled them and the issue persists.

logs Companion: DESKTOP-9OK9K8K_companion_log_20230129-1559.csv OBS: 2023-01-29 15-41-42.txt

To Reproduce Unknown exactly. It happens automatically when I turn on OBS and Companion.

Version Information:

bryce-seifert commented 1 year ago

Interesting. As far as I can tell, that log message should only fire if OBS is closed by the user or is not reachable over the network.

Just to rule some items out: does this persist after a reboot? does this persist if you rollback to OBS 28.x?

Jmwhite45 commented 1 year ago

Yes, it persists after a reboot. I just checked and yes it persists on OBS 28.1.2.

Companion and OBS are both running on the same computer so the network shouldn't be an issue. So far I have been using 127.0.0.1:4455 to connect to OBS but I also tried the IP address OBS says to connect to and both have the same issue.

Jmwhite45 commented 1 year ago

If it helps, I am able to stream and record while this is happening. However, it causes some "frame missed due to rendering lag". The missed frames occur even when I am not streaming or recording.

bryce-seifert commented 1 year ago

Thanks for testing that.

Would you be able to turn on "Enable Debug Logging" in the Tools > Websocket server settings, and upload that file?

Jmwhite45 commented 1 year ago

Gladly.

OBS websocket debug logs 2023-01-29 19-30-58.txt

bryce-seifert commented 1 year ago

Unfortunately, I don't see any obvious causes in the debug logs.

Do you happen to have another computer you can test a fresh Companion install on, connected to this OBS instance?

Jmwhite45 commented 1 year ago

I just tried it on a spare mac I have and it still is having the same issue. I have also uninstalled and reinstalled companion on my streaming computer and still am having the same issue. I did notice that when installing companion I selected the stable version which is currently 2.4.2. However when I connect to the GUI it says its experimental.

image

UPDATED VERSIONS:

Jmwhite45 commented 1 year ago

I installed OBS on the spare mac and I was able to obtain a stable connection from both my main computer and the Mac to the Mac. Later I will try uninstalling and reinstalling OBS on my main streaming computer

bryce-seifert commented 1 year ago

Thanks for the update. Let me know how it goes on the main streaming computer.

fyi, I have passed along the note about the "experimental" text to the main devs, that's just an error. It's a stable build

bryce-seifert commented 1 year ago

The "experimental" note being shown should now be fixed with the latest available 2.4.2 download

Jmwhite45 commented 1 year ago

So interesting development. I uninstalled OBS, cleaned the registry, and reinstalled OBS 29.0.2. After I reinstalled it, Companion was working fine so I started resetting up OBS. Notably I reimported the scenes I use through a scene collection. afterwards I noticed Companion was no longer working.

After some experimenting I found that when I am on my scene collection, Companion did not work. If I am on a blank scene collection It works. I am going to some more testing to figure out what exactly is causing the problem but maybe you can give some more insight.

the scene collection is pretty large, containing 29 different scenes. There are 3 camera sources coming through a integrated blackmagic capture card(decklink 8k Pro(SDI)), There is a 1 camera source something through HDMI elgato capture card(HD60 S+), the sound source is coming from a usb cable from a sound board, and finally there are some miscellaneous images and black boxes for different scenes.

Jmwhite45 commented 1 year ago

I am wondering if it has to do with the number of scenes. I deleted all but one scene to export that scene and it now works. I am slowly rebuilding the scenes I need. Hopefully from there I can see what is the root cause.

Jmwhite45 commented 1 year ago

I am utterly confused and have no idea why it wasn't working but I found the issue and the solution. I had a scene and when I deleted the scene it started working again. I did some more digging. That scene had 2 sources coming from the same device(Elgato capture card) so when I deleted one of them the problem fixed itself. After some thinking I think I know the root cause. I recently did a computer upgrade and got a new computer. This allowed me to go from 2 external capture cards to 1 internal and 1 external. My guess is that I removed the capture card but one of the scenes was still wanting to use it. Somehow OBS at some point decided to switch that source to the other capture card. From there I have no idea what went wrong. I have no idea how its connected to Companion.

In Short, It works now and I have no idea why.

bryce-seifert commented 1 year ago

@Jmwhite45 Wow, that sounds like quite a journey. Thanks for all the updates, sorry this was such a tough one...and we don't really know what the root cause is. It seems odd that the capture cards would affect websocket, but I'm not entirely sure of all of OBS's workings under the hood. Glad it's working, and feel free to reach out if it happens again!