Question / Help OBS "freezes" computer on startup... sometimes

Adam W

New Member
Hello all, I have posted about this problem before and I am still experiencing it. Basically, when I load OBS... it will sometimes completely freeze my computer. The mouse wont move.. frozen. The only way is to hard boot several times. These events are completely random as sometimes I will launch a dozen times with no problem and others I will freeze 3 times in a row. I have a feeling this is some kind of driver issue, but nothing stands out in particular. Any help is appreciated, please see log below of tonights crash.

20:58:21.029: CPU Name: Intel(R) Core(TM) i7-5820K CPU @ 3.30GHz
20:58:21.029: CPU Speed: 3300MHz
20:58:21.029: Physical Cores: 6, Logical Cores: 12
20:58:21.029: Physical Memory: 16295MB Total, 12442MB Free
20:58:21.029: Windows Version: 10.0 Build 14393 (revision: 1914; 64-bit)
20:58:21.029: Running as administrator: true
20:58:21.029: Aero is Enabled (Aero is always on for windows 8 and above)
20:58:21.029: Windows 10 Gaming Features:
20:58:21.029: Game Bar: Off
20:58:21.029: Game DVR Allowed: Yes
20:58:21.029: Game DVR: On
 

PotFFA

New Member
Hello all, I have posted about this problem before and I am still experiencing it. Basically, when I load OBS... it will sometimes completely freeze my computer. The mouse wont move.. frozen. The only way is to hard boot several times. These events are completely random as sometimes I will launch a dozen times with no problem and others I will freeze 3 times in a row. I have a feeling this is some kind of driver issue, but nothing stands out in particular. Any help is appreciated, please see log below of tonights crash.

20:58:21.029: CPU Name: Intel(R) Core(TM) i7-5820K CPU @ 3.30GHz
20:58:21.029: CPU Speed: 3300MHz
20:58:21.029: Physical Cores: 6, Logical Cores: 12
20:58:21.029: Physical Memory: 16295MB Total, 12442MB Free
20:58:21.029: Windows Version: 10.0 Build 14393 (revision: 1914; 64-bit)
20:58:21.029: Running as administrator: true
20:58:21.029: Aero is Enabled (Aero is always on for windows 8 and above)
20:58:21.029: Windows 10 Gaming Features:
20:58:21.029: Game Bar: Off
20:58:21.029: Game DVR Allowed: Yes
20:58:21.029: Game DVR: On
exact same issue, the annoying part is that, for me, it happens EVERY time I start it up, which means that everytime I try fixing it, I have to reboot my pc, which is making me lose motivation to even try fixing it
 

SumDim

Member
Adam, in your first post, you only cut and pasted a small portion of the current log. There should be a lot more in it.
Select All (CTRL+A), Copy, Then Paste
 

Adam W

New Member
Adam, in your first post, you only cut and pasted a small portion of the current log. There should be a lot more in it.
Select All (CTRL+A), Copy, Then Paste
Actually, that is all that is listed after a crash. I have other logs with more, but those are from regular startups. Any time it crashes, that is all I get in the log file.
 

sam686

Member
Show us a full, OBS-Studio logs when it worked correctly.
Which graphics card does your computer have?

Try to update graphics card software drivers.
If your desktop computer have PCI-E graphics card, it might be failing or isn't inserted all the way in.
 

SumDim

Member
There's a bug in how OBS Studio reports the Windows 10 gaming features. Don't know if this is causing the problem though.

What caught my eye is that your Game DVR is On while mine is Off. Both of our Game Bars are Off.

Here's mine:
22:29:55.267: Windows 10 Gaming Features:
22:29:55.267: Game Bar: Off
22:29:55.267: Game DVR Allowed: Yes
22:29:55.267: Game DVR: Off
22:29:55.267: Game DVR Background Recording: Off
22:29:55.267: Game Mode: Off
---- snip as it is long and doesn't stop here ---

Here's yours:
20:58:21.029: Windows 10 Gaming Features:
20:58:21.029: Game Bar: Off
20:58:21.029: Game DVR Allowed: Yes
20:58:21.029: Game DVR: On
--- crash ---

After looking a bit into the source code around this area of logging detection, I noticed a bug in the logging output for Windows 10 Gaming Features. If the registry keys associated with these checks don't exist or there is an error in reading them, the reporting can be totally wrong. This is because OBS Studio doesn't check the return status. If the key doesn't exist and no check is made for success, it is highly possible that the value used for reporting contains random garbage (i.e. non-zero from an uninitialized C struct on the stack) and interprets this as being "On/Enabled" which is wrong.

What you should do is see if it behaves like this all the time in the logs (i.e. stops at this point of logging) whenever you run OBS Studio. That is, if your log craps out consistently after the Game DVR check. That can help the developers.

