From: Marcel van der Veldt Date: Mon, 10 Mar 2025 15:11:06 +0000 (+0100) Subject: Chore: limit cache filling a bit more X-Git-Url: https://git.kitaultman.com/?a=commitdiff_plain;h=94e1059ac96257f19655d8403d9791978f1fbc9d;p=music-assistant-server.git Chore: limit cache filling a bit more to keep cpu to a minimum on super fast connections, rate limit the cache fill a bit more --- diff --git a/music_assistant/helpers/audio.py b/music_assistant/helpers/audio.py index 8bce0578..185642d3 100644 --- a/music_assistant/helpers/audio.py +++ b/music_assistant/helpers/audio.py @@ -157,8 +157,10 @@ class StreamCache: audio_input=audio_source, input_format=self.streamdetails.audio_format, output_format=self.streamdetails.audio_format, - extra_input_args=extra_input_args, chunk_size=64000, + # apply readrate limiting to avoid buffering too much data too fast + # so we only allow reading into the cache max 5 times the normal speed + extra_input_args=["-readrate", "5", *extra_input_args], ): async with self._lock: self._data += chunk