Alternative auto-gain controls

Posted by: Globbits

Alternative auto-gain controls - 27/07/2004 06:01

Hi all

I've got a Mk2 Empeg, with Hijack kernel. Very VERY pleased with the unit, but am not fond of the various different volume levels of each of my mp3's!

I've had a play with the automatic volume control and I have to say it's very good. But, being a SQ nut, the fact that it auto-gain controls as it goes along means that the gain isn't constant throughout a track. Not acceptable I'm afraid

So, I've found mp3gain - a nice little utility which puts gain information into the id3 tag. Winamp seems to happily read this gain control and adjust accordingly. But, before I completely replace all the 45GB of files on my Empeg:

1) Does the Empeg support this sort of gain information?
2) If not, is there any way I can get this to work, without relying on Hijack's AGC....?

Thanks in advance

Richard
Posted by: peter

Re: Alternative auto-gain controls - 27/07/2004 07:36

Quote:
So, I've found mp3gain - a nice little utility which puts gain information into the id3 tag. Winamp seems to happily read this gain control and adjust accordingly.

The mp3gain program alters the MP3 file's audio data itself, so the results are audible in any MP3 decoder, including that in the car-player.

Peter
Posted by: Globbits

Re: Alternative auto-gain controls - 27/07/2004 09:01

Hi Peter

Fortunately, that's not how it works. The audio is left alone, and merely a gain control updated in the id3 tag. That's why it's such a better option, as the original audio isn't affected

Just want to find out if the Empeg will support its use
Posted by: sn00p

Re: Alternative auto-gain controls - 27/07/2004 09:16

That's not what the program implies, the program implies that it is changing the mp3 data, it stores the analysis & "undo" information in the tags.

Adrian
Posted by: Globbits

Re: Alternative auto-gain controls - 27/07/2004 09:28

Quote:
From the mp3gain FAQ
Does normalizing the mp3 degrade its quality?
No. MP3Gain does not decode and re-encode the mp3 to change its volume. You can change the volume as many times as you want, and the mp3 will sound just as good (or just as bad!) as it did before you started.


Honest - it doesn't. I've converted my mp3's and the ID3 tag is the only bit that's changed....
Not only that, but if I play the music using iTunes, the volume level hasn't changed - that's why I'm asking the question
Posted by: peter

Re: Alternative auto-gain controls - 27/07/2004 10:26

Quote:
Fortunately, that's not how it works. The audio is left alone, and merely a gain control updated in the id3 tag. That's why it's such a better option, as the original audio isn't affected

Each MP3 audio frame has in its header a gain value which the decoder applies to the frame. The program goes through the file changing all these gain values (while leaving the rest of each frame alone -- that's what the FAQ answer is trying to say). I don't know why you don't perceive a difference in Itunes (perhaps it's using the tag data to undo the normalisation in favour of its own), but you certainly will on the car-player.

Peter
Posted by: Globbits

Re: Alternative auto-gain controls - 27/07/2004 10:27

Ah ok - now that answer I like
Thanks - technical explanations are always welcome
Will update my Empeg tonight, and tomorrow, and the day after........
Posted by: wfaulk

Re: Alternative auto-gain controls - 05/08/2004 18:16

I think that this is untrue. According to the MP3 frame header "spec" on id3.org, MP3 frames seem to have the following fields in their headers:
  • Sync
  • mpeg-1/mpeg-2
  • Layer (mp2/mp3)
  • Checksum existence flag
  • Bitrate
  • Frequency
  • Padding byte existence flag
  • Private bit (?)
  • Stereo/Mono Mode
  • Mode extension (?)
  • Copyright bit
  • Original media bit
  • Emphasis
  • Optional checksum
None of these fields seems to be for volume change. Looking at the mp3gain source, it looks like it slaps the gain info in the Xing/Lame Info header/tag.

That being said, is the car player responding to mp3gain changes? How about the replaygain-suggested RGAD ID3v2 frame, if it were set?
Posted by: tfabris

Re: Alternative auto-gain controls - 05/08/2004 18:27

Despite what that spec said, each MP3 frame *does* in fact have relative volume level information stored as part of it. Programs like MP3Trim and others *do* take advantage of this information.

I think the reason you didn't see it on that web page is because the information is not stored in the header. It's part of the actual data of the MP3 frame. It's still adjustable by a third-party program without needing to re-encode the frame, but it's not part of the header. Not certain about that, but I think that's the case.
Posted by: wfaulk

Re: Alternative auto-gain controls - 05/08/2004 18:33

Yeah, upon further investigation, I think that you're right.

Annoying. It'd be much better if it'd just write a tag and players would respond to that tag. Even better, it uses APEv2 tags to store its analysis and undo information instead of the probably already existant ID3v2 tag, just to add to the bloat a little bit more.

Still, it definitely modifies the Xing/Info tag, too. Maybe that's just metametadata.
Posted by: tfabris

Re: Alternative auto-gain controls - 05/08/2004 18:52