Also check to see if these keys exist or not in your Windows registry and what their data values are:

/HKEY_CURRENT_USER/Software/Microsoft/Windows/CurrentVersion/GameDVR/AppCaptureEnabled
/HKEY_CURRENT_USER/Software/Microsoft/Windows/CurrentVersion/GameDVR/HistoricalCaptureEnabled
/HKEY_CURRENT_USER/Software/GameConfigStore/GameDVR_Enabled
/HKEY_CURRENT_USER/Software/Policies/Microsoft/Windows/GameDVR/AllowGameDVR
/HKEY_CURRENT_USER/Software/Microsoft/GameBar/AllowAutoGameMode
 

Adam W

New Member
Show us a full, OBS-Studio logs when it worked correctly.
Which graphics card does your computer have? ASUS GTX 970
Try to update graphics card software drivers. UPDATED This problem has persisted over 12 months and multiple drivers updates.
If your desktop computer have PCI-E graphics card, it might be failing or isn't inserted all the way in.
SECURED

https://gist.github.com/anonymous/56df2bfea58d82037c6fe8111ba21417
Here is full log after a successful restart of OBS


There's a bug in how OBS Studio reports the Windows 10 gaming features. Don't know if this is causing the problem though.
I will check on the reg keys.

Originally, I thought that my cpu overclock was causing the issue as OBS logs are reporting a different clock speed than what I have it set at. I also thought that Logitech c920 drivers might be the culprit, but I have no way to really test the driver theory. Not sure if either of these have any merit.
I really appreciate all the help friends :D
 

sam686

Member
Check for possibly faulty memory with memtest86+

Check for possibly faulty graphics card or faulty graphics card's memory. I am not sure which one is a good GPU memory test. https://www.google.com/search?q=graphics+card+memory+test

Try to unplug your webcam, as webcam drivers won't be used when unplugged. If this stops the freezing, it might be your webcam software drivers. You can uninstall using device manager or sometimes add/remove programs.

Try a different operating system, like Linux, windows 10, windows 7, but if it still freezes, it has to be a hardware problem.

Try a different graphics card, or use integrated graphics (note: no integrated graphics on LGA2011 CPU sockets), to check if the graphics card might be failing. Something has to be failing when computer just freezes and locks up.
 

sam686

Member
One more thing: When using a graphics card, try a different PCI-E slot.

Technical wall of text about my computer for the rest of this reply:
My computer have been randomly freezing for many months mostly a few seconds after starting and stopping x264 encoder, on both AMD Radeon HD 7350 and HD 6770 (used one at a time on x16 slot), so I recently got NVidia GT 1030, and my computer's crashed 3 times in one day (1 freezes with auto-reboot and 2 BSOD crash related to NVidia drivers). My fix: when I decided to move the graphics card to a different PCI-E slot. (from x16 to a same length x4 slot on Motherboard: Asus P8H77-M CSM). So far there are no more BSOD and freezes. NVidia GT 1030 only support up to x4 PCI-E data link anyway, and my CPU (i7-2600) is limited to PCI-E 2.0. With LGA1155 motherboard, x16 slot closest to CPU is wired directly to CPU (now unused on my computer) and the rest goes through chipset on motherboard, so I guess my CPU's PCI-E x16 might be failing on me.
 

SumDim

Member
The struct is initialized to 0, so there is no issue with the logging.

Where is it initialized to 0? All five are being allocated off the stack. There is no memset or {0} being done. It can be total random garbage when instantiated as structs are indeterminate. If the registry key does not exist, there is no check for ERROR_SUCCESS.
The data returned in *info (all the five gamebar, dvr states) can be garbage and when it gets to BLOG, its wrong output.

struct reg_dword {
LSTATUS status;
DWORD size;
DWORD return_value;
};

