Skip to content

Relax resource requirements for audio analysis providers#4249

Merged
marcelveldt merged 1 commit into
devfrom
relax-audio-analysis-resource-requirements
Jun 16, 2026
Merged

Relax resource requirements for audio analysis providers#4249
marcelveldt merged 1 commit into
devfrom
relax-audio-analysis-resource-requirements

Conversation

@marcelveldt

Copy link
Copy Markdown
Member

What does this implement/fix?

The CPU/RAM gates added in #4198 for the Smart Fades and Sonic Analysis providers turned out to be too strict, blocking hosts that can comfortably run them (for example a 6GB / 2-core HAOS VM on an N100). This relaxes the hard minimum and replaces the strict-only gate with a clearer "recommended hardware" notice, so capable-but-modest systems can opt in while still being informed about the resource cost.

  • Lower the minimum to 4GB RAM + 2 CPU cores for both providers (was 8GB/4 cores for Sonic Analysis, 4 cores for Smart Fades).
  • Add an informational alert at the top of both providers explaining the feature loads an ML model in memory, stating the minimum requirements (incl. AVX2 on Intel/AMD CPUs) and the recommended 6GB+ RAM / 4 cores — only shown when the host is below the recommended level.
  • Add the alert text to each provider's strings.json for translation.
  • Back both the raising gate and a new non-raising predicate with a single _resource_shortfall helper so the check logic lives in one place.

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 CPU/RAM gates added in #4198 for Smart Fades and Sonic Analysis were too
strict and blocked capable hosts (e.g. a 6GB/2-core HAOS VM). Lower the minimum
to 4GB RAM + 2 CPU cores and show an informational notice with the recommended
hardware (6GB+ RAM, 4 cores) when the host is below that.
Copilot AI review requested due to automatic review settings June 16, 2026 07:57

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 relaxes the hardware gating for the Smart Fades and Sonic Analysis audio analysis providers and adds a “recommended hardware” informational alert so lower-spec but capable systems can still opt in while being warned about resource impact.

Changes:

  • Lower minimum requirements for Smart Fades and Sonic Analysis to 4GB RAM / 2 CPU cores (AVX2 still required on x86 for ML inference).
  • Add a non-blocking “resource warning” ALERT config entry to both providers, shown only when the host is below the recommended 6GB+ / 4 cores threshold.
  • Refactor the RAM/CPU checks into a shared _resource_shortfall helper and add a non-raising system_meets_requirements predicate; add unit tests for the new predicate and update English translations.

Reviewed changes

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

Show a summary per file
File Description
tests/core/test_helpers.py Adds coverage for the new non-raising system_meets_requirements predicate.
music_assistant/translations/en.json Updates English translation keys/messages for the new resource warning alerts.
music_assistant/providers/sonic_analysis/strings.json Adds the new resource_warning translation string for Sonic Analysis.
music_assistant/providers/sonic_analysis/init.py Lowers gating thresholds and adds a recommended-hardware alert entry in config UI.
music_assistant/providers/smart_fades/strings.json Replaces the old single-core warning with a new resource warning string.
music_assistant/providers/smart_fades/init.py Lowers gating CPU threshold and adds a recommended-hardware alert entry in config UI.
music_assistant/helpers/util.py Introduces _resource_shortfall + system_meets_requirements and reuses it in the raising gate.

@marcelveldt marcelveldt merged commit f4d5e94 into dev Jun 16, 2026
12 checks passed
@marcelveldt marcelveldt deleted the relax-audio-analysis-resource-requirements branch June 16, 2026 08:09
@X-dark X-dark mentioned this pull request Jun 16, 2026
17 tasks
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