mpg123

from Wikipedia, the free encyclopedia
mpg123

Mpg123.png
Console output of mpg123 when playing an mp3 file.
Basic data

developer Michael Hipp, Thomas Orgis, Oliver Fromme, Nicholas Humfrey
Publishing year 1999
Current  version 1.26.3
( July 17, 2020 )
operating system Unixoid system , Windows , macOS
programming language C , assembly language
category decoder
License LGPL
German speaking No
mpg123.de

mpg123 is a free audio player on the command line for MPEG-1 audio. The supported formats are MPEG-1 layers 1 , 2 and 3 (the latter is known as MP3 ). Its name is based on its support for these three formats. It is one of the most popular MP3 players and many other projects use its code.

Function and properties

mpg123 is used to decompress data in MPEG-1 audio format and to output it if necessary. This means that the program can serve as a command line based player for music. Due to its options, however, it can also be used as a decompression stage for other programs.

Required computing power

The goal of mpg123 is to decode and play the data in real time. This means that the program should decode faster than the sound is output. This makes it possible to decode a music track while it is being played. According to the homepage, this is already possible with an 80486 processor clocked at 120 MHz, for example . On many more modern computers, mpg123 creates a very low system load, so you can run several instances of mpg123 at the same time, for example to fill different rooms with sound. Mixer programs such as dermixd use several instances of mpg123 to implement a smooth transition - so-called crossfading - between two music tracks. In addition, mpg123 has specially optimized code for 80386 , 80486 , Pentium , AltiVec , MMX and 3DNow . A gain in speed can therefore be achieved on systems with such architectures. If the computing power is not sufficient for a certain use, you can use the built-in 2: 1 and 4: 1 downsampling , which reduces the sampling rate of the output by half or a quarter in order to achieve a higher speed.

Technical characteristics

The program runs on various Unix - operating systems . Are officially supported Linux , FreeBSD , SunOS 4.1.3, Solaris 2.5, HP-UX 9.x, IRIX and, more recently, macOS and Cygwin (Unix layer for Windows ). Further ports to Windows and Mac OS X exist.

Many different devices for outputting the sound are also supported. In addition, mpg123 also masters the option of outputting the decoded data to the standard output. In this way, the data can be processed by another program. The data can also be written as WAV to a file or raw on the standard output.

mpg123 normally uses floating point arithmetic for its mathematical calculations, but it can also be compiled to use fixed point arithmetic . This distinguishes mpg123 from MAD , for example , which always uses fixed-point arithmetic. Floating point arithmetic is built into many modern desktop processors and can therefore be processed quickly. On processors for PDAs, however, a higher execution speed can be achieved with fixed point arithmetic.

Other properties

The MPEG specification defines conditions under which the reproduction of a decoder can be said to be "correct". For this purpose, the deviation of the decoded output from the reference is measured. These deviations must not exceed a certain value in order not to violate the conditions for correct reproduction. Tests have shown that mpg123 meets these requirements.

Non-pause playback - so-called gapless playback - means that no pause can be heard between tracks being played. However, the MP3 format saves the data in sections (frames) so that the track length of the piece of music does not necessarily have to correspond to the sum of the length of the individual frames. In addition, the underlying algorithm requires additional length for correct playback. Therefore, additional information on the correct beginning and end of the piece of music is required in order to achieve gapless playback. For this purpose, mpg123 evaluates information from LAME . It also evaluates the ID3 tags and outputs the information obtained in this way on the console. Replay Gain is also supported. mpg123 accepts keyboard commands even during decoding. There is also another control interface via standard input and output, with which the music output can be controlled. Some user interfaces use this functionality.

history

Michael Hipp started mpg123 in 1995 as a further development of the mpegaudio package. Over time, other programmers made contributions, mainly optimized decoding routines for various processor architectures.

At the beginning of 2001, the activity of the further development of mpg123 was reduced after several versions in the 0.59 series had previously been released. As several serious security vulnerabilities became known over time, the Linux distributions Debian (based on mpg123 0.59r) and Gentoo (based on mpg123 0.59s) developed patches to fix these security vulnerabilities. Michael Hipp pointed out these problems in early 2005 and advised against using the official, but unkempt version.

In addition to these variants, various authors offered further developments as patches. In April 2005 Nicholas Humfrey started a project on SourceForge . He released a version called mpg123-gpl, based on version 0.59 and the Debian patches. As a further development, he implemented the use of GNU - Autoconf and ported the project to Mac OS X. Independently of this, Thomas Orgis developed several versions of mpg123-thor in 2005, which incorporated some freely available patches based on version 0.59r, including the Debian security patches. In addition, the control interface for front ends has been revised.

These two projects started working together in late 2005. With Michael Hipp's approval, they developed the new "official" version of mpg123. After several beta versions, version 0.60 of mpg123 was released on August 29, 2006. The date was chosen symbolically, one of the patents relating to MP3 expired on that day in Germany.

License and patents

From version 0.60, mpg123 is licensed under the LGPL and thus fulfills the conditions for free software and open source .

At the beginning of its development, however, mpg123 was still released under the following condition: free for private use, ask me when you want to do something commercial . The restrictions on commercial use, however, are inconsistent with the basic ideas behind free software. Many Linux distributions therefore put mpg123 in a non-free section or dispensed with this software entirely.

Because of this situation, Joe Drew developed a script in 1999 to replace mpg123 for use in FreeAmp . In 2001 he decided to develop a complete replacement called mpg321 from it, which should be completely compatible with mpg123 as well as free software.

Michael Hipp changed the license from mpg123 to GPL and the license of mpglib to LGPL in later publications . The program thus became free software, the need for a free alternative was eliminated. With the release of version 0.60, the new project managers changed the license for the entire package to LGPL.

The Fraunhofer-Gesellschaft and Thomson hold a number of software patents relating to techniques for using the MP3 format. According to their own statement, however, they do not charge license fees from free decoders. In addition, some of these patents have already expired.

Distribution and variants

Since version 0.60 was released, mpg123 has been downloaded from Sourceforge around a hundred times a day. There is also the option of downloading the program directly from the project page. It is also included in the major Linux distributions.

Michael Hipp created a Java variant in 1998 under the name jmpg123. However, this variant never got beyond version 0.1.

There is a Windows port of the program. mpg123 or its code components were used as decoders for MP3 in many other projects, for example XMMS , MPlayer , LAME , Xine and as a plug-in for Winamp .

Web links

Individual evidence

  1. mpg123.de .
  2. a b Windows version of mpg123 ( memento from March 15, 2007 in the Internet Archive ) (Japanese), accessed on November 18, 2011.
  3. Variant of mpg123 for Mac OS X
  4. underbit.com
  5. CVE-2004-0991 , Buffer-Overflow , CVE-2006-1655
  6. Website of mpg123-thor ( memento of the original from October 13, 2006 in the Internet Archive ) Info: The archive link was inserted automatically and has not yet been checked. Please check the original and archive link according to the instructions and then remove this notice. @1@ 2Template: Webachiv / IABot / thomas.orgis.org
  7. a b List of patents relating to MP3
  8. project page of mpg321
  9. Statement from the project manager on the patents
  10. Download statistics from mpg123 at Sourceforge