Skip to content

Hardware equalizer (Android AudioEffect) #28

Closed as not planned
Closed as not planned

Description

@ErfanBagheri404

Feature description

A real system-level equalizer: 10-band graphic EQ + presets (Bass boost, Vocal, Rock, Acoustic...) using Android's DynamicsProcessing / BassBoost effects on the TrackPlayer audio session — works for ALL sources including local files and Subsonic streams.

Motivation

Most offline players fake EQ with WebAudio filters that don't apply to background playback. A hardware AudioEffect session survives the whole app lifecycle and genuinely changes output on headphones and speakers.

Proposed solution

  • Native module attaching Equalizer/DynamicsProcessing to the media audio session ID from TrackPlayer
  • EQ screen: draggable band curve, preset chips, reset, toggle in Settings -> Playback
  • Persist user EQ per device (speaker vs headset profiles)

Test plan

  • Bass boost audibly different vs flat
  • EQ survives track changes + app restart
  • Effects detach cleanly when toggle off
  • No crackle/distortion at max gain

Activity

  1. changed the title [-]f17: Hardware equalizer (Android AudioEffect)[/-] [+]Hardware equalizer (Android AudioEffect)[/+] on Sep 15, 2026
  2. ErfanBagheri404 commented on Sep 26, 2026

    @ErfanBagheri404
    OwnerAuthor

    Implemented in PR #83: #83

    A 5-band hardware equalizer on the Android output mix, off by default. Toggle + band levels live in the existing audio section of Settings.

    One structural note worth stating up front, because it shapes the whole change: .gitignore has /android and CI runs expo prebuild --clean, so native code hand-written into the generated android/ tree is deleted on every build. The Kotlin therefore ships as an Expo config plugin — sources under plugins/android/*.kt, re-created by plugins/withEqualizer.js on every prebuild, registered in app.json. Same pattern as the existing widget plugin, so it survives CI and cannot silently ship half a feature.

    The player audio session id turns out to be not reachable from JS — no sessionId symbol exists anywhere in kotlin-audio 2.1.0 or track-player 4.1.2's public surface, so the effect cannot be handed the player session without forking the library. It attaches to the global session instead, which Android routes onto the active output mix. That is the design, not a workaround left dangling.

    Two things done defensively rather than optimistically: band index and millibel are clamped inside the Kotlin against the range the effect itself reports (a bad index into the platform effect is a hard crash on some devices, not a catchable error), and ROMs that ship no usable EFFECT_TYPE_EQUALIZER get an explicit unsupported state instead of an exception escaping to JS.

    Verification: 19/19 suite, exit 0, re-run to confirm deterministic; tsc clean; the native side is contract-checked from file content (package registered, every method the JS wrapper calls really is a @ReactMethod, clamping present, effect released in invalidate(), the toggle actually gates the native call, locale keys in both en and fa). local-playback still 6 pass / 2 pre-existing fail. Not device-verified — no audio was played through the effect, so the band values have not been heard; that is the one thing worth checking before you merge.

  3. github-actions commented on Oct 27, 2026

    @github-actions

    This issue has been automatically marked stale because it has not had activity in the last 30 days. It will be closed in 14 days if no further activity occurs.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions