Skip to content

feat(linux): add adaptive equalizer preset switching based on MPRIS media playback - #425

Open
flavves wants to merge 4 commits into
Oppzippy:masterfrom
flavves:ytMusic
Open

flavves wants to merge 4 commits into
Oppzippy:masterfrom
flavves:ytMusic

Conversation

@flavves

@flavves flavves commented Oct 27, 2026

Copy link
Copy Markdown

Summary

This PR adds a Linux-only (#[cfg(target_os = "linux")]) Adaptive Equalizer feature that monitors active media players via D-Bus MPRIS (org.mpris.MediaPlayer2.*), detects the genre of the currently playing track (with special handling for browser / YouTube Music metadata), and automatically switches the device's built-in PresetEqualizerProfile.

Related to the genre-based equalizer switching use case mentioned in #348.

What's Included

  1. openscq30-lib (adaptive_eq module, Linux only):

    • Reads active org.mpris.MediaPlayer2.* session bus players and parses PlaybackStatus and Metadata (xesam:title, xesam:artist, xesam:album, xesam:genre, xesam:url).
    • Cleans YouTube / YouTube Music metadata (strips - Topic, VEVO, (Official Video), (feat. ...), and extracts Artist - Title when the uploader channel is a record label).
    • Resolves the target Soundcore preset profile in priority order:
      1. User-defined custom rules (by Artist, Title/Keyword, or Genre)
      2. Priority title keywords (e.g. acoustic, unplugged, piano, podcast, audiobook, phonk, lo-fi)
      3. MPRIS xesam:genre metadata
      4. Optional online genre lookup (iTunes Search API, Deezer API, MusicBrainz API) with in-memory per-track caching (only queried on track change, can be disabled in GUI or via --no-online in CLI)
      5. Record label / channel hints and local keyword matching
      6. Configurable fallback preset profile
    • Persists configuration in adaptive_eq.json inside the application config directory.
  2. openscq30-gui (Adaptive EQ nav tab, Linux only):

    • Adds an Adaptive EQ (YT Music) page to the device settings sidebar.
    • Displays live player status, current track, detected genre/source,applied preset, custom rules editor, customizable genre-to-preset mappings, and recent switch history.
    • Includes English (en) and Turkish (tr) Fluent translations.
  3. openscq30-cli (adaptive-eq subcommand, Linux only):

    • Adds openscq30 adaptive-eq (and openscq30 device -a <MAC> adaptive-eq) with --once, --dry-run, --all-players, --no-online, --default-profile, --interval, and --json flags.

Platform Compatibility

All changes are gated behind #[cfg(target_os = "linux")] and use standard library process calls without modifying Cargo.toml or Cargo.lock, so Windows and Android builds remain unaffected.

Images

image image image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant