fix alert playback on squeezebox
authorMarcel van der Veldt <m.vanderveldt@outlook.com>
Tue, 3 Aug 2021 19:19:54 +0000 (21:19 +0200)
committerMarcel van der Veldt <m.vanderveldt@outlook.com>
Tue, 3 Aug 2021 19:19:54 +0000 (21:19 +0200)
music_assistant/providers/squeezebox/socket_client.py
music_assistant/resources/alert_announce.flac
music_assistant/resources/alert_announce_old.flac [new file with mode: 0644]

index f5be8ac43b451826dcbbeb682bac4b7490b348f3..c9ac060351fd472322e899977860bb24f73b4812 100644 (file)
@@ -218,7 +218,7 @@ class SqueezeSocketClient:
         enable_crossfade = crossfade_duration > 0
         command = b"s"
         # we use direct stream for now so let the player do the messy work with buffers
-        autostart = b"0"
+        autostart = b"3"
         trans_type = b"1" if enable_crossfade else b"0"
         uri = "/stream" + uri.split("/stream")[1]
         # extract host and port from uri
@@ -301,7 +301,7 @@ class SqueezeSocketClient:
         spdif=b"0",
         trans_duration=0,
         trans_type=b"0",
-        flags=0x00,
+        flags=0x40,
         output_threshold=0,
         replay_gain=0,
         server_port=8095,
@@ -457,8 +457,8 @@ class SqueezeSocketClient:
         """Process incoming stat STMl message: Buffer threshold reached."""
         # pylint: disable=unused-argument
         LOGGER.debug("STMl received - Buffer threshold reached.")
-        # start playing by send unpause command when buffer full
-        create_task(self.send_strm(b"u"))
+        # autoplay 0 or 2: start playing by send unpause command when buffer full
+        create_task(self.send_strm(b"u"))
 
     def _process_stat_stmn(self, data):
         """Process incoming stat STMn message: player couldn't decode stream."""
@@ -470,6 +470,8 @@ class SqueezeSocketClient:
     def _process_resp(self, data):
         """Process incoming RESP message: Response received at player."""
         LOGGER.debug("RESP received - Response received at player.")
+        # send continue (used when autoplay 1 or 3)
+        create_task(self._send_frame, b"cont", b"0")
 
     def _process_setd(self, data):
         """Process incoming SETD message: Get/set player firmware settings."""
index d14bfc8d6cb0141caaebd48284341b000302b474..95c7caec38691d579f02178bd6cf35b4f23525cf 100644 (file)
Binary files a/music_assistant/resources/alert_announce.flac and b/music_assistant/resources/alert_announce.flac differ
diff --git a/music_assistant/resources/alert_announce_old.flac b/music_assistant/resources/alert_announce_old.flac
new file mode 100644 (file)
index 0000000..d14bfc8
Binary files /dev/null and b/music_assistant/resources/alert_announce_old.flac differ