Skip to content

Commit 2e7b42e

Browse files
committed
fix frame build up latency by adding max size to every queue
1 parent fcb0cc4 commit 2e7b42e

File tree

5 files changed

+14
-7
lines changed

5 files changed

+14
-7
lines changed

.idea/discord.xml

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

BabbleApp/algo_settings_widget.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ def __init__(self, widget_id: Tab, main_config: BabbleSettingsConfig, osc_queue:
116116

117117
self.cancellation_event = Event() # Set the event until start is called, otherwise we can block if shutdown is called.
118118
self.cancellation_event.set()
119-
self.image_queue = Queue()
119+
self.image_queue = Queue(maxsize=1)
120120

121121

122122
def started(self):

BabbleApp/babbleapp.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ def main():
9595
# Check to see if we have an ROI. If not, bring up ROI finder GUI.
9696

9797
# Spawn worker threads
98-
osc_queue: queue.Queue[tuple[bool, int, int]] = queue.Queue()
98+
osc_queue: queue.Queue[tuple[bool, int, int]] = queue.Queue(maxsize=5)
9999
osc = VRChatOSC(cancellation_event, osc_queue, config)
100100
osc_thread = threading.Thread(target=osc.run)
101101
# start worker threads

BabbleApp/camera_widget.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,10 @@ def __init__(self, widget_id: Tab, main_config: BabbleConfig, osc_queue: Queue):
5151
# Set the event until start is called, otherwise we can block if shutdown is called.
5252
self.cancellation_event.set()
5353
self.capture_event = Event()
54-
self.capture_queue = Queue()
55-
self.roi_queue = Queue()
54+
self.capture_queue = Queue(maxsize=1)
55+
self.roi_queue = Queue(maxsize=1)
5656

57-
self.image_queue = Queue()
57+
self.image_queue = Queue(maxsize=1)
5858

5959
self.ransac = BabbleProcessor(
6060
self.config,
@@ -67,7 +67,7 @@ def __init__(self, widget_id: Tab, main_config: BabbleConfig, osc_queue: Queue):
6767
self.cam_id,
6868
)
6969

70-
self.camera_status_queue = Queue()
70+
self.camera_status_queue = Queue(maxsize=1)
7171
self.camera = Camera(
7272
self.config,
7373
0,

BabbleApp/general_settings_widget.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ def __init__(self, widget_id: Tab, main_config: BabbleSettingsConfig, osc_queue:
155155

156156
self.cancellation_event = Event() # Set the event until start is called, otherwise we can block if shutdown is called.
157157
self.cancellation_event.set()
158-
self.image_queue = Queue()
158+
self.image_queue = Queue(maxsize=1)
159159

160160

161161
def started(self):

0 commit comments

Comments
 (0)