From: Marcel van der Veldt Date: Mon, 20 Jun 2022 07:38:28 +0000 (+0200) Subject: Increase buffer size for radio streams (#379) X-Git-Url: https://git.kitaultman.com/?a=commitdiff_plain;h=b576380bdd3bcdf97d9a75eaa4e8df60f0365019;p=music-assistant-server.git Increase buffer size for radio streams (#379) --- diff --git a/music_assistant/controllers/streams.py b/music_assistant/controllers/streams.py index 7e715d17..f0767197 100644 --- a/music_assistant/controllers/streams.py +++ b/music_assistant/controllers/streams.py @@ -513,12 +513,12 @@ class QueueStream: sample_size = int( self.pcm_sample_rate * (self.pcm_bit_depth / 8) * self.pcm_channels - ) # 1 second - buffer_size = sample_size * (self.queue.settings.crossfade_duration or 2) + ) + buffer_size = sample_size * (self.queue.settings.crossfade_duration or 5) # force small buffer for radio to prevent too much lag at start if queue_track.media_type != MediaType.TRACK: use_crossfade = False - buffer_size = sample_size + buffer_size = sample_size * 2 self.logger.info( "Start Streaming queue track: %s (%s) for queue %s", diff --git a/music_assistant/helpers/process.py b/music_assistant/helpers/process.py index b368a28d..a556a9d7 100644 --- a/music_assistant/helpers/process.py +++ b/music_assistant/helpers/process.py @@ -52,7 +52,7 @@ class AsyncProcess: stdin=asyncio.subprocess.PIPE if self._enable_stdin else None, stdout=asyncio.subprocess.PIPE if self._enable_stdout else None, stderr=asyncio.subprocess.PIPE if self._enable_stderr else None, - limit=self.chunk_size * 5, + limit=self.chunk_size * 15, close_fds=True, ) else: @@ -61,7 +61,7 @@ class AsyncProcess: stdin=asyncio.subprocess.PIPE if self._enable_stdin else None, stdout=asyncio.subprocess.PIPE if self._enable_stdout else None, stderr=asyncio.subprocess.PIPE if self._enable_stderr else None, - limit=self.chunk_size * 5, + limit=self.chunk_size * 15, close_fds=True, ) return self