Skip to content

Relax 'Maximum' buffer tier to 7GB RAM#4268

Merged
marcelveldt merged 2 commits into
devfrom
relaxed-ritchie-1c9e45
Jun 17, 2026
Merged

Relax 'Maximum' buffer tier to 7GB RAM#4268
marcelveldt merged 2 commits into
devfrom
relaxed-ritchie-1c9e45

Conversation

@marcelveldt

Copy link
Copy Markdown
Member

What does this implement/fix?

Follow-up to #4249. The Maximum buffer preset (and the auto-selected default) required exactly 8GB of RAM. Machines marketed as "8GB" frequently report a little less — integrated GPUs carve out shared system memory (e.g. a real 7.7GB), and container runtimes report their cgroup limit — so they silently dropped to the Balanced tier and never got the largest buffer.

  • Lower the Maximum threshold from 8GB to 7GB, so near-8GB hosts qualify for the optimal buffer.
  • Keep the 4GB Balanced minimum intact (the genuine lower bound).
  • Replace the repeated magic numbers with named BALANCED_MIN_RAM_GB / MAXIMUM_MIN_RAM_GB constants and extend the buffer-tier test with the boundary cases (6.9 → Balanced, 7.0 / 7.7 → Maximum).

Related issue (if applicable):

  • n/a

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.

The Maximum buffer preset (and its auto-default) required exactly 8GB of RAM,
so machines marketed as 8GB that report slightly less - integrated GPUs carve
out shared memory, container runtimes report their cgroup limit - silently
dropped to the Balanced tier. Lower the threshold to 7GB while keeping the 4GB
Balanced minimum intact.
Copilot AI review requested due to automatic review settings June 16, 2026 21:50

Copilot AI 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.

Pull request overview

This PR adjusts the Streams controller’s RAM-gated buffer preset thresholds so that hosts reporting slightly under “8GB” (e.g., due to shared GPU memory or cgroup limits) still qualify for the Maximum buffer tier, and it updates the related tests and inline documentation accordingly.

Changes:

  • Lower the Minimum RAM threshold for Maximum buffer preset from 8GB to 7GB.
  • Introduce named constants (BALANCED_MIN_RAM_GB, MAXIMUM_MIN_RAM_GB) to replace repeated magic numbers.
  • Extend the buffer-size gating tests with boundary cases around the new 7GB cutoff.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
music_assistant/controllers/streams/constants.py Adds RAM threshold constants and applies the new 7GB cutoff to available presets and default selection logic.
music_assistant/controllers/streams/controller.py Updates the config-entry comment to reflect the new Maximum RAM threshold.
tests/controllers/streams/test_buffer_size.py Adds new boundary test cases validating the updated RAM gating behavior for available buffer presets.

Comment thread tests/controllers/streams/test_buffer_size.py
Copilot AI review requested due to automatic review settings June 16, 2026 22:23

Copilot AI 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.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.

@marcelveldt marcelveldt merged commit 139c4b7 into dev Jun 17, 2026
10 checks passed
@marcelveldt marcelveldt deleted the relaxed-ritchie-1c9e45 branch June 17, 2026 07:36
marcelveldt added a commit that referenced this pull request Jun 17, 2026
marcelveldt added a commit that referenced this pull request Jun 17, 2026
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.

2 participants