Menu

#510 ReplayGain values on Windows and Linux differ

Portability
open
nobody
None
5
2021-09-28
2021-09-15
Felix Droop
No

I have lame version 3.100 installed both on my Windows 10 System and inside the WSL on Ubuntu-20.04. When I use the two programs on the exact same files (input .wav output .mp3), I get almost the same output, except for the ReplayGain information. I use the --preset insane option, but for reproducibility I checked that the same behavior happens when I pass input and output files as the only command line parameters.

On Windows it says:

(...)
Writing LAME Tag...done
ReplayGain: +6.2dB

On Linux:

(...)
Writing LAME Tag...done
ReplayGain: -8.4dB

When loading the resulting .mp3 files into a DJ program (rekordbox, on Windows), the track from the Linux version is much louder and the waveform image of the program looks correct. The waveform image for the track of the Windows version looks essentially like a line. Hence I assume that the value of the Linux version is the desired one and there might be some problem in the Windows version. The raw .wav file looks like the Windows version in the DJ program.

Discussion

  • Elio Blanca

    Elio Blanca - 2021-09-20

    Which is the sample format for the source wav file? integer? float? bit depth?
    is any of both lame executables linked against libsndfile ?
    Libsndfile DOES amplify the source content when picking a file encoded as floating point.

     
  • Felix Droop

    Felix Droop - 2021-09-21

    The sample format is float32. I don't know whether the executables are linked against libsndfile and I honestly don't even know how to find out. For windows I got the LAME 3.100 64bit package from RareWares. It seems to only contain the lame_enc.dll. On Linux I got it via apt.

     
    • Elio Blanca

      Elio Blanca - 2021-09-22

      As a trivial check, feed lame with a flac encoded file.
      libsndfile can decode flac, plain lame can't.
      (my bet: linux distributions always link against libsndfile)

       
  • Felix Droop

    Felix Droop - 2021-09-23

    You were right, unsupported audio format error for my Windows version and no problems with my Linux version.

     
    • Elio Blanca

      Elio Blanca - 2021-09-28

      There is a pull request I created some time ago, which is still waiting for Erik to merge, extending this default behaviour when the caller application doesn't want to apply any amplitude modification to the audio source:
      https://github.com/libsndfile/libsndfile/pull/314
      this patch will hopefully prevent the replay gain discrepancy.

       
      • Felix Droop

        Felix Droop - 2021-09-28

        Do I understand it correctly that all versions will then produce values like my current Windows version? It is good that the values don't differ, but for me the files generated with my current Linux version, which is linked against libsndfile, worked well with the programs I use and the files from the Windows version were too quiet. Wouldn't it be desirable to bring the current Linux (+libsndfile) behavior to the (Windows) versions without libsndfile?

         

Log in to post a comment.