HydrogenAudio

Hosted Forums => foobar2000 => General - (fb2k) => Topic started by: aconverse on 2012-07-29 01:09:48

Title: foobar2000 replaygain reference level seems low
Post by: aconverse on 2012-07-29 01:09:48
The replaygain reference level in foobar2000 seems low.

I scanned http://replaygain.hydrogenaudio.org/proposal/ref_pink.wav (http://replaygain.hydrogenaudio.org/proposal/ref_pink.wav) from the original replaygain proposal, with a reference SPL of 89 dB. I was expecting to see a gain of +6 dB (as this file was supposed to generate +0 dB for 83 dB SPL). Instead I'm seeing +2.35 dB. Any ideas what's going on?

(http://i.imgur.com/XtIhn.png)
Title: foobar2000 replaygain reference level seems low
Post by: xnor on 2012-07-29 01:29:59
ReplayGain is not peak-normalization. Increase the gain on the Playback page (preamp) if you want less 'loss of volume' but check that you don't run into clipping (that's what the prevent clipping according to peak option is for).
Title: foobar2000 replaygain reference level seems low
Post by: aconverse on 2012-07-29 01:49:05
I'm completely confused about how peak normalization and pre-amp relate to what I asked. I'm not even complaining about a loss of volume. The gain here is positive after all. The gain just isn't as large as the replaygain spec says it should be.

