IPB

Welcome Guest ( Log In | Register )

3 Pages V   1 2 3 >  
Reply to this topicStart new topic
FLAC Stream Decoder Error, FLAC__STREAM_DECODER_ERROR_STATUS_LOST_S
Zennon
post Jan 16 2005, 03:01
Post #1





Group: Members
Posts: 11
Joined: 16-January 05
Member No.: 19091



I'm in the process of backing up 500 CD-DA discs in FLAC format (using EAC). I ran a shell script to test (flac.exe -t; flac version 1.1.1) the 4000 FLAC files on my hard drive so far and found that flac.exe reported errors for 36 files. All errors are the same:

<filename>: *** Got error code 0:FLAC__STREAM_DECODER_ERROR_STATUS_LOST_SYNC

The files decompress fine, but now I'm not sure if I got the exact WAVs back. What does this error message mean, and how severe is the error? Moreover, is there a way to avoid it when compressing WAVs to FLAC in EAC?

This post has been edited by Zennon: Jan 17 2005, 00:10
Go to the top of the page
+Quote Post
jcoalson
post Jan 16 2005, 05:56
Post #2


FLAC Developer


Group: Developer
Posts: 1526
Joined: 27-February 02
Member No.: 1408



if a file tests fine and the md5sum is non-zero (do "metaflac --show-md5sum file.flac") then you got all the audio data back. not sure what is causing the error though. if verify was on during compression and there were no errors then, I would guess hard drive corruption. unless repeating the test/decode on the same file yields different errors each time, in which case it is probably bad ram or overclocking.

Josh
Go to the top of the page
+Quote Post
Zennon
post Jan 17 2005, 13:56
Post #3





Group: Members
Posts: 11
Joined: 16-January 05
Member No.: 19091



Josh, thanks for your reply. It's always a delight to get an answer from the developer himself.

I tested all md5 sums and they were all non-zero. That means I've got files that fail the flac -t test, but have non-zero md5s.

All FLACs were encoded by EAC, with the following additional command line options:

-T "artist=%a" -T "title=%t" -T "album=%g" -T "date=%y" -T "tracknumber=%n" -T "genre=%m" %s --best --verify

That is, verify was on during encoding. AFAIK EAC does not keep track of FLAC encoding errors, so it's impossible to say whether they encoded without errors. I have always assumed they did because I have the "check from external programs return code" enabled in EAC's compression options and never got a warning.

I think I can rule out hard drive corruption because the bad FLACs occur on two different drives (Seagate/NTFS and Lacie/FAT32). Repeating the test/decode on the same file yields the same error each time, so we can can also rule out bad ram or overclocking.

So the perpetrator must be the encoding process performed through EAC. Could you perhaps explain what generates the FLAC__STREAM_DECODER_ERROR_STATUS_LOST_SYNC error during encoding?
Go to the top of the page
+Quote Post
jcoalson
post Jan 17 2005, 23:14
Post #4


FLAC Developer


Group: Developer
Posts: 1526
Joined: 27-February 02
Member No.: 1408



QUOTE (Zennon @ Jan 17 2005, 07:56 AM)
So the perpetrator must be the encoding process performed through EAC. Could you perhaps explain what generates the FLAC__STREAM_DECODER_ERROR_STATUS_LOST_SYNC error during encoding?
*

you mean during decoding right? that's a decoder error. it means the decoder was looking for a sync point that begins each frame and there wasn't one. usually caused by missing or corrupt data at that point; if so, there can be frame losses.

I don't know what else could be going on. when a wave file is encoded with --verify and it passes, flac has already done everything that decoding would do. so decoding the exact same flac file again should not produce any errors unless a different decoder with a bug was used.

to debug any more I'll need a sample of a file that is giving the error.

Josh
Go to the top of the page
+Quote Post
Zennon
post Jan 17 2005, 23:32
Post #5





