[LAD] Mixing audio: Implementing pan and balance

Raphaël BOLLEN raphael.bollen at mobistar.be
Sun Mar 24 10:10:19 UTC 2013


On 03/24/2013 10:49 AM, hermann meyer wrote:
> 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 at lists.linuxaudio.org
> http://lists.linuxaudio.org/listinfo/linux-audio-dev
>
>

It's working fine, nice

Thanks

--
Raphaël.


More information about the Linux-audio-dev mailing list