iiwusynth-devel
[Top][All Lists]
Advanced

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

Re: [iiwusynth-devel] Bugs / optimization


From: Josh Green
Subject: Re: [iiwusynth-devel] Bugs / optimization
Date: 27 Oct 2002 18:52:45 -0800

On Sat, 2002-10-26 at 09:15, M. Nentwig wrote:
> Hello,
> 
> Thanks to Josh we got (hopefully) rid of some bugs.
> I fixed the
> iiwu_voice_determine_amplitude_that_reaches_noise_floor_for_sample
> problem.
> Now a warning in the API says, that the
> 'amplitude_that_reaches_noise_floor_is_valid' flag should be cleared,
> when the sample changes (iiwu_defsfont.c uses memset to clear the
> sample, but that's a bit sneaky).

We should probably have an API function to notify FluidSynth of sample
data change, so it can do whatever it needs to. This isn't critical
right now, but should perhaps be a part of next API.

> There is also a new condition that should avoid the lockup in the DSP
> loop, but I didn't have a testcase at hand. So don't bet too much money
> on it.
> 

Looks like its still broken. I'll put up a test case for you.

> The new version should be (and is with my testcase) quite a bit faster
> than it was a week ago.
> A couple of multiplications in the DSP loop were unnecessary. The worst
> offender in many cases was the continuous recalculation of the filter
> coefficients. Now the DSP loop will avoid to do needless work wherever
> possible, for example it will not interpolate, when pitch and phase are
> normal.
> 

Good news indeed!

> 
> Some profiling with parts of the code removed revealed, that the
> interpolation requires almost 50 % of the DSP time, the filter almost 20
> % and the buffer copying (pan / reverb / chorus) almost 20 %. With that
> in mind I implemented a couple of new interpolation algorithms, which
> can be selected from the command line with 'interp x' for the synth or
> 'interpc chan x' on a per-channel-basis.
> x=0: No interpolation
> x=1: linear interpolation
> x=4: old four-point interpolation algorithm, default
> x=7: sinc-interpolation, seven points
> I haven't yet figured out, whether '7' actually sounds better than '4'.
> But it needs more horsepower, that's for sure.
> Linear interpolation sounds quite OK in most cases.
> Some experiments with 3rd and 5th order methods were unsatisfying, I did
> not commit them to CVS.
> 

Yippie!

I've been noticing that the estimated CPU frequency for profiling is
coming out 0 on my machine. I haven't tracked down why this is
occurring, so I'm hard coding the value for now.

> Since the new gcc supports Intel's SSE instructions, it would be
> feasible to recode the DSP loop for that instruction set. Four float
> multiplications at the same time should really speed up interpolation...
> 

Yes. I think SSE will only do 2 floats though (I could be wrong). I
tried "-msse -mfpmath=sse" but did not see any speed increase. I think
"-march=pentium3" (for my P3) has to be passed as well though, so I'll
try that.

> Cheers
> 
> Markus
> 
> PS: The last changes in iiwu_voice.c were committed through a telnet
> login. I haven't compiled that myself yet.
> 

Seems to compile :) Cheers.
        Josh Green





reply via email to

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