The replaygain spec (http://wiki.hydrogenaudio.org/index.php?title=ReplayGain_specification) says this file (-14 dB pink noise) should have a gain of +6 dB. Clipping is not a concern here because the file has 10.9 dB of head room. As shown in the screen shows foobar only computes a replaygain of +2.35 dB.
Title: foobar2000 replaygain reference level seems low
Post by: kode54 on 2012-07-29 01:54:17
The current ReplayGain scanner does not use the original ReplayGain algorithm any more. Instead, it uses the EBU R128 algorithm, converting the resulting LUFS 1:1 to a decibel offset to achieve a reference level of -18 LUFS.
Title: foobar2000 replaygain reference level seems low
Post by: xnor on 2012-07-29 02:06:27
I'm sorry aconverse, I completely misunderstood what you were asking.
Title: foobar2000 replaygain reference level seems low
Post by: aconverse on 2012-07-29 02:07:00
Thanks kode54, that clears things up
Title: foobar2000 replaygain reference level seems low
Post by: xnor on 2012-07-29 02:40:23
Hmm but when using r128gain with the ref_pink file using the ReplayGain profile (-18 LUFS) the resulting file is boosted by 6 dB.

edit: hmm the result doesn't change if I change the target LUFS...
Title: foobar2000 replaygain reference level seems low
Post by: kode54 on 2012-07-29 06:29:35
using the ReplayGain profile

And when you do that, it uses libreplaygain to scan the file.
Title: foobar2000 replaygain reference level seems low
Post by: xnor on 2012-07-29 11:49:10
I see. When using EBU R128-2 it reports -23.4 LUFS for the ref_pink file.

Instead, it uses the EBU R128 algorithm, converting the resulting LUFS 1:1 to a decibel offset to achieve a reference level of -18 LUFS.


-18 - (-23.4) = +5.4 dB, no?


Title: foobar2000 replaygain reference level seems low
Post by: kode54 on 2012-07-29 20:54:54
Maybe libebur128 needs some work, then. I found the same LUFS result with lib1770, regardless of using R128-1 or R128-2 mode.

lib1770 needs some work before it could be used in this scanner as well, as it doesn't support multi-threaded scanning, and my dodgy attempt to add that resulted in non-matching album gain levels.
Title: foobar2000 replaygain reference level seems low
Post by: xnor on 2012-07-29 21:50:58
R128-2 and -1 result in different LUFS here:

2:
  [1/1] "ref_pink.wav": -23.4 LUFS (0.4 LU)

1:
  [1/1] "ref_pink.wav": -23.5 LUFS (0.5 LU)


edit: I don't know much about R128/BS.1770 or the libraries that implement them. Just wondering why there's such a big difference in fb2k from the +6 or +5.4 dB.

edit2: I checked some music tracks and there the r128gain ebu r128-2 results line up fine with fb2k (referenced to -18 LUFS). Why wouldn't the ref_pink file?

edit3: The VST plugin 'AC-R128' measures the ref_pink file with -20.4 LUFS. So maybe it's just r128gain that's wrong.
Title: foobar2000 replaygain reference level seems low
Post by: kode54 on 2012-07-30 07:08:48
I have modified a version of lib1770 which may be useful for testing with this or the example programs:

http://kode54.foobar2000.org/moo/lib1770.7z (http://kode54.foobar2000.org/moo/lib1770.7z)

Title: foobar2000 replaygain reference level seems low
Post by: Case on 2012-07-30 16:33:09
That ref_pink file is mono, and for some reason R128Gain thinks it is half as loud as stereo file. foobar2000 scans mono files as stereo.
Title: foobar2000 replaygain reference level seems low
Post by: xnor on 2012-07-30 18:59:10
That ref_pink file is mono, and for some reason R128Gain thinks it is half as loud as stereo file. foobar2000 scans mono files as stereo.

Indeed, that's the case, Case. Surprisingly even Adobe Audition has that behavior. +5.4 dB as mono, +2.4 dB as stereo.

I just discovered that R128Gain has an option for this: "--mono=on,--mono    Don't treat mono as stereo."  This fixes things, but I'm wondering why this is 'force stereo' option is enabled by default.

edit: Maybe 'mono' means only the center channel is being used. But isn't it more common to play the mono files on the left and right channel (aka 'dual mono')?

edit2: libebur128 http://www.hydrogenaudio.org/forums/index....st&p=751044 (http://www.hydrogenaudio.org/forums/index.php?s=&showtopic=86116&view=findpost&p=751044)
Title: foobar2000 replaygain reference level seems low
Post by: pbelkner on 2012-07-31 07:08:17
I just discovered that R128Gain has an option for this: "--mono=on,--mono    Don't treat mono as stereo."  This fixes things, but I'm wondering why this is 'force stereo' option is enabled by default.

AFAIK this is not backed by EBU R128. The option was added because of user request.
Title: foobar2000 replaygain reference level seems low
Post by: xnor on 2012-07-31 12:51:34
AFAIK this is not backed by EBU R128. The option was added because of user request.

The r128 doc doesn't say much at all. It's based on ITU-R BS.1770, which is the technical standard for measuring loudness. 1770-2 definitely does mention mono (center channel) and dual mono (left and right channel).
Title: foobar2000 replaygain reference level seems low
Post by: pbelkner on 2012-08-17 22:19:08
I have modified a version of lib1770 which may be useful for testing with this or the example programs:

http://kode54.foobar2000.org/moo/lib1770.7z (http://kode54.foobar2000.org/moo/lib1770.7z)

There's a new version of "lib1770" (http://www.hydrogenaudio.org/forums/index.php?s=&showtopic=85978&view=findpost&p=805636) available:
Title: foobar2000 replaygain reference level seems low
Post by: Martin F. on 2013-05-04 23:36:26
The current ReplayGain scanner does not use the original ReplayGain algorithm any more. Instead, it uses the EBU R128 algorithm, converting the resulting LUFS 1:1 to a decibel offset to achieve a reference level of -18 LUFS.


Is it possible to change the value to match dBpoweramp’s default of ?23 LUFS? I haven’t found a preference for that.
Title: foobar2000 replaygain reference level seems low
Post by: kareha on 2013-05-05 16:55:52
The current ReplayGain scanner does not use the original ReplayGain algorithm any more. Instead, it uses the EBU R128 algorithm, converting the resulting LUFS 1:1 to a decibel offset to achieve a reference level of -18 LUFS.


Is it possible to change the value to match dBpoweramp’s default of ?23 LUFS? I haven’t found a preference for that.


Is this the reason why foobar and dbpoweramp produce different RG values?
Title: foobar2000 replaygain reference level seems low
Post by: garym on 2013-05-05 18:16:54
Is it possible to change the value to match dBpoweramp’s default of ?23 LUFS? I haven’t found a preference for that.

Is this the reason why foobar and dbpoweramp produce different RG values?


Yes. In dbpa one can change the setting to -18 LUFS.
Title: foobar2000 replaygain reference level seems low
Post by: Sandrine on 2013-05-06 10:55:25
Sorry to butt in with a really basic question: Since we're in a foobar2000 forum, I'm assuming you're using lib1770.dll in foobar2000. I can't find that file anywhere in my foobar2000 folders, though. How do you use it?
Title: foobar2000 replaygain reference level seems low
Post by: Case on 2013-05-06 11:42:16
Is it possible to change the value to match dBpoweramp’s default of ?23 LUFS? I haven’t found a preference for that.

Is this the reason why foobar and dbpoweramp produce different RG values?


Yes. In dbpa one can change the setting to -18 LUFS.


I'm disappointed in Spoon. He should know better and not break standards.
Title: foobar2000 replaygain reference level seems low
Post by: Case on 2013-05-06 11:45:01
Sorry to butt in with a really basic question: Since we're in a foobar2000 forum, I'm assuming you're using lib1770.dll in foobar2000. I can't find that file anywhere in my foobar2000 folders, though. How do you use it?

Your assumption is incorrect. foobar2000 uses libebur128 (https://github.com/jiixyj/libebur128) with some speed optimizations.
Title: foobar2000 replaygain reference level seems low
Post by: Sandrine on 2013-05-06 11:56:55
Your assumption is incorrect. foobar2000 uses https://github.com/jiixyj/libebur128 (http://%5burl="https://github.com/jiixyj/libebur128)"]libebur128[/url] with some speed optimizations.


Glad to know it's not me then but people posting unrelated info where it's confusing.
Title: foobar2000 replaygain reference level seems low
Post by: Martin F. on 2013-05-06 22:26:02
Is it possible to change the value to match dBpoweramp’s default of ?23 LUFS? I haven’t found a preference for that.

Is this the reason why foobar and dbpoweramp produce different RG values?


Yes. In dbpa one can change the setting to -18 LUFS.


I'm disappointed in Spoon. He should know better and not break standards.


From this thread (http://www.hydrogenaudio.org/forums/?showtopic=96544):
The proposed standard for Opus is R128 gain with a reference level of -23 LUFS.

From Loudness Metering: ‘EBU Mode’ metering to supplement loudness normalisation in accordance with EBU R 128 (http://tech.ebu.ch/docs/tech/tech3341.pdf#page=8):
Quote
For an ‘EBU Mode’ meter, the target loudness level shall be -23.0 LUFS = 0.0 LU (as defined in EBU R 128).


So dBpoweramp looks standard to me and that’s the reason I’d like to adjust foobar2000 rather than dBpoweramp.
Title: foobar2000 replaygain reference level seems low
Post by: garym on 2013-05-06 22:29:45
So dBpoweramp looks standard to me and that’s the reason I’d like to adjust foobar2000 rather than dBpoweramp.


Yes, dbpa uses -23 unless the user changes it.  In foobar2000 I don't see a way to change from -18.  I *think* the -18 was used in fb2000 so that the new RG values are similar to the old method RG values created in foobar2000.
Title: foobar2000 replaygain reference level seems low
Post by: Case on 2013-05-07 06:23:10
Of course, the whole point of ReplayGain is to play back files at the same loudness. Not to play some tracks at double volume. Scanners always need to target the same loudness level that ReplayGain standard specifies, not EBU. Playback software can then be adjusted to any target loudness level that is desired. If you really wish to target your -23 LUFS level you simply open Preferences and move the ReplayGain Preamp slider under Playback options to -5.4.