Add a bit of diagnostic info to troubleshoot the Sonos issue of playback stopping
authorMarcel van der Veldt <m.vanderveldt@outlook.com>
Mon, 3 Nov 2025 00:08:41 +0000 (01:08 +0100)
committerMarcel van der Veldt <m.vanderveldt@outlook.com>
Mon, 3 Nov 2025 00:08:41 +0000 (01:08 +0100)
music_assistant/controllers/streams.py
music_assistant/providers/sonos/player.py

index e9ff65ecbcf18ce113fc14fced0bed1a7071715c..fb339d0887b33f7114549136c7100314c190a96b 100644 (file)
@@ -1576,16 +1576,22 @@ class StreamsController(CoreController):
 
     def _log_request(self, request: web.Request) -> None:
         """Log request."""
-        if not self.logger.isEnabledFor(VERBOSE_LOG_LEVEL):
-            return
-        self.logger.log(
-            VERBOSE_LOG_LEVEL,
-            "Got %s request to %s from %s\nheaders: %s\n",
-            request.method,
-            request.path,
-            request.remote,
-            request.headers,
-        )
+        if self.logger.isEnabledFor(VERBOSE_LOG_LEVEL):
+            self.logger.log(
+                VERBOSE_LOG_LEVEL,
+                "Got %s request to %s from %s\nheaders: %s\n",
+                request.method,
+                request.path,
+                request.remote,
+                request.headers,
+            )
+        else:
+            self.logger.debug(
+                "Got %s request to %s from %s",
+                request.method,
+                request.path,
+                request.remote,
+            )
 
     async def get_output_format(
         self,
index a5bade0aaf462a7fe60217b596010e1dec27d637..c1c8f08ccfd4fd08d92351cd15fc90eb79ee7578 100644 (file)
@@ -34,7 +34,7 @@ from music_assistant_models.errors import PlayerCommandFailed
 from music_assistant_models.player import PlayerMedia
 
 from music_assistant.constants import (
-    CONF_ENTRY_HTTP_PROFILE_DEFAULT_1,
+    CONF_ENTRY_HTTP_PROFILE_DEFAULT_2,
     CONF_ENTRY_OUTPUT_CODEC,
     create_sample_rates_config_entry,
 )
@@ -235,7 +235,7 @@ class SonosPlayer(Player):
         base_entries = [
             *await super().get_config_entries(action=action, values=values),
             CONF_ENTRY_OUTPUT_CODEC,
-            CONF_ENTRY_HTTP_PROFILE_DEFAULT_1,
+            CONF_ENTRY_HTTP_PROFILE_DEFAULT_2,
             create_sample_rates_config_entry(
                 # set safe max bit depth to 16 bits because the older Sonos players
                 # do not support 24 bit playback (e.g. Play:1)
@@ -491,6 +491,10 @@ class SonosPlayer(Player):
         """
         current_item_id = self.current_media.queue_item_id if self.current_media else None
         self.sonos_queue.enqueue_next(current_item_id, media)
+        self.logger.debug(f"Enqueued next media item: {media.title}")
+        self.logger.debug(
+            "Current Sonos queue items: %s", [x.title for x in self.sonos_queue.items]
+        )
         if session_id := self.client.player.group.active_session_id:
             await self.client.api.playback_session.refresh_cloud_queue(session_id)