IPB

Welcome Guest ( Log In | Register )

2 Pages V   1 2 >  
Reply to this topicStart new topic
mp3Gain not always able to undo TrackGain, broken CRC's
Jojo
post Apr 15 2005, 20:52
Post #1





Group: Members
Posts: 1361
Joined: 25-November 02
Member No.: 3873



It seems that mp3Gain sometimes doesn't perfectly undo the applied volume change. I noticed that the Music CRC of some files doesn't match anymore even though I used the 'undo' feature. I'm not sure yet why it happens, because not every file is affected. I was able to reproduce this several times using the same file - always starting off with a fresh copy of it with matching CRC's...

It's also interesting that the same file was gained to 90,6dB and later to 90,5dB.

Any ideas?

Edit: I'm talking about LAME mp3's and the Music-CRC that is stored inside the LAME-Header...

This post has been edited by Jojo: Apr 15 2005, 23:17


--------------------
--alt-presets are there for a reason! These other switches DO NOT work better than it, trust me on this.
LAME + Joint Stereo doesn't destroy 'Stereo'
Go to the top of the page
+Quote Post
timcupery
post Apr 15 2005, 21:43
Post #2





Group: Members
Posts: 780
Joined: 19-December 01
From: Tar Heel country
Member No.: 683



If you're just getting the file CRC, it will be different after change+undo because mp3gain writes info to files using APE tags. If you change the file's gain, then undo it, and then "remove tags from files", then the file's CRC should be exactly the same as before touching it with mp3gain.
In cases where APE tags were already written to the file when you first got the CRC, then made gain change and then undid the gain change, the CRC should not change.
The point here being that the info in a tag, as well as the audio data, affects the file CRC.
Does "music CRC" refer to a checksum based only on music data that should be unaffected by the tag?

One other way to test this is by converting the mp3 to wav (using foobar2000 set on no dither) before and after changing using mp3gain. The wav output files should be identical.

I wouldn't worry about the 90.6 vs. 90.5, etc. This happens when a file's gain info is estimated on the border (so the actual value would be 90.5498 or something like that, in between 90.5 and 90.6).

Edit: it's also possible that I misunderstand the problem and you're talking about something else, especially on the CRC point. I just figured that this is likely what's going on.

This post has been edited by timcupery: Apr 15 2005, 21:47


--------------------
God kills a kitten every time you encode with CBR 320
Go to the top of the page
+Quote Post
Jojo
post Apr 15 2005, 23:14
Post #3





Group: Members
Posts: 1361
Joined: 25-November 02
Member No.: 3873



QUOTE (timcupery @ Apr 15 2005, 12:43 PM)
Edit: it's also possible that I misunderstand the problem and you're talking about something else, especially on the CRC point. I just figured that this is likely what's going on.
*

thanks for your answer, but indeed, you misunderstood something smile.gif
I should have mentioned that, but for me mp3 = LAME mp3. Anyway, I was talking about the Music CRC that is stored inside the LAME-Header. It doesn't matter if you add/delete/alter ID3v1/ID3v2/APEv2 tags after the checksum has been written, it will still match, because the (Lame) CRC only depends on the music part...

I don't care if there's a little volume difference, I just want that the Music-CRC matches again after I reset the volume. This works in most cases, but sometimes it doesn't...I think to reproduce that on every file you'd have to change the volume to 50dB or something...but I have files were I changed the volume from 96dB to 91dB and the error still accured...


--------------------
--alt-presets are there for a reason! These other switches DO NOT work better than it, trust me on this.
LAME + Joint Stereo doesn't destroy 'Stereo'
Go to the top of the page
+Quote Post
westgroveg
post Apr 16 2005, 00:31
Post #4





Group: Members
Posts: 1235
Joined: 5-October 01
Member No.: 220



QUOTE
It's also interesting that the same file was gained to 90,6dB and later to 90,5dB.

MP3Gain can only make changes in 1.5db steps so i don't see how this could be possible.
Go to the top of the page
+Quote Post
timcupery
post Apr 16 2005, 17:11
Post #5





Group: Members
Posts: 780
Joined: 19-December 01
From: Tar Heel country
Member No.: 683



I still doubt that the actual music data is different after doing + undoing with mp3gain. To test this, as I noted above, you should use convert the file to wav (without dithering the output) before touching it with mp3gain, and then after undoing with mp3gain. I expect that the actual wav output will be exactly the same, whether Lame's music CRC has changed or not.

Btw: westgroveg - I answered about the 90.5 vs 90.6 above. I figure it means nothing.


--------------------
God kills a kitten every time you encode with CBR 320
Go to the top of the page
+Quote Post
Jojo
post Apr 16 2005, 23:53
Post #6





Group: Members
Posts: 1361
Joined: 25-November 02
Member No.: 3873



QUOTE (westgroveg @ Apr 15 2005, 03:31 PM)
QUOTE
It's also interesting that the same file was gained to 90,6dB and later to 90,5dB.

MP3Gain can only make changes in 1.5db steps so i don't see how this could be possible.
*


not really...sometimes a file goes from 90.5 to 91.1 and vice versa...must have something to do with the rounding...


--------------------
--alt-presets are there for a reason! These other switches DO NOT work better than it, trust me on this.
LAME + Joint Stereo doesn't destroy 'Stereo'
Go to the top of the page
+Quote Post
Jojo
post Apr 16 2005, 23:57
Post #7





Group: Members
Posts: 1361
Joined: 25-November 02
Member No.: 3873



QUOTE (timcupery @ Apr 16 2005, 08:11 AM)
I still doubt that the actual music data is different after doing + undoing with mp3gain. To test this, as I noted above, you should use convert the file to wav (without dithering the output) before touching it with mp3gain, and then after undoing with mp3gain. I expect that the actual wav output will be exactly the same, whether Lame's music CRC has changed or not.
*

ok, I'll do that...but anyway, the LAME-Tag CRC is not touched, no matter what you do to the file, because it's stored within the LAME-Tag...it simply doesn't match if you re-calculate the current CRC and compare it to the one stored in the LAME-Tag...and again, that's not the case for every file...there are just some rare exceptions...


--------------------
--alt-presets are there for a reason! These other switches DO NOT work better than it, trust me on this.
LAME + Joint Stereo doesn't destroy 'Stereo'
Go to the top of the page
+Quote Post
Jojo
post Apr 17 2005, 00:59
Post #8





Group: Members
Posts: 1361
Joined: 25-November 02
Member No.: 3873



ok, here is an update:

1) I decompressed the original mp3 to wav
2) I changed the volume -3dB
3) I used mp3Gain's undo feature (volume was reported the same as before I applied the gain)
4) I calculated the mp3's Music-CRC and compared it to the one stored in the mp3. They didn't match anymore
5) I recalculated the volume using mp3Gain (just to make sure that the undo was applied).
6) I decompressed the mp3 to wav
7) I calculated the md5 hash of both files and compared them. They weren't matching!

8) I did the same with some other mp3. The only difference was that the Music-CRC was matching again after I used the undo function and that the 2 resulting wav files had matching md5 and sha-1 checksums...


--------------------
--alt-presets are there for a reason! These other switches DO NOT work better than it, trust me on this.
LAME + Joint Stereo doesn't destroy 'Stereo'
Go to the top of the page
+Quote Post
timcupery
post Apr 17 2005, 13:01
Post #9





Group: Members
Posts: 780
Joined: 19-December 01
From: Tar Heel country
Member No.: 683



Okay, interesting. This is good to know... but I'm still not sure. Two worries, the second of which may be valid:
1) since you had other mp3's where the wav files were identical, I presume you're using a decoder that doesn't dither
2) I'd be interested for you to test the "before" and "after" wav files in the instance that the CRC is different, using ExactAudioCopy's "compare to wav files" function. This will tell you what and where the differences.
I'm interested to make sure what's going on here, as I use mp3gain a lot.
Thanks.


--------------------
God kills a kitten every time you encode with CBR 320
Go to the top of the page
+Quote Post
Snelg
post Apr 18 2005, 00:02
Post #10


MP3Gain Developer


Group: Developer
Posts: 207
Joined: 30-December 01
Member No.: 846



Can you send me a copy of the mp3 that's behaving strangely?
I'd like to figure out what's going on here, too.

-Glen
Go to the top of the page
+Quote Post
Jojo
post Apr 18 2005, 17:55
Post #11





Group: Members
Posts: 1361
Joined: 25-November 02
Member No.: 3873



File 1): 2 files, both copied from the same mp3. One song with matching CRC's, other song without matching CRC's, but both are at the same volume. I removed all tags from the files to verify this (using mp3Tag) + I analysed both files again using the re-calculate function mp3Gain offers. I went back to the original file I made the copy from (different hard drive and folder) and used the undo feature...all of a sudden the CRC's matched!

File 2): a re-calculating of the volume revealed that the volume stored by mp3gain was wrong. It's interesting that the 'original' file volume (the one the undo function refers to) was actualy the volume the file should have been adjusted to. So instead of applying -6dB, mp3Gain applied -12dB, but when came to write the mp3gain-tags it acted as if -6dB were applied only (like I requested it)

File 3): the undo-tag volume was set to 96dB, but should have been 97,5dB

File 4): couldn't figure out how to get the CRC's matching, but it was interesting to see that mp3Gain changed the volume to -15,1dB -> see screenshot.

File 5): I've no idea how to get that file to it's original CRC. However, I made 2 copies of it (same source) and I played around a bit and got them at the same volume but with different CRC's! I re-calculated the volume several times. Anyway, when I did an Album Analysis the volume of one of the 2 files was -0.1dB less than the other file. How's that possible?! That's probably the reason for the 2 different CRC's. Maybe the volume wasn't applied to every frame?


I've more files like that which I haven't investigated yet. But maybe you already have a clue what's going on. The file I was originally talking about is pretty big (> 100MB), so I'm not sure if you still want it. I should also mention that it sometimes works and sometimes doesn't. I was able to reproduce that at least 7 times. Every time I started off with a fresh copy and matching CRC's...

I hope this helps to find the bug smile.gif

thanks


--------------------
--alt-presets are there for a reason! These other switches DO NOT work better than it, trust me on this.
LAME + Joint Stereo doesn't destroy 'Stereo'
Go to the top of the page
+Quote Post
2Bdecided
post Apr 19 2005, 10:46
Post #12


ReplayGain developer


Group: Developer
Posts: 5061
Joined: 5-November 01
From: Yorkshire, UK
Member No.: 409



Is your machine overclocked?

Just a thought! Probably not, but worth checking...

Cheers,
David.
Go to the top of the page
+Quote Post
Jojo
post Apr 19 2005, 17:08
Post #13





Group: Members
Posts: 1361
Joined: 25-November 02
Member No.: 3873



here's another strange thing of file 4, besides the one already reported on the first screenshot...

all 3 samples are a copy from the same mp3, therefore the CRC's stored in the Lame-Tag are the same.
As I already mentioned, the 1. sample is reported with a volume of 98,3 while the others seem to have a volume of 98,4. The *actual* Music-CRC differs between the 1. sample and the 2. sample in the list, but the 3. sample has the same *actual* Music-CRC like the 2. sample. Therefore, how is it possible that the 2. & 3. sample (copied from the same source), with identical *actual* Music-CRC's and the same volume have different Max. Noclip values?
Besides that, the 1. sample has a lower volume than the 2. sample but still has a higher max. noclip value..it should be the other way around...

Edit: I was able to find the original sample (with matching CRC's, before any changes were applied). The original volume was indeed 98,4dB...anyway take a look at the screenshot. I compared the resulting wav's of the mp3's with EAC...


anyway, any idea what could cause this? I could send you these 4 samples of file4...

QUOTE (2Bdecided @ Apr 19 2005, 01:46 AM)
Is your machine overclocked?

Just a thought! Probably not, but worth checking...

Cheers,
David.
*

no, definitely not smile.gif


--------------------
--alt-presets are there for a reason! These other switches DO NOT work better than it, trust me on this.
LAME + Joint Stereo doesn't destroy 'Stereo'
Go to the top of the page
+Quote Post
timcupery
post Apr 21 2005, 21:20
Post #14





Group: Members
Posts: 780
Joined: 19-December 01
From: Tar Heel country
Member No.: 683



I'd still be interested to hear about this; it may give you more of a sense of what's going on:
QUOTE (timcupery @ Apr 17 2005, 07:01 AM)
2) I'd be interested for you to test the "before" and "after" wav files in the instance that the CRC is different, using ExactAudioCopy's "compare to wav files" function. This will tell you what and where the differences.
*