static void log_gaming_features(void)
{
if (win_ver < 0xA00)
return;

struct reg_dword game_bar_enabled; <-------- stack allocated; INDETERMINATE
struct reg_dword game_dvr_allowed;
struct reg_dword game_dvr_enabled;
struct reg_dword game_dvr_bg_recording;
struct reg_dword game_mode_enabled;

get_reg_dword(HKEY_CURRENT_USER, WIN10_GAME_BAR_REG_KEY,
L"AppCaptureEnabled", &game_bar_enabled);
get_reg_dword(HKEY_CURRENT_USER, WIN10_GAME_DVR_POLICY_REG_KEY,
L"AllowGameDVR", &game_dvr_allowed);
get_reg_dword(HKEY_CURRENT_USER, WIN10_GAME_DVR_REG_KEY,
L"GameDVR_Enabled", &game_dvr_enabled);
get_reg_dword(HKEY_CURRENT_USER, WIN10_GAME_BAR_REG_KEY,
L"HistoricalCaptureEnabled", &game_dvr_bg_recording);
get_reg_dword(HKEY_CURRENT_USER, WIN10_GAME_MODE_REG_KEY,
L"AllowAutoGameMode", &game_mode_enabled);

blog(LOG_INFO, "Windows 10 Gaming Features:");
blog(LOG_INFO, "\tGame Bar: %s",
(bool)game_bar_enabled.return_value ? "On" : "Off");
blog(LOG_INFO, "\tGame DVR Allowed: %s",
(bool)game_dvr_allowed.return_value ? "Yes" : "No");
blog(LOG_INFO, "\tGame DVR: %s",
(bool)game_dvr_enabled.return_value ? "On" : "Off");
blog(LOG_INFO, "\tGame DVR Background Recording: %s",
(bool)game_dvr_bg_recording.return_value ? "On" :
"Off");
blog(LOG_INFO, "\tGame Mode: %s",
(bool)game_mode_enabled.return_value ? "On" : "Off");
}

void get_reg_dword(HKEY hkey, LPCWSTR sub_key, LPCWSTR value_name,
struct reg_dword *info)
{
struct reg_dword reg = {0}; <-------- LOCAL reg initialized, NOT *info
HKEY key;
LSTATUS status;

status = RegOpenKeyEx(hkey, sub_key, 0, KEY_READ, &key);

if (status != ERROR_SUCCESS) <-------- EXITS HERE IF NO REGISTRY KEY/FAILURE, *info is INDETERMINATE
return;

reg.size = sizeof(reg.return_value);

reg.status = RegQueryValueExW(key, value_name, NULL, NULL,
(LPBYTE)&reg.return_value, &reg.size);

RegCloseKey(key);

*info = reg; <----------- WONT GET HERE IF NO REGISTRY KEY OR RegOpenKeyEx failed
}
 

sam686

Member
The real reason for this incomplete log is... the entire computer locks up, freezes, crashes, or lost power. The delayed writing of windows disk buffered write of a last few seconds never made it.

Where is it initialized to 0? All five are being allocated off the stack.
You might be right about being uninitialized, but due to delayed buffered writes of logs by windows itself, the cause of the entire windows crashing is something else.

Windows 10 Gaming Features:
Game Bar: Off (0)
Game DVR Allowed: Yes (CCCCCCCC)
Game DVR: On (1)
Game DVR Background Recording: Off (0)
Game Mode: Off (0)

Uninitialized junk, showing hex value in paranthesis. CCCCCCCC in debug build, mostly random number in release build. It doesn't seem to matter what garbage number it was, it will not cause the program or the entire operating system to crash.
 

Attachments

  • test7.cpp.txt
    2.6 KB · Views: 11

SumDim

Member
The log file will rarely show the exact location of where a crash occurred. OBS Studio is using buffered file i/o (i.e. fprintf) versus raw (i.e. write). Write is async thread safe. fprintf isn't. Stuff can still be in the internal buffer at time of crash, unflushed.

Its entirely possible that this issue of his is crashing in another thread. Whether this is OBS process thread or not (who do we point the finger at), he needs to post his crash files so we can look at the stack trace for the running processes to get clues.

The 5 DVR/Gamebar states are not being used anywhere outside of log_gaming_features. I did a full source file scan across the entire project and there are no other references to them. The possibility of the registry values causing the crash on further algorithmic processing is low since OBS doesn't do any registry writes that some outside process could read and that they are not used outside OBS' logging function.

My comment above was that I noticed bugs that needs fixing. That the fallout of this is that if the Devs and Support are going to use the log for analysis to explain Win10 game bar/DVR issues causing problems with OBS, they need to get the right values in the log file before making that assessment.
 

sam686

Member
he needs to post his crash files so we can look at the stack trace for the running processes to get clues.
The title just says it "freezes" computer. My computer have had freezing problems, really hard to know what it is if it only freezes and locks up... until finally I figured it out my problem is a failing and unstable PCI-E x16 slot.
It isnt creating crash logs for the event. What is the next thing to consider?
No OBS-Studio crashes. And no blue screen of death (BSOD)? something is wrong with the computer itself, but not entirely sure. The computer itself won't show what it is if it only freezes and locks up the entire computer, that is harder then a crash or blue screen of death that actually logs somewhere or shows some hints on what the problem is. The timing of the freeze / locks up might have some hints of what the problem might be, like excessive CPU/GPU usage from failing GPU, CPU, or motherboard's PCI-E or CPU's VRM (voltage regulator module), or too weak of PSU (Power supply unit).
 
Top