Japanese page is here.
Other softwares


MMX support patch etc. for xmms

I attempt porting MMX mpeg audio decoder from mpg123 CVS tree to xmms (The original MMX decoder for mpg123 was written by Mr. higway under GPL. )

MMX support patch integrated new MMX support into 3DNow!/FPU decoder selection, so preference tab of MPG123 (MP3 decoder) was changed as follows.

This patch was merged into XMMS-1.2.8, so my private experiment is over. Thank you for visiting my page.

Download :

Development version

Old version

Benchmark patch

It seems that the latest CPU is fast, so 3DNow!/MMX effect is incomprehensible. And it is not appropriate to use 'top' to measure a performance. Therefore, I wrote a small patch, 'enable_benchmark', extended disk writer plug-in of XMMS (output to /dev/null mode). In disk writer plug-in, I think that a decoding performance can be measured, without receiving restrictions of the speed of a hard disk, since MP3 file is decoded at full speed.

Furthermore, my benchmark patch adds '-b' option in xmms command line. This is the mode which terminates xmms, when finishing playing the music of current play list. After selecting output plug-in as the "disk writer" and making it the benchmark mode (outputs to /dev/null) in the setting dialog of xmms, quit xmms once. And start xmms with '-b' option from command line. For example, 'time xmms -b', you can measure decoding time.

How to compile :

  1. Get xmms-1.2.7 source (ex. from http://www.xmms.org/)
  2. Unpack xmms-1.2.7.tar.gz (ex. tar xfz xmms-1.2.7.tar.gz )
  3. Apply MMX patch
    (cd xmms-1.2.7; zcat xmms-1.2.7-mmx.patch.gz | patch -p1 )
  4. Apply 'enable_benchmark' patch (optional)
    (zcat xmms-1.2.6-dwbench.patch.gz | patch -p1 )
  5. Remake configure, type "aclocal; automake; autoconf"
    And also remake in libxmms, type "cd libxmms; aclocal; automake; autoconf; cd .."
  6. Type "./configure --enable-simd"
  7. Type "make" to compile
  8. Become root if necessary, and type "make install"
  9. Good luck!

Performance Benchmark :

I measured for decoding time by 'DiskWriter plugin' (applied my benchmark patch), xmms-1.2.4 + MMX patch release 2. Target files are 96Kbit/s VBR, MPEG1 layerIII (3 files total 7410KB, 13m38s).

Decoding times in following table, user time of 'time'.

3DNow! MMX FPU
Duron 700@888, 256MB 9.61s1.2% 7.83s1.0% 10.18s1.2%
85X 104X 80X
K6-III/450@500, 128MB 20.19s2.5% 26.12s3.2% 39.17s4.8%
41X 31X 21X
PIII-500@515, 128MB NA 17.73s2.2% 21.68s2.7%
46X 38X

Change Log :

2002.9.7modified automatic decoder selection
2002.8.24rewrite automatic decoder selection. use x86cpucaps if installed.
2002.3.9update for xmms-1.2.7
2002.2.9update for xmms-1.2.6
remove modification 'aboutbox'
2001.12.24modify decode_i386.c etc, to reduce overheads (not much tested) .
Change preference tab, now you can change channel (stereo/mono) when 3DNow! decoder selected.
And now you cannot change resolution (8bit/16bit) and down sample (1/2/4) when MMX decoder selected.
2001.12.8fix a bug when playng monophonic mp3 with MMX decoder (Thanks Mr.Waschk)
but slower than release 2(Thanks Mr.Hillyerd (on MMX Pentium 200))
2001.11.17fix a serious bug fix mpg123 initialization problem (Thanks Mr.Waschk, Mr.Jordan)
disable SSE detection
2001.6.30update for xmms-1.2.5
2001.5.19update for xmms-1.2.5-pre1
2001.4.14fix a serious bug related make_decode_tables (could not play with 3DNow!/FPU decoder correctly)
fix a compilation problem.
code clean up for reducing some overheads.
fix a small bug in configure dialogue etc.
2001.4.71st release for xmms-1.2.4. implement MMX optimized decoder, based on Mr. higway's MMX decoder in mpg123-CVS
added MMX decoder in decoder selection dialogue
replace getcpuflags.s to check_cpu.c for detecting MMX
changed My URL, in the about dialogue of MPEG Layer 1/2/3 Plugin

Screen shot :

Automatic CPU Detection (running on 3DNow! supported system, in Japanese locale) disable Automatic Detection (in English)

3DNow! support patch for xmms

I have enjoyed playing MP3 with xmms and mpg123. I found the source code of libmpg123 (MP3 decode plugin in xmms) is similar to mpg123, but it doesn't have support 3DNow! instructions. Therefore I attempt to porting decoder engine of mpg123-0.59r and new 3DNow! patch to xmms.

This patch was merged into XMMS-1.2.4, so my private experiment is over. Thank you for visiting my page.
This patch was merged into XMMS-1.2.4, but 3DNow! support was disabled in default. So XMMS binary, you can get from xmms web site, was not support 3DNow! If you enable 3DNow!, please read How to enable 3DNow! support in xmms-1.2.4.

This patch provides following features.

NOTE: require binutils-2.9.1.0.19a or later to compile 3DNow! instructions.


Download :

(Obsoletes. I recommend you should get latest xmms)


Hints to use :

  1. Get xmms-1.2.3 source (ex. from http://www.xmms.org/)
  2. Unpack xmms-1.2.3.tar.gz (ex. tar xfz xmms-1.2.3.tar.gz )
  3. Apply this patch
    (cd xmms-1.2.3; bzcat xmms-1.2.3-3dnow-xxxxxxxx.patch.bz2 | patch -p1 )
  4. Type "./configure --enable-3dnow; make" to compile
  5. Become root if necessary, and type "make install"
  6. Good luck!

How to enable 3DNow! support in xmms-1.2.4

My 3DNow! patch was merged into XMMS-1.2.4, but 3DNow! support was disabled in default. So XMMS binary, you can get from xmms web site, was not support 3DNow! If you enable 3DNow!, please make and install yourself.

  1. Download xmms source rpm (xmms-1.2.4-1.src.rpm) from Download section in XMMS Web site
    (I assumed you have super user privilege)
  2. # rpm -ivh xmms-1.2.4-1.src.rpm
    extract source file
  3. # cd /usr/src/redhat/SPECS
  4. change 'xmms.spec' in L116
    (old) ./configure --prefix=%{prefix};
    (new) ./configure --prefix=%{prefix} --enable-3dnow;
  5. # rpm -ba xmms.spec
    rebuild XMMS
  6. # rpm -Uvh --force /usr/src/redhat/RPMS/i386/xmms*.rpm
    install 3DNow! supported XMMS

If you cannot rebuild xmms, you may use this binary. Please download and extract it to xmms plugin directory (ex. /usr/lib/xmms/Input ).


Trouble shooting

Some people told me that they couldn't compile xmms with 3DNow! patch (they could compile without the patch).

( "./configure --enable-3dnow" was finished normally)


# make
cd . && aclocal
aclocal: macro `MACRO-NAME' required but not defined
aclocal: configure.in: 41: macro `AM_PATH_GLIB' not found in library
aclocal: configure.in: 42: macro `AM_PATH_GTK' not found in library
aclocal: configure.in: 151: macro `AM_GNU_GETTEXT' not found in library
make: *** [aclocal.m4] Error 1
#

If you encount such errors, please try another version of 3DNow! patch, xmms-1.2.2-3dnow-20000729-noconfigure.patch.bz2. Thanks Mr.Lindqvist.

This version always makes 3DNow! supported MP3 decoder, so you don't need "--enable-3dnow".

Mr. Knack and Mr. Suchanek reported to me that they could compile "noconfigure" version of 3DNow! patch. Thanks.


Tested platform :

AMD K6-2/300@336, Linux-2.2.10, Creative Sound Blaster Live! value
AMD K6-III/450@504, Linux-2.4.0-test4, Creative Sound Blaster Live! value
3DNow! decoder about 50% faster than original (see comments on this below).
You may use 3DNow! decoder with any other 3DNow! supported CPU (AMD Athlon is confirmed).
Intel P-III/500, Linux-2.2.12, Creative Ensoniq Audio PCI
if force to use 3DNow! decoder, it causes "Illegal Instruction" error :)

Performance Benchmarking :

I measured for decoding time by 'DiskWriter plugin'. target is j-stereo 44.1KHz 96Kbit/s MPEG1 layerIII file (2967KB, 4m12s).

Result (xmms-0.9.5.1)
K6-2/336 + SB Live!FPU30 sec12 %
3DNow!14 sec6 %
K6-III/504 + SB Live!FPU17 sec7 %
3DNow!9 sec4 %

Change Log :

2000.11(My 3DNow! patch was merged into xmms-1.2.4)
2000.9.9modified patch for xmms-1.2.3-pre1.
2000.7.29(modified "noconfigure" patch for xmms-1.2.2)
2000.6.20modified patch for xmms-1.2.1.
2000.6.17modified patch for xmms-1.2.0. minor update
2000.3.10modified patch for xmms-1.0.1. minor bug fix
2000.1.29modified patch for xmms-1.0.0.
Utilized 'configure' for enabling (or disabling) 3DNow! support.
Now if you want to add support 3DNow!, you must to './configure --enable-3dnow"
minor bug fix.
1999.11.20make 'about' dialogue about MPEG plugin.
change 'Decoder Select' dialogue.
enable 16bit, stereo, 1:1 mode only, when use 3DNow! decoder
fixed minor bug (cannot compile layer3.c, if not define USE_3DNOW)
1999.10.2modified patch for xmms-0.9.5.1.
display result of detect 3DNow! support, moved to MPG123 Configuration.
1999.9.27modified patch for xmms-0.9.5.
1999.9.23minor update. revised new 3DNow! patch (ver.19990911. modified for binutils-2.9.5, but not tested)
1999.9.11enable NEW_DCT9 switch in layer3.c (it's enable in mpg123-0.59r, but not xmms-0.9.1)
1999.9.4added "Decoder select" option in MPG123 Configuration Auto / Force 3DNow! / no 3DNow!
1999.8.28minor update. revised new 3DNow! patch (ver.19990824, but not implement 3DNow! equalizer)
1999.8.23if CPU is support 3DNow!, display strings "MPEG Layer 1/2/3 Player (3DNow!)" in xmms preference tab. (thanks Dr.K!
1999.8.22implement CPU auto-detection from new 3DNow! patch (use floating-pointer decode routine if CPU isn't support 3DNow! instructions).
1999.8.21Test release for xmms-0.9.1. implement 3DNow! optimized decoder, based on mpg123-0.59r and new 3DNow! patch.

Related Links

Xmms Homepage
mpg123 - An MP3 player for Linux and other UNIX systems
3DNow! support for mpg123 [English]
KIMURA Takuhiro's Web Page. He wrote new 3DNow! patch for mpg123 (His patch already merged CVS). My 3DNow! patch is porting these codes to xmms.

I don't receive any mail from free providers (@hotmail.com etc.), because of rejecting SPAM jacobi@sorryihatespamjcom.home.ne.jpnospam
Return to topReturn to top (all other pages are written in Japanese).