Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: LAME optimized for dual core processors? (Read 18142 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

LAME optimized for dual core processors?

Hello,

Is this true? I was told to input the switch "-j" to optimize LAME 

I have an A64 X2 3800+. Sorry if this has been posted before.

Thanks

Jerome

LAME optimized for dual core processors?

Reply #1
I don't think it's necessary, I got up to 20x encoding speeds on my A64 X2 3800+ in Lame.

LAME optimized for dual core processors?

Reply #2
I don't think it's necessary, I got up to 20x encoding speeds on my A64 X2 3800+ in Lame.


Right...with the following rig:

Antec SLK3000B
Gygabyte K8NF-9 nForce4 (BIOS F11)
Fortron Green Power FSP400-GLN v2
A64 3800+ X2 socket 939 Toledo (driver AMD 1.3.2)
Zalman CNSP7000B-AlCu + Fan Mate 2 (~1350 rpm)
1*1024 Mo DDR 400 PC3200 Kingston
Maxtor 200 Go, 8 Mo S-ATA2

I top 18x but no higher... I use LAME 3.97b1, -V 6.

Thanks

LAME optimized for dual core processors?

Reply #3
Is this true? I was told to input the switch "-j" to optimize LAME
Looks like somebody confused LAME with make
There was a multithreaded LAME version available at one time, but it's quality was inferior because it disabled the bit reservoir. You could probably get as much speed up running two LAME processes at the same time (on different files). I don't know if you will find a frontend to do this - but I do it with a makefile.

LAME optimized for dual core processors?

Reply #4
note: EAC can start several encoder instances. Set it to two instances for dual cores, and you will have your speed increase.

LAME optimized for dual core processors?

Reply #5
The MP3 spec is not made to be run on >1 processor.  It can if you disable features IIRC, but this is senseless.

Just run two copies of LAME at once.  It'll be faster and there is no quality loss.

LAME optimized for dual core processors?

Reply #6
The MP3 spec is not made to be run on >1 processor.  It can if you disable features IIRC, but this is senseless.


Well, the MP3 spec does not define obvious ways to achieve thread level parallelism, but:

*it does not mean that it is not possible
*it does not mean that it would automatically reduce quality
*in the mpeg-4 case, the most obvious way defined in the standard implies a small quality reduction, but users are not complaining about it.

But still, the easier way is by running 2 encoder instances.


LAME optimized for dual core processors?

Reply #8
Is there LAME frontend that can batch encode FLAC files to LAME by executing two encoder instances?

foobar2000' converter works that way on multi-CPU machines.

LAME optimized for dual core processors?

Reply #9
Is there LAME frontend that can batch encode FLAC files to LAME by executing two encoder instances?

foobar2000' converter works that way on multi-CPU machines.

Does it do the same when using iTunesEncode.exe? Or is that impossible because there can only be one instance of iTunes running?

I'm getting an (AMD) dual core CPU next week but don't really know how to make full use of it. Does Foobar automatically detect it is running on a dual core system, or do I need to change some settings?

LAME optimized for dual core processors?

Reply #10
Does it do the same when using iTunesEncode.exe? Or is that impossible because there can only be one instance of iTunes running?

I'm getting an (AMD) dual core CPU next week but don't really know how to make full use of it. Does Foobar automatically detect it is running on a dual core system, or do I need to change some settings?

foobar2000 automatically detects the number of processors and I'm sure it will launch two instances of iTunesEncode.exe on dual processor (two CPU devices) machine. You can verify whether iTunes allows multiple encoding threads by launching two encoding tasks simultaneously on your current hardware (unfortunately, I cannot verify it myself as I don't use iTunes).

LAME optimized for dual core processors?

Reply #11
Well, the MP3 spec does not define obvious ways to achieve thread level parallelism, but:

*it does not mean that it is not possible
*it does not mean that it would automatically reduce quality
*in the mpeg-4 case, the most obvious way defined in the standard implies a small quality reduction, but users are not complaining about it.

But still, the easier way is by running 2 encoder instances.

I imagine the bit reservoir not working because the encoder splits the input into 'chunks of time' letting the first one done by thread1 and the second by thread2. When they both are finished thread2 could not make use of the reservoir that thread1 ended up having. Is this somewhat right?

Wouldn't it be possible to split up in threads that are not dependent on eachother, something else than time?

Just wondering...
Every night with my star friends / We eat caviar and drink champagne
Sniffing in the VIP area / We talk about Frank Sinatra
Do you know Frank Sinatra? / He's dead

LAME optimized for dual core processors?

Reply #12
Wouldn't it be possible to split up in threads that are not dependent on eachother, something else than time?

