replay gain - not too sure if it degrades the sound
May 5, 2020 at 6:09 AM Thread Starter Post #1 of 16

magicalmouse

500+ Head-Fier
Joined
Oct 21, 2013
Posts
890
Likes
211
Location
uk
hi, i have been experimenting and have come to a conclusion (imo and subject to my hearing) that the sound is more dynamic and 'real' without replaygain.

I know the convenience is useful for random play but it seems to be offset by a reduction in quality although it is impossible to compare properly due to time lag/volume so this is subjective.

I did however read in some older feeds that replaygain alters the digital stream in particular the word length so there seems to be some science behind this.

I also noticed that fidelizers advice on setup of his program that replaygain should be disabled.

Any thoughts - i am using foobar2000 on my windows laptop and on my fiio x7 (foobar mobile)

d
 
May 5, 2020 at 8:07 AM Post #2 of 16
[1] hi, i have been experimenting and have come to a conclusion (imo and subject to my hearing) that the sound is more dynamic and 'real' without replaygain.
[2] I know the convenience is useful for random play but it seems to be offset by a reduction in quality although it is impossible to compare properly due to time lag/volume so this is subjective.
[3] I did however read in some older feeds that replaygain alters the digital stream in particular the word length so there seems to be some science behind this.
[4] I also noticed that fidelizers advice on setup of his program that replaygain should be disabled.

1. As the name suggests, ReplayGain changes the gain on replay. It lowers the gain of each track/song according to a measurement of it's loudness, so that every track/song has the same overall loudness. Replaygain does not change/affect the dynamics within the songs/tracks, only the overall level of each track as a whole.

2. There's no reduction in quality, only a reduction in gain. Bare in mind though, if you have to compensate for this reduction in gain by setting your amp at or near it's max, then your amp might cause a reduction in quality.

3. The digital stream is a series of zeros and ones that represent a measurement of amplitude over time. Reducing the amplitude (gain), which is what replaygain does, will therefore alter the digital stream, although the word length is unchanged (unless of course you apply some other process that changes the word length).

4. The amount of processing required by replaygain is insignificant for any modern processor, even those in mobile phones. If you have a really ancient system or are overloading your system/CPU there might be an impact. This is the only valid reason I can think of for "fidelizers advice".

G
 
May 5, 2020 at 2:13 PM Post #3 of 16
My take is the less processing the better. I never use any of them. Simple is good.
 
May 5, 2020 at 4:26 PM Post #4 of 16
My take is the less processing the better. I never use any of them. Simple is good.

Your choice, but I find it an odd position give how much processing/eq is applied during recording/engineering/mastering. So adding a little processing during playback really shouldn't be considered an issue.

Add that to imperfect response curves almost all transducers have and personal biology/preference and it's hard to imagine your current setup (or mine) can't be improved with the right tools.

Simple may be good, but more accurate reproduction fit to my taste is better.
 
May 6, 2020 at 3:53 AM Post #5 of 16
My take is the less processing the better. I never use any of them. Simple is good.

Don't you use an amplifier? If you do, then you're already applying processing, you're changing the gain/level of the signal.

As @bfreedma stated, a great deal of processing is applied during the recording's creation process. If we're including volume changes as processing, along with EQ, reverb, compression and other processors, then many hundreds of processes are typically applied during mixing and mastering, do you think the purpose of all of them is to make the track sound better or worse? And, how much difference do you think adding one more will make? In fact, it's possible in some cases that replaygain could actually improve sound quality, by lowering the inter-sample peaks to below the digital distortion threshold. However, it's also possible, if the replaygain is set to a very high amount of gain reduction, that there might be a slight reduction in sound quality, although only a tiny number of tracks (if any) are likely to be affected.