What I don't understand is what does a program like MP3gain do in this case, where the classical recording has a couple of really huge peaks. If it increases the gain on all of the MP3 frames, those peaks will clip.

Or does it simply decrease the gain on everything else in your collection by a huge amount?

Either way it's an inelegant solution.
Posted by: wfaulk

Re: Alternative auto-gain controls - 05/08/2004 19:01

It decreases the gain on everything else. The designer then suggests that you may need a "pre-amp" gain to push things back up. He's also considered clipping scenarios.

I'd like to hear how it could be better, honestly, other than by opening a can of whoopass on all the producers and engineers who've decided that we'd prefer our music to be louder at the expense of dynamic range.
Posted by: tfabris

Re: Alternative auto-gain controls - 05/08/2004 19:06

Quote:
It decreases the gain on everything else.

Meaning that when you hit that classical song in your collection, those peaks drive your amp to its limit and blow your speakers rather than just clipping digitally.

Quote:
I'd like to hear how it could be better, honestly, other than by opening a can of whoopass on all the producers and engineers who've decided that we'd prefer our music to be louder at the expense of dynamic range.

I agree. The only other solution is additional dynamic range compression above and beyond what's already been applied to the music. Which comes with its own set of problems of course.
Posted by: wfaulk

Re: Alternative auto-gain controls - 05/08/2004 19:08

Also read this and this and this (repeat).
Posted by: tfabris

Re: Alternative auto-gain controls - 05/08/2004 19:15

Heh, I love his pop/classical comparison, it looks almost exactly like mine.

He makes a good point about turning down the loud tracks. i.e., that most of their energy is already "up there" and that turning them down won't lose much quality.
Posted by: wfaulk

Re: Alternative auto-gain controls - 05/08/2004 19:22

The other option is to use dynamic range expansion on the compressed tracks. I bet you'd start to really hear the terrible compression artifacts, though.

Of course, the potentially better solutions are all both CPU-intensive and storage-intensive. The big advantage to replaygain is that it's CPU-intensive, but that can be done beforehand because it stores its data in 4 bytes per track (8 if you use per-track and per-album data).
Posted by: Globbits

Re: Alternative auto-gain controls - 06/08/2004 05:58

Just to chuck a very large spanner in the works, I've finished re-uploading my music with mp3gain's amended frame-volumes, and it's had absolutely no effect on the volume from the empeg!

Since I'd just installed emphatic 2.0 on the empeg, I did wonder whether it was that. So, I've now installed the latest hijack, but still no joy

Any ideas?
Posted by: wfaulk

Re: Alternative auto-gain controls - 06/08/2004 12:42

That would be 100% in the player, currently.

However....

Is there a gain on the DSP that Hijack could tweak? It's feasible that we could write a tool to do real replaygain stuff (not munge the data like mp3gain is doing) and have Hijack read that data and adjust the gain based on it. This would be largely equivalent to the proposed method preferred by the author of replaygain.
Posted by: tfabris

Re: Alternative auto-gain controls - 06/08/2004 13:49

Quote:
I've finished re-uploading my music with mp3gain's amended frame-volumes, and it's had absolutely no effect on the volume from the empeg!

Does MP3Gain have an option to either just *tag* the files with an offset number, or actually *apply* the gain changes to the MP3s audio data? If such an option exists, and you chose the former, then that would be expected behavior.
Posted by: Globbits

Re: Alternative auto-gain controls - 06/08/2004 18:21

Hmm - not sure how to answer that.
As I understand it, mp3gain stores a "marker" in the id3v2 tag, to say what the overall gain level is. When you apply changes, it then applies a general multiplier to each frame, to affect the gain. (Hope that makes sense?!)
So, to answer your question, it does both - but the key is that it (allegedly - I have my doubts) does affect the audio data

By the way, sorry for the slow responses - the notification messages are being filtered as Spam by hotmail
Posted by: wfaulk

Re: Alternative auto-gain controls - 06/08/2004 19:00

mp3tag stores audio analysis and undo information in tags (though it uses APEv2 instead of ID3v2, just to be annoying). It also stores replaingain information in the Xing header or LAME Info header (which are virtually the same thing). It also seems to modify each mp3 frame to change its gain setting.

It seems that the latter part of that ought to affect playback on the player. I don't know why it wouldn't, really. Perhaps the tracks you chose were already close to the ideal that mp3gain tries to match. Perhaps the player somehow undid itself by reading both the gain info in the frames and in the tags (this seems highly unlikely).

See if you can find some real quiet track and a real loud track and mp3gain them and play them on the player. Let us know if they seem closer in volume or not.
Posted by: Globbits

Re: Alternative auto-gain controls - 06/08/2004 19:22

I have done, I'm afraid. Got a very eclectic selection on the empeg, with widely-varying volume levels. No difference I could tell - basically, I still have to change the volume by up to 10dB to get them to the same listening levels
Posted by: wfaulk

Re: Alternative auto-gain controls - 06/08/2004 19:39

Nuts. I'll have to do some experiments when I have time.