It may be possible to set up multiple threads as a pipeline, in the manner you describe.  It works great when each stage requires a similar amount of CPU time. However, what often ends up being the case (and I'm guessing is the case with mp3 encoding) is that there is a single stage that requires more CPU time than the rest, effectively "stalling" the pipeline.  Think of it as an accident on a freeway: Cars farther back end up being stuck waiting to get around, and the ones that finally do get around have lots of open road ahead to work with.  In the end you may end up with a slight gain, but not necessarily one worth the effort.  If the "hot" thread takes an overwhelming amount of CPU time, you could end up with a net loss from the context switching, thread management, and synchronization overhead.

LAME optimized for dual core processors?

Reply #13
foobar2000 automatically detects the number of processors and I'm sure it will launch two instances of iTunesEncode.exe on dual processor (two CPU devices) machine.


Which, unfortunately, makes iTunesEncode choke, because iTunes is not currently able to do multiple simultaneous encodes.  When I used iTunesEncode with Foobar2000 (before using Nero's stand-alone encoder), I had to set my dual core's affinity to use only one of the cores with fb2k when I was encoding so it wouldn't try to put two files in the pipeline at once.

See this thread for details.

 

LAME optimized for dual core processors?

Reply #14
foobar2000's converter works that way on multi-CPU machines.
For completeness: this was introduced in foobar2000 v0.9
In theory, there is no difference between theory and practice. In practice there is.

LAME optimized for dual core processors?

Reply #15
Wouldn't it be possible to split up in threads that are not dependent on eachother, something else than time?
A 'pipeline' like approach tends to work well (as Ardax said) as a way to parallelise programs which offer no inherent data level parallelism or where interlinking between parallel tasks is very high. In LAME's case, this is due to the bit reservoir, which makes blocks dependent on others and stops you from parallelising the tasks. Pipelining LAME would, as far as I can see, prove to be fairly difficult as there is a fair amount of feedback. It would be a very interesting project, but not particularly useful in my opinion.

The reason for the lack of usefulness is that the most common use case for an MP3 encoder is a batch of smallish jobs (like encoding a CD). The easiest way to optimise this case is to run multiple instances of the encoder on different files - this is what Foobar, EAC, et al are already doing and seems to offer a nice speedup.  For other use cases (for example encoding a whole CD image) this approach is going to be less useful. However, if you only have one image to encode then just set it encoding and enjoy the fact that you can use your PC without any loss of interactivity (thanks to that second idle core).

LAME optimized for dual core processors?

Reply #16
I'm surprised no-one has mentioned lame-mt?

I don't use mp3 much, but I get about 60x realtime encoding speed with the multithreaded oggenc/lancer build.

edit: http://www.lame-mt.com/ seems to have fresher builds.

LAME optimized for dual core processors?

Reply #17
AFAIK the latest Monkey's Audiocompressor-frontend is also able to start two simultaneously running threads at once. So for transcoding Monkey-files to e.g. LAME or Vorbis it´s already possible to take full advantage of these multi-core-CPU´s. Also it's possible to configure that frontend that it works with FLAC.
Quote
Version 4.01b1 (January 8, 2006)

1. NEW: Features new user interface. (written in C++ and threaded for dual-core computers -- making it nearly twice as fast to compress, decompress, and convert with a dual-core setup)
.....
My used codecs and settings:
FLAC V1.1.2 -4 / APE V3.99 Update 4 -high / MPC V1.15v --q 5 / LAME V3.97b2 -V2 --vbr-new / OGG aoTuV V4.51 Lancer -q5


LAME optimized for dual core processors?

Reply #19
No, but it is an MT'ed encoder, like the OP asked for.

LAME optimized for dual core processors?

Reply #20
GOGO 3.13 (based on LAME 3.8x or 3.90?) is Multithreaded.
Encoding speed is over 130x on Athlon 4400+ X2, half speed if forced to one CPU only.

It has CBR and old school vbr (no presets) but still..  Quality should be more than ok.

LAME optimized for dual core processors?

Reply #21
Well, it would be great to have a 2 pass encoder for dual cores... 

LAME optimized for dual core processors?

Reply #22
I am very interested in LAME for dual core processors as well, since I have a Dual Intel Xeon machine in order (Mac Pro).
It would be great to use both cores on each processor at once!

LAME optimized for dual core processors?

Reply #23
I am very interested in LAME for dual core processors as well, since I have a Dual Intel Xeon machine in order (Mac Pro).
It would be great to use both cores on each processor at once!

4-thread encoding. Just set processor affinity to 4.