I'm certainly not saying that more processing is always better or that simple is never good. As a general rule, less processing is better and simple is good but it's a general rule with a large number of exceptions and different degrees, which need to be considered on a case by case basis. In this case, providing excessive replaygain settings are not employed, there will be no audible loss of sound quality, with the possible exception already mentioned of compensating for the gain reduction by increasing the gain of the amplifier and over-driving it to distortion or audible noise. Although if this is occurs, then it's probably the wrong (under-powered) amplifier in the first place.

G
 
May 6, 2020 at 4:31 AM Post #6 of 16
hi, i have been experimenting and have come to a conclusion (imo and subject to my hearing) that the sound is more dynamic and 'real' without replaygain.

I know the convenience is useful for random play but it seems to be offset by a reduction in quality although it is impossible to compare properly due to time lag/volume so this is subjective.

I did however read in some older feeds that replaygain alters the digital stream in particular the word length so there seems to be some science behind this.

I also noticed that fidelizers advice on setup of his program that replaygain should be disabled.

Any thoughts - i am using foobar2000 on my windows laptop and on my fiio x7 (foobar mobile)

d
You must never trust your impressions born from listening to 2 different loudness levels. You're very right to be skeptical about that.

The bit loss from replay gain attenuation is objectively reducing fidelity in some way, but so is everything else in the recording, making of a track, and playing it back. So what should concern us IMO, is the magnitude of the impact and not that there is an impact. Because everything has some impact. When you change the volume level on your amp you also probably affect SNR and dynamic in some tiny but measurable way. Avoiding something because it's not perfect is the most counter productive way of thinking in this hobby. Even more so when the very notion of perfection is an illusion.

Depending on your DAC, drivers, and settings, the digital gain change will be calculated with 24,32 or maybe even 64bit, and will reach the DAC more likely with samples having a bit depth of 24 or 32bit. Gain changes of maybe down to 10 or 12dB in this context is not something you have to care about IMO.
Now if you output everything at 16bit on some old DAC, there may be some rare cases where you'd be able to notice loss in SNR(you'd perceive some background hiss from quantization noise. Even in a worst case scenario, you'd really have to go look for it with a tailor made track and/or listening way too loud for your own good. Because in practice, if a track has very quiet passages and very dynamic content, replay gain would never calculate something like -12dB for it. It might actually suggest a boost on such a track based on your target loudness.


And that is IMO where you need to worry about replay gain. Not the attenuation, but when you don't get enough or worst, when you get a boost. Because depending on your settings, a very dynamic track could be made to clip and that isn't good, ever! When that happens, we're not talking about maybe noticing some background hiss in the quietest parts of the track if by chance there isn't already some louder from the recording itself, we're talking clipping the loudest content on the track!!!
To save yourself from that nasty thing the easiest possible way, you'll first select "apply gain and prevent clipping according to peak". That will give priority to stop clipping so some tracks might not subjectively sound as loud as the rest of the playlist. That's the downside.

Second thing to do is to scan tracks for replaygain and peak information using oversampling, so that even intersample clipping is accounted for. In the version of foobar I have, under file->preferences->tools->replaygain scanner, you'll find the options for true peak scan using oversampling of your choice. Obviously the most accurate is the highest oversampling, but it will also directly impact how much CPU and time you will spend scanning your albums. So you might want to check with one album how things go with various settings, and settle on what feels like a good compromise for yourself. If I max out everything and scan many albums at once, my computer gets very hot and very laggy, so I don't do that. Because even though we do want to avoid clipping, it's not like we'll notice any tiny clipping by 0.03dB for 1/2000th of a second on an entire track. Again, common sense and complete paranoia are not the same thing IMO ^_^.
So you can just try and see if you notice something(very unlikely). And if I just made you "clip paranoid" for life with this post, then just go along with the endless scan using max oversampling. The choice is all yours, and sorry :wink:. I use a 4X setting, and in my case with my library, that seems to be good enough to avoid clipping. I still get one from time to time here and there, but it's usually some damaged old crappy mp3 file and the clipping occurs often just at the very end. Really no big deal considering those files are garbage to begin with and I don't keep them for their objective fidelity.
 
May 6, 2020 at 11:52 AM Post #7 of 16
Your choice, but I find it an odd position give how much processing/eq is applied during recording/engineering/mastering. So adding a little processing during playback really shouldn't be considered an issue.

Add that to imperfect response curves almost all transducers have and personal biology/preference and it's hard to imagine your current setup (or mine) can't be improved with the right tools.

Simple may be good, but more accurate reproduction fit to my taste is better.

The processing done in the studio is how they wanted the music they made to sound. So yes, the less processing after that, the better. And there is also a difference in the quality of tools available to consumers vs. music production. It doesn't seem like a valid comparison.

Simple is good and it leads to the most accurate rendering of the music as delivered. That might very well be different from how individual people want it to sound or what is considered the most lifelike, etc. But leaving it alone is absolutely the best way not to break anything.
 
Last edited:
May 6, 2020 at 12:28 PM Post #8 of 16
The processing done in the studio is how they wanted the music they made to sound. So yes, the less processing after that, the better. And there is also a difference in the quality of tools available to consumers vs. music production. It doesn't seem like a valid comparison.

Simple is good and it leads to the most accurate rendering of the music as delivered. That might very well be different from how individual people want it to sound or what is considered the most lifelike, etc. But leaving it alone is absolutely the best way not to break anything.


That would only apply if everyone involved in the engineering and mastering process did a "perfect" job every time. No offense to the professionals out there, but I don't think anyone would argue that point. And even then, it fails to account for the massive differences in reproduction due to the variance in transducers used by the general public. So at best, it could be "perfect" for one person on one headphone/speaker.

Who is the "They" you are referring to in "The processing done in the studio is how they wanted the music they made to sound"? The artist? The Engineer? The Mastering Engineer? The studio head paying for it?. In my admittedly limited experience in the recording process, I've never seen them all meet and agree on a final version of a recording.
 
May 6, 2020 at 12:30 PM Post #9 of 16
Whoever won the argument that day :wink:
 
May 7, 2020 at 5:10 AM Post #10 of 16
[1] The processing done in the studio is how they wanted the music they made to sound.
[1a] So yes, the less processing after that, the better.
[2] And there is also a difference in the quality of tools available to consumers vs. music production. It doesn't seem like a valid comparison.
[3] Simple is good and it leads to the most accurate rendering of the music as delivered.
[4] That might very well be different from how individual people want it to sound or what is considered the most lifelike, etc.
[5] But leaving it alone is absolutely the best way not to break anything.

1. True but how that final mix will sound outside of the studio, when replayed on a consumer system will be significantly different to "how they wanted the music they made to sound", which is why the final mix is sent to a mastering engineer. Therefore:
1a. More processing done after the final mix has been completed is better. Furthermore, the mastering engineer is not trying to create a master that sounds great in their mastering studio but a master that sounds great when replayed by the target consumers/playback media.

2. That depends on the tools in question. Tools such as EQ for example are generally exactly the same quality, the difference between pro and consumer EQs, where there is any, are in the functionality available (more bands, better automation control, etc.), not a difference in audio quality.

3. Typically that is incorrect, recordings are NOT supposed to be rendered as delivered and it's not what the pros/commercial studios themselves do! The vast majority of recordings are primarily designed to be reproduced on speakers. The "the most accurate rendering of the music" is therefore NOT "as delivered" but with the room acoustics of the consumers' listening environments added. Room acoustics are significantly variable and even the very well acoustically treated commercial studios themselves apply some corrective EQ in their playback chain. The "most accurate rendering of the music" by the consumer would therefore virtually always also require EQ.

4. If you want to try and reproduce the music "as delivered" with no additional processing then that's entirely up to you of course, but that is NOT the "most accurate rendering" of it. "What is considered most lifelike" is also an audiophile myth, the vast majority of recordings are deliberately very significantly different to "lifelike"!

