Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GStreamer hang on broken FLAC #3

Closed
pscn opened this issue Feb 27, 2013 · 5 comments
Closed

GStreamer hang on broken FLAC #3

pscn opened this issue Feb 27, 2013 · 5 comments

Comments

@pscn
Copy link

pscn commented Feb 27, 2013

During the process of importing my FLAC collection to beet, the import always stopped at one point. I found the file in question and was able to downtrace it to gstdec GstAudioFile stopping at init after self.ready_sem.acquire(). After that I was kind of lost with gst and whatnot ^^

The FLAC file is broken, so I believe audioread should come back with an error. I suspect this could be a bug in gst, but I'm not sure so I report it here first. If it's ok for you, I would send you the file in question or upload it somewhere (~25MB).

flac -t says:

flac 1.2.1, Copyright (C) 2000,2001,2002,2003,2004,2005,2006,2007 Josh Coalson
flac comes with ABSOLUTELY NO WARRANTY. This is free software, and you are
welcome to redistribute it under certain conditions. Type `flac' for details.

Somefile.flac: *** Got error code 0:FLAC__STREAM_DECODER_ERROR_STATUS_LOST_SYNC
Somefile.flac: *** Got error code 0:FLAC__STREAM_DECODER_ERROR_STATUS_LOST_SYNC

Somefile.flac: ERROR while decoding data
state = FLAC__STREAM_DECODER_READ_FRAME

@sampsyo
Copy link
Member

sampsyo commented Feb 27, 2013

Thanks for reporting this. Yes, absolutely—if you don't mind, please share the file in question (or even a reduced version of it); I'll use that to debug this further.

(Hangs are frustratingly common in the GStreamer backend due to all the fancy synchronization necessary to consume data at full speed. This is just the latest in a long legacy of such bugs.)

@sampsyo
Copy link
Member

sampsyo commented Feb 28, 2013

Thanks for the sample. That commit should raise an error in this situation.

@pscn
Copy link
Author

pscn commented Feb 28, 2013

Thanks. The issue is fixed in regards to gst, but now it just jumps to ffdec in my setup and that succeeds. Damn :)

@pscn
Copy link
Author

pscn commented Feb 28, 2013

FYI: ffmpeg output

ffmpeg -i test/Somefile.flac -f s16le - > x
ffmpeg version 0.8.5-4:0.8.5-0ubuntu0.12.04.1, Copyright (c) 2000-2012 the Libav developers
built on Jan 24 2013 18:01:36 with gcc 4.6.3
*** THIS PROGRAM IS DEPRECATED ***
This program is only provided for compatibility and will be removed in a future release. Please use avconv instead.
[flac @ 0x25c39c0] max_analyze_duration reached
Input #0, flac, from 'test/Somefile.flac':
[ ... ]
Press ctrl-c to stop encoding
[flac @ 0x25c5940] overread: 1
Error while decoding stream #0.0
Multiple frames in a packet from stream 0
[flac @ 0x25c5940] invalid sync code
[flac @ 0x25c5940] invalid frame header
[flac @ 0x25c5940] decode_frame() failed
Error while decoding stream #0.0
[flac @ 0x25c5940] invalid sync code
[flac @ 0x25c5940] invalid frame header
[flac @ 0x25c5940] decode_frame() failed
Error while decoding stream #0.0
[flac @ 0x25c5940] qlevel -8 not supported, maybe buggy stream
[flac @ 0x25c5940] decode_frame() failed
Error while decoding stream #0.0
[flac @ 0x25c5940] qlevel -10 not supported, maybe buggy stream
[flac @ 0x25c5940] decode_frame() failed
Error while decoding stream #0.0
[flac @ 0x25c5940] invalid sync code
[flac @ 0x25c5940] invalid frame header
[flac @ 0x25c5940] decode_frame() failed
[ ... ]
[flac @ 0x25c5940] invalid sync code
[flac @ 0x25c5940] invalid frame header
[flac @ 0x25c5940] decode_frame() failed
Error while decoding stream #0.0
size= 33218kB time=192.83 bitrate=1411.2kbits/s
video:0kB audio:33218kB global headers:0kB muxing overhead 0.000000%

and the best:

echo $?
0

@pscn
Copy link
Author

pscn commented Feb 28, 2013

I guess I had wrong expectations for this. Even if the chroma plugin fails, the files will still be imported to beets. Not sure which part should fail and how to prohibit the import of broken files. But that is another stroy. I will create a new issue regarding ffdec.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants