diff --git a/UI/data/locale/en-US.ini b/UI/data/locale/en-US.ini
index 001cdf4f0..f45096fa5 100644
--- a/UI/data/locale/en-US.ini
+++ b/UI/data/locale/en-US.ini
@@ -605,6 +605,8 @@ Basic.Settings.Advanced.StreamDelay.Preserve="Preserve cutoff point (increase de
Basic.Settings.Advanced.StreamDelay.MemoryUsage="Estimated Memory Usage: %1 MB"
Basic.Settings.Advanced.Network="Network"
Basic.Settings.Advanced.Network.BindToIP="Bind to IP"
+Basic.Settings.Advanced.Network.EnableNewSocketLoop="Enable new networking code"
+Basic.Settings.Advanced.Network.EnableLowLatencyMode="Low latency mode"
# advanced audio properties
Basic.AdvAudio="Advanced Audio Properties"
diff --git a/UI/forms/OBSBasicSettings.ui b/UI/forms/OBSBasicSettings.ui
index 36bc107fc..d3c0d9299 100644
--- a/UI/forms/OBSBasicSettings.ui
+++ b/UI/forms/OBSBasicSettings.ui
@@ -3455,9 +3455,9 @@
0
- 0
- 593
- 699
+ -16
+ 803
+ 738
@@ -3787,16 +3787,9 @@
Basic.Settings.Advanced.StreamDelay
- -
-
-
- Enable
-
-
- true
-
-
-
+
+ 2
+
-
@@ -3873,6 +3866,16 @@
+ -
+
+
+ Enable
+
+
+ true
+
+
+
@@ -3979,6 +3982,23 @@
+ -
+
+
+ Basic.Settings.Advanced.Network.EnableNewSocketLoop
+
+
+
+ -
+
+
+ false
+
+
+ Basic.Settings.Advanced.Network.EnableLowLatencyMode
+
+
+
@@ -4147,6 +4167,29 @@
reconnectRetryDelay
reconnectMaxRetries
bindToIP
+ enableNewSocketLoop
+ enableLowLatencyMode
+ warnBeforeStreamStop
+ recordWhenStreaming
+ keepRecordStreamStops
+ replayWhileStreaming
+ keepReplayStreamStops
+ snappingEnabled
+ screenSnapping
+ centerSnapping
+ sourceSnapping
+ snapDistance
+ hideProjectorCursor
+ projectorAlwaysOnTop
+ saveProjectors
+ systemTrayEnabled
+ systemTrayWhenStarted
+ systemTrayAlways
+ enableAutoUpdates
+ warnBeforeStreamStart
+ scrollArea_2
+ language
+ theme
@@ -4276,7 +4319,7 @@
241
- 54
+ 53
@@ -4291,7 +4334,7 @@
67
- 243
+ 250
67
@@ -4344,54 +4387,6 @@
-
- streamDelayEnable
- toggled(bool)
- label_56
- setEnabled(bool)
-
-
- 503
- 450
-
-
- 269
- 476
-
-
-
-
- streamDelayEnable
- toggled(bool)
- streamDelayPreserve
- setEnabled(bool)
-
-
- 503
- 450
-
-
- 503
- 499
-
-
-
-
- streamDelayEnable
- toggled(bool)
- widget_12
- setEnabled(bool)
-
-
- 503
- 450
-
-
- 503
- 476
-
-
-
simpleOutAdvanced
toggled(bool)
@@ -4415,12 +4410,12 @@
setEnabled(bool)
- 384
- 559
+ 730
+ 556
- 400
- 585
+ 746
+ 579
@@ -4431,12 +4426,28 @@
setEnabled(bool)
- 484
- 566
+ 830
+ 556
- 480
- 605
+ 826
+ 602
+
+
+
+
+ enableNewSocketLoop
+ toggled(bool)
+ enableLowLatencyMode
+ setEnabled(bool)
+
+
+ 403
+ 642
+
+
+ 403
+ 665
@@ -4447,12 +4458,12 @@
setEnabled(bool)
- 380
- 322
+ 733
+ 317
- 330
- 350
+ 347
+ 343
@@ -4463,12 +4474,12 @@
setEnabled(bool)
- 421
- 325
+ 774
+ 317
- 429
- 346
+ 782
+ 343
@@ -4479,12 +4490,12 @@
setEnabled(bool)
- 467
- 325
+ 820
+ 317
- 484
- 378
+ 837
+ 366
@@ -4495,12 +4506,12 @@
setEnabled(bool)
- 528
- 329
+ 881
+ 317
- 537
- 392
+ 890
+ 389
@@ -4511,12 +4522,12 @@
setEnabled(bool)
- 575
- 328
+ 928
+ 317
- 562
- 422
+ 915
+ 412
@@ -4527,12 +4538,12 @@
setEnabled(bool)
- 457
- 205
+ 803
+ 199
- 474
- 226
+ 820
+ 222
@@ -4543,12 +4554,76 @@
setEnabled(bool)
- 401
- 247
+ 747
+ 245
- 407
- 270
+ 753
+ 268
+
+
+
+
+ streamDelayEnable
+ toggled(bool)
+ label_56
+ setEnabled(bool)
+
+
+ 431
+ 422
+
+
+ 356
+ 443
+
+
+
+
+ streamDelayEnable
+ toggled(bool)
+ streamDelaySec
+ setEnabled(bool)
+
+
+ 465
+ 420
+
+
+ 463
+ 447
+
+
+
+
+ streamDelayEnable
+ toggled(bool)
+ streamDelayInfo
+ setEnabled(bool)
+
+
+ 533
+ 420
+
+
+ 557
+ 446
+
+
+
+
+ streamDelayEnable
+ toggled(bool)
+ streamDelayPreserve
+ setEnabled(bool)
+
+
+ 504
+ 420
+
+
+ 494
+ 465
diff --git a/UI/window-basic-main-outputs.cpp b/UI/window-basic-main-outputs.cpp
index f0866dd4c..27a5f9b4f 100644
--- a/UI/window-basic-main-outputs.cpp
+++ b/UI/window-basic-main-outputs.cpp
@@ -665,9 +665,17 @@ bool SimpleOutput::StartStreaming(obs_service_t *service)
"DelayPreserve");
const char *bindIP = config_get_string(main->Config(), "Output",
"BindIP");
+ bool enableNewSocketLoop = config_get_bool(main->Config(), "Output",
+ "NewSocketLoopEnable");
+ bool enableLowLatencyMode = config_get_bool(main->Config(), "Output",
+ "LowLatencyEnable");
obs_data_t *settings = obs_data_create();
obs_data_set_string(settings, "bind_ip", bindIP);
+ obs_data_set_bool(settings, "new_socket_loop_enabled",
+ enableNewSocketLoop);
+ obs_data_set_bool(settings, "low_latency_mode_enabled",
+ enableLowLatencyMode);
obs_output_update(streamOutput, settings);
obs_data_release(settings);
@@ -1314,9 +1322,17 @@ bool AdvancedOutput::StartStreaming(obs_service_t *service)
"DelayPreserve");
const char *bindIP = config_get_string(main->Config(), "Output",
"BindIP");
+ bool enableNewSocketLoop = config_get_bool(main->Config(), "Output",
+ "NewSocketLoopEnable");
+ bool enableLowLatencyMode = config_get_bool(main->Config(), "Output",
+ "LowLatencyEnable");
obs_data_t *settings = obs_data_create();
obs_data_set_string(settings, "bind_ip", bindIP);
+ obs_data_set_bool(settings, "new_socket_loop_enabled",
+ enableNewSocketLoop);
+ obs_data_set_bool(settings, "low_latency_mode_enabled",
+ enableLowLatencyMode);
obs_output_update(streamOutput, settings);
obs_data_release(settings);
diff --git a/UI/window-basic-main.cpp b/UI/window-basic-main.cpp
index 976e24ece..00be4407c 100644
--- a/UI/window-basic-main.cpp
+++ b/UI/window-basic-main.cpp
@@ -1001,6 +1001,10 @@ bool OBSBasic::InitBasicConfigDefaults()
config_set_default_uint (basicConfig, "Output", "MaxRetries", 20);
config_set_default_string(basicConfig, "Output", "BindIP", "default");
+ config_set_default_bool (basicConfig, "Output", "NewSocketLoopEnable",
+ false);
+ config_set_default_bool (basicConfig, "Output", "LowLatencyEnable",
+ false);
int i = 0;
uint32_t scale_cx = cx;
diff --git a/UI/window-basic-settings.cpp b/UI/window-basic-settings.cpp
index 17fd6b396..bcbe46d8b 100644
--- a/UI/window-basic-settings.cpp
+++ b/UI/window-basic-settings.cpp
@@ -403,6 +403,8 @@ OBSBasicSettings::OBSBasicSettings(QWidget *parent)
HookWidget(ui->reconnectMaxRetries, SCROLL_CHANGED, ADV_CHANGED);
HookWidget(ui->processPriority, COMBO_CHANGED, ADV_CHANGED);
HookWidget(ui->bindToIP, COMBO_CHANGED, ADV_CHANGED);
+ HookWidget(ui->enableNewSocketLoop, CHECK_CHANGED, ADV_CHANGED);
+ HookWidget(ui->enableLowLatencyMode, CHECK_CHANGED, ADV_CHANGED);
#if !defined(_WIN32) && !defined(__APPLE__)
delete ui->monitoringDevice;
@@ -453,6 +455,8 @@ OBSBasicSettings::OBSBasicSettings(QWidget *parent)
delete ui->processPriorityLabel;
delete ui->processPriority;
delete ui->advancedGeneralGroupBox;
+ delete ui->enableNewSocketLoop;
+ delete ui->enableLowLatencyMode;
ui->rendererLabel = nullptr;
ui->renderer = nullptr;
ui->adapterLabel = nullptr;
@@ -460,6 +464,8 @@ OBSBasicSettings::OBSBasicSettings(QWidget *parent)
ui->processPriorityLabel = nullptr;
ui->processPriority = nullptr;
ui->advancedGeneralGroupBox = nullptr;
+ ui->enableNewSocketLoop = nullptr;
+ ui->enableLowLatencyMode = nullptr;
#endif
#ifndef __APPLE__
@@ -2004,6 +2010,7 @@ void OBSBasicSettings::LoadAdvancedSettings()
ui->streamDelayPreserve->setChecked(preserveDelay);
ui->streamDelayEnable->setChecked(enableDelay);
+
SetComboByName(ui->colorFormat, videoColorFormat);
SetComboByName(ui->colorSpace, videoColorSpace);
SetComboByValue(ui->colorRange, videoColorRange);
@@ -2025,10 +2032,18 @@ void OBSBasicSettings::LoadAdvancedSettings()
#elif _WIN32
const char *processPriority = config_get_string(App()->GlobalConfig(),
"General", "ProcessPriority");
+ bool enableNewSocketLoop = config_get_bool(main->Config(), "Output",
+ "NewSocketLoopEnable");
+ bool enableLowLatencyMode = config_get_bool(main->Config(), "Output",
+ "LowLatencyEnable");
+
idx = ui->processPriority->findData(processPriority);
if (idx == -1)
idx = ui->processPriority->findData("Normal");
ui->processPriority->setCurrentIndex(idx);
+
+ ui->enableNewSocketLoop->setChecked(enableNewSocketLoop);
+ ui->enableLowLatencyMode->setChecked(enableLowLatencyMode);
#endif
loading = false;
@@ -2505,6 +2520,9 @@ void OBSBasicSettings::SaveAdvancedSettings()
priority.c_str());
if (main->Active())
SetProcessPriority(priority.c_str());
+
+ SaveCheckBox(ui->enableNewSocketLoop, "Output", "NewSocketLoopEnable");
+ SaveCheckBox(ui->enableLowLatencyMode, "Output", "LowLatencyEnable");
#endif
#ifdef __APPLE__