5. It's entirely possible to apply processing in the playback chain in such a way as to break something, even processing as simple as raising or lowering the gain, which we all have to do anyway. It's certainly a laudable goal "not to break anything" but it's an even more laudable goal "not to break anything" AND to achieve a more accurate rending of the music. Isn't high fidelity playback (more accurate rendering of the music) the whole point of audiophilia?

Unfortunately, the audiophile world appears to have it's own narrative (seemingly created by marketing) and commonly just makes-up all sorts of assertions about recording, mixing and mastering in order to fit that narrative. What's really surprising is that when the professionals who actually work in commercial studios dispute those assertions, they're shouted down by audiophiles (who've probably never even been inside a world class studio), which is why virtually all commercial music and sound engineers actively avoid the audiophile community. Unfortunately though, this results in numerous nonsense assertions going unchallenged and therefore being unquestioningly accepted as facts!

Who is the "They" you are referring to in "The processing done in the studio is how they wanted the music they made to sound"? The artist? The Engineer? The Mastering Engineer? The studio head paying for it?. In my admittedly limited experience in the recording process, I've never seen them all meet and agree on a final version of a recording.

Commonly they all do agree on a final version of a recording. However, there are certainly exceptions and sometimes the artists either don't want to have a say on the final version or are contractually not entitled to one (more so with new artists than established successful ones). However, you're right in the sense that they don't all meet at the mastering studio to approve the master, this never happens as far as I'm aware and in fact, the mastering engineer is typically the only person to hear the final version in the mastering studio. The producer will probably hear the master in the mix studio and on their consumer (home and car) systems, while the artists might hear it in the mix studio or only on their consumer systems, same with the label exec/s. Sometimes the mastering engineer will be required to make a few alterations/compromises before a consensus is achieved. None of this is set in stone though and commonly varies at least somewhat from artist to artist and label to label.

G
 
May 7, 2020 at 5:20 PM Post #11 of 16
Discussion became sophisticated and not all points are correct, so I'd like to put it simple for the benefit of the OP. The best volume control is in your preamp. The analog knob. It gives a maximum dynamic range and the best linearity for the CD quality (16-bit) source. I am sure there is an agreement to this point. In other words whenether possible, keep in the Foobar volume control 100% and even more important, work in WASAPI exclusive mode or in ASIO. No one has mentioned that volume control in Foobar can work in two ways:

1. A DAC report to the system ability of handling digital volume internally. Foobar recognise it and adjusts a volume in exact decrements DAC allows. It is seen clearly on the Topping D30 which has a rough decrements. All newer DAC chips handle volume control in smaller steps, Foobar can even produce internally bigger steps. It is done by sending commands to the DAC. A data stream is unchanged, zero digital processing in Foobar.

2. A DAC has no digital volume control. Foobar adjust volume internally using 32-bit floating point.

Foobar volume control is a quality processing, but when a DAC is adjusting volume, it may produce better dynamic range. Foobar is not able to do it. In other words results depend on your hardware.

In fact, it's possible in some cases that replaygain could actually improve sound quality, by lowering the inter-sample peaks to below the digital distortion threshold.
It is true when there is no additional processing in Foobar. Intersample peaks (or overloads) - it is complicated matter. When playing the original sample rate in bit perfect mode, result can be exacly as it was intended in recording studios. In the NOS DAC intersample peaks are shaped properly in the analog low pass filter efectively increasing dynamic range. I don't listen to such music, I don't care, but when upsampling is done either inside the DAC or in Foobar, clipping becomes a problem. I don't know how it is handled in oversampling DACs, but people on other forums found that there is a problem with Foobar architecture. It is because Foobar internally convert PCM to the 32-bit floating point. Maximum peaks receive floating point value +1 or -1. There is no a bigger value. Any DSP in Foobar produce clipping before it goes to the volume control. There were tests on some components, including SoX, they don't care about clipping. All these horror stories give me indication that keeping bit-perfect data path is essential for sound quality.
 
