Skip to main content

Documentation Index

Fetch the complete documentation index at: https://rockboxzig.mintlify.app/llms.txt

Use this file to discover all available pages before exploring further.

ReplayGain reads the REPLAYGAIN_* tags written by tools like loudgain / mp3gain / metaflac and applies the recommended gain at playback time. Albums are kept at consistent loudness without re-encoding the files.
[replaygain_settings]
type   = 0      # 0=Track 1=Album 2=Track shuffle 3=Off
noclip = true
preamp = 0

Settings

SettingStorageValues / rangeDefaultDescription
Type.typetrack / album / track shuffle / offshuffleWhich RG tag to apply for normalisation
No-Clip.noclipboolfalseIf the RG adjustment would cause clipping, scale down to avoid it
Preamp.preamp−120..+120 dB (step 5)0 dBExtra gain on top of the RG value (use with No-Clip to avoid surprises)
Applied via dsp_replaygain_set_settings() in lib/rbcodec/dsp/dsp_misc.h.

Modes explained

  • Track — every track plays at its own RG-normalised level.
  • Album — all tracks within an album share the same gain; preserves intended quiet/loud relationships within the album.
  • Track shuffle — Track gain when shuffling, Album gain otherwise. The default; behaves naturally regardless of how you’re listening.
  • Off — RG tags ignored.

Tagging your files

Rockbox does not write ReplayGain tags. Use one of:
  • loudgain — modern multi-format CLI (FLAC, MP3, Opus, OGG, M4A).
  • mp3gain — MP3 only, but lossless.
  • metaflac --add-replay-gain — FLAC, ships with flac.
Example:
loudgain -a -k -s e *.flac    # tag album-mode, prevent clipping
After re-tagging, trigger a library rescan:
mutation { scanLibrary }

Configuring at runtime

mutation {
  saveSettings(input: {
    replaygainSettings: {
      type: 1
      noclip: true
      preamp: 0
    }
  }) { replaygainSettings { type } }
}