PDA

View Full Version : Quality loss with ReplayGain?



stefanta650
2009-11-08, 06:06
Hi there!
I have a Squeezebox Classic and most of my music is in flac format. All these files have the ReplayGain-Tag. As far as I know ReplayGain is just a tag and does NOT affect the music data itself. So when listening to my music and applying ReplayGain I was a bit surprised and sort of disappointed as the music sounded not that clear and bright as without replay gain applied. So my question is: does applying replaygain affect the sound quality? If so what can I do to at least reduce that effect (maybe use an external DAC?). Or are there any other ways to 'normalize' the volume output?

Thanks for your help!!

Stefan

Phil Leigh
2009-11-08, 06:21
Hi there!
I have a Squeezebox Classic and most of my music is in flac format. All these files have the ReplayGain-Tag. As far as I know ReplayGain is just a tag and does NOT affect the music data itself. So when listening to my music and applying ReplayGain I was a bit surprised and sort of disappointed as the music sounded not that clear and bright as without replay gain applied. So my question is: does applying replaygain affect the sound quality? If so what can I do to at least reduce that effect (maybe use an external DAC?). Or are there any other ways to 'normalize' the volume output?

Thanks for your help!!

Stefan

RG is just a tag and doesn't change the audio data in your files.
RG simply causes the Classic to reduce the volume via its 24-bit level control (which is very good quality by the way).

When using RG, you MUST have the digital level set to maximum.
RG will reduce the level by -10dB or less.

The reason your music sounds less good is either:

1) it is just quieter and quieter ALWAYS sounds less clear and bright
or
2) You have the digital level a lot less than max and so the total reduction in level is too great, eating into the SNR/dynamic range of the music

tot
2009-11-08, 06:25
It does affect the sound quality, but so little that it should be totally inaudible. It just adjusts the volume in digital domain and causes noise in the lowest bit(s), but that is below the hearing threshold.

When you tested, did you compare with identical sound levels? The louder always sounds better, even if the difference is very small.

cliveb
2009-11-08, 10:38
When using RG, you MUST have the digital level set to maximum.
I normally see eye-to-eye with Phil on most things, but I strongly disagree with this statement. When using RG it is perfectly OK to use the SB's digital volume control as well.

Think of it this way: you have a file with a RG value of -3dB. Playing it with the SB's RG support turned on, and adding an extra 3dB of digital volume level attenuation is *identical in every way* to playing it with the SB's RG support turned off and applying 6dB of digital level attenuation.

Phil Leigh
2009-11-08, 10:47
I normally see eye-to-eye with Phil on most things, but I strongly disagree with this statement. When using RG it is perfectly OK to use the SB's digital volume control as well.

Think of it this way: you have a file with a RG value of -3dB. Playing it with the SB's RG support turned on, and adding an extra 3dB of digital volume level attenuation is *identical in every way* to playing it with the SB's RG support turned off and applying 6dB of digital level attenuation.

Yes sorry that was a mistake - what I should have said was, when using RG you shouldn't also have lots of digital level reduction. Otherwise you may be straying into the low-SNR realm. I reckon that RG of -10dB (which is pretty much the max for very "loud" albums) + -10dB of level reduction is probably the safe limit. Even after that it won't sound bad...

stefanta650
2009-11-08, 11:04
RG is just a tag and doesn't change the audio data in your files.
RG simply causes the Classic to reduce the volume via its 24-bit level control (which is very good quality by the way).

When using RG, you MUST have the digital level set to maximum.
RG will reduce the level by -10dB or less.

The reason your music sounds less good is either:

1) it is just quieter and quieter ALWAYS sounds less clear and bright
or
2) You have the digital level a lot less than max and so the total reduction in level is too great, eating into the SNR/dynamic range of the music

Hi Phil!
The digital level IS fixed to maximum level. Of course I adjusted the volume control of my amplifier when applying the RG. The question is HOW SB reduces the level. Is is just a digial lowering of the output level or happens more, let's say some sort of compression or reducing the dynamic range. I will go into further tests next days...

Stefan

Phil Leigh
2009-11-08, 11:29
Hi Phil!
The digital level IS fixed to maximum level. Of course I adjusted the volume control of my amplifier when applying the RG. The question is HOW SB reduces the level. Is is just a digial lowering of the output level or happens more, let's say some sort of compression or reducing the dynamic range. I will go into further tests next days...

