PDA

View Full Version : Replay Gain in next nightly/firmware 22



vidurapparao
2005-09-15, 17:25
Latest svn and the next nightly build (along with Squeezebox2 firmware
22) implements volume normalization/Replay Gain for various audio and
tag formats - ogg, FLAC, MP3Gain (APETAGEX), AACGain, RVAD (MP3 via
iTunes) and RVA2.

There is now a Replay Gain setting under the Player Settings > Audio
section of the web interface. This setting can take the following values:
1) Disable Replay Gain
2) Use Track Gain (if present) - uses only track gain information.
3) Use Album Gain (if present) - uses only album gain information.
4) "Smart" gain selection - uses ideas and code from James Sutula's
Dynamic Transition Updater/Smart Gain plugin to dynamically choose
between track and album gain. The idea is that album gain is used if
successive tracks are from the same album and in track order, track gain
is used otherwise.

The last is the default value of the setting. Please give this a try,
post feedback and file bugs if you see any. I'm open to alternate ideas
for the setting choices and default.

Thanks to Dan Sully for tag parsing/database work and James Sutula for
his plugin.

--Vidur

mrfantasy
2005-09-15, 18:54
Is ReplayGain being applied on the player itself or is the file being transcoded (say, flac->flac) on the server with the ReplayGain info applied?

vidurapparao
2005-09-15, 22:37
mrfantasy wrote:

>Is ReplayGain being applied on the player itself or is the file being
>transcoded (say, flac->flac) on the server with the ReplayGain info
>applied?
>
>
It's being applied on the player. As I mentioned, we now support
multiple ReplayGain tag formats, so this is not just FLAC specific.

Aylwin
2005-09-15, 23:34
Nice!!! Well done!

mrfantasy
2005-09-16, 04:55
It's now time for me to start playing with the nightlies, I guess. . .


mrfantasy wrote:

>Is ReplayGain being applied on the player itself or is the file being
>transcoded (say, flac->flac) on the server with the ReplayGain info
>applied?
>
>
It's being applied on the player. As I mentioned, we now support
multiple ReplayGain tag formats, so this is not just FLAC specific.

abdomen
2005-09-16, 06:32
I have not tried it yet, but I sure do appreciate this work. To everyone who had a hand in implementing this: Thank you!!

dean
2005-09-16, 07:29
One other issue that was fixed in conjunction with replaygain was
that the volume curve for Squeezebox2 was made smoother, with more
resolution in the low end. The maximum output level is the same.

This means that after the update you may find that your loudness is
lower for your current volume setting. Crank it up.

Feedback welcome on this new curve.

-dean

On Sep 15, 2005, at 5:25 PM, Vidur Apparao wrote:

>
> Latest svn and the next nightly build (along with Squeezebox2
> firmware 22) implements volume normalization/Replay Gain for
> various audio and tag formats - ogg, FLAC, MP3Gain (APETAGEX),
> AACGain, RVAD (MP3 via iTunes) and RVA2.
>
> There is now a Replay Gain setting under the Player Settings >
> Audio section of the web interface. This setting can take the
> following values:
> 1) Disable Replay Gain
> 2) Use Track Gain (if present) - uses only track gain information.
> 3) Use Album Gain (if present) - uses only album gain information.
> 4) "Smart" gain selection - uses ideas and code from James Sutula's
> Dynamic Transition Updater/Smart Gain plugin to dynamically choose
> between track and album gain. The idea is that album gain is used
> if successive tracks are from the same album and in track order,
> track gain is used otherwise.
>
> The last is the default value of the setting. Please give this a
> try, post feedback and file bugs if you see any. I'm open to
> alternate ideas for the setting choices and default.
>
> Thanks to Dan Sully for tag parsing/database work and James Sutula
> for his plugin.
>
> --Vidur
>

Dan Sully
2005-09-16, 10:30
* Vidur Apparao shaped the electrons to say...

>Latest svn and the next nightly build (along with Squeezebox2 firmware
>22) implements volume normalization/Replay Gain for various audio and
>tag formats - ogg, FLAC, MP3Gain (APETAGEX), AACGain, RVAD (MP3 via
>iTunes) and RVA2.

FYI - RVAD isn't working quite yet. I've just checked in a change to disable
it. However, if you have files with those tags, you'll want to wipe & rescan
your database.

Sorry about the trouble.

-D
--
<noah> the auto mechanic told me there was something wrong with my rear differential.
I told him I never took calculus.

max.spicer
2005-09-16, 14:35
Is the plan to put options for replaygain into the SqueezeBox's menus? It would be much easier to be able to easily select these settings from the arm chair. Then again, if it was possible to only have it turn on when the playlist is shuffled, I would probably never need to touch the settings. Is this a possibility, or is there a blocker somewhere?

I'm currently adding replaygain tags to all my flac files so will hopefully be able to some testing of this great new feature over the weekend. Thanks for all the work in adding it.

Max


Latest svn and the next nightly build (along with Squeezebox2 firmware
22) implements volume normalization/Replay Gain for various audio and
tag formats - ogg, FLAC, MP3Gain (APETAGEX), AACGain, RVAD (MP3 via
iTunes) and RVA2.

There is now a Replay Gain setting under the Player Settings > Audio
section of the web interface. This setting can take the following values:
1) Disable Replay Gain
2) Use Track Gain (if present) - uses only track gain information.
3) Use Album Gain (if present) - uses only album gain information.
4) "Smart" gain selection - uses ideas and code from James Sutula's
Dynamic Transition Updater/Smart Gain plugin to dynamically choose
between track and album gain. The idea is that album gain is used if
successive tracks are from the same album and in track order, track gain
is used otherwise.

The last is the default value of the setting. Please give this a try,
post feedback and file bugs if you see any. I'm open to alternate ideas
for the setting choices and default.

Thanks to Dan Sully for tag parsing/database work and James Sutula for
his plugin.

--Vidur

davep
2005-09-16, 17:46
Can anybody clarify where the volume adjustment is done? If I am running digital outs to an external DAC, with the SB2 player option set to fix the digital output volume, then will Replay Gain still do what it is supposed to?

(In case it matters, all files are flac, streamed as flac.)

davep

dean
2005-09-16, 17:53
On Sep 16, 2005, at 5:46 PM, davep wrote:

>
> Can anybody clarify where the volume adjustment is done? If I am
> running digital outs to an external DAC, with the SB2 player option
> set
> to fix the digital output volume, then will Replay Gain still do
> what it
> is supposed to?
Yes.

There are now three gain controls in Squeezebox2:

1. At the output of the decoder, this is used to adjust the levels
for replaygain and crossfading.

2. Before the DAC, which is adjusted when you change the volume
control. When you turn on fixed digital volume, this control has no
effect on the digital output.

3. Inside the DAC converter, which is the Preamp Volume control.

davep
2005-09-16, 18:00
Thanks, Dean.

Can I add my vote to the request to allow Replay Gain to be turned off and on at the SB itself via the remote control. I'll probably want to leave it in Smart mode most of the time but would like to be able to disable it completely for the occasional "purist" listening sessions and not have to go to the server to do this.

davep

dean
2005-09-16, 19:48
Ok, it's in there for tonight's nightly.

On Sep 16, 2005, at 6:00 PM, davep wrote:

>
> Thanks, Dean.
>
> Can I add my vote to the request to allow Replay Gain to be turned off
> and on at the SB itself via the remote control. I'll probably want to
> leave it in Smart mode most of the time but would like to be able to
> disable it completely for the occasional "purist" listening sessions
> and not have to go to the server to do this.
>
> davep
>
>
> --
> davep
>

max.spicer
2005-09-17, 02:02
You're a nice chap, Dean. I hope people have told you that often!

Max


Ok, it's in there for tonight's nightly.

On Sep 16, 2005, at 6:00 PM, davep wrote:

>
> Thanks, Dean.
>
> Can I add my vote to the request to allow Replay Gain to be turned off
> and on at the SB itself via the remote control. I'll probably want to
> leave it in Smart mode most of the time but would like to be able to
> disable it completely for the occasional "purist" listening sessions
> and not have to go to the server to do this.
>
> davep
>
>
> --
> davep
>

max.spicer
2005-09-17, 02:13
Can I suggest that ReplayGain be called something other than ReplayGain in the server and SB2 gui? ReplayGain is a less than obvious term for what it does so could end up confusing the less savvy users. Something like Volume Correction or Automatic Volume Adjustment would be a lot better.

*lol* I've just updated to the latest build and found that it is indeed called Volume Adjustment. I'll get my coat...

Max

max.spicer
2005-09-17, 02:14
In Settings->Volume Adjustment, "Smart" gain selection should be "Smart" Gain Selection to have consistent case with the other options.

Max


Can I suggest that ReplayGain be called something other than ReplayGain in the server and SB2 gui? ReplayGain is a less than obvious term for what it does so could end up confusing the less savvy users. Something like Volume Correction or Automatic Volume Adjustment would be a lot better.

*lol* I've just updated to the latest build and found that it is indeed called Volume Adjustment. I'll get my coat...

Max

abdomen
2005-09-17, 05:29
On Sep 16, 2005, at 5:46 PM, davep wrote:
There are now three gain controls in Squeezebox2:

1. At the output of the decoder, this is used to adjust the levels
for replaygain and crossfading.

2. Before the DAC, which is adjusted when you change the volume
control. When you turn on fixed digital volume, this control has no
effect on the digital output.

3. Inside the DAC converter, which is the Preamp Volume control.

Sorry if these questions are dense, but which of those gain controls is used for the analog RCA outputs when the volume buttons are pressed? And can using the volume buttons result in a loss of precision when listening through the RCA outputs? Thanks in advance for the help.

dean
2005-09-17, 07:32
On Sep 17, 2005, at 5:29 AM, abdomen wrote:

>
> dean Wrote:
>
>> On Sep 16, 2005, at 5:46 PM, davep wrote:
>> There are now three gain controls in Squeezebox2:
>>
>> 1. At the output of the decoder, this is used to adjust the levels
>> for replaygain and crossfading.
>>
>> 2. Before the DAC, which is adjusted when you change the volume
>> control. When you turn on fixed digital volume, this control has no
>> effect on the digital output.
>>
>> 3. Inside the DAC converter, which is the Preamp Volume control.
>>
>
> Sorry if these questions are dense, but which of those gain
> controls is
> used for the analog RCA outputs when the volume buttons are pressed?
#2. "volume control" = volume buttons and volume links in the web
interface.

> And
> can using the volume buttons result in a loss of precision when
> listening through the RCA outputs?
No. The precision is the same, 24 bits.

abdomen
2005-09-18, 18:04
Thanks for the answers, Dean!

NigelMSB
2005-09-19, 09:44
Just tried r4356 v6.2 beta and Replay Gain works great. I can now fast forward and reverse again (redundant transcoding removed). This along with the multiple artists in comments makes a great upgrade to SB2. Thanks to Slim and anyone else that's helped with v6.2 - it is appreciated.

I’ve noticed some things, though:

1. Replay Gain with Softsqueeze. This doesn’t appear to work but I seem to remember reading (can’t find the thread) that this is a known issue that requires SS to be updated.

2. Using Exbrowse2, the links from a track information page don't work. "Artist", "Album" & "Genre" show as links but when you click on them you get a script error. Clicking on the "Artist" link gives:

Line: 37
Char: 1
Error: Object expected
Code: 0
URL: http://localhost:9000/ExBrowse2/songinfo.html?item=8118&player=<MAC address here>

Also on the track information page, the link to the file doesn't download the file - it launches another track information page within the same frame. I guess if Exbrowse2 is being replaced with Exbrowse3 this won’t matter. Oh yes, this was with IE6 on WinXP SP2 and Opera 8 on WinXP SP2. The default skin works fine but Exbrowse3 is broken too. Clearing the database and browser cache doesn’t fix it.

3. I’d previously used MP3Gain to analyse and apply gain to the both the data and metadata (APE tags). Looking at the SlimServer web interface, the gain for each MP3 was less than 1.5 dB – much less that the -7 – -10 dB modern music needs to lower the level down to -89 dB. It took me a while to realise that when MP3Gain is used, even through the resolution of the data adjustment is -+ 1.5 dB, MP3Gain still adds a track and album gain metadata to correct this coarse -+ 1.5 dB adjustment to the exact gain – hence the small RG values. I’ve now undone the data adjustment using MP3Gain, leaving the APE tags for SlimServer to read. Both ways works fine - I just preferred to have the MP3s back to their original state.

4. I don’t know if Slimserver can handle this but I think Foobar uses TXXX ID3v2 tags when writing RG information, when it’s configured not to write APE tags. If it can write APE tags, it will. I don’t use Foobar to Replay Gain MP3s (but do for FLACs but that’s another matter) but I didn’t see anything on the checkins list to suggest that TXXX tags were supported (does anyone use them for RG?), so I thought I'd mention it.

Dan Sully
2005-09-19, 10:31
* NigelMSB shaped the electrons to say...

>1. Replay Gain with Softsqueeze. This doesn’t appear to work but
>I seem to remember reading (can’t find the thread) that this is a
>known issue that requires SS to be updated.

That is correct - Richard will need to update SoftSqueeze.

>2. Using Exbrowse2, the links from a track information page don't work.
>"Artist", "Album" & "Genre" show as links but when you click on them
>you get a script error. Clicking on the "Artist" link gives:

ExBrowse2 has just been deprecated in place of ExBrowse3

>4. I don’t know if Slimserver can handle this but I think Foobar
>uses TXXX ID3v2 tags when writing RG information, when it’s
>configured not to write APE tags. If it can write APE tags, it will.
>I don’t use Foobar to Replay Gain MP3s (but do for FLACs but
>that’s another matter) but I didn’t see anything on the
>checkins list to suggest that TXXX tags were supported (does anyone use
>them for RG?), so I thought I'd mention it.

Could you send me a file with RG in the TXXX tags? When testing with FB2k, I
found it only wrote out APE tags for MP3s.

Thanks!

-D
--
"A good messenger expects to get shot." --Larry Wall

Robin Bowes
2005-09-19, 11:54
Dan Sully said the following on 19/09/2005 18:31:
> * NigelMSB shaped the electrons to say...
>
>> 4. I don’t know if Slimserver can handle this but I think Foobar
>> uses TXXX ID3v2 tags when writing RG information, when it’s
>> configured not to write APE tags. If it can write APE tags, it will.
>> I don’t use Foobar to Replay Gain MP3s (but do for FLACs but
>> that’s another matter) but I didn’t see anything on the
>> checkins list to suggest that TXXX tags were supported (does anyone use
>> them for RG?), so I thought I'd mention it.
>
>
> Could you send me a file with RG in the TXXX tags? When testing with
> FB2k, I found it only wrote out APE tags for MP3s.

I'd be interested in that too. I'd like to add ReplayGain support to
flac2mp3.

Thanks,

R.
--
http://robinbowes.com

If a man speaks in a forest,
and his wife's not there,
is he still wrong?

dip
2005-09-19, 14:50
I just recognized that for my Ogg Vorbis files on the song info page a replaygain value is shown (it seems to be the track gain vlue not the album gain value). For all my mp3 files, however, no replaygain value is shown at all although track and album gain values are set.
Is that behavior correct?

And why is only the track gain value but not the album gain value shown for ogg vorbis files?

NigelMSB
2005-09-20, 02:25
Dan - I've sent you the three files produced below by email (too big for the forum).

Here’s the steps used to produce them.

1. Started with FLAC.flac with Vorbis comments (and Replay Gain information from Foobar2000).

2. Removed Replay Gain information from FLAC file using Foobar2000.

3. Converted to MP3 using LAME command line encoder within Foobar2000.

