login | register
Sat 30 of Aug, 2008 [01:25 UTC]

voip-info.org

History

mpg123

Created by: Yosh,Last modification on Wed 04 of Jun, 2008 [10:19 UTC] by sty
Quoted from the homepage:

"mpg123 is a real time MPEG 1.0/2.0/2.5 audio player for layers 1,2 and 3 (MPEG 1.0 layer 3 aka MP3 most commonly tested). Among others working with Linux, MacOSX, FreeBSD, SunOS4.1.3, Solaris 2.5, HPUX 9.x, SGI Irix and Cygwin. It is free software licensed under LGPL."

Homepage of MPG123

mpg123 version 0.59r is known to work with Asterisk, but is outdated an has some bugs.Please use the updated version and
read what the maintainer tells us about it:


As current maintainer of the mpg123 project (yes - it _is_ active again; officially since two years now), I from time to time get requests from asterisk users on how to set up mp3 decoding for music-on-hold (I guess) with mpg123. For several years, there prevailed a really unfortunate situation in that respect:

  • The official mpg123 was dead, the old version 0.59r in debian worked, but was confined to the non-free section
  • The slightly fresher pre0.59s (in gentoo, for example) had trouble with the downsampling to 8000Hz due to the MMX accelerated decoder.
  • Then there was/is the sort-of replacement mpg321 masquerading as mpg123 in many GNU/Linux distributions. It has the main functionality of mpg123, but misses quite a number of goodies — like the downsampling to 8000Hz. Besides, it is also a dead project since 2002 or so...

Now, enter 2008! Thanks to the hard work of the mpg123 team, there is a current successor to the venerable 0.59 that
  • fixes all known security bugs (overflows, etc.)
  • fix all known playback problems of specific files
  • is Free under the LGPL, thus able to re-replace mpg321 again in distributions
  • since version 1.0 offers the decoder as a library

The revived mpg123 is entering standard distibutions at moderate pace... version 0.67 is in debian lenny, gentoo has 1.3 and 1.4 . Pkgsrc-wip is working on a current version. Clearly, there is still some work to do to make it known better and this posting is part of that. Also, personally, I would like to lower (to zero;-) the number of people who ask me about troubles they have with asterisk and some outdated mpg123 or even the faking mpg321.

So the first major message I would like to give to the asterisk community is that there is a current, active mpg123 and that the old way of calling it in a pipe to produce 8kHz pcm audio from MPEG files works just fine, provided you use a current one. The second message is: In case you want to avoid the trouble of external programs, that may even call themselves mpg123 although they aren't mpg123, you can use the libmpg123 that is provided by mpg123 since version 1.0 for an asterisk input module. There is API documentation on http://mpg123.org/api

Alrighty then,

Thomas Orgis, mpg123 maintainer.



Further information and source is available at:




Do not install or use mpg321 on the linux-System because it does not do the necessary converting of the frequency.
So e.g. if your music on hold sounds odd on the phone, most likely there is a problem with the codec/player.

INSTALLING THE CORRECT VERSION
If you are *EVER* unsure that mpg123 is correctly installed (correct verison etc), you can enter the asterisk source tree, and type 'make mpg123' (without quotes), and mpg123 v0.59r will be download ed, unpacked, and built for you, and then a simple make install will install asterisk AND mpg123 in one smooth motion.
-Josh

Also see format_mp3 from asterisk-addons. This can be used as a replacement for a external mp3 decoder.
See Asterisk MusicOnHold Configuration for more info.

See Also


Comments

Comments Filter
222

333broken'make mpg123'

by steelback, Friday 02 of February, 2007 [18:56:16 UTC]
thanks to Mathias Pasquay, your solution helped me
I have the same problem with Slackware 11.0, gcc 3.4.6, GNU Make 3.81
222

333Same Problem in Suse 10.2

by silviolucas, Friday 26 of January, 2007 [12:44:10 UTC]


gcc: gcc-4.1.3-29
make: make-3.81-23

I was compilling mpg123 in my suse box (10.2 version) and I had the same problem of Mathias Pasquay. I did the same changes and works normally. I don't know why, but works. :) My gcc is gcc-4.1.3-29 and make is make-3.81-23.
222

333

by callwbs, Monday 13 of November, 2006 [06:24:16 UTC]
Thanks for the post - it fixed our issue with Fedora Core6.
222

333Debian Sid (gcc 4.11 and make 3.81) workaround

by Hias, Sunday 22 of October, 2006 [11:25:43 UTC]
If you try to compile mpg123 with "make mpg123" on a Debian Sid system you'll get the following compile error:

gcc -DI386_ASSEM -DPENTIUM_OPT -DREAL_IS_FLOAT -DLINUX \
        -DREAD_MMAP -DOSS -DTERM_CONTROL\
        -Wall -O2 -m486 \
        -fomit-frame-pointer -funroll-all-loops \
        -finline-functions -ffast-math   -c -o dct64_i386.o dct64_i386.c
<command line>:1:13: warning: missing whitespace after the macro name
as   -o decode_i586.o decode_i586.s
make[3]: *** No rule to make target `\
', needed by `mpg123'.  Stop.


I just changed these lines in the Makefile
linux:
                $(MAKE) CC=gcc LDFLAGS= \
                OBJECTS='decode_i386.o dct64_i386.o decode_i586.o \
                        audio_oss.o term.o' \
                CFLAGS='-DI386_ASSEM -DPENTIUM_OPT -DREAL_IS_FLOAT -DLINUX \
                        -DREAD_MMAP -DOSS -DTERM_CONTROL\
                        -Wall -O2 -m486 \
                        -fomit-frame-pointer -funroll-all-loops \
                        -finline-functions -ffast-math' \
                mpg123-make


in these two lines

linux:
                $(MAKE) CC=gcc LDFLAGS= OBJECTS='decode_i386.o dct64_i386.o decode_i586.o audio_oss.o term.o' CFLAGS='-DI386_ASSEM -DPENTIUM_OPT -DREAL_IS_FLOAT -DLINUX  -DREAD_MMAP -DOSS -DTERM_CONTROL -Wall -O2 -m486 -fomit-frame-pointer -funroll-all-loops -finline-functions -ffast-math' mpg123-make




now it works. I don't know if this is a Debian specific problem or if it has something to do with my make or gcc version.