Re: [LAD] is this a compiler issue??

From: Tim Goetze <tim@email-addr-hidden>
Date: Wed Aug 19 2009 - 13:37:36 EEST

[Conrad Berhörster]
>i have written a channel class, which collects data from (file) sources and
>copies it to a buffer. Jack will get this buffer and put it into his streams.
>So far, I think, this is a normal design with the following code
>
>for (unsigned int n = 0; n < nframes; ++n)
>{
> pBuffer[n] += pFrames[n];
> pBuffer[n] *= volume;
>}
>
>i know, it's not really optimized. But it works as an example. as you can
>think, pBuffer and pFrames are float* and volume is also a float.
>
>now it happens, when the volume is 0, after 3-5 seconds, the CPU will run into
>100%.
>
>a workaround is the following before the loop
>
> if(volume < 0.0000001)
> volume = 0.0000001;
>
>But i try to understand, what happens here. Is the compiler overoptimizing
>zeros.

It'd be a lot more helpful to see the full source but from what you're
writing I'd be willing to bet you're encountering denormals.

Cheers, Tim

_______________________________________________
Linux-audio-dev mailing list
Linux-audio-dev@email-addr-hidden
http://lists.linuxaudio.org/mailman/listinfo/linux-audio-dev
Received on Wed Aug 19 16:15:02 2009

This archive was generated by hypermail 2.1.8 : Wed Aug 19 2009 - 16:15:02 EEST