4. Removed all TXXX tags using MP3 Tag Studio (Foorbar2000 converted various Vorbis comments to these - like ENSEMBLE, PERFORMER, etc.).

5. Saved two identical copies - ID3v2.mp3 and APE.mp3.

6. Output from Tag.exe (http://www.neilpopham.pwp.blueyonder.co.uk/tag.html).

FLAC.flac:

Format: FLAC
Details: 44100 Hz Stereo, 349 kbps, playtime 00:15
Tag: FLAC
Title: St. John Passion
Artist: John Eliot Gardiner
Album: St. John Passion
Year: 1986
Track: 8
Genre: Classical
Comment: EAC (secure mode) + FLAC v1.1.1 -8
PART=Part I. Simon Petrus Aber Folgete Jesu Nach
PARTNUMBER=8
DISCNUMBER=1
SOURCEMEDIA=CD-R
COMPOSER=Johann Sebastian Bach
OPUS=BVW 245
CONDUCTOR=John Eliot Gardiner
ENSEMBLE=English Baroque Soloists
ENSEMBLE=Monteverdi Choir
LABEL=Archiv Produktion
PERFORMER=Anthony Rolfe Johnson (tenor))
PERFORMER=Stephen Varcoe (bass-baritone)
PERFORMER=Nancy Argenta (soprano)
PERFORMER=Ruth Holton (soprano)
PERFORMER=Michael Chance (counter-tenor)
PERFORMER=Neill Archer (tenor)
PERFORMER=Rufus Müller (tenor)
PERFORMER=Cornelius Hauptmann (bass)

ID3v2.mp3 and APE.mp3:

Format: MPEG 1 Layer 3, Joint Stereo
Details: 44100 Hz Stereo, 168 kbps, playtime 00:15
Tags: ID3v1, ID3v2
Title: St. John Passion
Artist: John Eliot Gardiner
Album: St. John Passion
Year: 1986
Track: 8
Genre: Classical
Comment: EAC (secure mode) + FLAC v1.1.1 -8
Composer=Johann Sebastian Bach
Conductor=John Eliot Gardiner

7. Set "Foobar2000 > Preferences > Playback > Input > Standard Inputs > MP3 tag writing > Tag type to write" to "ID3v2 and ID3v1".

8. Load ID3v2.mp3 and Replay Gain as album.

9. Tag.exe output for ID3v2.mp3:

Format: MPEG 1 Layer 3, Joint Stereo
Details: 44100 Hz Stereo, 168 kbps, playtime 00:15
Tags: ID3v1, ID3v2
Title: St. John Passion
Artist: John Eliot Gardiner
Album: St. John Passion
Year: 1986
Track: 8
Genre: Classical
Comment: EAC (secure mode) + FLAC v1.1.1 -8
Composer=Johann Sebastian Bach
Conductor=John Eliot Gardiner
replaygain_track_gain=+16.87 dB
replaygain_track_peak=0.113414
replaygain_album_gain=+16.87 dB
replaygain_album_peak=0.113414

10. Set "Foobar2000 > Preferences > Playback > Input > Standard Inputs > MP3 tag writing > Tag type to write" to "APEv2 and ID3v1".

11. Load APE.mp3 and Replay Gain as album.

12. Tag.exe output for APE.mp3:

Format: MPEG 1 Layer 3, Joint Stereo
Details: 44100 Hz Stereo, 168 kbps, playtime 00:15
Tags: ID3v1, APE v2.0
Title: St. John Passion
Artist: John Eliot Gardiner
Album: St. John Passion
Year: 1986
Track: 8
Genre: Classical
Comment: EAC (secure mode) + FLAC v1.1.1 -8
Composer=Johann Sebastian Bach
Conductor=John Eliot Gardiner
replaygain_track_gain=+16.87 dB
replaygain_track_peak=0.113414
replaygain_album_gain=+16.87 dB
replaygain_album_peak=0.113414

It looks (to me) like the ID3v2.mp3 has Replay Gain information stored in TXXX tags.