Bug#697144: dir2ogg: Broken sound speed of converted files

2013-03-17 Thread Thomas Orgis
TLDR: Please check with current mpg123 snapshot and think about either
prescribing format and letting mpg123 write really raw data or make
proper use of the improper WAV header.

Hello,

mpg123 upstream here. I really did not intend to break dir2ogg in
various ways. I totally regret touching WAV writing code at all. While
I think that it is a bit bold to pipe something like WAV to stdout and
expect it to work (many programs really are not happy with the
inconsistent headers that this produces, take audacity or even just
libsndfile), there are some that could make use of this. Among those
are oggenc and lame, for that matter.

I do wonder why you have

opts=['-r', '-R', str(mutagen.File(self.song).info.sample_rate)]

for mpg123 output in dir2ogg. Is this already an attempt to fix broken
WAV output by mpg123? If not, I really have to wonder why you do not just use

mpg123 -s input.mp3 | ogggenc -r -R $rate -C $channels -B 16 -o 
output.ogg

or rather

mpg123 -e s24  -s input.mp3 | ogggenc -r -R $rate -C $channels -B 24 -o 
output.ogg

for avoiding extra quality impact from rounding to 16 bit in between
(sadly, oggenc does not seem to support float, which would avoid
integer intermediate altogether).

Note $channels ... current dir2ogg will screw up if the input is a mono
file. It assumes stereo. 

Thing is, you tell mpg123 to write WAV headers and then tell oggenc to
ignore them via -r. That confuses me. If you want raw data, tell mpg123
to deliver raw data to stdout via the -s switch.

But, once we got through this mess with the repeatedly messed up
WAV-to-stdout (which I always recommend to use with caution only ...),
for example using current http://mpg123.org/snapshot, which shall
become mpg123 1.16.0, you can just do that:

src/mpg123 -w - -e s24 input.mp3 | oggenc  -o output.ogg -

and have it magically work. Note that the '-e s24' might not be
available on certain builds of mpg123. If it is supported, it appears in

mpg123 --longhelp

in this line:

 -e c --encoding c force a specific encoding (s16 u16 u8 s8 ulaw alaw 
f32 s32 u32 s24 u24)

I might add a specific switch to ask about that (mpg123
--list-encodings or such) to 1.16.0, if it's desired.

To support all versions of mpg123, you can extend your hack that
inserts the sample rate via mutagen and have it provide the full format
(including channel count) and just pipe the raw data from mpg123 via
-s. The option for s24 format would just reduce the quality loss a
bit ... if you care about that when converting between lossy formats;-)

Using the WAV output of a minimally required mpg123 = 1.16.0 would
avoid the question of checking which output format is available. People
can make different builds of mpg123 that have different (default)
sample format (floating point, for example).

It's interesting that oggenc and lame are the only tools I found with
some quick tests that are happy with the kind of broken WAV you get via
pipes. But then, if you intend to store such files, you'd better write
them properly.


Alrighty then,

Thomas


signature.asc
Description: PGP signature


Bug#697144: dir2ogg: Broken sound speed of converted files

2013-03-03 Thread Julian Andres Klode
Control: reassign -1 mpg123
Control: affects -1 dir2ogg

On Tue, Jan 01, 2013 at 08:07:51PM -0200, Nelson A. de Oliveira wrote:
 Package: dir2ogg
 Version: 0.11.8-1
 Severity: important
 
 Something is really broken when converting the attached
 decima-quinta.mp3 with a simple dir2ogg decima-quinta.mp3
 

That's true, yes. You used mpg123 as the mp3 decoder, right? It
seems that this creates a different file depending on whether
the output is a file or a pipe. Thus, if you pass dir2ogg the
-P argument to create a temporary file, everything works.

Using another mp3 decoder also works.

(And yes, mpg123 is completely broken now in combination
with dir2ogg without the -P option, as it's handling of
-w/dev/stdout and -w- broke a second time[1]).

[1] I switched dir2ogg 0.11.4 to use -w/dev/stdout instead
of -w- for mpg123, as mpg123 did not understand -w- anymore;
now only -w- works, and -w/dev/stdout is broken.

-- 
Julian Andres Klode  - Debian Developer, Ubuntu Member

See http://wiki.debian.org/JulianAndresKlode and http://jak-linux.org/.


pgpPDc6yetDp6.pgp
Description: PGP signature


Bug#697144: dir2ogg: Broken sound speed of converted files

2013-01-01 Thread Nelson A. de Oliveira
Package: dir2ogg
Version: 0.11.8-1
Severity: important

Something is really broken when converting the attached
decima-quinta.mp3 with a simple dir2ogg decima-quinta.mp3

Result is also attached.

Thank you!

Best regards,
Nelson

-- System Information:
Debian Release: 7.0
  APT prefers unstable
  APT policy: (500, 'unstable'), (100, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 3.5-trunk-amd64 (SMP w/8 CPU cores)
Locale: LANG=pt_BR.UTF-8, LC_CTYPE=pt_BR.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages dir2ogg depends on:
ii  mpg321 [mpg123]  0.3.2-1.1
ii  python   2.7.3-3
ii  python-mutagen   1.20-1
ii  vorbis-tools 1.4.0-1

Versions of packages dir2ogg recommends:
pn  faadnone
ii  mplayer2 [mplayer]  1:2.0~git20120817-dmo1
pn  musepack-tools  none
pn  wavpack none

Versions of packages dir2ogg suggests:
pn  cdparanoia | icedax  none
pn  python-cddb  none
pn  python-musicbrainz2  none

-- no debconf information


decima-quinta.mp3
Description: audio/mpeg


decima-quinta.ogg
Description: application/ogg