Re: [LAD] Mixing audio: Implementing pan and balance

From: hermann meyer <brummer-@web.de>
Date: Sun Mar 24 2013 - 11:49:56 EET

Am 24.03.2013 09:46, schrieb Raphaël BOLLEN:
> Aargh, although only if the inputs are left un-connected, if you
> stream silence on input 1 cpu % increase is back.
I use when ever possible SSE2 to avoid denormals, compile with -msse2
-mfpmath=sse
flags and implement as followed:

///////////////////////// DENORMAL PROTECTION WITH SSE /////////////////

#ifdef __SSE__
/* On Intel set FZ (Flush to Zero) and DAZ (Denormals Are Zero)
    flags to avoid costly denormals */
#ifdef __SSE3__
#include <pmmintrin.h>
inline void AVOIDDENORMALS()
{
   _MM_SET_FLUSH_ZERO_MODE(_MM_FLUSH_ZERO_ON);
   _MM_SET_DENORMALS_ZERO_MODE(_MM_DENORMALS_ZERO_ON);
}
#else
#include <xmmintrin.h>
inline void AVOIDDENORMALS()
{
   _MM_SET_FLUSH_ZERO_MODE(_MM_FLUSH_ZERO_ON);
}
#endif //__SSE3__

#else
inline void AVOIDDENORMALS() {}
#endif //__SSE__

//////////////////////////////////////////////////////////////////////////////////////////////////////////

now run once
AVOIDDENORMALS();

somewhere in init()

_______________________________________________
Linux-audio-dev mailing list
Linux-audio-dev@email-addr-hidden
http://lists.linuxaudio.org/listinfo/linux-audio-dev
Received on Sun Mar 24 12:15:02 2013

This archive was generated by hypermail 2.1.8 : Sun Mar 24 2013 - 12:15:02 EET