# FMOD\_Orbis\_SetThreadAffinity bug report

**URL:** <https://qa.fmod.com/t/fmod-orbis-setthreadaffinity-bug-report/12757>\
**Category:** FMOD Studio\
**Created:** [October 19, 2016, 4:29am UTC](https://qa.fmod.com/t/fmod-orbis-setthreadaffinity-bug-report/12757 "2016-10-19T04:29:37Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dismiss](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/dismiss/32/1137_2.png) [@Dismiss](https://qa.fmod.com/u/Dismiss)\
**Post date:** [October 19, 2016, 4:29am UTC](https://qa.fmod.com/t/fmod-orbis-setthreadaffinity-bug-report/12757/1 "2016-10-19T04:29:37Z")

</div>

In fmorbis.h the enum value FMOD\_THREAD\_MAX is incorrect.

```
typedef enum
{
    FMOD_THREAD_DEFAULT, 
    FMOD_THREAD_CORE0 = 1 << 0,
    // ...
    FMOD_THREAD_CORE5 = 1 << 5,
    FMOD_THREAD_MAX
} FMOD_THREAD;

```

The enum should really be…

```
typedef enum
{
    FMOD_THREAD_DEFAULT, 
    FMOD_THREAD_CORE0 = 1 << 0,
    // ...
    FMOD_THREAD_CORE5 = 1 << 5,
    FMOD_THREAD_ANYCORE = ... (bit-or all previous enum values),
    FMOD_THREAD_MAX
} FMOD_THREAD;

```

As a result of its current value, fmod returns ‘invalid parameter’ if you try to set a cpu affinity mask for FMOD\_THREAD\_CORE0|1|2|3|4|5, even though that is a valid affinity mask.

---

<div class="post-metadata">

**Author:** ![mathew](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/mathew/32/431_2.png) [@mathew](https://qa.fmod.com/u/mathew)\
**Post date:** [October 25, 2016, 3:55am UTC](https://qa.fmod.com/t/fmod-orbis-setthreadaffinity-bug-report/12757/2 "2016-10-25T03:55:52Z")

</div>

You are correct, FMOD\_THREAD\_MAX should not be there, it’s left over from when the enum was for individual threads instead of a mask. I’ll get that removed for a future release.

I can confirm that ORing core 0 through 6 together does indeed work. Perhaps you were getting the error because some of the members of the affinity struct were undefined. Ensure you set all values or memset to 0 first.