Group: Members
Posts: 11
Joined: 16-January 05
Member No.: 19091



QUOTE (jcoalson @ Jan 17 2005, 02:14 PM)
QUOTE (Zennon @ Jan 17 2005, 07:56 AM)
So the perpetrator must be the encoding process performed through EAC. Could you perhaps explain what generates the FLAC__STREAM_DECODER_ERROR_STATUS_LOST_SYNC error during encoding?
*

you mean during decoding right? that's a decoder error. it means the decoder was looking for a sync point that begins each frame and there wasn't one. usually caused by missing or corrupt data at that point; if so, there can be frame losses.

I don't know what else could be going on. when a wave file is encoded with --verify and it passes, flac has already done everything that decoding would do. so decoding the exact same flac file again should not produce any errors unless a different decoder with a bug was used.

to debug any more I'll need a sample of a file that is giving the error.

Josh
*
Go to the top of the page
+Quote Post
Zennon
post Jan 17 2005, 23:37
Post #6





Group: Members
Posts: 11
Joined: 16-January 05
Member No.: 19091



Yes, the error that I get is a decoder error. What I meant is that the error in the FLAC must be created when EAC is processing the encode queue. EAC does not log the queue processing, so it is impossible to track down failed encodes afterwards, even if --verify was used. What would be the best way to provide you with a sample FLAC?
Go to the top of the page
+Quote Post
jcoalson
post Jan 18 2005, 01:02
Post #7


FLAC Developer


Group: Developer
Posts: 1526
Joined: 27-February 02
Member No.: 1408



the best way is if you can host it somewhere accessible via http/ftp. the sourceforge bugtracker (http://sourceforge.net/tracker/?atid=11347...478&func=browse) allows uploads but has a size limit that is usually too big for flac files.

I guess I'm still confused how a file can decode fine but repeatedly give sync errors when testing since they do the same thing (testing just doesn't write the wave file).

Josh
Go to the top of the page
+Quote Post
Zennon
post Jan 18 2005, 01:22
Post #8





Group: Members
Posts: 11
Joined: 16-January 05
Member No.: 19091



OK, I will upload a buggy FLAC tonight. Not sure if the file actually decodes fine. Decoding produces a WAV with non-zero md5 sum, but since I don't keep md5 files for ripped CD's I can't compare md5 checksums. I tried reproducing EAC's CRC checksums (see http://www.digital-inn.de/showthread.php?t=28754) but that turned out to be not so easy.
Go to the top of the page
+Quote Post
80k
post Jan 18 2005, 06:33
Post #9





Group: Members
Posts: 29
Joined: 1-January 05
Member No.: 18745



I had an interesting situation with the same error.

On two of my FLAC's (using the latest EAC and the latest FLAC codec), i received that error (the warning pops up in foobar, but it plays fine). it also shows that error when i "test" the track with the FLAC frontend, and also when i decode it (it decodes fine, but the warning still shows in the window).

I then proceeded to re-encode it using EAC from the original disk. I received the same error, so it was something that seems to be inherent in the wav file extracted from the CD.

THis happened on two tracks, on separate disks. And both times, i tried to re-rip it from the original source and it still gave the same error.

I just decoded it and re-encoded it back to FLAC, and it is fine now smile.gif

any idea what it is? looking at the situation, it seems it is not data corruption.

This post has been edited by 80k: Jan 18 2005, 06:34
Go to the top of the page
+Quote Post
jcoalson
post Jan 18 2005, 06:39
Post #10


FLAC Developer


Group: Developer
Posts: 1526
Joined: 27-February 02
Member No.: 1408



QUOTE (80k @ Jan 18 2005, 12:33 AM)
...
any idea what it is?  looking at the situation, it seems it is not data corruption.
*

no idea.

to make sure it is not flac, start with a wave file and encode that. if you don't get the same error every time at the same place with the same file it is unlikely to be flac.

Josh
Go to the top of the page
+Quote Post
jcoalson
post Jan 20 2005, 01:35
Post #11


FLAC Developer


Group: Developer
Posts: 1526
Joined: 27-February 02
Member No.: 1408



I looked at your files quickly... the sync error seems to be caused by the ID3v1 tag at the end of the files, so it's not affecting the decoding. flac is supposed to be id3 tag aware so I'll look at why it's reporting a sync error in this case. the audio is fine though.

Josh
Go to the top of the page
+Quote Post
Zennon
post Jan 20 2005, 03:48
Post #12





Group: Members
Posts: 11
Joined: 16-January 05
Member No.: 19091



Thanks Josh, that's good news. I guess now I don't have to re-rip the source discs for the buggy FLACs.
Go to the top of the page
+Quote Post
jcoalson
post Jan 24 2005, 01:22
Post #13


FLAC Developer


Group: Developer
Posts: 1526
Joined: 27-February 02
Member No.: 1408



OK, found the problem. it is a decoder bug that is exposed when there is an id3 tag at the end of the file AND the last frame of the audio stream has a certain blocksize. integrity of the audio is not affected but the sync error is annoying. no need to re-encode either.

it's fixed in CVS and will be in the next release.

Josh
Go to the top of the page
+Quote Post
80k
post Jan 24 2005, 07:33
Post #14





Group: Members
Posts: 29
Joined: 1-January 05
Member No.: 18745



QUOTE (jcoalson @ Jan 23 2005, 04:22 PM)
OK, found the problem.  it is a decoder bug that is exposed when there is an id3 tag at the end of the file AND the last frame of the audio stream has a certain blocksize.  integrity of the audio is not affected but the sync error is annoying.  no need to re-encode either.

it's fixed in CVS and will be in the next release.

Josh
*


interesting. yea it has happened to me a bunch, and i just decoded and reencoded (which stripped the id3 tag, i guess). i did it because foobar always pops up a message and i wanted it to go away smile.gif

so a fix would be to set EAC to not "add ID3 tag", huh? in fact, the ID3 tag really does nothing and has no place/purpose in a flac file, cuz it uses a different tagging system?
Go to the top of the page
+Quote Post
jcoalson
post Jan 24 2005, 09:01
Post #15


FLAC Developer


Group: Developer
Posts: 1526
Joined: 27-February 02
Member No.: 1408



QUOTE (80k @ Jan 24 2005, 01:33 AM)
so a fix would be to set EAC to not "add ID3 tag", huh?  in fact, the ID3 tag really does nothing and has no place/purpose in a flac file, cuz it uses a different tagging system?
*

yeah, if you can avoid id3 tags on FLAC files, do it, use native FLAC tags instead. the spec does not require compliant implementations to support id3. even though the standard tools do there's no guarantee it will stay like that.

Josh
Go to the top of the page
+Quote Post
Zennon
post Jan 26 2005, 01:33
Post #16





Group: Members
Posts: 11
Joined: 16-January 05
Member No.: 19091



Josh, many thanks for sorting this out. Glad to hear I don't have to re-rip/re-encode.

Cheers,
Zennon
Go to the top of the page
+Quote Post
KingTubba
post Apr 20 2005, 16:18
Post #17





Group: Members
Posts: 5
Joined: 20-April 05
Member No.: 21579



I was wondering if you could help me out. I have a bunch of flacs (with no access to the original sources) that I encoded but give the LOST_SYNC error when verified. The strange thing is they will play fine in Media Monkey if a non LOST_SYNC file is played first (?). Anyway, is there anyway to fix the files? flac -d doesn't work. It gives the same error, and if you tell decode through errors is says something about the source file being to big for a single wav chunk. Note: Yes, these were originally encoded with an id3 tag, silly of me...

Any ideas on how to fix the files? I do have a 4MB sample (its an intro to a "song") that I could email over if anyone needs to see it. Feel free to reply here or email me at maps1@nesurf.com.
Go to the top of the page
+Quote Post
kjoonlee
post Apr 20 2005, 16:46
Post #18





Group: Members
Posts: 2526
Joined: 25-July 02
From: South Korea
Member No.: 2782



How about using an ID3 editor to just chop the ID3v1 tag off? A dumb editor which doesn't recognize FLAC would be enough, in which case renaming the .flac to .mp3 will allow you to edit tags.

Alternatively, you could chop 128 bytes off from the end of the file for the same effect.


--------------------
http://blacksun.ivyro.net/vorbis/vorbisfaq.htm
Go to the top of the page
+Quote Post
guest0101
post Apr 20 2005, 16:57
Post #19





Group: Banned
Posts: 446
Joined: 15-July 03
Member No.: 7789



QUOTE (kjoonlee @ Apr 20 2005, 08:46 AM)
How about using an ID3 editor to just chop the ID3v1 tag off? A dumb editor which doesn't recognize FLAC would be enough, in which case renaming the .flac to .mp3 will allow you to edit tags.

Alternatively, you could chop 128 bytes off from the end of the file for the same effect.
*

If someone would write a CLI Windows utility to remove any/all IDv1 and IDv2 tags from FLAC files that would be a great asset. Unfortunately too many tag editors and audio programs that convert/save to FLAC are using IDv1 or IDv2 tags today inside FLAC files. Some use both IDv tags and Vorbis tags, others just use IDv tags.

I have written to some developers about this and about the Spread FLAC campaign, but many audio apps authors appear nowadays to reside in China (about 80% of them which I have written to), and it seems they don't know much about the FLAC format, let alone about the need to use Vorbis style tags inside FLAC files. Maybe Josh should publish the FLAC developer docs in Chinese smile.gif

It wouldn't hurt, Josh, to put a real emphasis on your site, in your docs and in your program code comments for developers to use Vorbis tags only and to stay away from using IDv1 or IDv2 tags inside FLAC files that their programs edit or create, as many developers are so used to the MP3 tagging formats. Just my 2 cents.

This post has been edited by guest0101: Apr 20 2005, 17:25
Go to the top of the page
+Quote Post
kjoonlee
post Apr 20 2005, 17:26
Post #20





Group: Members
Posts: 2526
Joined: 25-July 02
From: South Korea
Member No.: 2782



Well, have you tried Case's Tag? wink.gif


--------------------
http://blacksun.ivyro.net/vorbis/vorbisfaq.htm
Go to the top of the page
+Quote Post
jcoalson
post Apr 20 2005, 17:49
Post #21


FLAC Developer


Group: Developer
Posts: 1526
Joined: 27-February 02
Member No.: 1408



QUOTE (KingTubba @ Apr 20 2005, 10:18 AM)
I was wondering if you could help me out. I have a bunch of flacs (with no access to the original sources) that I encoded but give the LOST_SYNC error when verified. The strange thing is they will play fine in Media Monkey if a non LOST_SYNC file is played first (?). Anyway, is there anyway to fix the files? flac -d doesn't work. It gives the same error, and if you tell decode through errors is says something about the source file being to big for a single wav chunk. Note: Yes, these were originally encoded with an id3 tag, silly of me...

Any ideas on how to fix the files? I do have a 4MB sample (its an intro to a "song") that I could email over if anyone needs to see it. Feel free to reply here or email me at maps1@nesurf.com.

if the lost sync is at the end of the file it could be tags but I'd have to see the file. I'll email you for the sample.

as for the chinese docs... good idea but someone will have to volunteer for the translation. our russian version of the FLAC site has fallen out of date too for lack of maintenance.

and yes, now that vorbis comment adoption has increased it's probably time for more stern wording on the site. I'm hesitant to pull support altogether because id3v2 is being used in some products for album art.

Josh
Go to the top of the page
+Quote Post
Synthetic Soul
post Apr 20 2005, 22:07
Post #22





Group: Super Moderator
Posts: 4887
Joined: 12-August 04
From: Exeter, UK
Member No.: 16217



QUOTE (kjoonlee @ Apr 20 2005, 05:26 PM)
Well, have you tried Case's Tag? wink.gif

I believe I'm right in saying you can either remove all tags, or just ID3v2, using Tag.

You can't specify to just remove ID3v1.

Obviously it would be fine to remove all (--remove) if there were no VORBIS tags present as well.


--------------------
I'm on a horse.
Go to the top of the page
+Quote Post
jcoalson
post Apr 21 2005, 01:45
Post #23


FLAC Developer


Group: Developer
Posts: 1526
Joined: 27-February 02
Member No.: 1408



QUOTE (KingTubba @ Apr 20 2005, 10:18 AM)
I was wondering if you could help me out. I have a bunch of flacs (with no access to the original sources) that I encoded but give the LOST_SYNC error when verified. The strange thing is they will play fine in Media Monkey if a non LOST_SYNC file is played first (?). Anyway, is there anyway to fix the files? flac -d doesn't work. It gives the same error, and if you tell decode through errors is says something about the source file being to big for a single wav chunk. Note: Yes, these were originally encoded with an id3 tag, silly of me...

Any ideas on how to fix the files? I do have a 4MB sample (its an intro to a "song") that I could email over if anyone needs to see it. Feel free to reply here or email me at maps1@nesurf.com.

got the file. it's corrupted. I can see in a hex editor that there are big blocks of zeroes where the middle of the id3v2 tag and beginning of the FLAC stream should be.

flac -dF is currently not able to decode through errors like this.

Josh
Go to the top of the page
+Quote Post
kjoonlee
post Apr 21 2005, 03:33
Post #24





Group: Members
Posts: 2526
Joined: 25-July 02
From: South Korea
Member No.: 2782



QUOTE (Synthetic Soul @ Apr 21 2005, 06:07 AM)
QUOTE (kjoonlee @ Apr 20 2005, 05:26 PM)
Well, have you tried Case's Tag? wink.gif

I believe I'm right in saying you can either remove all tags, or just ID3v2, using Tag.

You can't specify to just remove ID3v1.

Obviously it would be fine to remove all (--remove) if there were no VORBIS tags present as well.
*


You can --force APEv2 --remove all (syntax might be wrong, but you get the idea.)

Can't it do the same with FLAC?


--------------------
http://blacksun.ivyro.net/vorbis/vorbisfaq.htm
Go to the top of the page
+Quote Post
Deep_Elem
post Apr 21 2005, 05:46
Post #25





Group: Members
Posts: 120
Joined: 14-April 04
Member No.: 13473



QUOTE (Synthetic Soul @ Apr 20 2005)
I believe I'm right in saying you can either remove all tags, or just ID3v2, using Tag.

You can't specify to just remove ID3v1.

Obviously it would be fine to remove all (--remove) if there were no VORBIS tags present as well.

I uses Case's Tag in a batch file to solve this problem. The batch file works as follows:

1. Creates an empty text file with the .tag extension
2. Uses Case's Tag to:
i) copy all tags from the flac file to the .tag file with --force ape2 & --nocheck
ii) remove all tags from the flac file
iii) copy the tags from the .tag file back to the flac file. Case's tag will automatically use the right format.
3. Deletes .tag file

One caveat: Do not stop the process in the middle of removing the tags from the flac file as the flac file will likely become corrupted. I.e. backup your flac files first and delete the backups when the process is done. I haven't incorporated the backup process into the batchfile yet but I plan to when I get some time.

I've tried using --force flac --remove in a single command but for some reason it often fails to remove the ID3V1 tags.

This post has been edited by Deep_Elem: Apr 21 2005, 05:51
Go to the top of the page
+Quote Post

3 Pages V   1 2 3 >
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 December 2014 - 17:47