Stefan

Stefan
It just reduces the level by adjusting the 24-bit word value internally - exactly as the digital volume control does. There is NO compression or limiting.

stefanta650
2009-11-08, 11:36
RG is just a tag and doesn't change the audio data in your files.
RG simply causes the Classic to reduce the volume via its 24-bit level control (which is very good quality by the way).

When using RG, you MUST have the digital level set to maximum.
RG will reduce the level by -10dB or less.

The reason your music sounds less good is either:

1) it is just quieter and quieter ALWAYS sounds less clear and bright
or
2) You have the digital level a lot less than max and so the total reduction in level is too great, eating into the SNR/dynamic range of the music

Hi Phil!
The digital level IS fixed to maximum level. Of course I adjusted the volume control of my amplifier when applying the RG. The question is HOW SB reduces the level. Is is just a digial lowering of the output level or happens more, let's say some sort of compression or reducing the dynamic range. I will go into further tests next days...

Stefan

Spies
2009-11-08, 12:13
Stefan,

Perhaps this post by our founder Sean Adams copied to the wiki may help: http://wiki.slimdevices.com/index.php/Digital_Volume_Control_and_SNR

Teus de Jong
2009-11-09, 02:17
Yes sorry that was a mistake - what I should have said was, when using RG you shouldn't also have lots of digital level reduction. Otherwise you may be straying into the low-SNR realm. I reckon that RG of -10dB (which is pretty much the max for very "loud" albums) + -10dB of level reduction is probably the safe limit. Even after that it won't sound bad...

For people with classical music, it is even important not to set the volume at 100% to allow for positive gain (which can be used now the clipping bug is solved). Positive RP is almost always low (the highest I have seen is +3.5). So I have set the volume to 95%, which seems a save setting: end result between 82% for ridiculously compressed modern recordings an 5dB playroom for positive RG.

Teus

