HydrogenAudio

Hydrogenaudio Forum => General Audio => Topic started by: waaateva on 2009-04-12 11:20:34

Title: About ReplayGain standard
Post by: waaateva on 2009-04-12 11:20:34
Hi! I'm new here. I'm sorry if this is posted in the wrong place, I'd appreciate your help!

Please read this first:
I made a suggestion, which I think will improve the current Replay Gain standard. But my strongest point was proven invalid. Other benefits, though existent, may not be worth the hassles of changing an already popular standard. So I guess we'll just leave it as it is .
Thanks for the discussion.


I think RG standard should be changed, so that it stores the actual level of the track, rather than the "gain". Here are my points:

1. Standards should not feel awkward, and the current standard feels very awkward. Don't get me wrong, it works perfectly. But where did that 89dB "reference level" come from? Based on what was it decided? Besides, I'd rather see how loud my track/album is, instead of looking at some (less meaningful) negative numbers.

2. To my knowledge, the reference level used to be 83dB (it's still on the RG homepage), but was later changed to 89dB for some reason. I have no idea how players dealed with that change, really. Now what if it is changed again? Of course updating the gain is a trivial task, but how do we know if the track were updated or not? And which tracks were scanned using which reference level? Storing the actual level is immune to this problem, because it is the logical way to store track loudness.
Not valid.

3. This is the most important. This change will not break any compatibility! All we have to do is add 2 new tag fields: REPLAYGAIN_TRACK_LEVEL and REPLAYGAIN_ALBUM_LEVEL. They can be easily calculated from the 2 old "GAIN" fields (assuming the 89dB reference was used). New players will use these new fields and just ignore the old ones, while old players remain compatible. And the "Pre-amp" option will be changed to "Preferred Level", which defaults to 89dB. Makes much more sense to me!

4. It's not too late. Replay Gain is getting more and more attention. My Sansa Fuze has just got RG support via a firmware update, and I'm extremely happy with that. Before RG is widely used or even becomes an official standard, we should improve it as far as we can!

These are only my ideas. I don't know what else to do but post it here . If you are the RG proposer, or a player developer, or have anything to do with the Replay Gain standard, please consider!

Thank you.
Title: About ReplayGain standard
Post by: tot on 2009-04-12 14:03:29
The gain numbers are meaningful.  They show how much the track/album must be adjusted to match -20dBFS pink noise.  Thus, if the gain is -5dB, the average volume is -15dBFS. 

The reference level affects just loudness contour that is used to calculate the average power.  For example, 89dB means that if you listen at that SPL level the perceived power levels match. 
Title: About ReplayGain standard
Post by: waaateva on 2009-04-12 15:27:25
The reference level affects just loudness contour that is used to calculate the average power.

Does that mean if the reference level is changed, the "volume level" calculated by RG will change accordingly?
That doesn't seem to be the case with MP3Gain.
Title: About ReplayGain standard
Post by: tot on 2009-04-12 16:12:40
The reference level affects just loudness contour that is used to calculate the average power.

Does that mean if the reference level is changed, the "volume level" calculated by RG will change accordingly?

Yes it would.  Ideally it should be the real level you listen to.  The reference level is just for you information, the player does not use it (how could it, it does not know the final level).
Title: About ReplayGain standard
Post by: waaateva on 2009-04-12 16:54:35
I'm sorry but I have no idea what you're talking about. My suggestion is actually very simple. Let's take this track as an example:

Current Replay Gain standard:

REPLAYGAIN_ALBUM_GAIN:  -9.79 dB
REPLAYGAIN_TRACK_GAIN:  -9.35 dB
REPLAYGAIN_ALBUM_PEAK:  0.998840
REPLAYGAIN_TRACK_PEAK:  0.987976

I suggested this:

REPLAYGAIN_ALBUM_LEVEL:  98.79 dB
REPLAYGAIN_TRACK_LEVEL:  98.35 dB
REPLAYGAIN_ALBUM_PEAK:  0.998840
REPLAYGAIN_TRACK_PEAK:  0.987976
(The 2 GAIN fields can be stored for compatibility with older players)

for the reasons mentioned in my first post.
Title: About ReplayGain standard
Post by: lvqcl on 2009-04-12 17:15:06
Quote
Besides, I'd rather see how loud my track/album is, instead of looking at some (less meaningful) negative numbers.


Audio player can calculate sound pressure level if it knows REPLAYGAIN_xxxxx_GAIN.
For foobar2000 you can create column with the following code:
Code: [Select]
$puts(x,%replaygain_track_gain%)
$puts(d,$strchr($get(x),'.'))
$puts(r,$sub(8900,$mul($left($get(x),1)1,$add($mul($substr($get(x),2,$sub($get(d),1)),100),$substr($get(x),$add($get(d),1),$add($get(d),2))))))
$substr($get(r),1,$sub($len($get(r)),2)).$right($get(r),2)


Edit: ® -> ( r )
Title: About ReplayGain standard
Post by: tot on 2009-04-12 17:29:36
I suggested this:

REPLAYGAIN_ALBUM_LEVEL:  98.79 dB
REPLAYGAIN_TRACK_LEVEL:  98.35 dB

Relative to what?  dB is just a relative scale, there are no absolute values.
Title: About ReplayGain standard
Post by: skamp on 2009-04-12 17:42:05
REPLAYGAIN_ALBUM_LEVEL:  98.79 dB

I often get confused about sound level measurement because it's among those things that I can be explained to me and I'll always forget it 5 minutes later, but IIRC the maximum level a digital file can have is 0dB, and the lowest level for CD-DA is -96dB.
Title: About ReplayGain standard
Post by: waaateva on 2009-04-12 17:44:49
Audio player can calculate sound pressure level if it knows REPLAYGAIN_xxxxx_GAIN.
For foobar2000 you can create column with the following code:


Of course it can! But seriously, you expect people to do that?

Relative to what?  dB is just a relative scale, there are no absolute values.


Please, I have little knowledge about it, but that's not the point of this thread. You can download MP3Gain and give it a try, these values were taken from the columns "Volume" and "Album Volume".
Title: About ReplayGain standard
Post by: waaateva on 2009-04-12 17:49:05
REPLAYGAIN_ALBUM_LEVEL:  98.79 dB

I often get confused about sound level measurement because it's among those things that I can be explained to me and I'll always forget it 5 minutes later, but IIRC the maximum level a digital file can have is 0dB, and the lowest level for CD-DA is -96dB.


Me too. But as far as I know, what you're talking about is dBFS, the Replay Gain level is dB SPL.
Title: About ReplayGain standard
Post by: lvqcl on 2009-04-12 17:49:32
Of course it can! But seriously, you expect people to do that?

No, but developers of audioplayers can do that.
Title: About ReplayGain standard
Post by: waaateva on 2009-04-12 18:01:14
Agreed. And my suggestion is to tweak the standard a little bit, it just seems more logical to me. Some people (including me) don't agree with the 89dB reference, other do. So why not just leave the SPL there, and let them decide what is the "reference"?

Besides, you didn't take my point #2 into account.
Title: About ReplayGain standard
Post by: tot on 2009-04-12 18:05:59
Me too. But as far as I know, what you're talking about is dBFS, the Replay Gain level is dB SPL.

That is where it goes wrong, Replay Gain is not dB SPL, but dB relative to -20dBFS pink noise, both adjusted with the loudness curve.
Title: About ReplayGain standard
Post by: waaateva on 2009-04-12 18:10:27
Me too. But as far as I know, what you're talking about is dBFS, the Replay Gain level is dB SPL.

That is where it goes wrong, Replay Gain is not dB SPL, but dB relative to -20dBFS pink noise, both adjusted with the loudness curve.

What I meant is the REPLAYGAIN_TRACK_LEVEL and REPLAYGAIN_ALBUM_LEVEL in the example.

OK, have you tried MP3Gain? Can you tell me what kind of dB is in the columns "Volume" and "Album Volume"? I don't care what it is, but I want Replay Gain to store that information, instead of what it's doing now
Title: About ReplayGain standard
Post by: ExUser on 2009-04-12 18:57:45
Agreed. And my suggestion is to tweak the standard a little bit, it just seems more logical to me. Some people (including me) don't agree with the 89dB reference, other do. So why not just leave the SPL there, and let them decide what is the "reference"?
You're welcome to adjust the preamp in foobar2000 to be whatever you like. The standard, as it stands, is completely sensible. You've yet to give any conclusive or compelling reason why the 89dB reference should be adjusted. As it is, it is a bit too loud for some music.
Title: About ReplayGain standard
Post by: greynol on 2009-04-12 19:07:33
Coming from someone who uses 92 dB for a target volume in MP3Gain, I fail to see a problem with RG as it's currently implemented.
Title: About ReplayGain standard
Post by: timcupery on 2009-04-12 19:13:53
I like the suggestion, although I don't think it's a big deal.
Mp3gain always displays the track volume (e.g., 95.2 dB) which I find a more intuitive way of thinking about the volume level than -6.2 dB.
But I don't know if this is worth adding a field to the standard, despite the backward compatibility.
Title: About ReplayGain standard
Post by: WonderSlug on 2009-04-12 19:27:00
Wouldn't it just be easier to assume that since 89dB is the reference standard for 99%+ of the music files with respect to ReplayGain Track/Album values, that any software and hardware follow such accordingly unless there is a *single* custom TAG field (i.e. REPLAYGAIN_LEVEL 85dB) that states otherwise?
Title: About ReplayGain standard
Post by: greynol on 2009-04-12 19:31:17
There's already a tag for this:
REPLAYGAIN_REFERENCE_LOUDNESS
Title: About ReplayGain standard
Post by: tot on 2009-04-12 20:00:13
OK, have you tried MP3Gain? Can you tell me what kind of dB is in the columns "Volume" and "Album Volume"? I don't care what it is, but I want Replay Gain to store that information, instead of what it's doing now

No I haven't, I don't use mp3 at all, and I don't know what mp3gain shows.

What you suggest would be "if I would listen -20dBFS pink noise at 89dB SPL, this track would play xxx dB SPL loud".  But it is not even that, since SPL measurement does not take the  loudness curve into account whereas the RG calculation does.

The current way is meaningful for digital audio, since the hard-limit of the headroom is 0dBFS, thus the number tells you something about available dynamic range.  -5dB RG value tells you that there is 15dB dynamic range above average level.  -9dB or louder means most likely crapware :-)
Title: About ReplayGain standard
Post by: saratoga on 2009-04-13 01:38:59
This seems pointless.
Title: About ReplayGain standard
Post by: Big_Berny on 2009-04-13 02:35:21
IMHO it makes sense what waaateva means. And AFAIK the replaygain-developer also said somewere that absolute  values would have been better than the relative ones, but it came into his mind to late.
Title: About ReplayGain standard
Post by: waaateva on 2009-04-13 04:08:53
Coming from someone who uses 92 dB for a target volume in MP3Gain, I fail to see a problem with RG as it's currently implemented.
Actually, that's the problem! If you mix your library with mine, who use 89dB, they'll play with different loudness. And there's no way to tell which files scanned with which reference. If, however, RG store the LEVEL instead, you can play with your 92dB "Preferred Level", and I can play with my 89dB. No matter what one chooses, all files in this world, scanned with RG, will have the same loudness. That's what I call standard. Doesn't that make sense?
This is wrong.

