Post Reply 
 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
ReplayGain
10-06-2016, 14:12
Post: #11
RE: ReplayGain
I have done some experiments to see how this could work.

There are two tags used by dBpoweramp: ReplayGain_Album_Gain and ReplayGain_Track_Gain. The value of ReplayGain_Track_Gain can differ greatly between tracks of the same album and I don't think it would be a good idea for MinimStreamer to adjust levels based on this. Adjusting levels based on ReplayGain_Album_Gain should produce a better result.

In my experiments, adjusting output level as part of ffmpeg transcoding didn't degrade sound quality noticeably, so this should be a viable approach for supporting this capability.

I still need to work out how best to pass the ReplayGain_Album_Gain value for a track from MinimServer to MinimStreamer when the track is selected for playback.
Find all posts by this user
Quote this message in a reply
10-06-2016, 14:46
Post: #12
RE: ReplayGain
(10-06-2016 14:12)simoncn Wrote:  I have done some experiments to see how this could work.

There are two tags used by dBpoweramp: ReplayGain_Album_Gain and ReplayGain_Track_Gain. The value of ReplayGain_Track_Gain can differ greatly between tracks of the same album and I don't think it would be a good idea for MinimStreamer to adjust levels based on this. Adjusting levels based on ReplayGain_Album_Gain should produce a better result.

In my experiments, adjusting output level as part of ffmpeg transcoding didn't degrade sound quality noticeably, so this should be a viable approach for supporting this capability.

I still need to work out how best to pass the ReplayGain_Album_Gain value for a track from MinimServer to MinimStreamer when the track is selected for playback.

Thank you very much for considering the request. Highly appreciated and happy to provide input if so required.

Would it not be able to have a variable that would determine whether to read ReplayGain_Track or ReplayGain_Album? Here is the reasoning based on a conversation I had with Spoon, the maker of DBPoweramp.

If I recall his words correctly, ReplayGain_Album will hold the value to normalise tracks that are of the same album. So, if you have two songs with wildly differing output levels, then for that album you can level it through ReplayGain_album. Both tracks will now sound roughly the same in terms of volume / output level. However, you are still left with differences between tracks of different albums. And this is where ReplayGain_track comes in handy.

DBPoweramp's batch processor (And I believe Foobar as well) allows you to level all tracks within your selection. In other words, if you select your entire library or any subset of it, that subset will be levelled in its entirety (is that proper English?) to the same level. This will resolve the play list issue that so many talk about where low output level tracks from the 1980s (Pink Floyd's original CD issue of The Wall comes to mind) are way too soft, while CD releases from the 2000s and later will make you jump up against the ceiling because they are so loudly recorded.

Also, DBPoweramp and EAC will allow you to ensure that no clipping occurs when determining the ReplayGain value. So, in principle you can take the value that the software calculated as given, I think. If there is a problem, the user needs to reapply the ReplayGain calculation algorythm or turn off ReplayGain processing in Minim. It should not be the responsibility of Minim to check the originally applied ReplayGain or second guess its value, in my view.

I agree that sound quality will not be affected as bits and dynamic range are not affected. But there will be a perceived quality loss for tracks that will get a lower output level. The reverse will be the case for tracks that will get leveled upwards.

But I think many of us would be happy to have this option. Thank you.
Find all posts by this user
Quote this message in a reply
10-06-2016, 20:49 (This post was last modified: 10-06-2016 20:50 by simoncn.)
Post: #13
RE: ReplayGain
My experience with track gain and album gain is different from your reasoning. I applied the dBpoweramp DSP effect to one of my albums to see what values would be produced. The album gain value (applied to all tracks) was -0.53 dB and the track gain values varied from +23.97 dB to -3.8 dB. These large differences in track gain values are because some tracks contain louder music and some tracks contain quieter music. It would not make sense (at least to me) to play this album with the loud tracks made quieter and the quiet tracks made louder.

I have other albums whose average recorded level is louder or quieter than this album. If I am playing a louder album after this album, it would be useful to have the server use the album gain values to automatically reduce the level when the second album starts playing. I don't want to change the level in the middle of either album because I want to preserve the relative loudness or quietness of the tracks within each album.

The same would apply when listening to a playlist containing individual tracks selected from many different albums. I would want to use the album gain value for each track because I don't want tracks containing quiet music to be played louder just because they are in a playlist.

I think the only time that the track gain value would be useful is when listening to a file that isn't part of an album. In this case, the file wouldn't have an album gain value and the only value that can be used is the track gain.
Find all posts by this user
Quote this message in a reply
11-06-2016, 11:18 (This post was last modified: 11-06-2016 11:20 by Pepsican.)
Post: #14
RE: ReplayGain
(10-06-2016 20:49)simoncn Wrote:  My experience with track gain and album gain is different from your reasoning. I applied the dBpoweramp DSP effect to one of my albums to see what values would be produced. The album gain value (applied to all tracks) was -0.53 dB and the track gain values varied from +23.97 dB to -3.8 dB. These large differences in track gain values are because some tracks contain louder music and some tracks contain quieter music. It would not make sense (at least to me) to play this album with the loud tracks made quieter and the quiet tracks made louder.

I guess whether you'd use album gain for levelling or track gain, depends very much on your purpose. For listening to albums I would, like you, apply album gain. You'd want to preserve the output level differences because they probably are as the artist intended. But when building random playlists, that idea is no longer valid. Applying album gain in such a case could still leave you having to dial up or down the volume, especially when your selection of tracks is a bit eclectic and varies from 1980s releases to those of the current century.

(10-06-2016 20:49)simoncn Wrote:  I think the only time that the track gain value would be useful is when listening to a file that isn't part of an album. In this case, the file wouldn't have an album gain value and the only value that can be used is the track gain.
And in my view that case occurs when I start building playlists of various artists from CDs of various recording qualities. Something I personally do a lot. Think of playlists for parties or fitness. Arguably, today's listener no longer thinks in terms of albums. Mostly the music industry still does. But with iTunes and other download sites offering downloads by track, the idea of the album left us some time ago. But that last point is probably worthy of its own thread and best discussed over a beer and a meal. Smile

Your points did make me think things through again though. I did a search on ReplayGain and there is not a site on audio where there is not a thread discussing whether album gain is better or not than track gain. So, it is safe to say that the general audience is divided and what one favours depends on how one listens to music.

That said, I guess (without understanding the structure and architecture of your software properly) that if a ReplayGain implementation makes it to MinimServer / MinimStreamer, a property to set which of the two you want to use is probably one of the less problematic things to programme compared to the rest (0 = off, 1 = trackgain, 2= album gain).

For now, thank you for your time and I'll just conclude you're contemplating some ideas and I'll sit back, hope, and see what happens. Wink
Find all posts by this user
Quote this message in a reply
11-06-2016, 16:02 (This post was last modified: 11-06-2016 16:03 by simoncn.)
Post: #15
RE: ReplayGain
(11-06-2016 11:18)Pepsican Wrote:  I guess whether you'd use album gain for levelling or track gain, depends very much on your purpose. For listening to albums I would, like you, apply album gain. You'd want to preserve the output level differences because they probably are as the artist intended. But when building random playlists, that idea is no longer valid. Applying album gain in such a case could still leave you having to dial up or down the volume, especially when your selection of tracks is a bit eclectic and varies from 1980s releases to those of the current century.

Even with playlists, I think album gain would produce a better result than track gain. Album gain is the average of the album, so this will be higher for a track from a 1980s album that was recorded at a lower level.

Quote:And in my view that case occurs when I start building playlists of various artists from CDs of various recording qualities. Something I personally do a lot. Think of playlists for parties or fitness.

The recording quality aspect would be handled by using album gain. Equalizing levels for a party/fitness playlist might be a use case for track gain.

Quote:That said, I guess (without understanding the structure and architecture of your software properly) that if a ReplayGain implementation makes it to MinimServer / MinimStreamer, a property to set which of the two you want to use is probably one of the less problematic things to programme compared to the rest (0 = off, 1 = trackgain, 2= album gain).

I can imagine other combinations that users would want, such as using album gain if available and falling back to track gain if album gain isn't available. Also, some users might want peak level factored into the calculation.

Quote:For now, thank you for your time and I'll just conclude you're contemplating some ideas and I'll sit back, hope, and see what happens. Wink

Thanks for your time and input. You're right that I'm currently at the contemplating stage. This is on the list of possible future enhancements, which is quite a long list. Smile
Find all posts by this user
Quote this message in a reply
11-06-2016, 16:39
Post: #16
RE: ReplayGain
(11-06-2016 16:02)simoncn Wrote:  I can imagine other combinations that users would want, such as using album gain if available and falling back to track gain if album gain isn't available. Also, some users might want peak level factored into the calculation.

I wasn't going to mention it but we now see something called SmartGain. An algorythm that predicts which of the two tags to take and/or take some average of the two values. scope creep anyone?Angel
Find all posts by this user
Quote this message in a reply
12-06-2016, 05:01
Post: #17
RE: ReplayGain
(11-06-2016 16:02)simoncn Wrote:  Thanks for your time and input. You're right that I'm currently at the contemplating stage. This is on the list of possible future enhancements, which is quite a long list. Smile