lasker98
2010-08-01, 08:35
I realize this is an old thread but I came across it looking for information on relpay gain. I was trying to find an explanation of why even with my entire collection of music converted to FLAC and with replay gain applied (both album and track replay gain) I still notice variations in perceived loudness when playing random tracks (with replay gain disabled in sqeezeboz variations are much worse so I know it's working). This last post about setting maximum volume to less than 100% to allow for positive replay gain values makes a lot of sense if the concept is correct.
For example, I have a ripped cd with album gain of +1.33db (I realize 1.33 db is negligible but for example purposes). If I have my volume set at 100%, then there is no room to increase by the 1.33 db? Is this logic correct?
On the same cd with +1.33 db album gain, I have a track with +5.6 db of track gain. Would this track gain of +5.6 db have to be added to the current volume to play back at same comparative volume as other replay gained tracks? So in effect I would need to have my squeezebox fixed volume at no more than 94.4% (100 -5.6)to get the proper result of the replay gain values on playback of this track?
Obviously I don't have much of an understanding of how exactly replay gain is applied but this idea of positive replay gain values not being able to be applied if volume is set at 100% could be the explanation for the loudness variations I'm noticing.
Thanks,
Bill

Teus de Jong
2010-08-01, 10:52
...
For example, I have a ripped cd with album gain of +1.33db (I realize 1.33 db is negligible but for example purposes). If I have my volume set at 100%, then there is no room to increase by the 1.33 db? Is this logic correct?
...
Yes, that is correct. If the volume is set to 100%, there is no room to apply positive replay gain.

As to your second question: there is track gain and album gain. SBS let's you choose between Album gain, Track gain, Smart gain and No adjustment.

When you choose album gain, only the album gain value is used. This is what I use. In general, for classical music it is a disaster to use track gain: the deliberate volume level differences between movements would be killed if you used track gain.

Track gain should only be used when using playlists with tracks from different albums. And don't use it with classical music.

Smart gain is the ideal setting for most people: it means album gain is used when playing an album, track gain when playing a playlist with tracks from different albums.

Album gain and track gain are never added (or subtracted): Album gain is the gain applied to an album based on the measured average volume level of all tracks on the album. Track gain uses the average volume level of a track. Both values are based on a the offset of a standard volume level (I've heard 89dB, but others may be better informed).

For several reasons, using replay gain will not 'equalize' all volume differences. 1) There is a difference between measured and perceived loudness. E.g., if you play a single piano at the same measured loudness as an orchestra, the perceived loudness will be different. 2. Although replay gain can help getting rid of the ridiculously high volume of cd's of the last decades, compression applied to the music in this loudness war will result in a different (higher) perceived volume while the correct gain correction is applied. (That was exactly the idea of the loudness war: your song should be perceived as being louder).


I hope this helps.

lasker98
2010-08-01, 13:19
Thanks Teus. I couldn't ask for a clearer response. I'm really surprised I haven't seen this discussed before. Everything I've read previously pointed to having Squeezebox volume left at 100%. I've set mine for 95% and will see how it goes. Thanks again.
Bill

garym
2010-08-01, 17:15
It does seem that most (95% I'd say) of my replaygain adjustments are NEGATIVE. So 100% volume wouldn't be an issue for these.

Wirrunna
2010-08-01, 19:23
Thanks Teus. I couldn't ask for a clearer response. I'm really surprised I haven't seen this discussed before. Everything I've read previously pointed to having Squeezebox volume left at 100%. I've set mine for 95% and will see how it goes. Thanks again.
Bill

Also thank you from me. Excellent explanation.

Teus de Jong
2010-08-02, 02:29
It does seem that most (95% I'd say) of my replaygain adjustments are NEGATIVE. So 100% volume wouldn't be an issue for these.

Agreed, almost all pop/rock albums of the last decade have negative replay gain, so a 100% volume setting won't make any difference. But in classical music the loudness war did not have so much impact and a lot of albums have a slight positive replay gain. Some examples: the new boxed set of Mozarts piano concertos by Alfred Brendel: +0.73. The 2008 recording of Bach's Wohltemperierte Klavier by Angela Hewitt: +3.24. Jazz music has in general (in my collection) a mild negative replay gain.

So a setting of 100% will only have the right result for those who don't listen to classical music.

cliveb
2010-08-02, 04:17
This last post about setting maximum volume to less than 100% to allow for positive replay gain values makes a lot of sense if the concept is correct.
Unless the firmware and/or server has been changed recently, I don't think this is relevant in the context of the Squeezebox implementation of Replaygain.

As far as I'm aware, when the bug that allowed positive RG values to introduce clipping was fixed, it was done in a fairly primitive way, by simply backing off the RG adjustment according to the peak level. No account was taken of the playback setting of the Squeezebox itself. (Example: you have a track with a peak level of -3dB and a RG vaue of +6dB. With the SB volume set to 100%, the RG adjustment should be restricted to +3dB. If the SB volume were set to -3dB, you could *in theory* apply the whole +6dB adjustment. But this doesn't actually happen: it's still restricted to +3dB).

rodorigo
2010-08-02, 08:13
Hi.


If the volume is set to 100%, there is no room to apply positive replay gain.

Could you please explain this a bit?.

The reason is: I have lots of classical recordings from digital radio.
They were originally mp2 with a very low loudness.
So I converted them to flac and added a positive replay gain to increase the volume without modifying the original audio data.
My output volume is set to 100% to allow ac3 playback and I don't want to change that.

Teus de Jong
2010-08-02, 09:15
Unless the firmware and/or server has been changed recently, I don't think this is relevant in the context of the Squeezebox implementation of Replaygain.

As far as I'm aware, when the bug that allowed positive RG values to introduce clipping was fixed, it was done in a fairly primitive way, by simply backing off the RG adjustment according to the peak level. No account was taken of the playback setting of the Squeezebox itself. (Example: you have a track with a peak level of -3dB and a RG vaue of +6dB. With the SB volume set to 100%, the RG adjustment should be restricted to +3dB. If the SB volume were set to -3dB, you could *in theory* apply the whole +6dB adjustment. But this doesn't actually happen: it's still restricted to +3dB).

Correct me if I'm wrong, but as far as I know this is only the case when the peak level doesn't allow for positive gain, because it would cause clipping. So, although primitive, it would only apply to albums/tracks with a very high peak level.

I looked at the peak level for several classical albums. It seems this is given as a number between 0 and 1. Most of my classical albums have a peak level around 0.9. So this would leave 19% volume gain without clipping.

But maybe this reasoning is totally wrong.

cliveb
2010-08-02, 10:03
Correct me if I'm wrong, but as far as I know this is only the case when the peak level doesn't allow for positive gain, because it would cause clipping. So, although primitive, it would only apply to albums/tracks with a very high peak level.

I looked at the peak level for several classical albums. It seems this is given as a number between 0 and 1. Most of my classical albums have a peak level around 0.9. So this would leave 19% volume gain without clipping.

But maybe this reasoning is totally wrong.
I never understood why the ReplayGain peak tags are expressed as a number up to 1.0, while their gain tags are in dB - it is bound to cause confusion. With that in mind, you should be aware that a peak value of 0.9 is about -0.92dB, which means there is less than 1dB of headroom to play with.

But let's go back to the way Squeezeboxes implement RG...

In principle, it should be possible to apply a full RG positive gain if the peak level plus any digital attenuation exceeds the required gain. For example, if a file's peak level is -1dB and the playback device also has a digital attenuation of 3dB, then a positive gain of up to 4dB can be accomodated. But this is only what is theoretically possible - it is NOT how it gets implemented in Squeezeboxes. They ignore the digital attenuation setting, applying only as much positive gain as can be applied based solely on the RG peak tag. So in the example here, you'll get only 1dB of gain regardless of the SB's volume setting.

I initially thought that this was just because the programmers were being lazy (although at the time it was good that the clipping bug got fixed at all). However, some time ago, someone (sorry, I forget who) made the observation that this approach can be considered to make sense. If the digital attenuation were also taken into account, you'd end up in the situation where changing the SB's volume control didn't make any difference to the playback level in some circumstances. That behaviour would seem a bit peculiar to many users.

Teus de Jong
2010-08-02, 11:34
Clive, I hope I understand your reasoning. As I understand it, this means that with an album peak level of 0.9, the positive gain will be at most 0.92, even if the RG of the album is +3. It is an extra explanation (besides the ones I already gave) why RG settings will not always have the desired result.

I just looked at the tags of one album and I see indeed what you mean: the album with +3.24 RG I mentioned states:

>Album Volume Adjustment: 3.24 dB (1.62 dB to prevent clipping)

So, if I set the digital volume to 90 there would be room to apply the +3.24 dB, but even then only +1.62 is applied. Is this sound reasoning?

cliveb
2010-08-03, 09:42
Clive, I hope I understand your reasoning. As I understand it, this means that with an album peak level of 0.9, the positive gain will be at most 0.92, even if the RG of the album is +3.
[snip]
>Album Volume Adjustment: 3.24 dB (1.62 dB to prevent clipping)
So, if I set the digital volume to 90 there would be room to apply the +3.24 dB, but even then only +1.62 is applied. Is this sound reasoning?
In the Squeezebox world, yes. That's just the way RG is implemented on Squeezeboxes.

Other players might be intelligent enough to factor in the additional headroom available when digital attenuation is in force, although I don't know of any that do.

I get the impression that Squeezebox Server is in possession of all the necessary data to do this (file peak level, RG gain, SB volume setting), so I'd have thought it ought to be fairly easy to implement. But Logitech's engineers might have reasons for not doing so (other than the obvious one that they can't be bothered). The peculiar behaviour of the volume control I mentioned in my previous post is one possible reason; perhaps there are others too subtle for my feeble brain to think of.

pski
2010-08-05, 18:28
So if this is "No Volume Adjustment," what is the effect on playback volume?

I can play most m4a's made by iTunes (from CD) at 100% when my receiver is connected directly to the amp.

Some CD's (Live at SXSW by Thomas Dolby and the Jazz Mafia Horns) are really loud and drive the amp to protect.

p

Teus de Jong
2010-08-06, 02:45
So if this is "No Volume Adjustment," what is the effect on playback volume?

Like the options says: there is no effect on the volume. In other words: the cd is played as loud as it is recorded.


Some CD's (Live at SXSW by Thomas Dolby and the Jazz Mafia Horns) are really loud and drive the amp to protect.

Maybe you should use RG then (if the album tracks have the RG tags filled). A lot of modern cd'd have a RG value of -9dB; I have even seen one with -13 dB. Compared with cd's from some decades ago, these cd's will play 3-5 times louder. When these albums are played amidst others and RG is not used, you get the effect you mention.