There's already a tag for this:
REPLAYGAIN_REFERENCE_LOUDNESS
I've never seen this tag in use.
Title: About ReplayGain standard
Post by: saratoga on 2009-04-13 04:16:31
Coming from someone who uses 92 dB for a target volume in MP3Gain, I fail to see a problem with RG as it's currently implemented.

Actually, that's the problem! If you mix your library with mine, who use 89dB, they'll play with different loudness.


I think all replaygain implementations (at least all I've used) use the same reference level.  The target volume is adjusted at playback time, not scan time.  Therefore you'll both get the same volume.
Title: About ReplayGain standard
Post by: waaateva on 2009-04-13 04:32:11
I think all replaygain implementations (at least all I've used) use the same reference level.  The target volume is adjusted at playback time, not scan time.  Therefore you'll both get the same volume.
You must not have used MP3Gain. If, for example, you use 89dB as the reference, and it returns a -5dB gain, then you change to 92dB, it'll return -2dB!

The real problem is: scanners (and users) are not supposed to change the reference level when scanning, because it is in the standard.

Wrong.

What surprised me the most is, when I read the RG homepage, it says the reference level is 83dB, while all scanners use 89dB. Now if someone can assure me that the 89dB will NEVER be changed again, and that no other scanners will allow changing it (MP3Gain is no longer maintained, so it's understandable), then I'll admit, this suggestion is pretty pointless.

Nevertheless, I still think it's better to store the SPL, you know, less hassles, more convenience.

@tot: you really enlightened me, I now have a much better understanding what those numbers mean. Thank you!
BTW, you can still calculate the headroom when storing the LEVEL.

Edit: just a little FYI, I've just tried MediaMonkey, and guess what? It allows changing the reference level too!

So, because users have the ability (and reasons) to change the reference level, why don't we just remove it from the standard, and store the SPL instead?

Wrong.
Title: About ReplayGain standard
Post by: greynol on 2009-04-13 07:21:27
You must not have used MP3Gain. If, for example, you use 89dB as the reference, and it returns a -5dB gain, then you change to 92dB, it'll return -2dB!
So what?  The RG value still gets adjusted according to the -89dB reference*.  If you load one of my mp3s and change the target volume to something different it will adjust accordingly.  Undo will bring it back to exactly where it started as well.  Besides, there's nothing stopping me from rescanning.  Furthermore, you will never see my mp3s in you collection.  I get the feeling that this would never be of any concern to people who encode their own music.

The real problem is: scanners (and users) are not supposed to change the reference level when scanning, because it is in the standard.
Nonsense.

(*) EDIT: Just to clarify, although MP3Gain allows you to adjust the 'Target "Normal" volume' the Reference level is still 89dB.  Notice that it's called "Target Volume" and not "Reference Level".
Title: About ReplayGain standard
Post by: greynol on 2009-04-13 07:24:05
So, because users have the ability (and reasons) to change the reference level, why don't we just remove it from the standard, and store the SPL instead?

Because it's already well supported and works just fine the way it is.
Title: About ReplayGain standard
Post by: David Nordin on 2009-04-13 08:33:12
Actually, that's the problem! If you mix your library with mine, who use 89dB, they'll play with different loudness. And there's no way to tell which files scanned with which reference. If, however, RG store the LEVEL instead, you can play with your 92dB "Preferred Level", and I can play with my 89dB. No matter what one chooses, all files in this world, scanned with RG, will have the same loudness. That's what I call standard. Doesn't that make sense?


Now, this is exactly how it works today - what are you missing?
Standard is 89dB, user adjusts with preamp in his player of choice - everybody gets a banana!
Title: About ReplayGain standard
Post by: [JAZ] on 2009-04-13 10:33:12
I also believe waaateva got confused.

I've checked it to be sure, and indeed, if you aply mp3gain with different target volume, the replaygain values change accordingly.

One has to remember that mp3gain changes the volume of the mp3 data, so the change of the replaygain values is a consequence of that, not of the change of the target volume.

(If i wasn't clear, a file mp3gained at both, 92db and 89db played back in foobar2000 at the same loudness. Of course, a non replaygain aware player would play them at different volumes, but that's out of the scope of the current topic)
Title: About ReplayGain standard
Post by: waaateva on 2009-04-13 10:57:26
Guys,
You were right, I was wrong about MP3Gain and MediaMonkey, my bad for not confirming it before posting.
Sorry for the confusion I've made so far, I'll edit my posts.
@greynol, JAZ: thanks for clearing that up for me

Now one more question. Anyone know why the reference level was changed from 83dB to 89dB? Is there any possibility it will be changed again?
Title: About ReplayGain standard
Post by: Lear on 2009-04-13 13:25:07
Now one more question. Anyone know why the reference level was changed from 83dB to 89dB? Is there any possibility it will be changed again?


Because that's what people actually used (see here (http://www.hydrogenaudio.org/forums/index.php?showtopic=15445&view=findpost&p=154605)). As I recall it, 89 dB was used because 83 dB was seen as a bit low, especially for portable players. Considering it has stayed the same for over 5 years, I wouldn't expect it to be changed again.

As for using level rather than gain, it has been discussed before (both in the thread linked above, as well as here (http://www.hydrogenaudio.org/forums/index.php?showtopic=1709&view=findpost&p=16589)), and was considered too late to change in 2003...
Title: About ReplayGain standard
Post by: waaateva on 2009-04-13 15:12:06
Thanks for the links, they are very helpful. This require a lot more background knowledge than I thought!
Title: About ReplayGain standard
Post by: tot on 2009-04-13 15:28:13
Because that's what people actually used (see here (http://www.hydrogenaudio.org/forums/index.php?showtopic=15445&view=findpost&p=154605)). As I recall it, 89 dB was used because 83 dB was seen as a bit low, especially for portable players. Considering it has stayed the same for over 5 years, I wouldn't expect it to be changed again.

As for using level rather than gain, it has been discussed before (both in the thread linked above, as well as here (http://www.hydrogenaudio.org/forums/index.php?showtopic=1709&view=findpost&p=16589)), and was considered too late to change in 2003...


Reading those old threads and how casually the reference level was changed would suggest that just the reference level number, which is not used in the RG calculation at all, was changed.  I wonder why people are so obsessed with the number in the first place...

The only relevance of the reference level is the filter selection to get better match in the perceived loudness, and I doubt it was adjusted at the time.  Not that it would make any difference, I am just being pedantic here.
Title: About ReplayGain standard
Post by: 2Bdecided on 2010-09-03 10:41:14
I didn't see this thread at the time, and I certainly don't want to resurrect it because IMO the ideas in it are not good.

However, a Google search now throws it up, so I feel I should add a comment.

The threads linked above include quite long discussions, but the conclusion is here...

http://www.hydrogenaudio.org/forums/index....st&p=170957 (http://www.hydrogenaudio.org/forums/index.php?s=&showtopic=15445&view=findpost&p=170957)
When it stored the absolute loudness of the file (e.g. 92dB), it was called Replay Level.

When it changed to storing the relative gain (e.g. -3dB), it was renamed to Replay Gain: relative gains, referenced to making the loudness 83dB through a calibrated system, plus 6dB.

... conceptually, saying the file sounds x dB loud at reference playback level doesn't actually tell you how much to change the gain if the non-parallel equal loudness curves are ever taken into account ... Whereas saying "shift it x dB to make it the reference playback loudness" can include that factor in the calculation.
So it's better the way it is

btw, a replaygain_reference_level tag is a very bad idea, because it completely breaks compatibility with all other implementations, and is totally unnecessary. I hope no one has implemented it.

(though I know that data can be implicitly present as part of the undo data when ReplayGain changes have been applied, e.g. by mp3gain, which is fine).

Cheers,
David.