Bug#680101: mpg123: writing wav to stdout still works ugly

2012-07-05 Thread Thomas Orgis
Am Wed, 4 Jul 2012 14:25:56 +0400
schrieb dimas : 

> well, in my case:
> 
> >14:19:03 186 ~/downloads/music/Sword/1986 Metalized$ /usr/bin/mpg123 -q -w 
> >/dev/stdout 01.mp3 | file -

Ah, everyday I learn something new. I did not know that there is a
difference for a program between

$ prog > output

and 

$prog | otherprog > output

In the former case, stdout is seekable (as it's a file), in the latter,
it is not (as it's a pipe). Now, thinking about it, it's obvious. The
shell opens the output file and maps the file descriptor to stdout of
the child. Et voilá, you got seekable stdout.

Now, back to the issue. I am getting angry about this. What triggers
here is the attempt of mpg123 to deal with a full disk; code which
tries to deal with
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=67259 . It is actually
non-trivial to handle out-of-disk well when using buffered I/O (C
stdio).

There is a test if at least one byte can be written at the
beginning, combined with a seek to overwrite it again. I have to think
hard why I did this. This is not necessary. Writing the header is test
enough. Ah! No, for raw CD audio (cdr) writing, there is no header.

Well, frick this ... I will remove the test with the single byte. This
will fix this bug here by reverting to old behaviour. Only concession
to bug 67259 is catching out-of-disk while writing WAV/AU header and
informing at the end if out-of-disk condition prevented full output.

I hope that makes everyone reasonably happy. Except me: I should just
have ignored bug 67259. Two regressions with one attempt at fixing a
not-really-fixable bug. That sucks.

And: Looking for possible aliases for stdout won't happen. It will be
treated just like any other file (in the case of a pipe, a non-seekable
one).

I will also clear up the situation about changing input format and WAV
writing for the next release (at least document it).

This stuff will part of mpg123 1.15.0, not a new 1.14.x release, as I
am explicitly changing functionality (even if it is only a single byte
write). Test with http://mpg123.org/snapshot --- does that work with
dir2ogg?


Alrighty then,

Thomas

-- 
Thomas Orgis - Source Mage GNU/Linux Developer
(http://www.sourcemage.org) OrgisNetzOrganisation ---)=-
http://orgis.org GPG public key D446D524:
http://thomas.orgis.org/public_key Fingerprint: 7236 3885 A742 B736
E0C8 9721 9B4C 52BC D446 D524


signature.asc
Description: PGP signature


Bug#680101: mpg123: writing wav to stdout still works ugly

2012-07-04 Thread dimas
well, in my case:

>14:19:03 186 ~/downloads/music/Sword/1986 Metalized$ /usr/bin/mpg123 -q -w 
>/dev/stdout 01.mp3 | file -
[wav.c:143] error: cannot even write a single byte: Illegal seek
[audio.c:630] error: failed to open audio device
[mpg123.c:902] error: Failed to initialize output, goodbye.
/dev/stdin: very short file (no magic)
>14:19:23 186 ~/downloads/music/Sword/1986 Metalized$ /usr/bin/mpg123 -q -w - 
>01.mp3 | file -
[wav.c:428] warning: Cannot rewind WAV file. File-format isn't fully conform 
now.
/dev/stdin: RIFF (little-endian) data, WAVE audio, Microsoft PCM, 16 bit, 
stereo 44100 Hz

with "-w /dev/stdout" it drops errors and outputs nothing. but with "-w -" it 
successfully outputs wav file.
i have version 1.14.2+svn20120622-1, most recent in Debian testing.


2012-186 01:02 Thomas Orgis  wrote:
> What exactly fails? With 1.14.3 (also 1.14.2, actually) I do this:
> 
> $ mpg123 -w - bla.mp3 > bla.wav
> $ mpg123 -w /dev/stdout bla.mp3 > bla2.wav
> $ md5sum bla*.wav
> ebcdd5f3136e11265c99c578815c4b9b  bla2.wav
> ebcdd5f3136e11265c99c578815c4b9b  bla.wav
> 
> Same for trunk ... at least for a single file, I don't see any
> problem. What did you test?



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org



Bug#680101: mpg123: writing wav to stdout still works ugly

2012-07-03 Thread Thomas Orgis
What exactly fails? With 1.14.3 (also 1.14.2, actually) I do this:

$ mpg123 -w - bla.mp3 > bla.wav
$ mpg123 -w /dev/stdout bla.mp3 > bla2.wav
$ md5sum bla*.wav
ebcdd5f3136e11265c99c578815c4b9b  bla2.wav
ebcdd5f3136e11265c99c578815c4b9b  bla.wav

Same for trunk ... at least for a single file, I don't see any problem. What 
did you test?


Alrighty then,

Thomas


signature.asc
Description: PGP signature


Bug#680101: mpg123: writing wav to stdout still works ugly

2012-07-03 Thread dimas
0. because, imho, good program should correctly handle as much aliases as 
possible, not limiting to "-" only, but also "/dev/stdout", "/dev/fd/1" or 
whatever it can be.
1. it was working for a long time until got broken in some of recent versions
2. not only dir2ogg may rely on that behaviour.

of course it's up to dir2ogg devs to fix this call as well. but here we have 
good old feature broken, and that causes some pain - isn't it a bug?))


2012-185 18:05 Reinhard Tartler  wrote:
> Why not fix dir2ogg to call mpg123 correctly?



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org



Bug#680101: mpg123: writing wav to stdout still works ugly

2012-07-03 Thread Reinhard Tartler
On Tue, Jul 3, 2012 at 5:16 PM, dimas  wrote:
> Package: mpg123
> Version: 1.14.2+svn20120622-1
> Severity: normal
>
> hello.
> after recent upgrade on Debian testing i've found that dir2ogg (that uses 
> mpg123 directly) fails to do the job. pleasee see #679813 for details.
> after digging around i've also read this in mpg123's changelog:
>> mpg123 (1.14.2-1) unstable; urgency=low
>>
>>   * New upstream release.
>> - Fix writing of WAV to stdout.
>>
>>  -- Miguel A. Colón Vélez   Sat, 12 May 2012 
>> 13:30:02 -0400
> looks promising, but. dir2ogg calls mpg123 with "-q -w /dev/stdout 
> /path/to/file.mp3". i've tried the same and it failed. but when i replaced 
> "/dev/stdout" with dash (-w - filename.mp3) - it works fine!
> thus we see that output to stdout now works incorrect, and we need to fix 
> understanding of "/dev/stdout" as output file, not only "-". hope that's 
> easy))

Why not fix dir2ogg to call mpg123 correctly?
-- 
regards,
Reinhard



--
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org



Bug#680101: mpg123: writing wav to stdout still works ugly

2012-07-03 Thread dimas
Package: mpg123
Version: 1.14.2+svn20120622-1
Severity: normal

hello.
after recent upgrade on Debian testing i've found that dir2ogg (that uses 
mpg123 directly) fails to do the job. pleasee see #679813 for details.
after digging around i've also read this in mpg123's changelog:
> mpg123 (1.14.2-1) unstable; urgency=low
> 
>   * New upstream release.
> - Fix writing of WAV to stdout.
> 
>  -- Miguel A. Colón Vélez   Sat, 12 May 2012 
> 13:30:02 -0400
looks promising, but. dir2ogg calls mpg123 with "-q -w /dev/stdout 
/path/to/file.mp3". i've tried the same and it failed. but when i replaced 
"/dev/stdout" with dash (-w - filename.mp3) - it works fine!
thus we see that output to stdout now works incorrect, and we need to fix 
understanding of "/dev/stdout" as output file, not only "-". hope that's easy))



--
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org