[Openal-devel] x86 cpu capabilites detection routine to be commited

Elias Naur naur at odense.kollegienet.dk
Tue Oct 11 10:57:52 PDT 2005


On Monday 26 September 2005 16:00, Prakash Punnoor wrote:
> Hi,
>
> I gathered some info and worked out a bit of infrastructure for OpenAL
> so that routines can safely use SIMD code when available by checking for
> _alHave[SIMD](). The caps detection does this first via compile time
> detection and on x86 via runtime detection, as well. Furthermore SIMD
> usage can be controlled via env vars.
>
> The detection is initialized via call to _alDetectCPUCaps(). I put it
> into alcCreateContext(), as I consider this to be OpenAL's "main"
> function. I tried to minimize scattering of ifdefs in al code and as
> such I added a stub for the portable variant.
>

I think I stumpled upon another problem in the simd changes. Let 
USE_LIGHT_GEN_MIXING be defined and __MMX__ be undefined. Those are the 
current values on my setup.

in linux/src/al_mixer.h, GENMIXSOURCES is defined like this:

#if defined(USE_LIGHT_GEN_MIXING) && defined(__MMX__)
#define GENMIXSOURCES 8
#else
#define GENMIXSOURCES 64
#endif /* USE_LIGHT_GEN_MIXING && __MMX__ */

Meaning GENMIXSOURCES will be 64, given my setup.

In linux/src/al_mixfunc.c, mf->max is set to GENMIXSOURCES (64), however, only 
8 mixer functions are put into the mixer func array mf, since 
USE_LIGHT_GEN_MIXING is true. This causes a nasty crash when more than 8 
sources or so are active at once. What's the fix for this?

 - elias



More information about the Openal-devel mailing list