AirPlay: Issue the extra volume command on RAOP only
authorMarcel van der Veldt <m.vanderveldt@outlook.com>
Tue, 4 Nov 2025 22:14:04 +0000 (23:14 +0100)
committerMarcel van der Veldt <m.vanderveldt@outlook.com>
Tue, 4 Nov 2025 22:14:04 +0000 (23:14 +0100)
music_assistant/providers/airplay/protocols/raop.py
music_assistant/providers/airplay/stream_session.py

index 18a50b98b9a714e55609fe0f231b6d5348171b99..91f91bfe295cd07a600e278670a73704a8427b03 100644 (file)
@@ -116,6 +116,10 @@ class RaopStream(AirPlayProtocol):
 
         # start reading the stderr of the cliraop process from another task
         self._cli_proc.attach_stderr_reader(self.mass.create_task(self._stderr_reader()))
+        # repeat sending the volume level to the player because some players seem
+        # to ignore it the first time
+        # https://github.com/music-assistant/support/issues/3330
+        self.mass.call_later(1, self.send_cli_command(f"VOLUME={self.player.volume_level}\n"))
 
     async def start_pairing(self) -> None:
         """Start pairing process for this protocol (if supported)."""
index 60ace8f44ca28b66b68b101817d6e363ae4c82b7..65c6cf1dc073f0f7a4b43af631d082e76506b29b 100644 (file)
@@ -383,10 +383,6 @@ class AirPlayStreamSession:
         # start the stream
         assert airplay_player.stream  # for type checker
         await airplay_player.stream.start(start_ntp)
-        # repeat sending the volume level to the player because some players seem
-        # to ignore it the first time
-        # https://github.com/music-assistant/support/issues/3330
-        await airplay_player.stream.send_cli_command(f"VOLUME={airplay_player.volume_level}\n")
 
     async def _start_client_ffmpeg(self, airplay_player: AirPlayPlayer) -> None:
         """Start or restart the player's ffmpeg stream."""