[PlanetCCRMA] Pentium-4 and denormal numbers on planetccrma

Mark Knecht Mark Knecht <markknecht@gmail.com>
Fri Jan 28 16:28:02 2005


On 28 Jan 2005 16:01:05 -0800, Fernando Lopez-Lezcano
<nando@ccrma.stanford.edu> wrote:
> On Fri, 2005-01-28 at 15:35, Steve Harris wrote:
> > On Fri, Jan 28, 2005 at 03:17:41PM -0800, Fernando Pablo Lopez-Lezcano wrote:
> > > On Fri, 2005-01-28 at 14:51, Fernando Lopez-Lezcano wrote:
> > > > On Wed, 2005-01-12 at 03:40, Steve Harris wrote:
> > > > > On Mon, Jan 10, 2005 at 11:07:55 +0100, andersvi@extern.uio.no wrote:
> > > > > NB, using the SSE instruction set uses a more efficient denormal handler
> > > > > (about 40x slower than processing a normal number), but it still doesnt
> > > > > zero them, if you also call this function I hacked up when the program
> > > > > starts:
> > > >
> > > > Hi Steve, I'm trying to use this to see if I can get freeverb back from
> > > > denormal hell, but I can't compile it as position independent code as in
> > > > that mode the compiler uses the bx register (I did some searches but
> > > > could not find a solution that both compiled and did not segfault :-)
> > >
> > > I tried adding noise to the inputs (from
> > > http://www.musicdsp.org/files/denormal.pdf):
> > >
> > > unsigned int rand_state = 1;
> > >
> > > inline add_white_noise (float &val) {
> > >   rand_state = rand_state * 1234567UL + 890123UL;
> > >   int mantissa = rand_state & 0x807F0000;
> > >   int flt_rnd = mantissa | 0x1e999999;
> > >   val += *reinterpret_cast <const flat*> (&flt_rnd);
> > > }
> > >
> > > And while it is a hack it did work, surprisingly.
> > > Perhaps not the best solution.....
> >
> > Its a perfectly reasonable solution, sorry, I should have suggested it.
> > The thing to test would be to turn up the RT60 time as high as posible and
> > measure the amplitude of the output to see how much it affects the SNR.
> 
> I just tried this: I connected hydrogen to jack-rack running the hacked
> freeverb (max wet output, no dry output, max room size, 0 damping, 0.5
> width) and jack-rack to bitscope. After stopping hydrogen the "smallest
> non-zero sample" shown on bitscope slowly falls down to a noisy -400db
> (the "largest sample" field hovers around -336db). Bitscope is handy :-)
> As much as I hate to introduce "noise" in the signal chain I think most
> probably -300db is quiet enough. I can't hear it, but maybe its just my
> aging ears :-)
> 
> The best thing to do, obviously, would be to figure out why the
> undenormal routines in freeverb are not doing their job. I look at it
> and it seems they are inserted in the right places.
> 
> For now I'll probably release this, at least it brings freeverb back
> from the ladspa dead.
> 
> Maybe this is the way to "cure" (as in "don't think too much")
> freqtweak, it also has denormal issues in its current release.
> 
> -- Fernando
> 

A bit off-topic but while you have bitscope out and working try
hooking up alsaplayer and playing either some mp3 or wave files. Do
you see any problems?

- Mark