fluid-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [fluid-dev] Parallelize rendering using openMP


From: Ceresa Jean-Jacques
Subject: Re: [fluid-dev] Parallelize rendering using openMP
Date: Thu, 12 Apr 2018 16:16:21 +0200 (CEST)

Hi, Tom

 

>I would like to rework fluidsynths parallel audio rendering. The current implementation is not very efficient, the synchronization overhead seems to dominate. At least for me, most of the time only >one core is fully active.

 

I am surprised, you get only one core active most of the time.

Please are you using a very fast machine ? did you ask to fluidsynth to play sufficient number of notes ?

 

Testing this on a 4 cores CPU (from 1 to 4) and on each successive test we see one more core in use  (using Windows XP).

 

Here the table of results that show that the current implementation works well:

The cpu load of one voice (voice(%)) is inversely proportional to the number of core in use.

 

Using 1 core:

--------------

> prof_set_notes 800
> prof_start 1 1000
Generating 800 notes, generated voices:800
Number of measures(n_prof):1, duration of one mesure(dur):1000ms

Profiling time(mm:ss): Total=0:1  Remainder=0:1, press to cancel
 ------------------------------------------------------------------------------
 Cpu loads(%) (sr: 44100 Hz, sp: 22.68 microsecond) and maximum voices
 ------------------------------------------------------------------------------
 nVoices| total(%)|voices(%)| reverb(%)|chorus(%)| voice(%)|estimated maxVoices
 -------|---------|---------|----------|---------|---------|-------------------
     800|  100.308|   99.226|     1.083|    0.000|    0.123|              801

 

Using 2 cores:

--------------

> prof_set_notes 800
> prof_start 1 1000
Generating 800 notes, generated voices:800
Number of measures(n_prof):1, duration of one mesure(dur):1000ms

Profiling time(mm:ss): Total=0:1  Remainder=0:1, press to cancel
 ------------------------------------------------------------------------------
 Cpu loads(%) (sr: 44100 Hz, sp: 22.68 microsecond) and maximum voices
 ------------------------------------------------------------------------------
 nVoices| total(%)|voices(%)| reverb(%)|chorus(%)| voice(%)|estimated maxVoices
 -------|---------|---------|----------|---------|---------|-------------------
     800|   55.095|   53.999|     1.096|    0.000|    0.067|             1481

 

Using 3 cores:

--------------

> prof_set_notes 800

> prof_start 1 1000
Generating 800 notes, generated voices:800
Number of measures(n_prof):1, duration of one mesure(dur):1000ms

Profiling time(mm:ss): Total=0:1  Remainder=0:1, press to cancel
 ------------------------------------------------------------------------------
 Cpu loads(%) (sr: 44100 Hz, sp: 22.68 microsecond) and maximum voices
 ------------------------------------------------------------------------------
 nVoices| total(%)|voices(%)| reverb(%)|chorus(%)| voice(%)|estimated maxVoices
 -------|---------|---------|----------|---------|---------|-------------------
     800|   36.216|   35.079|     1.137|    0.000|    0.043|             2287

 

Using 4 cores:

--------------

> prof_set_notes 800

> prof_start 1 1000

Generating 800 notes, generated voices:800
Profiling time(mm:ss): Total=0:1  Remainder=0:1, press to cancel
 ------------------------------------------------------------------------------
 Cpu loads(%) (sr: 44100 Hz, sp: 22.68 microsecond) and maximum voices
 ------------------------------------------------------------------------------
 nVoices| total(%)|voices(%)| reverb(%)|chorus(%)| voice(%)|estimated maxVoices
 -------|---------|---------|----------|---------|---------|-------------------
     800|   28.083|   26.960|     1.122|    0.000|    0.033|             2996

 

Sorry for the ugly formatted table

jjc.

 

> Message du 11/04/18 21:26
> De : "Tom M." <address@hidden>
> A : address@hidden
> Copie à :
> Objet : [fluid-dev] Parallelize rendering using openMP
>
> I would like to rework fluidsynths parallel audio rendering. The current implementation is not very efficient, the synchronization overhead seems to dominate. At least for me, most of the time only one core is fully active. I would like to get rid of that manual thread handling in rvoice_mixer and use openMP to attempt a simpler, yet more efficient implementation. I think it should be possible without any hard synchronization between threads. In case the openMP implementation performs better than the current one, this will be provided as a feature for the next major version. This means, in order to have fluidsynth being able to render audio in parallel, it needs to be compiled using a compiler that supports at least openMP 3.0, because I need the omp task directive. OMP 3.0 was released in 2008. Nowadays all major compilers (clang, gcc, Intel, IBM, Sun Studio) support this version... execpt Microsofts VC compiler ofc, which is still lacking behind with openMP 2.0 (rel. 2002) and apparently they have no plans to support any newer version [1] [2]. Just to be clear: openMP would be an optional dependency. You can continue to compile fluidsynth without it, it would just not be capable of parallel rendering.
>
> Any thoughts on that? In case anybody is interested, you may follow the current implementation progress: [3]
>
> Reference issue with some nice pictures illustrating the basic implementation of rvoice_mixer: [4]
>
> Tom
>
> [1] https://visualstudio.uservoice.com/forums/121579-visual-studio-2015/suggestions/2276847-support-openmp-3-0-or-3-1
> [2] https://visualstudio.uservoice.com/forums/121579-visual-studio-ide/suggestions/13495731-add-support-for-openmp-4-5-to-vc
> [3] https://github.com/FluidSynth/fluidsynth/compare/openmp
> [4] https://github.com/FluidSynth/fluidsynth/issues/197
>
>
> _______________________________________________
> fluid-dev mailing list
> address@hidden
> https://lists.nongnu.org/mailman/listinfo/fluid-dev
>

reply via email to

[Prev in Thread] Current Thread [Next in Thread]