Menu

#100 Uppercase REPLAYGAIN_TRACK_GAIN tag not recognized

v1.0 (example)
closed-fixed
nobody
None
5
2023-09-18
2019-07-02
Moonbase
No

I’m currently working on an EBU R128/BS.1770 compatible loudness gaining tool (mp3gain-almost-drop-in-replacement for FLAC, OGG, MP3) and ran across the problem that IDJC only recognizes lowercase "replaygain_track_gain" tags. Although the ReplayGain 2 spec (still a proposal) speaks of UPPERCASE replaygain tags, many tools did it "wrong" in the past and wrote lowercase tags only (most notably MusicBrainz Picard before the introduction of Mutagen 1.22, MP3Gain and others). SOME gaining tools wrote uppercase, though.

Most players nowadays have adapted (even my own ices0 version 0.4.5) and recognize BOTH variants.

I did a quick check with IDJC 0.8.15_development under Ubuntu 14.04.6 and IDJC 0.8.18_development under Ubuntu 18.04/Linux Mint 19.1). Turns out 0.8.15_dev crashes, 0.8.18_dev ignores the uppercase tag.

Currently, the following tags are affected, can’t remember offhand which of these IDJC actually uses:
REPLAYGAIN_ALBUM_GAIN (dB or LU)
REPLAYGAIN_ALBUM_PEAK (RMS or True Peak value)
REPLAYGAIN_REFERENCE_LOUDNESS (dB or LUFS)
REPLAYGAIN_TRACK_GAIN (dB or LU)
REPLAYGAIN_TRACK_PEAK (RMS or True Peak value)

I strongly assume more tools like my loudgain adaption and bs1770gain will appear that use uppercase tags, so I propose to check for these in a case-insensitive manner in IDJC (like most players nowadays do).

This might involve running through all TXXX frames in MP3 ID3v2 tags and checking their description field. The XiphComment (Ogg, FLAC) is specified to be case-insensitive anyway, so in theory we MUST be able to do both lower/upper/mixed case.

Thanks for considering!

Discussion

  • Moonbase

    Moonbase - 2019-07-02

    Side note: ReplayGain v2 uses EBU R128/BS.1770 loudness measuring, BUT store tags with a " dB" suffix in order to stay compatible. This works since 1 LU=1 dB. These files are usually targeted at a program loudness of -18 LUFS (estimated to be an equivalent loudness as the earlier 89 dB (SPL) target).

    Factually, adding a tag like REPLAYGAIN_REFERENCE_LOUDNESS=89 dB would not be correct and REPLAYGAIN_REFERENCE_LOUDNESS=-18 LUFS not be understood by older software, so they simply dropped this tag in the RGv2 "standard", resulting in loudness tagging tools not writing this tag anymore.

    This might be important to know in case IDJC tries to read this tag for whatever calculations.

     
  • Moonbase

    Moonbase - 2019-07-27

    I suggest replacing line #74 in python/playergui.py with the following, which also cures the reference loudness not being read:

    EasyID3.RegisterTXXXKey('TXXX_REPLAYGAIN_TRACK_GAIN', 'replaygain_track_gain')
    EasyID3.RegisterTXXXKey('TXXX_REPLAYGAIN_TRACK_GAIN', 'REPLAYGAIN_TRACK_GAIN')
    EasyID3.RegisterTXXXKey('TXXX_REPLAYGAIN_REFERENCE_LOUDNESS', 'replaygain_reference_loudness')
    EasyID3.RegisterTXXXKey('TXXX_REPLAYGAIN_REFERENCE_LOUDNESS', 'REPLAYGAIN_REFERENCE_LOUDNESS')
    

    Tested on Linux Mint 19.1 (Ubuntu 18.04-based).

     

    Last edit: Moonbase 2019-07-27
  • Stephen Fairchild

    • status: open --> closed-fixed
     

Log in to post a comment.