Last edited:
May 8, 2020 at 6:06 AM Post #12 of 16
It is because Foobar internally convert PCM to the 32-bit floating point. Maximum peaks receive floating point value +1 or -1. There is no a bigger value. Any DSP in Foobar produce clipping before it goes to the volume control. There were tests on some components, including SoX, they don't care about clipping.
help me understand this.
Annotation 2020-05-08 112941.png

-First track at the top is stereo 200Hz sine generated in Audacity that peaks at -0.1dB(I called it FS out of habit but that's a lie ^_^).

-Second track in the middle is stereo recording when playing the first track in foobar with an EQ put twice in the DSP chain. First EQ set to add +10.22dB, while the second EQ is set to lower the gain by 10.22dB. So 2 EQ set only with global gain values to cancel each other. Clearly foobar did not clip the signal at the first EQ that boosted -0.1dB peaks by more than 10dB.

-Third track is a recording when I bypass the second EQ(the one with -10.22dB gain). The red lines for those who don't know, are warning from Audacity that all those areas are clipping. Which is as expected after boosting the signal 10dB above full scale level:scream:. Confirming that if we let the signal clipped until the output(foobar volume was left maxed out and no replay gain data was on that track), then sure enough it clips.

What am I missing here?
PS: All this was done in a digital loop, no DAC or ADC involved, in case someone cares.
 
May 8, 2020 at 6:38 AM Post #13 of 16
@castleofargh. It is obvious that a second grapgh should be cliping. Why is not clipping? The one possibility is that EQ software is clever enough to not adjust a volume itself, just attaching a volume adjustment header to the data stream for later processing in a Foobar. In such case Foobar will take a sum of both adjustments in the final stage. It might be a special case. Try a non-linear frequency EQ, and repeat test. EQ can be also an internal Foobar function, I can't predict results without examining a Foobar plugin programming interface.
 
May 8, 2020 at 10:16 AM Post #14 of 16
[1] Discussion became sophisticated and not all points are correct, so I'd like to put it simple for the benefit of the OP.
[2] The best volume control is in your preamp. The analog knob.
[2a] It gives a maximum dynamic range and the best linearity for the CD quality (16-bit) source.
[2b] I am sure there is an agreement to this point.
[3] Foobar volume control is a quality processing, but when a DAC is adjusting volume, it may produce better dynamic range. Foobar is not able to do it.
[3a] In other words results depend on your hardware.

1. If one is going to state that other people's points are incorrect and correct them, it's particularly important to actually be correct! However,

2. As a general rule, the end result would be no different!
2a. Provided you're not doing something silly to ruin the gain-staging, such as lowering the digital volume by a very large amount and then turning your amp way up to compensate, the dynamic range and "linearity" will be the same.
2b. I'm sure there is NOT agreement on your point! I don't know if there's agreement amongst audiophiles (according to audiophile myths) but those who know/understand the actual facts (most engineers, etc.) would not agree.

3. Volume control is the very simplest/easiest of all digital processing tasks. It would be astonishing, after all these years, if Foobar had such a serious flaw in this simplest of processing tasks that it didn't output the full dynamic range of a recording, same with a DAC that adjusts digital volume (the caveat again being that the amount of digital gain reduction isn't excessive). And of course, if Foobar were "not able to do it" then it would NOT be "quality processing", it would be the opposite!
3a. No, it would NOT depend on your hardware. Although we can't completely rule out the possibility that some hardware might exist that is extremely badly designed!

