PDA

View Full Version : Where/how is gain adjustment carried out?



peterbell
2006-10-08, 16:05
I have all of my CDs encoded using FLAC. I recently added replaygain tags to the files.

My first question is:

Does the gain adjustment get performed at the Server or the player?


Secondly:
Obviously, if the first answer is 'Server', then the adjustment is carried out in the digital domain. However, if the adjustment is performed at the player, is this done in the digital or the analogue domain?

If the adjustment is performed in the digital domain, then it must be a 'lossy' process and not conducive to good perfect reproduction of the original waveform. However, if the adjustment were to be carried out in the analogue domain, then it would probably not be detrimental to the sound.

Mark Lanctot
2006-10-08, 16:59
I had more or less the same question:

http://forums.slimdevices.com/showthread.php?t=19946


The replay gain adjustment happens at decode time and is independent
of the master volume control (and the analog preamp gain control).
It's a simple gain multiplier, calculated from the replaygain value
stored in the tags.

This was in response to the details in firmware, so this means it's done at the player.

Regarding it being a "lossless" process I would venture to say it isn't - if the track is HDCD-encoded, ReplayGain implemented in SlimServer will disrupt HDCD decoding, which means it isn't bit-perfect.

JJZolx
2006-10-08, 18:14
I had more or less the same question:

http://forums.slimdevices.com/showthread.php?t=19946

This was in response to the details in firmware, so this means it's done at the player.
It wasn't clear (to me) from that thread the answer regarding the volume of the digital out when it's set to fixed. Does it remain fixed or does replaygain affect the volume?

JJZolx
2006-10-08, 18:24
Obviously, if the first answer is 'Server', then the adjustment is carried out in the digital domain. However, if the adjustment is performed at the player, is this done in the digital or the analogue domain?

If the adjustment is performed in the digital domain, then it must be a 'lossy' process and not conducive to good perfect reproduction of the original waveform. However, if the adjustment were to be carried out in the analogue domain, then it would probably not be detrimental to the sound.
This debate has been smacked around in the audiophile forum on several occasions. You might want to do a search there.

Squeezebox/Transporter does no volume adjustment in the analog domain. IIRC, the only instance is within the Transporter, which has internal jumpers for adjusting the attenuation of the analog out.

Mark Lanctot
2006-10-08, 18:52
It wasn't clear (to me) from that thread the answer regarding the volume of the digital out when it's set to fixed. Does it remain fixed or does replaygain affect the volume?

ReplayGain definitely does affect the volume even when it's set to fixed. No doubt about that when you switch it off for a recent "master it loud" track with a -10 dB RG. :-)

peterbell
2006-10-09, 02:38
From these responses, I gather that the gain adjustment is performed at the player, but that it is done in the digital domain. This implies that it must be a 'lossy' process and should be turned off for best quality reproduction.

This is a shame, because it does seem to me that, for the analogue outputs, it ought to be possible to adjust the analogue gain in response to the replaygain value and maintain a lossless reproduction.

I guess that I'll leave Volume Adjustment turned off on my main system, but leave it turned on on the other SB which is used for casual/background listening.

badbob
2006-10-09, 02:43
So for HDCD titles it's best not to scan the albums, and just leave it as it is? I use digital out to a HDCD capable DAC.

Mark Lanctot
2006-10-09, 06:57
So for HDCD titles it's best not to scan the albums, and just leave it as it is? I use digital out to a HDCD capable DAC.

Depends if you hear a difference with HDCD - not all do.

But your decoder should indicate it's decoding HDCD as soon as ReplayGain is disabled. Note it'll have to be over digital, and the digital volume must also be at 100%.

Josh Coalson
2006-10-09, 13:31
--- peterbell <peterbell.2femkn1160386801 (AT) no-mx (DOT) forums.slimdevices.com>
wrote:
>
> >From these responses, I gather that the gain adjustment is performed
> at
> the player, but that it is done in the digital domain. This implies
> that it must be a 'lossy' process and should be turned off for best
> quality reproduction.
>
> This is a shame, because it does seem to me that, for the analogue
> outputs, it ought to be possible to adjust the analogue gain in
> response to the replaygain value and maintain a lossless
> reproduction.

analogue amplification is also lossy, the question is always whether
or not it's audible. the flac replaygain synthesis code does dithering
with noise shaping, so you should ABX test it to see if you can hear
a difference first.

also, the noise shaping is controllable via switches in one of the
conf files; you can spend more processor time to increase the quality.

Josh

peterbell
2006-10-09, 16:52
--- peterbell <peterbell.2femkn1160386801 (AT) no-mx (DOT) forums.slimdevices.com>
wrote:[color=blue]
> analogue amplification is also lossy, the question is always whether
or not it's audible. the flac replaygain synthesis code does dithering
with noise shaping, so you should ABX test it to see if you can hear
a difference first.

also, the noise shaping is controllable via switches in one of the
conf files; you can spend more processor time to increase the quality.

Josh
Oh yes, of course there is loss of information (and addition of false information) in the anologue domain but I would guess, unless there are some very serious non-linearities, the effect is seldom as obvious as the infidelities which could be introduced in the digital domain.

However, it may be worth, as you suggest, setting up an ABX test so that I can judge for myself.

I guess that, from a purist point of view, having elected to use FLAC coding for all my music, it goes against the grain to, knowingly, introduce unneccessary digital processing.

JJZolx
2006-10-09, 17:02
I guess that, from a purist point of view, having elected to use FLAC coding for all my music, it goes against the grain to, knowingly, introduce unneccessary digital processing.
Why would anyone serious about music reproduction use replaygain for anything other than casual listening, anyway?

So add the calculated values to your files and then decide whether or not you ever want to use it - it's just a few tags that don't affect the actual audio data. It's great for music playback for background music, parties and other non-critical listening situations where the benefits outweigh the potential minuses.