--------------------
God kills a kitten every time you encode with CBR 320
Go to the top of the page
+Quote Post
Jojo
post Apr 22 2005, 00:28
Post #15





Group: Members
Posts: 1361
Joined: 25-November 02
Member No.: 3873



QUOTE (timcupery @ Apr 21 2005, 12:20 PM)
I'd still be interested to hear about this; it may give you more of a sense of what's going on:
QUOTE (timcupery @ Apr 17 2005, 07:01 AM)
2) I'd be interested for you to test the "before" and "after" wav files in the instance that the CRC is different, using ExactAudioCopy's "compare to wav files" function. This will tell you what and where the differences.
*

*


how about if you read my post? I posted a screenshot that contains 3 examples...1 song, 3 different samples, same volume, 2 different CRC's...all compared to the song with matching CRC's...


--------------------
--alt-presets are there for a reason! These other switches DO NOT work better than it, trust me on this.
LAME + Joint Stereo doesn't destroy 'Stereo'
Go to the top of the page
+Quote Post
timcupery
post Apr 22 2005, 21:43
Post #16





Group: Members
Posts: 780
Joined: 19-December 01
From: Tar Heel country
Member No.: 683



QUOTE (Jojo @ Apr 21 2005, 06:28 PM)
how about if you read my post? I posted a screenshot that contains 3 examples...1 song, 3 different samples, same volume, 2 different CRC's...all compared to the song with matching CRC's...
*

Yeah, I saw your post. I just don't know enough about music CRC's to trust them. (Which isn't to say that I think they're untrustworthy - I don't know enough to think that, either.) I'm just always slightly skeptical about adjustments to mp3 and subsequent calculations. So I'm curious if the actual sample-by-sample wav data that comes out of the mp3 when decoded without dither is actually different.
That's all.


--------------------
God kills a kitten every time you encode with CBR 320
Go to the top of the page
+Quote Post
Jojo
post Apr 22 2005, 21:56
Post #17





Group: Members
Posts: 1361
Joined: 25-November 02
Member No.: 3873



QUOTE (timcupery @ Apr 22 2005, 12:43 PM)
QUOTE (Jojo @ Apr 21 2005, 06:28 PM)
how about if you read my post? I posted a screenshot that contains 3 examples...1 song, 3 different samples, same volume, 2 different CRC's...all compared to the song with matching CRC's...
*

Yeah, I saw your post. I just don't know enough about music CRC's to trust them. (Which isn't to say that I think they're untrustworthy - I don't know enough to think that, either.) I'm just always slightly skeptical about adjustments to mp3 and subsequent calculations. So I'm curious if the actual sample-by-sample wav data that comes out of the mp3 when decoded without dither is actually different.
That's all.
*


another hint: take a look at this: http://www.hydrogenaudio.org/forums/index....ndpost&p=291900 the second screenshot...you must be blind... rolleyes.gif

This post has been edited by Jojo: Apr 22 2005, 21:56


--------------------
--alt-presets are there for a reason! These other switches DO NOT work better than it, trust me on this.
LAME + Joint Stereo doesn't destroy 'Stereo'
Go to the top of the page
+Quote Post
timcupery
post Apr 22 2005, 22:39
Post #18





Group: Members
Posts: 780
Joined: 19-December 01
From: Tar Heel country
Member No.: 683



Oops, sorry. I just saw the mp3gain screenshot on your second post with screenshots, and then skipped below. I must have just assumed that was all you had in the post, and I know that mp3gain can't actually tell you if samples are different. So no, I didn't see the second screenshot you added with the edit.

So, does this leave us with no sense of how mp3gain messed up your files?


--------------------
God kills a kitten every time you encode with CBR 320
Go to the top of the page
+Quote Post
Snelg
post Apr 23 2005, 08:23
Post #19


MP3Gain Developer


Group: Developer
Posts: 207
Joined: 30-December 01
Member No.: 846



QUOTE (timcupery @ Apr 22 2005, 02:39 PM)
So, does this leave us with no sense of how mp3gain messed up your files?


I know I'm confused. Jojo, yeah, send me the four copies of "file 4". I wanna look at the raw data myself.

Use the address that's conveniently located on the "Help - About..." screen in mp3gain itself.

-Glen
Go to the top of the page
+Quote Post
Snelg
post Apr 26 2005, 22:22
Post #20


MP3Gain Developer


Group: Developer
Posts: 207
Joined: 30-December 01
Member No.: 846



I looked at some mp3 files that Jojo sent me.
The mp3 data differed by 1 to 3 bits. Not even full bytes. 3 bits total.
The flipped bits aren't even in the "gain" part of the data, which is the only thing that mp3gain touches.
There are tag differences between the files (some have ID3v2 tags, some don't, some have title/artist/etc. in the APE tags, some don't), so mp3gain is not the only program that has made changes to the files.
Jojo, are you able to re-create the problem with a fresh, clean mp3 (i.e. no tags of any kind) using only mp3gain functions?

-Glen

This post has been edited by Snelg: Apr 26 2005, 22:22
Go to the top of the page
+Quote Post
Jojo
post Apr 27 2005, 00:28
Post #21





Group: Members
Posts: 1361
Joined: 25-November 02
Member No.: 3873



QUOTE (Snelg @ Apr 26 2005, 01:22 PM)
I looked at some mp3 files that Jojo sent me.
The mp3 data differed by 1 to 3 bits. Not even full bytes. 3 bits total.
The flipped bits aren't even in the "gain" part of the data, which is the only thing that mp3gain touches.
There are tag differences between the files (some have ID3v2 tags, some don't, some have title/artist/etc. in the APE tags, some don't), so mp3gain is not the only program that has made changes to the files.
Jojo, are you able to re-create the problem with a fresh, clean mp3 (i.e. no tags of any kind) using only mp3gain functions?

-Glen
*

well, the only program I used for tagging was mp3tag. So I don't think that's part of the problem...when I first encountered the problem I didn't even tag the files. I used the original file with matching CRC's and changed the volume and went back to it's original volume. I've tried that several times and 5 out of 7 times the CRC's were broken. I always started with a fresh copy. Since the file is too big I decided to look for some more samples in my archive and hoped that this would help you to find the bug...

In addition, only 1 of the 4 samples I've sent you have been tagged using mp3Tag. The original hasn't been changed at all. The other sample has been changed using mp3Tag, however, I made 2 extra copies of it - which are different as well. And after I made the copies of it and started to mess around with the files they have not been changed with any other program than mp3Gain; even though I might have removed/added tags, but that was only because I wanted to see if that changes the file's *actual* CRC and therefore could have caused the problem, which wasn't the case...so even if mp3Tag changed one sample, which I can't retrace anymore, the question remains why are it's 2 copies different then?

Also, 2 of the samples have identical *actual* Music CRC's (that don't match with the Music CRC stored in the LAME-Tag) and they both behave differently. How do you explain that? Check sample 2 & 3! The max no clip value differs!

Anyway, I wonder why some bits make a rather big difference in calculating the actual volume + it's max no clip value...


--------------------
--alt-presets are there for a reason! These other switches DO NOT work better than it, trust me on this.
LAME + Joint Stereo doesn't destroy 'Stereo'
Go to the top of the page
+Quote Post
Snelg
post Apr 28 2005, 06:11
Post #22


MP3Gain Developer


Group: Developer
Posts: 207
Joined: 30-December 01
Member No.: 846



QUOTE (Jojo @ Apr 26 2005, 04:28 PM)
Also, 2 of the samples have identical *actual* Music CRC's (that don't match with the Music CRC stored in the LAME-Tag) and they both behave differently. How do you explain that? Check sample 2 & 3! The max no clip value differs!


Simple: the tags say they have different peak amplitudes. If you choose "Ignore tags" from the mp3gain menu (or remove tags) and then re-calculate the mp3gain info of those two files, they look exactly the same.
Of course, that leaves the question of how they ended up like that in the first place.

What I need from you is a precise, step-by-step recreation of the problem starting with an extra-fresh mp3 with absolutely no tags whatsoever. No mp3gain tags, no nothin'.

Save a copy of the tag-less mp3.

Then just do an analysis in mp3gain (with tag usage turned on as normal) and save a copy of that mp3.

Then try to re-create the error, keeping track of precisely what you do. Not just "adjust gain", but "1) set 'Normal Volume' to 91dB. 2) Press 'Track Gain' button", etc.

Then when the error rears its ugly head, save a copy of that version, and send me the three files along with the detailed steps on how you went from the analyzed version to the messed up version.

QUOTE
Anyway, I wonder why some bits make a rather big difference in calculating the actual volume + it's max no clip value...


I wouldn't say 0.03 dB is a big difference in the volume wink.gif
That's the "precise" difference: 98.34 dB vs. 98.37 dB. They just round differently.

As for the max no-clip value, the flipped bits are in the middle of the mp3 data, so apparently it's throwing off the decoder and making some slightly-too-loud samples for a few milliseconds. A tiny spike like that can throw off the max no-clip value without having a very large effect on the "volume". (which is the whole point behind the Replay Gain algorithm in the first place)
Go to the top of the page
+Quote Post
Jojo
post Apr 28 2005, 21:54
Post #23





Group: Members
Posts: 1361
Joined: 25-November 02
Member No.: 3873



QUOTE (Snelg @ Apr 27 2005, 09:11 PM)
QUOTE (Jojo @ Apr 26 2005, 04:28 PM)
Also, 2 of the samples have identical *actual* Music CRC's (that don't match with the Music CRC stored in the LAME-Tag) and they both behave differently. How do you explain that? Check sample 2 & 3! The max no clip value differs!


Simple: the tags say they have different peak amplitudes. If you choose "Ignore tags" from the mp3gain menu (or remove tags) and then re-calculate the mp3gain info of those two files, they look exactly the same.
Of course, that leaves the question of how they ended up like that in the first place.

I hoped that this would give you a clue what might be going on...that seems to be part of the problem. I suspect that the volume tag is sometimes not written correctly - or maybe rounded wrong...

QUOTE
What I need from you is a precise, step-by-step recreation of the problem starting with an extra-fresh mp3 with absolutely no tags whatsoever. No mp3gain tags, no nothin'.
*

that's gonna be pretty hard to achieve...anyway, what if the bug has something to do with certain tags including the mp3Gain tags?


--------------------
--alt-presets are there for a reason! These other switches DO NOT work better than it, trust me on this.
LAME + Joint Stereo doesn't destroy 'Stereo'
Go to the top of the page
+Quote Post
Jojo
post Apr 28 2005, 23:56
Post #24





Group: Members
Posts: 1361
Joined: 25-November 02
Member No.: 3873



holly cow! I've found files that have a volume of 113dB when I applied the 'undo'. The max-no-clip is -17dB...there's no way that this was the original volume! Besides that, mp3Gain only applies volumes upto 105dB...the other 2 I spoted have a volume of 107dB when I used the undo feature...the max-no-clip is similar to the one mentioned above...


--------------------
--alt-presets are there for a reason! These other switches DO NOT work better than it, trust me on this.
LAME + Joint Stereo doesn't destroy 'Stereo'
Go to the top of the page
+Quote Post
Snelg
post Apr 29 2005, 02:05
Post #25


MP3Gain Developer


Group: Developer
Posts: 207
Joined: 30-December 01
Member No.: 846



QUOTE (Jojo @ Apr 28 2005, 01:54 PM)
QUOTE (Snelg @ Apr 27 2005, 09:11 PM)
Of course, that leaves the question of how they ended up like that in the first place.

I hoped that this would give you a clue what might be going on...that seems to be part of the problem.


The only clue that gives me is that maybe something's going on with the tags.

QUOTE
QUOTE
What I need from you is a precise, step-by-step recreation of the problem starting with an extra-fresh mp3 with absolutely no tags whatsoever. No mp3gain tags, no nothin'.

that's gonna be pretty hard to achieve...anyway, what if the bug has something to do with certain tags including the mp3Gain tags?


No, I just mean start with a no-tag mp3 file.

The point here is that I have no idea what you're doing to these files. I can't recreate the problem on my end. I tried fiddling around with the files in MP3Gain (changing volume, un-doing, etc.), and I didn't have any problems. If I know exactly what you're doing, precisely step-by-step, then I can try doing those exact same steps.

"Repeatable error" is the key phrase here. If I can't repeat the error myself, I can't fully analyze it.

-Glen

This post has been edited by Snelg: Apr 29 2005, 02:06
Go to the top of the page
+Quote Post

2 Pages V   1 2 >
Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 29th July 2014 - 12:48