Bug#590752: audacity: can't import "open" FLAC files

2010-07-29 Thread Adrian Knoth
On Thu, Jul 29, 2010 at 10:57:42PM +0100, Ximin Luo wrote:

>> Looks like this or libsndfile is broken, I'll now investigate closer,
>> just wanted to share the workaround with you.
>>
>> If you like, confirm if it's working for you.
> Yup, this works, thanks :)

[..]

> Just out of interest, is this considered a broken flac file or not? If 

No, it's valid:

http://flac.sourceforge.net/format.html#metadata_block_streaminfo

See <36>: "A value of zero here means the number of total samples is
unknown."

> so, maybe I should file a bug with the GNOME sound recorder people too?

It is a bug in libsndfile, I'm therefore reassigning this bug to
libsndfile and CC the maintainer who happens to also be the upstream
author. ;)

Erik, for further information and test files, see this bug report.
Everything else is mentioned in the patch. ;)


Cheerio

-- 
mail: a...@thur.de  http://adi.thur.de  PGP/GPG: key via keyserver
From: Adrian Knoth 
Bug-Debian: http://bugs.debian.org/590752
Description: Correctly open/read FLAC streams of unknown length
 Some FLAC files provide a zero sample count, because they are live
 streams or dumps of such a live recorder. If so, don't simply return
 zero samples, but treat the stream almost like a pipe and wait for EOF.
--- a/src/flac.c
+++ b/src/flac.c
@@ -342,6 +342,10 @@ sf_flac_eof_callback (const FLAC__StreamDecoder *UNUSED (decoder), void *client_
 	if (psf_ftell (psf) == psf->filelength)
 		return SF_TRUE ;
 
+if (psf->is_pipe) {
+return SF_TRUE;
+}
+
 return SF_FALSE ;
 } /* sf_flac_eof_callback */
 
@@ -405,6 +409,18 @@ sf_flac_meta_callback (const FLAC__StreamDecoder * UNUSED (decoder), const FLAC_
 			psf->sf.samplerate = metadata->data.stream_info.sample_rate ;
 			psf->sf.frames = metadata->data.stream_info.total_samples ;
 
+/* if the file claims to have 0 frames, then it's a
+ * stream of unknown length. We then treat it almost like a pipe
+ * with unknown sample count and not being seekable.
+ * In contrast to a real pipe, we know the actual filesize,
+ * so we don't mess with it.
+ */
+if (0 == psf->sf.frames) {
+psf->sf.frames = SF_COUNT_MAX;
+psf->sf.seekable = SF_FALSE;
+psf->is_pipe = true;
+}
+
 			psf_log_printf (psf, "FLAC Stream Metadata\n  Channels: %d\n  Sample rate : %d\n  Frames  : %D\n", psf->sf.channels, psf->sf.samplerate, psf->sf.frames) ;
 
 			switch (metadata->data.stream_info.bits_per_sample)
___
pkg-multimedia-maintainers mailing list
pkg-multimedia-maintainers@lists.alioth.debian.org
http://lists.alioth.debian.org/mailman/listinfo/pkg-multimedia-maintainers


Bug#590752: audacity: can't import "open" FLAC files

2010-07-29 Thread Ximin Luo

On 29/07/10 22:04, Adrian Knoth wrote:

As a quick workaround, I can provide the following hint:

instead of simply opening/importing the file from the file list, make
sure the file type selector in the open/import dialog is set to "FLAC
files", not "All files" or "All supported files".

This way, audacity's FLAC importing tool is used and everything is fine.
(at least I can open you test1.flac with it).

If you don't set the file type, audacity uses the PCM import module
that relies on libsndfile to open FLAC files.

Looks like this or libsndfile is broken, I'll now investigate closer,
just wanted to share the workaround with you.

If you like, confirm if it's working for you.



Yup, this works, thanks :)

However, when doing this for play1.flac (the 180 MB file), the "Importing 
Files" progress bar doesn't work properly - the "remaining time" flickers 
between 0:00:00 and random hour-long times before suddenly completing.


I guess this is because it doesn't have the "total number of samples" 
information? (But totem can detect total length, somehow.)


Just out of interest, is this considered a broken flac file or not? If so, 
maybe I should file a bug with the GNOME sound recorder people too?




HTH






___
pkg-multimedia-maintainers mailing list
pkg-multimedia-maintainers@lists.alioth.debian.org
http://lists.alioth.debian.org/mailman/listinfo/pkg-multimedia-maintainers


Bug#590752: audacity: can't import "open" FLAC files

2010-07-29 Thread Adrian Knoth
On Thu, Jul 29, 2010 at 11:34:32AM +0100, Ximin Luo wrote:

> Audacity can import test1_s.flac, but not test1.flac. (However, in this 

Thanks for the file.

As a quick workaround, I can provide the following hint:

instead of simply opening/importing the file from the file list, make
sure the file type selector in the open/import dialog is set to "FLAC
files", not "All files" or "All supported files".

This way, audacity's FLAC importing tool is used and everything is fine.
(at least I can open you test1.flac with it).

If you don't set the file type, audacity uses the PCM import module
that relies on libsndfile to open FLAC files.

Looks like this or libsndfile is broken, I'll now investigate closer,
just wanted to share the workaround with you.

If you like, confirm if it's working for you.


HTH

-- 
mail: a...@thur.de  http://adi.thur.de  PGP/GPG: key via keyserver



___
pkg-multimedia-maintainers mailing list
pkg-multimedia-maintainers@lists.alioth.debian.org
http://lists.alioth.debian.org/mailman/listinfo/pkg-multimedia-maintainers


Bug#590752: audacity: can't import "open" FLAC files

2010-07-29 Thread Ximin Luo

play1.flac is 180 megabytes. Here's a cleaner sample, 16 seconds of silence:

$ file test1*.flac
test1.flac:   FLAC audio bitstream data, 24 bit, stereo, 44.1 kHz, length 
unknown
test1_s.flac: FLAC audio bitstream data, 24 bit, stereo, 44.1 kHz, 741888 
samples

Audacity can import test1_s.flac, but not test1.flac. (However, in this case 
totem seems unable to work out the total length of test1.flac, and shows 
"Streaming" instead.)


Also when I try to re-code test1.flac directly (instead of using WAV as an 
intermediate), it comes out with:


$ flac -o test1_r.flac test1.flac
[...]
test1.flac: ERROR: FLAC input has STREAMINFO with unknown total samples which 
is not supported



On 29/07/10 03:20, Reinhard Tartler wrote:

On Wed, Jul 28, 2010 at 21:29:17 (EDT), Ximin Luo wrote:


$ file play1*.flac
play1.flac:   FLAC audio bitstream data, 24 bit, stereo, 44.1 kHz, length 
unknown


can you please attach play1 to this bug?

I'm not that familiar with audacity nor its flac support itself, but I
guess an expert would certainly ask for a 'broken' sample in order to be
able to reproduce it without need to install and use the gnome sound recorder.





test1.flac
Description: audio/flac


test1_s.flac
Description: audio/flac
___
pkg-multimedia-maintainers mailing list
pkg-multimedia-maintainers@lists.alioth.debian.org
http://lists.alioth.debian.org/mailman/listinfo/pkg-multimedia-maintainers


Bug#590752: audacity: can't import "open" FLAC files

2010-07-28 Thread Reinhard Tartler
On Wed, Jul 28, 2010 at 21:29:17 (EDT), Ximin Luo wrote:

> $ file play1*.flac
> play1.flac:   FLAC audio bitstream data, 24 bit, stereo, 44.1 kHz, length 
> unknown

can you please attach play1 to this bug?

I'm not that familiar with audacity nor its flac support itself, but I
guess an expert would certainly ask for a 'broken' sample in order to be
able to reproduce it without need to install and use the gnome sound recorder.

-- 
Gruesse/greetings,
Reinhard Tartler, KeyID 945348A4



___
pkg-multimedia-maintainers mailing list
pkg-multimedia-maintainers@lists.alioth.debian.org
http://lists.alioth.debian.org/mailman/listinfo/pkg-multimedia-maintainers


Bug#590752: audacity: can't import "open" FLAC files

2010-07-28 Thread Ximin Luo
Package: audacity
Version: 1.3.12-4+b1
Severity: important

I don't know if "open" is the right terminology here, but:

$ file play1*.flac
play1.flac:   FLAC audio bitstream data, 24 bit, stereo, 44.1 kHz, length 
unknown
play1_s.flac: FLAC audio bitstream data, 24 bit, stereo, 44.1 kHz, 225787392 
samples

play1.flac was created with GNOME Sound Recorder. play1_s.flac is a re-coded
version of play1.flac, using the `flac` tool to decode it into WAV then encode
it back into FLAC (`flac -d play1.flac && flac -o play1_s.flac play1.wav`)

The two files are otherwise identical, and both have full functionality when
played in totem (ie. random seek, total length known, etc).

However, audacity can only import the latter and NOT the former. When I try
to import play1.flac, literally nothing happens - not even an error message in
the terminal window that it's being run from.

I imagine it's fairly normal to record something then immediately want to edit
it. Audacity claims FLAC support, yet here it leaves no obvious clue here on
how to proceed. I stumbled upon the re-code tactic by sheer luck.


-- System Information:
Debian Release: squeeze/sid
  APT prefers testing
  APT policy: (990, 'testing'), (500, 'unstable'), (500, 'stable'), (1, 
'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.32-5-amd64 (SMP w/2 CPU cores)
Locale: LANG=en_GB.utf8, LC_CTYPE=en_GB.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages audacity depends on:
ii  audacity-data   1.3.12-4 A fast, cross-platform audio edito
ii  libasound2  1.0.23-1 shared library for ALSA applicatio
ii  libc6   2.11.2-2 Embedded GNU C Library: Shared lib
ii  libexpat1   2.0.1-7  XML parsing C library - runtime li
ii  libflac++6  1.2.1-2+b1   Free Lossless Audio Codec - C++ ru
ii  libflac81.2.1-2+b1   Free Lossless Audio Codec - runtim
ii  libgcc1 1:4.4.4-7GCC support library
ii  libglib2.0-02.24.1-1 The GLib library of C routines
ii  libgtk2.0-0 2.20.1-1 The GTK+ graphical user interface 
ii  libid3tag0  0.15.1b-10   ID3 tag reading library from the M
ii  libmad0 0.15.1b-5MPEG audio decoder library
ii  libogg0 1.2.0~dfsg-1 Ogg bitstream library
ii  libsamplerate0  0.1.7-3  Audio sample rate conversion libra
ii  libsndfile1 1.0.21-2 Library for reading/writing audio 
ii  libsoundtouch1c21.3.1-2  sound stretching library
ii  libstdc++6  4.4.4-7  The GNU Standard C++ Library v3
ii  libtwolame0 0.3.12-1 MPEG Audio Layer 2 encoding librar
ii  libvamp-hostsdk32.1-1helper library for Vamp hosts writ
ii  libvorbis0a 1.3.1-1  The Vorbis General Audio Compressi
ii  libvorbisenc2   1.3.1-1  The Vorbis General Audio Compressi
ii  libvorbisfile3  1.3.1-1  The Vorbis General Audio Compressi
ii  libwxbase2.8-0  2.8.10.1-3   wxBase library (runtime) - non-GUI
ii  libwxgtk2.8-0   2.8.10.1-3   wxWidgets Cross-platform C++ GUI t

Versions of packages audacity recommends:
ii  libavcodec52   5:0.6~svn20100603-0.0 library to encode decode multimedi
ii  libavformat52  5:0.6~svn20100603-0.0 ffmpeg file format library

Versions of packages audacity suggests:
pn  ladspa-plugin  (no description available)
ii  libmp3lame0   3.98.4-0.0 LAME Ain't an MP3 Encoder

-- no debconf information



___
pkg-multimedia-maintainers mailing list
pkg-multimedia-maintainers@lists.alioth.debian.org
http://lists.alioth.debian.org/mailman/listinfo/pkg-multimedia-maintainers