Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: FLAC corruption problem ? (Read 24736 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

FLAC corruption problem ?

Hi everyone,

Some of my FLAC files (quite few fortunately) display the following error message when I play them with foobar :

Code: [Select]
Decoding failure at [time of the error] (Unsupported format or corrupted file)


However, the files still play fine ! The error appears only at the END, once a file has finished playing.

I have tried to re-encode them with FLAC, and I get the following error :

Code: [Select]
Error converting to FLAC
md5 did not match decoded data, file is corrupt.


But again, the files still play fine ! 

So I was wondering if there was a way to "repair" those FLAC files, because this is probably a problem with md5 and not necessarily with the audio data which looks fine to my ears.

I'd appreciate to be able to repair those files, rather than having to re-encode them, which would take some time (I said "quite few", but there are some dozens of them).

Thanks in advance for your help.

Jose

FLAC corruption problem ?

Reply #1
101

FLAC corruption problem ?

Reply #2
So what does it mean ? That the audio data is corrupt ? It's possible of course, although to my ears it is not.

So rather than re-ripping everything, I'd prefer to find a way to keep this files for the moment, even corrupt, because I'm not obsessed with one or two bits that might be different and alter the md5 if the whole thing sounds fine without a glitch.

It must be a way, right ? (maybe a way of forcing the md5 to be recalculated according to the decoded data)

FLAC corruption problem ?

Reply #3
101

FLAC corruption problem ?

Reply #4
Thanks Cosmo.

However, FLAC frontend doesn't seem to let me re-encode files in a single operation ? (I would have to decode them first, thus losing all the tags, then encode them again). And dbPowerAmp doesn't allow me to set the -F switch apparently.

So what would be the best way to re-encode all those files with the -F switch ? Is there some software that could help me ? (I'm not used to FLAC command-lines, but if someone gives me the right syntax I can try of course)

FLAC corruption problem ?

Reply #5
101

FLAC corruption problem ?

Reply #6
Thank you so much cosmo ! Now it works, I'm reencoding with dbPowerAmp.

Also, you are totally right, I will keep some tracks for comparison purposes with re-ripped ones, just to see.

Because what amazes me is that all errors are systematically located at the very END of each track. That's why my guess is that all the song information is correct, and there must be some kind of error in the very last bits (probably an encoder problem or something, I don't know).

In other words, all my reencoded tracks should remain perfect (from my ear's point of view of course), even if their final bits differ from the original.

I'll post again once I've bit-compared the faulty tracks with the fresh re-ripped ones. Then all shall be revealed ! 

Thanks again !

FLAC corruption problem ?

Reply #7
101


FLAC corruption problem ?

Reply #9
Hello again greynol.

Yes, it could be possible IMHO, for several reasons :
- When I first noticed the problem was when I tried to re-encode one of my FLACs into mp3 (to explain why would be too complicated). The resulting mp3 played OK but it had no tags at all !
- Now that I'm reencoding the faulty FLACs into proper FLACs, I'm noticing that all the new "proper" FLACs don't have any tags at all either (so I have to retag everything).

My provisory conclusion is that there's probably a problem within the tags part, and not necessarily within the music part of the files. Weird isn't it ?

If somebody's able to do an in-depth analysis of a given FLAC file, I can host a quite small "corrupted" FLAC file (11 MB). It's the "01 - Intro (Back To Basics).flac" song from Christina Aguilera's latest album. So if somebody's interested, I can host it so that you can see exactly what's wrong with it (and even bit-compare it with its "bit-perfect" equivalent if you have ripped the album). Thanks in advance !

FLAC corruption problem ?

Reply #10
My provisory conclusion is that there's probably a problem within the tags part, and not necessarily within the music part of the files. Weird isn't it ?

The md5 is for the audio part only, so I am certain there music part was corrupted.  I was wondering if a tag had overwritten the data at the end of the file.

FLAC corruption problem ?

Reply #11
Folks, I have been through some testing, and I just can't figure this out.

I've taken the intro track I was talking about (let's call it "corrupted.flac"), then I've done this :
1/ Set up dbPowerAmp so that it doesn't stop on decoding errors
2/ Decode "corrupted.flac" to WAV, which gives a "corrupted.wav" file
3/ Convert "corrupted.flac" to FLAC, which gives a "repaired.flac" file (I say "repaired" because this new FLAC file no longer generates errors, so something has changed)
4/ Decode "repaired.flac" to WAV, which gives a "repaired.wav" file
5/ Don't forget to revert dbPowerAmp to the default setting ! 

Now let's compare "corrupted.wav" and "repaired.wav" :
- Both files are slightly different in size : 18 855 980 bytes vs. 18 856 136 bytes, that's 156 more bytes in the "repaired.wav" file
- However, an EAC WAV Compare gives 0 differences ! 
- Quite surprised, I've also tried Audacity : loaded the two tracks (which are exactly the same length : 1:46.893039), then inverted the second and mixed it with the first so that the second is substracted from the first. The result is absolutely a ZERO file (I mean a "full silence" file, not a single audio byte differs from zero).
- BTW foobar's error message on "corrupted.flac" is : "Decoding failure at 1:46.893 (Unsupported format or corrupted file)". Notice that 1:46.893 is the end of the file according to Audacity.
- BWT, "corrupted.wav" doesn't give any error message under foobar (I thought it would)

How can you explain all this ?...   

(the good news is that my audio seems totally untouched by the FLAC -> FLAC conversion, even though I've been through the decoding errors !!!  )

Thanks  /  Jose

PS : oh, one last question : I've used EAC and Audacity, simply because I haven't been able to find foobar's bitcompare function. I have foobar 0.9.5 (latest version). I have loaded both wavs, then selected them, then right-clicked and... I see nothing about bitcomparing both wavs. Is it normal ?

FLAC corruption problem ?

Reply #12
- Both files are slightly different in size : 18 855 980 bytes vs. 18 856 136 bytes, that's 156 more bytes in the "repaired.wav" file
This is probably because dBpoweramp has the ability to put tag information in wave files (metadata in RIFF chunks, or whatever is the correct technical jargon).

- However, an EAC WAV Compare gives 0 differences ! 
This is as should be expected.

- BWT, "corrupted.wav" doesn't give any error message under foobar (I thought it would)
What do you mean by this exactly?

(the good news is that my audio seems totally untouched by the FLAC -> FLAC conversion, even though I've been through the decoding errors !!!  )
All you've done is re-encoded the errant flac to flac again.  Now the new flac has the error as it was decoded and still does not match the original source used to make the flac that became corrupted.  IOW, the error is still there, just that the ability of this new file to tell you about the error is now forever lost.

 

FLAC corruption problem ?

Reply #13
I have ripped about 700 CDs into flac using dbpoweramp and am now finding that 1 in every few hundred tracks has an MD5 signature error. If you try to run:

"flac.exe -d -f source.flac output.wav"

you get an error message "ERROR, MD5 signature mismatch" and nothing happens. If you change to

"flac.exe -d -f --decode-through-errors source.flac output.wav"

you get an error message and an output file. Windows Media Player plays this wav file fine and then throws up an error message saying it is corrupted. In all the case I have seen the error occurs right at the end of the track in the silent period just before it ends. So the "--decode-through-errors" creates a file but screws it up when the error occurs (great). my guess is that this is some bug in the flac format encoder (i love open source). elsewhere i read people saying these md5 errros are caused by bad memory in the ripping machine, but this is not true for me and it looks like many people are getting the error. note there is a program called FLACTester.exe which scans directories for flac files with this problem and prints them out.

I see now in dbpoweramp you can identify these errors as you rip using the verify option but it's too late for me to go back to those cds. my slimdevices transporter plays the file fine and the errors occur at the end so i don't think there is any need to rerip.

*** i wish there was a utility to fix the errors by rebuilding the MD5 signature but i do not see one. Anyone fancy writing this - would be very useful. ***

I need to run flac.exe to convert to wav and then wav->aac for my ipod. as luck would have it the nero encoder does not give up when it hits the error in the .wav file produced by flac.exe with the "--decode-through-errors" option so I am OK in what I have to do. But it's annoying.

FLAC corruption problem ?

Reply #14
It should first be checked whether this is really an encoder error. It would probably help to keep a few defective files, re-rip them from CD to wav and check the md5 of the audio data against that stored in the flac (not sure how best to do this), and compare the actual audio data. Also, you could try running Orthos for an hour or two to make sure your system really works as stable as you think.

FLAC corruption problem ?

Reply #15
you get an error message "ERROR, MD5 signature mismatch" and nothing happens. If you change to

"flac.exe -d -f --decode-through-errors source.flac output.wav"
In case this makes a difference, -f tells flac to overwrite the output file if it already exists and -F is a shorter way to tell flac to decode through errors.

my guess is that this is some bug in the flac format encoder (i love open source).
It could just as easily be that you file became corrupt sometime after it was created.  Did you use -V when encoding?

*** i wish there was a utility to fix the errors by rebuilding the MD5 signature but i do not see one. Anyone fancy writing this - would be very useful. ***
This does not fix the error; it merely covers it up!

FLAC corruption problem ?

Reply #16
greynol, I totally agree with you : we're not fixing errors here, just covering them. But in my case the errors really do not seem to have affected the audio part of the files. Anyway, I'll try to bit-compare my "corrupted.wav" with a properly ripped one when I have the time.

- BWT, "corrupted.wav" doesn't give any error message under foobar (I thought it would)
What do you mean by this exactly?

Simply this : I thought that since "corrupted.flac" had errors, the decoded "corrupted.wav" would also have errors. But forget it, I'm not an expert.

Oh BTW, I have found two EXCELLENT tools for checking files :

- For FLACs, MP3, etc. : Audiotester ( http://www.vuplayer.com/other.php ). It does NOT correct errors, but it points them precisely if they exist. So for FLAC files this is great.

- For MP3 only : mp3val ( http://mp3val.sourceforge.net/ ). This is a GREAT tool for mp3 : it checks the files, and it corrects all the errors at the speed of light !

FLAC corruption problem ?

Reply #17
No I did not check with -V. I see thats an option for the future. I am 99% sure this is not covering errors but rather fixing bugs in the dodgy MD5 signature flac code as already explained.

FLAC corruption problem ?

Reply #18
No I did not check with -V.
Then you have no way of excluding the possibility that there was an error in the encoding rather than there being an error in the md5 checksum, though this still doesn't excuse the likely possibility that the file became corrupted sometime after it was created.

I am 99% sure this is not covering errors but rather fixing bugs in the dodgy MD5 signature flac code as already explained.
 

The only person saying that the md5 signature is dodgy and has bugs is you.

FLAC corruption problem ?

Reply #19
to me the arguments are pretty obvious and if it was written by one of my software developers i would be kicking him in the butt. anyway most software is so depressingly bad it makes me cry. i moved all my flac music to itunes and an ipod and can not get my head around how bad that itunes sorting is. for the world's biggest player to be so bad really says something about the sadness of this world - or rather the idiots that mostly make it up.

anyway if the arguments are not obvious to you then:

(a) we are not taking about a one in a zillion... we are talking a bunch of people and two in a few days on this thread alone.
(a) why is there a -v option in the first place in the encoder? this is worse that propellor heads adding idiot checksums to wintel tcpip sockets - because it far slower and far sillier.
(b) look on the web and it mentions corrupted ram causing these erros so you had better check with -v. yea yea and and sep 11th was a cia plot - typical forum junk.
© copying files around my hard drive is not going to set off checksum errors. even sillier that the usual "oh if you reboot that bug might go away" - or "that not a bug it's a virus".
(d) quick tests have shown that the wav files are identical and the errors occur in the final moment.
(e) its open source. i have used flac and played with their interface - it lotus notes quality software.

pretty much the only possibility is bugs in flac or bugs in the software i use to edit tags. but we are taking the streaming info block which is not touched in that process.

FLAC corruption problem ?

Reply #20
Your arguments do not exclude the more likely scenarios I have presented you with.

(a) we are not taking about a one in a zillion... we are talking a bunch of people and two in a few days on this thread alone.
It has not been determined that the original problem that was posted stemmed from a corrupt md5 signature.

Feel free to find one of your corrupt flacs, decode it and compare it to the original.  If you don't have the original, how in the bloody hell can you claim it's just the checksum and not some problem in the rest of the file?  This defies all logic.

pretty much the only possibility is bugs in flac or bugs in the software i use to edit tags. but we are taking the streaming info block which is not touched in that process.
Nonsense, but even if it was a bug in flac, how do you know for certain it's with the way it calculates the md5 checksum and not something else? 

FLAC corruption problem ?

Reply #21
Hi guys,

I'm sorry, I didn't mean to start a war between you two !

Like I said, here's a small "corrupted" (?) FLAC file. Feel free to download it, decode it, analyze it, and tell us all exactly where this "corruption" comes from.

Many thanks in advance to the one who'll care to do this.

Moderation: Link removed.  The length of audio files must be limited to 30 seconds.

FLAC corruption problem ?

Reply #22
Like I said, here's a small "corrupted" (?) FLAC file. Feel free to download it, decode it, analyze it, and tell us all exactly where this "corruption" comes from.
Yes, the file was clearly corrupt, though flac gave a decoding error rather than just complaining that the md5 didn't match.

In the future please do the testing yourself and post the results like you did earlier.  If you need help with the testing feel free to request it.

FLAC corruption problem ?

Reply #23
Hi greynol,

I would have done the testing myself if I had known how to do it. Next time I'll request.

I understand the moderation, but I could not limit the file to 30 seconds since I needed to post the corrupted file, not a modified one. BTW I understand the usual 30-second limit for "normal" files (for obvious copyright reasons), but should it be the same for corrupted files ?...

The md5 error was given by FLAC when I tried to re-encode the file (see quote in my first post). If you have another error, it's not normal : it might be that the hosted file was more corrupt (FTP error, that happens to me often for large files).

So if you want me to test the file that I own, please explain me how and I'll post the results.

Thanks !

FLAC corruption problem ?

Reply #24
(b) look on the web and it mentions corrupted ram causing these erros so you had better check with -v. yea yea and and sep 11th was a cia plot - typical forum junk.

I've actually had this exact same problem with an older PC. I got decoding errors with FLAC on random files, it seemed like once every so often this would happen. I did a memory test, realized I had defective RAM and replaced it. The problems magically went away! So I don't think this is forum junk, this is a legitimate problem and should be ruled out. If it were me this would be the first thing I would test.