Skip to content

[network] stream-bitrate does not do anything when streaming from Navidrome #1995

@liquidev

Description

@liquidev

Desktop

  • OS: Arch Linux
  • OS version: rolling
  • Tauon Version: 8.2.3
  • Installation method: pacman

Describe the bug
As in the title—the stream-bitrate setting has no effect when streaming music from Navidrome, causing excessive bandwidth usage. This is caused by Navidrome assuming the raw format by default, rather than a compressed format like opus.

https://github.com/navidrome/navidrome/blob/71f549afbf9f85748dc2096ad5e98effbd9c1600/core/media_streamer.go#L135

Fixing this would require exposing a streaming format setting in addition to a the streaming bitrate, and the value of this setting should be passed into the underlying Subsonic server using the format parameter.

def resolve_stream(self, key: str) -> (tuple[str, dict[str, str]] | bytes | Any | None):
p = {"id": key}
if self.prefs.network_stream_bitrate > 0:
p["maxBitRate"] = self.prefs.network_stream_bitrate
return self.r("stream", p={"id": key}, get_url=True)
# logging.info(response.content)

	def resolve_stream(self, key: str) -> (tuple[str, dict[str, str]] | bytes | Any | None):
		p = {"id": key}
		if self.prefs.network_stream_bitrate > 0:
			p["maxBitRate"] = self.prefs.network_stream_bitrate
+		if self.prefs.network_stream_format != "":
+			p["format"] = self.prefs.network_stream_format

		return self.r("stream", p={"id": key}, get_url=True)
		# logging.info(response.content)

Such a setting is exposed in Feishin, another player with support for streaming from Subsonic servers.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions