Skip to content

fix(loudness): tune equalizer defaults to eliminate volume pumping#304

Open
iscle wants to merge 1 commit into
ronitsingh10:mainfrom
iscle:fix/loudness-equalizer-pumping
Open

fix(loudness): tune equalizer defaults to eliminate volume pumping#304
iscle wants to merge 1 commit into
ronitsingh10:mainfrom
iscle:fix/loudness-equalizer-pumping

Conversation

@iscle

@iscle iscle commented May 21, 2026

Copy link
Copy Markdown

Heads-up: This PR and fix was generated by Claude, but I did manually review it and test it! No sloppy unsupervised AI code here :)

Summary

  • Tunes LoudnessEqualizerSettings defaults to eliminate audible volume pumping at low-to-moderate listening levels
  • Reduces gain swing magnitude, lengthens analysis window, and adjusts smoothing timings for stable perceived loudness

Dependencies

This PR depends on #303 (preamp cut for LoudnessCompensator). That PR must be merged first — without it, the compensator still clips bass at low volumes since both features share a single toggle.

Problem

The previous default settings caused the LoudnessEqualizer to produce audible volume fluctuations ("pumping" / "breathing"):

Parameter Old New Why
analysisWindowMs 30 100 30ms reacted to transients (drums, consonants) instead of sustained loudness
maxBoostDb 15 6 15 dB created dramatic level swings between quiet and loud passages
gainAttackMs 180 250 Smoother gain reduction on loud transients
gainReleaseMs 5000 3000 5s recovery was audibly slow — listener heard a "swell" as gain crept back up
detectorReleaseMs 400 600 Holds peaks slightly longer, reducing measurement jitter
noiseFloorThresholdDb -48 -40 -48 dB allowed aggressive boosting of near-silence and reverb tails
lowLevelMaxBoostDb 1.5 0.5 More conservative at very low signal levels

Test plan

  • All LoudnessEqualizerTests pass (including updated defaults test)
  • Manual: Loudness Equalization enabled over Bluetooth — no audible pumping or breathing at low/moderate volumes
  • Manual: music with dynamic range (quiet→loud transitions) plays without gain "hunting"

Closes #302

🤖 Generated with Claude Code

The previous defaults caused audible volume fluctuations ("pumping")
especially at low-to-moderate listening levels:

- 30ms analysis window reacted to individual transients instead of
  sustained loudness, causing rapid gain swings on drum hits
- 15 dB max boost created dramatic level changes between quiet and
  loud passages
- 5000ms gain release made recovery audibly slow, creating a
  "breathing" effect as gain slowly crept back up
- -48 dB noise floor allowed aggressive boosting of near-silence

Tuned defaults:
- analysisWindowMs: 30 → 100 (smooths transients, measures phrases)
- maxBoostDb: 15 → 6 (meaningful lift without dramatic pumping)
- gainAttackMs: 180 → 250 (smoother gain reduction)
- gainReleaseMs: 5000 → 3000 (faster recovery, less "swell")
- detectorReleaseMs: 400 → 600 (holds peaks longer, reduces jitter)
- noiseFloorThresholdDb: -48 → -40 (protects quiet material)
- lowLevelMaxBoostDb: 1.5 → 0.5 (conservative at very low levels)

Closes ronitsingh10#302

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.

[Bug] Loudness Equalization can cause audible volume fluctuations

1 participant