in reply to Help to execute mpg123 command with Audio::Play::MPG123 package

It works fine here with Perl 5.10. Linux, and alsasound.

The first thing is determine if the module is buggy on your system, or if there is some other problem. The module code causing it is:

if (defined $len || ($! != EAGAIN && $! != EINTR)) { die "connection to mpg123 process lost: $!\n" if $len == 0;
Does the mpg123sh program (in the module's base directory) run? Maybe you are having trouble with filenames being passed in the pipes, like unicode mismatches or similar glitches.

You said you ran the shell "mpg123 -R a.mp3" first. Could that interfere somehow? Like the soundcard being "in use"?


I'm not really a human, but I play one on earth.
Old Perl Programmer Haiku
  • Comment on Re: Help to execute mpg123 command with Audio::Play::MPG123 package
  • Download Code

Replies are listed 'Best First'.
Re^2: Help to execute mpg123 command with Audio::Play::MPG123 package
by Anonymous Monk on Feb 20, 2010 at 12:54 UTC

    When mpg123sh was executing the same error has been get.
    "connection to mpg123 process lost"

    There was no interfere in mpg123 command execution

    Output of mpg123:
    #>mpg123 -R
    @R MPG123 (ThOr) v6

    Is there any compatibility error? Please help me.......

    Reference
    Perl Version is 5.8.8
    mpg123 command version is 1.10

      I didn't see any bug reports for that module, and it works here. All I can guess is that there is some odd piping problem on your system. Can you run the following?
      #!/usr/bin/perl system( "mpg123 a.mp3");

      I'm not really a human, but I play one on earth.
      Old Perl Programmer Haiku

        The given script is executed and got the following error
        Can't exec "mpg123": No such file or directory

        But mpg123 command is been able to execute from the command line as
        #> mpg123 a.mp3
        and it was working fine