HydrogenAudio

Hosted Forums => foobar2000 => General - (fb2k) => Topic started by: ToS_Maverick on 2006-11-08 01:26:52

Title: How is the 6ch replaygain value calculated?
Post by: ToS_Maverick on 2006-11-08 01:26:52
How is the replaygain value calculated with 6ch files as source?

i have the following problem:
- 6ch source which has a RG value of -5 dB
- downmixed correctly to 2ch via behappy gives +0,5 dB

behappy uses a normalised downmix-matrix, wich i also use for 6ch playback in ffdshow. foobar uses this (http://www.hydrogenaudio.org/forums/index.php?showtopic=24246) downmix matrix in the "downmix 5.1 to stereo" dsp, which isn't clipping-safe.

the above facts result in this dilemma:
- 2ch file is played back correctly in foobar
- 6ch original file, replaygained, downmix-dsp active, is played back about 5 dB louder with RG ON!
- 6ch original and 2ch are being played back correctly with ffdshow (at the same volume, because of the same matrices)
- if i apply aacgain to the 6ch file, it is played back 5 dB too low in ffdshow

i'm a bit frustrated with this right now. i want to have clipping-free music-dvd-backups, thus the aacgain, which play back at the same volume in foobar(if i want to listen to the music only, thanks to mp4) and in MPC+ffdshow.

hope everyone can follow my facts, if not, please don't hesitate to ask
Title: How is the 6ch replaygain value calculated?
Post by: ToS_Maverick on 2007-07-17 08:26:56
hm, noone who could help with this?
Title: How is the 6ch replaygain value calculated?
Post by: 2Bdecided on 2007-07-17 10:29:13
A long time ago, someone (I think it was SamK) reported issues with ReplayGaining more than 2 channels. I didn't have chance to look in to it properly.

You have the added problem of the downmix(es). I don't know if there's a foobar specific way to change the down mix coefficients, but that might be a useful start.

As for RG of 5.1 material, a nasty work-around is to edit the ReplayGain values - maybe copying the stereo down-mix value into the 5.1 file.

Cheers,
David.
Title: How is the 6ch replaygain value calculated?
Post by: Hancoque on 2008-02-06 18:12:43
I just tested how foobar2000 (0.9.5) calculates the ReplayGain values. It seems like every channel is scanned independently and the resulting RG value is the average of the channels' values. It is important to note that the LFE channel is ignored. So the RG values are properly calculated for multichannel files.

But the problem persists that these RG values are not representative after downmixing to stereo because of the increased dynamic range of the downmixed version. So the downmixed files will be played back at a lower volume than they should.

A feature could be implemented in the player to scan RG values with DSPs applied. That would be very useful for people that don't have a multi-speaker system and generally downmix multichannel material during playback.