[1] Intersample peaks (or overloads) - it is complicated matter.
[2] When playing the original sample rate in bit perfect mode, result can be exacly as it was intended in recording studios.
[3] In the NOS DAC intersample peaks are shaped properly in the analog low pass filter efectively increasing dynamic range.
[3a] I don't listen to such music, I don't care, but when upsampling is done either inside the DAC or in Foobar, clipping becomes a problem.
[4] I don't know how it is handled in oversampling DACs, but people on other forums found that there is a problem with Foobar architecture. It is because Foobar internally convert PCM to the 32-bit floating point. Maximum peaks receive floating point value +1 or -1. There is no a bigger value.
[5] All these horror stories give me indication that keeping bit-perfect data path is essential for sound quality.

1. Providing one has a basic understanding of how digital audio works, inter-sample peaks are not a conceptually "complicated matter". More importantly, Inter-sample peaks are NOT overloads, although under certain conditions they *might* cause overloads! For the uninitiated: As the digital to analogue conversion (DAC) process reconstructs the actual analogue WAVE form, rather than just joining the digital samples with straight lines, the peaks of the wave can occur between the sample values and therefore be higher in level than the sample value. Here's a rather extreme example:
pic1.png

The dots are the sample points/values and the waveform connecting them is what will be reconstructed upon conversion to analogue. You can see we have numerous inter-sample peaks (between 0 & 1, 2 & 3, 8 & 9, etc.). However, none of them would cause an overload except the one between 5 and 6, because the sample values are already at 0dB and therefore the inter-sample peak exceeds the 0dB distortion/clipping threshold. If we were to oversample this signal we would run into the same problem, the waveform would be the same but now we'd have sample points between 5 & 6, which would exceed 0dB and cause distortion/clipping. Or rather, it would cause clipping if it weren't for the fact that inter-sample peaks are an entirely predictable phenomena, have been known about since before there were any consumer digital audio devices and therefore any competent DAC designer will provide additional headroom to allow for them.

2. That would depend on the mastering studio's DAC and your DAC. In the example above, if the mastering studio's DAC provides 6dB of headroom there would be no clipping distortion but if your DAC only provides 3dB of headroom, which is not uncommon, then there would be distortion (although it probably wouldn't be audible). However, if you had used replaygain to reduce the gain by 6dB (or more), then the inter-sample peak would be below 0dB and therefore clipping could NOT occur with any DAC. Hence why I stated that replaygain could actually improve audio quality in some (few) instances.

3. Firstly, all inter-sample peaks are NOT shaped properly in the analogue filter of NOS DACs (without digital filters): Either their phase is affected, their amplitude or other spurious peaks (alias images) are introduced by inadequate filtering, any of which could be audible. An oversampling DAC (with sufficient headroom) would generally more "properly shape" the inter-sample peaks (and any artefacts almost certainly be inaudible)!
3a. If you don't listen to music with inter-sample peaks, then you don't listen to any music, because all commercial digital audio recordings contain inter-sample peaks! The vast majority of music recordings have inter-sample peaks that never exceed the headroom allowed by consumer DACs and how do you know which ones do? Do you know the headroom of your particular DAC and measure all of your music with a True Peak Meter?

4. This assertion is false! 32bit float allows values up to about +1,500 (dBFS) not just +1 (dBFS). Of course, +1,500dB is pointless so most plugins will only go up to +12dB or whatever the developer decides is reasonable. It's a shame you've chosen to emphasise (bold) an assertion that is actually wrong!

5. Yep, that seems to be a very common issue in the audiophile world; listening to stories written by audiophiles (and those who market to them) rather than examining the actual facts. Admittedly though, stories are typically more readable and entertaining than boring facts!

G
 
May 8, 2020 at 6:18 PM Post #15 of 16
4. This assertion is false! 32bit float allows values up to about +1,500 (dBFS) not just +1 (dBFS). Of course, +1,500dB is pointless so most plugins will only go up to +12dB or whatever the developer decides is reasonable. It's a shame you've chosen to emphasise (bold) an assertion that is actually wrong!
A proof, please. And what is according to you a digital (bit) value of 0 or +1 dBFS in Foobar?
 

Users who are viewing this thread

Back
Top