Skip to content

Allow configuring Snapcast TCP stream sample rate and bit depth - #5140

Merged
OzGav merged 5 commits into
music-assistant:devfrom
rwjack:feature/snapcast-configurable-stream-format
Aug 8, 2026
Merged

Allow configuring Snapcast TCP stream sample rate and bit depth#5140
OzGav merged 5 commits into
music-assistant:devfrom
rwjack:feature/snapcast-configurable-stream-format

Conversation

@rwjack

@rwjack rwjack commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

What does this implement/fix?

Makes the sample rate and bit depth of the Music Assistant -> Snapserver TCP source
configurable via two new advanced provider settings, instead of being hardcoded to
48000:16:2. Defaults are unchanged (48 kHz / 16-bit).

For 24-bit the stream is sent as packed s24le and the TCP source URI gets
packed_s24le=true, which requires a Snapserver build with
snapcast/snapcast#1532.

image

Related issue (if applicable):

Types of changes

  • Bugfix (non-breaking change which fixes an issue) — bugfix
  • New feature (non-breaking change which adds functionality) — new-feature
  • Enhancement to an existing feature — enhancement
  • New music/player/metadata/plugin provider — new-provider
  • Breaking change (fix or feature that would cause existing functionality to not work as expected) — breaking-change
  • Refactor (no behaviour change) — refactor
  • Documentation only — documentation
  • Maintenance / chore — maintenance
  • CI / workflow change — ci
  • Dependencies bump — dependencies

Checklist

  • The code change is tested and works locally.
  • pre-commit run --all-files passes.
  • pytest passes, and tests have been added/updated under tests/ where applicable.
  • For changes to shared models, the companion PR in music-assistant/models is linked.
  • For changes affecting the UI, the companion PR in music-assistant/frontend is linked.
  • I have read and complied with the project's AI Policy for any AI-assisted contributions.
  • I have raised a PR against the documentation repository targeting the main or beta branch as appropriate: Document configurable Snapcast stream sample rate and bit depth music-assistant.io#825

@OzGav

OzGav commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Please restore the PR description template, only select one type of change and CI is failing.

@musicassistant-bot

musicassistant-bot Bot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

✅ The title and description are good to go. Thanks!

Comment thread music_assistant/providers/snapcast/ma_stream.py Outdated

@MarvinSchenkel MarvinSchenkel left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice addition to the snapcast provider. Left a few comments, we should be able to merge this afterwards 🙏 . Marking this PR as draft. Please set this to 'ready for review' again when you want us to have another look

Comment thread music_assistant/providers/snapcast/provider.py
Comment thread music_assistant/providers/snapcast/ma_stream.py
@MarvinSchenkel
MarvinSchenkel marked this pull request as draft August 3, 2026 13:17
@rwjack
rwjack marked this pull request as ready for review August 5, 2026 15:33
@rwjack

rwjack commented Aug 5, 2026

Copy link
Copy Markdown
Contributor Author

Hey Marvin, thanks for the review. I made some changes based on your comments. Lmk what you think

rwjack added 4 commits August 5, 2026 17:36
Enables optional hi-res PCM (up to 192 kHz / 24-bit) for Music Assistant
Snapcast sources, adding packed_s24le for 24-bit ffmpeg ingest pending
snapcast/snapcast#1532.
The new Snapcast config entry strings were missing from the generated en.json source file, which failed the build_translations_source hook.
Built-in Snapserver stays at 48 kHz / 16-bit until upstream packed 24-bit ingest lands; hide the sample rate and bit depth options unless Use existing Snapserver is enabled.
Use provider.stream_audio_format directly, simplify external stream format casting, and refuse to adopt orphan streams whose sample format no longer matches.
@rwjack
rwjack force-pushed the feature/snapcast-configurable-stream-format branch from ed89c56 to 187daf4 Compare August 5, 2026 15:42
rwjack added a commit to rwjack/music-assistant-io that referenced this pull request Aug 7, 2026
@OzGav
OzGav enabled auto-merge (squash) August 8, 2026 15:06
@OzGav
OzGav merged commit 6c13f0c into music-assistant:dev Aug 8, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants