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: FLAC for core duo? 1.2.1 (Read 18462 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

FLAC for core duo? 1.2.1

Reply #25

The way I do it on Linux is that, if I have 10 songs, I open two terminals and start one flac with the first 1-5 songs, and in the other terminal start flac with the songs 6-10.

The trouble with that approach is that if the song sizes aren't distributed evenly, one of the jobs might finish long before the other.  That'll leave a CPU idle unnecessarily.

My little set of audio tools uses a simple distributor which starts one flac encoding process per CPU.  Then, as waitpid(2) tells it a process finishes, the distributor starts up another.  That keeps all CPUs busy until the number of remaining tracks gets smaller than the CPU count.

It's certainly an easier short term method than trying to make the flac encoder itself into a multithreaded application, so long as the "one file per track" method of CD ripping remains popular.

Perhaps something like that could be implemented in flac. E.g. when more than one file is specified it uses multi core?

FLAC for core duo? 1.2.1

Reply #26
Perhaps something like that could be implemented in flac. E.g. when more than one file is specified it uses multi core?

That's implemented easily enough in shell scripts and third-party encoding apps. There's not much point in adding bloat to the reference encoder. What would make sense in the core libraries is a low-level multi-threaded encoding API, but Josh doesn't seem too keen on doing that.

FLAC for core duo? 1.2.1

Reply #27
Easiest way is using two instances of flac as foobar2000 does already.
Having a frontend like Flac frontend that will make use of it like the Monkeys Audio frontend will already be a big step.
I bet modifying the existant Flac frontend will be easier than to reingeneer flac itself.
Is troll-adiposity coming from feederism?
With 24bit music you can listen to silence much louder!

FLAC for core duo? 1.2.1

Reply #28
Easiest way is using two instances of flac as foobar2000 does already.
Having a frontend like Flac frontend that will make use of it like the Monkeys Audio frontend will already be a big step.
I bet modifying the existant Flac frontend will be easier than to reingeneer flac itself.


an alternative to instances is to compile flac with ICC10/ICC9 with multi-threading and profiling, that's what I whant to do, it will not be as effective as instances - but then instances have their own drawbacks (you need 2 physical hard drives, and make sure the data is split between them, so that the hard drive activity would not hold back the other thread, worse is that hard drives (and raids too) are not very good at working on more than one file/operation - you could move some of the data to other physical drives, but that would not make it any faster as you will still have to wait until it is transferred, and defeats the purpose)

FLAC for core duo? 1.2.1

Reply #29
Hello,

Does anybody know if there's version of FLAC that will use both cores of Intel cpu's (Core Duo),for 1.2.1? I searched and found one  but for FLAC version 1.1.4, I would prefer 1.2.1.

TIA

Edit: I never found an optimized version to run on multi-core cpu's.

Reflacer 1.04 allows FLAC 1.2.1 to use both cores of a dual core processor.

http://www.hydrogenaudio.org/forums/index....st&p=551735

FLAC for core duo? 1.2.1

Reply #30
Reflacer 1.04 allows FLAC 1.2.1 to use both cores of a dual core processor.

I assume you mean Reflacer allows for encoding multiple files concurrently (your sentence gives the impression that Reflacer makes FLAC itself multi-threaded).


FLAC for core duo? 1.2.1

Reply #32
As mentioned above, dBpoweramp Reference will encode flac files on multiple cores.  Keeps my quad core very busy...  Also flac v1.2.1 is available as of 10/02/2007 in their beta forum.

FLAC for core duo? 1.2.1

Reply #33
If FLAC (or any other codec, for that matter) offered an option to losslessly join files together (i.e. blocks of compressed data), third-party tools would be able to encode chunks in parallel and join them into a single file at the end. FLAC already provides the ability to encode parts of PCM audio with the --skip and --until parameters.
Ghido had that functionality in his TODO list for OptimFROG (joining files together) but never got around to implementing it, apparently.

Edit: hmm, I'm repeating myself.

FLAC for core duo? 1.2.1

Reply #34
The newly released GCC 4.3.0 has an auto-parallelisation switch, based on OpenMP (you need to build GCC OpenMP support). For those daring enough, give it a go.

-ftree-parallelize-loops=n

Where n is the number of threads. 2*cores would be my suggestion.

FLAC for core duo? 1.2.1

Reply #35
Adding -ftree-parallelize-loops=8 to my C[XX]FLAGS didn't improve encoding or decoding speed with FLAC, WavPack nor Monkey's Audio in my tests.

FLAC for core duo? 1.2.1

Reply #36
Adding -ftree-parallelize-loops=8 to my C[XX]FLAGS didn't improve encoding or decoding speed with FLAC, WavPack nor Monkey's Audio in my tests.

Heh, it won't even compile for me.
Quote
-o .libs/test_cuesheet main.o  ../../../src/share/grabbag/.libs/libgrabbag.a ../../../src/share/replaygain_analysis/.libs/libreplaygain_analysis.a ../../../src/libFLAC/.libs/libFLAC.so -lm
../../../src/libFLAC/.libs/libFLAC.so: undefined reference to `GOMP_parallel_end'
../../../src/libFLAC/.libs/libFLAC.so: undefined reference to `omp_get_num_threads'
../../../src/libFLAC/.libs/libFLAC.so: undefined reference to `GOMP_parallel_start'
../../../src/libFLAC/.libs/libFLAC.so: undefined reference to `omp_get_thread_num'
collect2: ld returned 1 exit status
make[4]: *** [test_cuesheet] Error 1

Oh well.

FLAC for core duo? 1.2.1

Reply #37
Yeah I fixed that by compiling the replay gain code without that flag. Same thing happens with wvgain (WavPack's implementation).

FLAC for core duo? 1.2.1

Reply #38
Yeah I fixed that by compiling the replay gain code without that flag. Same thing happens with wvgain (WavPack's implementation).

Just a thought, do you have a processor with shared L2 cache? OpenMP apparently is only beneficial with such processors.... I  see you used 8, so I guess combined with my suggestion you have four cores, is it a Core rather than a Phenom or a dual X2?

FLAC for core duo? 1.2.1

Reply #39
Phenom 9600, shared L3 cache but dedicated L2 cache for each core.

 

FLAC for core duo? 1.2.1

Reply #40
Phenom 9600, shared L3 cache but dedicated L2 cache for each core.

That may be the problem then, I believe that the L3 is just used as a really quick prefetch store. But I may be wrong.