From aecb9f5816db6618fb1dbf76ab41722f3886a3f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aleix=20Conchillo=20Flaqu=C3=A9?= Date: Thu, 30 May 2024 10:18:43 -0700 Subject: [PATCH] transport(output): fix high CPU usage with camera_out_enabled and no images --- CHANGELOG.md | 4 ++++ src/pipecat/transports/base_output.py | 2 ++ 2 files changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index f6bc51111..e910bcb89 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Fixed SileroVAD frame processor. +- Fixed an issue where `camera_out_enabled` would cause the highg CPU usage if + no image was provided. + + ## [0.0.24] - 2024-05-29 ### Added diff --git a/src/pipecat/transports/base_output.py b/src/pipecat/transports/base_output.py index 6106eaefa..90ac406d6 100644 --- a/src/pipecat/transports/base_output.py +++ b/src/pipecat/transports/base_output.py @@ -252,6 +252,8 @@ def _camera_out_thread_handler(self): image = next(self._camera_images) self._draw_image(image) time.sleep(1.0 / self._params.camera_out_framerate) + else: + time.sleep(1.0 / self._params.camera_out_framerate) except queue.Empty: pass except Exception as e: