Help - Search - Members - Calendar
Full Version: optimization of realtime encoding
Hydrogenaudio Forums > Lossy Audio Compression > MP3 > MP3 - Tech
amps
I've got a couple Duron 750's running Redhat 7.2 with glibc-2.2.4-32. I've got a real-time encoders running to convert 128k => 32k and 128k => 56k in real time for a streaming radio station using Lame.

Unfortunately each encoding process takes 6-12% CPU and the combined load average went from 0 to 12!! I was able to hack things down a bit by using the -k and -q 9 switches.

What I really need is a binary more optimized for my crappy CPU's. I've looked around, but they only seem to be available for glibc 3.x -- and since I'm using Redhat 7.2 I'm stuck with 2.x.

So am I out of luck here?

Thanks...
tigre
Have you tried Gogo (=speed optimized encoder based on lame 3.8x-3.90 IIRC)?

Edit: Oops, you need linux compile... don't know where to get that. Maybe google can help ...
amps
I've searched everywhere. I've found a couple compiles but they were done under glibc3.x and will not run on redhat 7.2. Since this is a production server, I can't upgrade these libraries. =(

Maybe someone can provide instructions on compiling my own 'more optimized' binaries under glibc2.x?
tigre
I'd recommend to start a new thread like
"Compile lame or gogo speed-optimized for Redhat 7.2. Please help"

I think there are quite some people who could help, but won't read this thread here ...
dev0
It's linux, so why don't you just try compiling LAME/GOGO yourself?
AstralStorm
You might want to use 3.93.1 rather than 3.90.3 (which sources are at RareWares)
You can download 3.93.1 sources from official LAME website.

After getting them, try just:
CODE
tar -xzf <path to LAME archive>
cd <dir with LAME sources>
./configure
make
make install

The compiled LAME will land in /usr/local
To install it to /usr, launch configure like this:
CODE
configure --prefix=/usr


If the code isn't fast enough, then you can always export your optimization options before configuring, eg.
CODE
export CFLAGS="-march=athlon -O3 -pipe -ffast-math -fomit-frame-pointer -fsched-spec-load -fforce-addr"
export CXXFLAGS=${CFLAGS}
amps
Thanks for all the info. If I am correct glibc2.x doesn't have athlon optimization? I already tried compiling with athlon optimization but it didn't work. I've also heard that i686 optimization tends to be faster than athlon for some reason.

BTW my current compile is 3.93.1

Anyways, I'll give all your recommendations a shot and report back.
AstralStorm
Someone told you a sh*tload of FUD.

Athlon optimizations on Duron are much faster than plain i686 ones.
(mostly due to alignment and pipeline hazard recogniser)

Anyway, RedHat's glibc is optimized for any 686 processor, not only Athlon.
But of course you can mix the code compiled for one CPU with code compiled for another CPU.

Why wouldn't -march=athlon work? Do you use one of old RedHat 2.96.xyz compilers?
Some of them were broken, so I guess you should upgrade (at least the compiler).
amps
OK. Here's the verdict, in CPU time of encoding over the same interval:

Standard compile (no customization):
2:22

i686 compile:
2:17

Athlon compile:
2:14

So it seems I have been able to get the best results using the recommendations of AstralStorm. Thanks a bunch guys, if you have any other suggestions let me know! The performance increase seems minimal (5.6%)... but it's nice to see an improvement!

BTW this is using gcc-2.96-112.7.2

-amps
Chun-Yu
A good idea would be to try Intel's C++ Compiler for Linux, which might help.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2008 Invision Power Services, Inc.