fluid-dev
[Top][All Lists]
Advanced

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

[fluid-dev] FPE Exceptions (was Re: Problem in fluidsynth (Ubuntu 11.10)


From: Pedro Lopez-Cabanillas
Subject: [fluid-dev] FPE Exceptions (was Re: Problem in fluidsynth (Ubuntu 11.10) still in Ubuntu 12.04)
Date: Mon, 28 May 2012 15:56:08 +0200
User-agent: KMail/1.13.5 (Linux/2.6.34.10-0.6-desktop; KDE/4.4.4; i686; ; )

Hi,

On Wednesday 23 May 2012, David Henningsson wrote:
> FluidSynth upstream) didn't make a bug fix release either. Perhaps we 
> should do that some time soon...so that the fixes will go into 12.10 at 
> least...

I'm not sure if only fixing that particular bug justifies a release. It 
doesn't harm to do it, of course. But we may face very similar bugs in the 
future. Let me explain.
 
I've found the bug you are talking about some time ago, while I was working 
with fluidsynth for a Nokia device having an ARM processor:
http://sourceforge.net/apps/trac/fluidsynth/ticket/100

This bug was solved by David with this patch:
http://sourceforge.net/apps/trac/fluidsynth/changeset/435

The problem was very specific to lowering the polyphony, but the cause was not 
uncommon and had plagued FluidSynth for a long time. The root problem is 
denormals in floating point calculations:
http://en.wikipedia.org/wiki/Denormal_number

To show a similar problem, here is a simple test scenario.

1.- Sample MIDI file: http://www.miditrax.com/Aug/salsa.mid
2.- GeneralUser GS Soundfont: http://www.schristiancollins.com/generaluser.php
3.- Build FluidSynth (SVN head, or any previous release) in debug mode with 
floats instead of doubles and FPE checks:

$ cmake -DCMAKE_BUILD_TYPE=Debug \
        -Denable-debug=on \
        -Denable-floats=on \
        -Denable-fpe-check=on

Runtime results on an AMD Athlon(tm) XP processor:

fluidsynth: warning: FPE exception (before or in voice_write vol env): 
Underflow 
fluidsynth: warning: FPE exception (before or in voice_write vol env): 
Denormal number 
fluidsynth: warning: FPE exception (before or in voice_filter): Underflow 
fluidsynth: warning: FPE exception (before or in voice_write vol env): 
Denormal number Underflow 
fluidsynth: warning: FPE exception (before or in voice_write vol env): 
Denormal number 
fluidsynth: warning: FPE exception (before or in voice_filter): Denormal 
number Underflow 

When running FS in some old CPUs, denormals penalize CPU performance and sound 
quality, while in modern CPUs these denormal numbers are automatically fixed 
in hardware, eliminating the problem.

My oldest machine is the only one I can access today, which is (slightly) 
affected by denormals in FluidSynth:

$ cat /proc/cpuinfo 
processor       : 0
vendor_id       : AuthenticAMD
cpu family      : 6
model           : 10
model name      : AMD Athlon(tm) XP 2800+
stepping        : 0
cpu MHz         : 2086.903
cache size      : 512 KB
fdiv_bug        : no
hlt_bug         : no
f00f_bug        : no
coma_bug        : no
fpu             : yes
fpu_exception   : yes
cpuid level     : 1
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca 
cmov pat pse36 mmx fxsr sse syscall mmxext 3dnowext 3dnow up
bogomips        : 4173.80
clflush size    : 32
cache_alignment : 32
address sizes   : 34 bits physical, 32 bits virtual
power management: ts

My other machines with Intel processors (Core2Duo, Core-i7) implementing SSE2 
instructions are immune. However, you can tell the GCC compiler to not use the 
SSE2 instructions with this flag: -mno-sse2 

$ cmake ... -DCMAKE_C_FLAGS=-mno-sse2 ...

The above configuration allows some FPU exceptions to be reported on runtime, 
even in a modern CPU. I would like to know if somebody is able to reproduce my 
test results and help fixing them.

Regards,
Pedro



reply via email to

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