My $0.02? MinimServer as is stands today is very complete, flexible and clearly the leading UPnP/DLNA media server to music.

If you really want to take things to the next level, you should partner with bubbleguuum and define a DLNA 2.X and go beyond the specification.

No one else will do it and the leading server and control point app authors should be able to lead the way and just do whatever they feel is next-gen.

Please do it... we will all happily follow and micro-fund via payments for next versions.
Find all posts by this user
Quote this message in a reply
12-06-2016, 06:43 (This post was last modified: 12-06-2016 06:46 by Pepsican.)
Post: #18
RE: ReplayGain
Edit: incorrect post.
Find all posts by this user
Quote this message in a reply
12-06-2016, 10:13 (This post was last modified: 12-06-2016 10:14 by Dieter Stockert.)
Post: #19
RE: ReplayGain
(12-06-2016 05:01)krutsch Wrote:  MinimServer as is stands today is very complete, flexible [...]. If you really want to take things to the next level [...]

MinimServer is very flexible. But the next level for me would be to make it easier to adjust. Right now the user interface may be alright for those who like command lines but not for the other folks who are used to make mouse clicks on drop down menues. But that would be a lot of work for Simon (maybe 10 lines of code for the pure functionality need 100 lines of code for a really good user interface).
Find all posts by this user
Quote this message in a reply
12-06-2016, 23:45 (This post was last modified: 13-06-2016 19:10 by Servatius.)
Post: #20
RE: ReplayGain
It might be interesting to see what foobar2000 is doing. Its ReplayGain scanner creates tags REPLAYGAIN_ALBUM_GAIN, REPLAYGAIN_ALBUM_PEAK,
REPLAYGAIN_TRACK_GAIN, REPLAYGAIN_TRACK_PEAK.

The foobar2000 playback settings for ReplayGain are:
  • Source mode: none / track / album / by playback order
  • Processing: none / apply gain / apply gain and prevent clipping according to peak / prevent clipping according to peak
  • Preamp with RG info: -20.0 dB ... +20.0 dB (default: 0.0 dB)
  • Preamp without RG info: -20.0 dB ... +20.0 dB (default: 0.0 dB)

Source mode tells which gain values are applied. "By playback order" allows for a party mode without having to change the settings. When playing normally or in Shuffle (Album) mode, it uses album gain. When playing in Shuffle (Track) mode, it uses track gain (that would be the party mode). I am not sure whether such an automatic selection would be possible with MinimServer as it would require the control point to tell the server its play mode.

Preamp without RG info can be used to select a default loudness for albums/tracks not having ReplayGain info. I don't think this needs to be supported, because a user wanting to use ReplayGain could easily tag all his audio files with RG info (in foobar2000, select the media root directory and use ReplayGain -> Scan selection as albums (by tags)).

However, the Processing settings to apply gain and prevent clipping and the Preamp with RG info setting should be considered to be supported since only a small preamp value gives some headroom for audio files that require to increase the loudness according to the _GAIN values but still have a high _PEAK value that could cause clipping then.

More technical information and links are on the Hydrogenaudio ReplayGain page.

For me as a listener of classical music it is not an issue to adjust the loudness once when I start listening to a long musical work with multiple movements. The variance in album gain values is not so big either. But pop music suffered from extreme compression due to the loudness war in the last two decades so that a collector of pop music may have quieter CDs from the 80s and much louder CDs bought more recently. It must be very annoying to change loudness all the time. For them, honouring ReplayGain in the transcoding process would be an important feature.

As the average loudness for radio station is being regulated in many states now (see this article), the loudness war might stop and we might see again pop music CDs with lower loudness and wider dynamic range in future. However, as this article mentions, sound engineers might still be enforced to produce different masters for loudness-normalised destinations (radio stations) and what the music industry considers peak-normalized destinations (CDs). The more loudness-normalised playback systems exist, the more reason the music industry will see to produce uncompressed material in future. So support for ReplayGain could help pop music listeners to get better audio quality.

Simon, in case you decide to support this, I would have a question about effects of the ReplayGain processing on the sound quality: would it be possible to do the signal processing in high resolution (24 bit), at least when choosing a hires output format? And what about a DSD stream? Could they be processed without transcoding to PCM?

Because there are still radio stations available with a higher loudness level, I would also suggest to consider a possibility to specify a ReplayGain value for an internet stream, e.g. in the #EXTINF description of the playlist entry in an .m3u/.m3u8 file.
Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)