From 9e98bf0a1841d288d879a2098147fc10f3f8a1e8 Mon Sep 17 00:00:00 2001 From: Marcel van der Veldt Date: Mon, 3 Nov 2025 02:13:06 +0100 Subject: [PATCH] Workaround for slow starting radio streams --- music_assistant/controllers/streams.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/music_assistant/controllers/streams.py b/music_assistant/controllers/streams.py index fb339d08..91a266b0 100644 --- a/music_assistant/controllers/streams.py +++ b/music_assistant/controllers/streams.py @@ -1304,6 +1304,15 @@ class StreamsController(CoreController): filter_params=filter_params, ) + if ( + streamdetails.media_type == MediaType.RADIO + and streamdetails.volume_normalization_mode == VolumeNormalizationMode.DYNAMIC + ): + # prepend 3 seconds of silence to give loudnorm filter time to adjust + # fixes https://github.com/music-assistant/support/issues/4028#issuecomment-3478449178 + silence = b"\0" * int(pcm_format.sample_rate * (pcm_format.bit_depth / 8) * 2) * 3 + yield silence + first_chunk_received = False fade_in_buffer = b"" bytes_received = 0 -- 2.34.1