obsproject / obs-studio

OBS Studio - Free and open source software for live streaming and screen recording
https://obsproject.com
GNU General Public License v2.0
57.19k stars 7.71k forks source link

OBS Improperly Shutting Down - Constant Unclean Shutdown Error Messages #10932

Open Nominative99 opened 4 days ago

Nominative99 commented 4 days ago

Operating System Info

Windows 10

Other OS

No response

OBS Studio Version

30.1.2

OBS Studio Version (Other)

No response

OBS Studio Log URL

https://obsproject.com/logs/W0ryLbfajQBB8Eg8

OBS Studio Crash Log URL

No response

Expected Behavior

OBS to close normally.

Current Behavior

The OBS preview screen widens out and hangs for a few seconds before closing/crashing. No crash logs are being generated to upload.

Steps to Reproduce

  1. Run OBS
  2. Wait +15 Minutes
  3. Close OBS ...

Anything else we should know?

Once OBS has been running for over 15 minutes, it will improperly close down. Only on rare occasions it will close without issues. This happens in both Safe & Normal Modes, even letting it run without recording or streaming. The preview screen widens and hangs for a few seconds. This issue can sometimes prevent any changes done in OBS to save properly. Unfortunately no crash logs are being generated.

I did a clean re-install of OBS just as an extra precaution but the error persists. This issue started to occur since the release of 30.0 last year. I really didn't pay too much attention and ignored it until I noticed settings aren't being saved at times.

I've uploaded additional logs. Normal run, safe mode run, then normal run again (closing in a few short minutes to prevent the error. Please let me know what I can do to assist further if needed.

2024-06-28 21-17-48.txt 2024-06-28 21-49-57.txt 2024-06-28 22-19-21.txt

RytoEX commented 4 days ago

In these logs: https://obsproject.com/logs/W0ryLbfajQBB8Eg8 2024-06-28 21-17-48.txt 2024-06-28 21-49-57.txt

OBS is not shutting down correctly. Something is causing it to prematurely exit without completing its shutdown process. You can see an example of a complete shutdown in the last log you posted, where "Number of memory leaks: 1" is logged at the end: 2024-06-28 22-19-21.txt

That there is 1 memory leak is probably not related, though that is not ideal. We'll set that aside in the hope that it's not relevant to the core issue here.

Frustratingly, this also appears to be bypassing our crash handler or at least you aren't getting our crash notice. Are there any crash logs in the crash logs folder at %APPDATA%\obs-studio\crashes?

What I find curious is the end of the log is consistent when it crashes:

21:50:34.531: [WASAPISource::ProcessCaptureData] window disappeared
21:50:34.534: Device '[VIRTUAL_AUDIO_DEVICE_PROCESS_LOOPBACK]' invalidated.  Retrying (source: FireFoxAudio)
21:50:37.536: WASAPI: Device '[VIRTUAL_AUDIO_DEVICE_PROCESS_LOOPBACK]' [48000 Hz] initialized (source: FireFoxAudio)
22:00:05.481: adding 42 milliseconds of audio buffering, total audio buffering is now 42 milliseconds (source: FireFoxAudio)
22:00:05.481: 
22:11:13.808: [WASAPISource::ProcessCaptureData] window disappeared
22:11:13.810: Device '[VIRTUAL_AUDIO_DEVICE_PROCESS_LOOPBACK]' invalidated.  Retrying (source: FireFoxAudio)
22:11:16.813: WASAPI: Device '[VIRTUAL_AUDIO_DEVICE_PROCESS_LOOPBACK]' [48000 Hz] initialized (source: FireFoxAudio)
22:19:10.084: ==== Shutting down ==================================================
22:19:10.105: WASAPI: Device 'Wave Link Stream (Elgato Wave:3)' Terminated
22:19:10.109: WASAPI: Device 'Game Capture HD60 X (2- Game Capture HD60 X)' Terminated

I'm not sure that "waiting 15 minutes" is necessary. The common symptom in the log seems to be that an Application Audio Capture source has lost its target at least once before (or twice?) and seemingly re-initialized capture before OBS is asked to close. I wonder if that's somehow related and the time spent waiting is simply how long that takes to happen (due to something, the window title changing, the window disappearing?). What are that source's settings and what is it set to capture?

RytoEX commented 4 days ago

After a bit of local experimentation, I got this on shutdown:

00:41:01.073: Not all sources were cleared when clearing scene data:
00:41:01.073: 
00:41:01.073: - Application Audio Capture (BETA)
00:41:01.073: 
00:41:01.107: WASAPI: Device '[VIRTUAL_AUDIO_DEVICE_PROCESS_LOOPBACK]' Terminated

However, then OBS shuts down normally. I wonder if an added component is that you're adding this source to other scenes via "Scene As Source". May I ask why you are doing this? Does adding the existing FireFoxAudio source to each scene not work for your use-case? Just wondering if that might not crash on exit.

Nominative99 commented 3 days ago

I apologize for the late reply. I used the Application Audio Capture to play music from FireFox. I figured adding it as a Scene Source just so if I make any changes, I just need to do it once versus going to each Scene one by one. It's a recent addition I've done to my setup. That's been deleted and here is the log file with OBS running without it. The issue still occurred.

https://obsproject.com/logs/XOUXv16NyJBnnbeW

As per time, I just mentioned it out of consistency. I just have to use OBS long enough it to occur any less and it closes with no issues. Sadly it still doesn't generate a crash report. The folder is empty.

I am wondering if it may have to do with putting in an Audio Input Capture using the HD60X. There is a quirk with the HD60X where audio will eventually desync, so the fix is mute the Video Capture Source, and add audio back in via Audio Input. Looks to be a common issue with some Elgato devices from what I've read online. I've had this setup for quite some time and it was only until v30 was released did the unclean issues start.

Log Without Elgato Sources (No Issue Closing): https://obsproject.com/logs/GOR7qrQhXfkkLxsC Log With Just Video Capture (No Issue Closing): https://obsproject.com/logs/pKOem5DvaUFmmafA Log with Both Video & Audio Input (Issue Occurs): https://obsproject.com/logs/8uWSYKMGQBnHBgss