#11 Malformed mpg123 command

closed-fixed
bidd
None
5
2005-02-07
2005-02-03
blaksaga
No

From the debug info, mpg123 has been getting called as
such:

mpg123 -v --resync -r44100 --stereo
-w/tmp/GnomeBaker/blaksaga/create_audiocd/06 -
Trouble.wav
/mnt/share/audio/music/Rock/Coldplay/Parachutes/06 -
Trouble.mp3

There is two problems here:
1) There is no space after the -w.
2) There are no quotes around the filenames.

This is how it should be called:

mpg123 -v --resync -r44100 --stereo -w
"/tmp/GnomeBaker/blaksaga/create_audiocd/06 -
Trouble.wav"
"/mnt/share/audio/music/Rock/Coldplay/Parachutes/06 -
Trouble.mp3"

When mpg123 is not called properly, no .wav files are
created in /tmp. As a result gnomebaker displays
something about "Please insert a blank CD into the CD
writer" because it errors out when trying to burn these
nonexistant files.

Discussion

  • bidd

    bidd - 2005-02-03

    Logged In: YES
    user_id=1161543

    Please can you check that the
    tmp/GnomeBaker/blaksaga/create_audiocd/ directory exists and
    also are you using mpg123 or mpg321?

    The reason I ask is that it works perfectly on my machine.

     
  • blaksaga

    blaksaga - 2005-02-03

    Logged In: YES
    user_id=1094667

    /tmp/GnomeBaker/blaksaga/create_audiocd/ does not exist but
    nothing changes if I create the directory manually before
    burning.

    This is EXACTLY what debug spits out:
    mpg123 -v --resync -r44100 --stereo
    -w/tmp/GnomeBaker/blaksaga/create_audiocd/06 -
    Trouble.wav
    /mnt/share/audio/music/Rock/Coldplay/Parachutes/06 -
    Trouble.mp3

    which is most definately incorrect. Running this from
    command line results in "Reading from standard input" or
    something of that nature and no wav file is created. This
    can be validated by the fact that while the conversions are
    taking place in gnomebaker there are no audio files created
    in the tmp directory.

    Also, without quotation marks around the filenames the
    spaces in the names (ie: 06 - trouble.wav) cause the mpg123
    arguments to be parsed incorrectly.

    If you want the entire debug message I can post it but it
    does not contain any errors (excluding the mpg123 call)
    other than the "Please insert a blank CD into the CD writer"
    which I can guarantee is caused by the fact that there are
    no .wav files created due to mpg123 being called incorrectly.

    I'll download the source again and come up with a patch
    myself if that's what it takes. If my assumptions are
    correct it's an easy fix.

     
  • blaksaga

    blaksaga - 2005-02-03

    Logged In: YES
    user_id=1094667

    BTW: This is version 0.2.

     
  • Nobody/Anonymous

    Logged In: NO

    I completely understand what you are saying.

    Please bear with me as I am trying to get to the bottom of
    the problem; If I make the changes you suggest (there's no
    need to send a patch but thanks anyway) , it no longer works
    on my machine. So there's something more fundamentally wrong
    as we have a difference between our machines.

    Gnomebaker invokes mpg123 via fork and execvp, not directly
    via the command line. Hence there are often slight
    differences in invocation. I've never understood why and
    it's never been a problem until now.

    Please could you tell me the version of libc you are using
    along with the version of mpg123 (or mpg321).

     
  • blaksaga

    blaksaga - 2005-02-03

    Logged In: YES
    user_id=1094667

    Firstly, src/mpg123.c, mpg123_add_mp3_args(), at around line 50:

    -----
    exec_cmd_add_arg(cmd, "-w \"%s\"", *convertedfile);

    g_message("Converted file is [%s]", *convertedfile);
    g_free(filename);

    exec_cmd_add_arg(cmd, "\"%s\"", file);
    -----

    This will allow mpg123 to be called properly. It's still
    not executing the command though from what I can tell as the
    mp3 is not actually getting decoded and put in /tmp.

    I'll try to dig deeper in the code and see if I can figure
    out what is wrong.

    BTW: Documentation is your friend. :P

     
  • Nobody/Anonymous

    Logged In: NO

    Thanks

    Please could you tell me the version of libc you are using
    along with the version of mpg123 (or mpg321).

    What distro are you using?

     
  • blaksaga

    blaksaga - 2005-02-03

    Logged In: YES
    user_id=1094667

    nobody: Thanks for the reply.

    Here's my libc and mpg123

    sys-libs/glibc-2.3.4.20040808-r1
    media-sound/mpg123-0.59s-r9
    gentoo linux (2.6.9-gentoo-r13 i686 AMD Athlon(TM) XP 2000+
    AuthenticAMD GNU/Linux)

     
  • Nobody/Anonymous

    Logged In: NO

    Fixed.

    We previously would write:

    exec_cmd_add_arg(cmd, "-w%s", *convertedfile);

    whereas the correct way to do it is:

    exec_cmd_add_arg(cmd, "%s", "-w");
    exec_cmd_add_arg(cmd, "%s", *convertedfile);

    The reason for this is thay they are discrete arguments on
    the command line and as such must be seperate arguments in
    the argument array passed to execvp.

    As they are discrete arguments in the array there is no need
    to quote filenames.

    Thanks for highlighting this issue...

     
  • bidd

    bidd - 2005-02-05
    • assigned_to: nobody --> bidd
    • status: open --> pending-fixed
     
  • blaksaga

    blaksaga - 2005-02-05
    • status: pending-fixed --> open-fixed
     
  • blaksaga

    blaksaga - 2005-02-05

    Logged In: YES
    user_id=1094667

    Thanks for the fix. I knew the way it was being called
    wasn't correct. I'll take your word on not needing
    quotation marks. Still, however, this does not change the
    fact that it will not put .wav files in my /tmp. I thought
    this was the reason why but maybe it is something else.
    Should I start another bug report?

     
  • bidd

    bidd - 2005-02-06

    Logged In: YES
    user_id=1161543

    Have you tried the latest CVS?

     
  • Nobody/Anonymous

    Logged In: NO

    Any news on this? Is it fixed in 0.3?

    gamehack

     
  • blaksaga

    blaksaga - 2005-02-07

    Logged In: YES
    user_id=1094667

    It seems to be working for me in 0.3. Thanks.

     
  • bidd

    bidd - 2005-02-07
    • status: open-fixed --> closed-fixed
     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks