# Emscripten 6.0.2 with Fmod Pthreads not creating threads

**URL:** https://qa.fmod.com/t/emscripten-6-0-2-with-fmod-pthreads-not-creating-threads/24420
**Category:** FMOD Engine
**Tags:** cpp
**Created:** [July 23, 2026, 8:30pm UTC](https://qa.fmod.com/t/emscripten-6-0-2-with-fmod-pthreads-not-creating-threads/24420 "2026-07-23T20:30:31Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![sbehnke-zynga](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/sbehnke-zynga/32/8834_2.png) [@sbehnke-zynga](https://qa.fmod.com/u/sbehnke-zynga)
#### Post date: [July 23, 2026, 8:30pm UTC](https://qa.fmod.com/t/emscripten-6-0-2-with-fmod-pthreads-not-creating-threads/24420/1 "2026-07-23T20:30:31Z")

</div>

I’m using:

FMOD Engine 2.03.14 html5/wasm fmodP/fmodPL (w32) libs, linked into an emscripten 6.0.2 C/C++ project.

Cross-origin isolation is working (crossOriginIsolated === true, SAB available); the AudioWorklet mixer runs fine.

But FMOD\_OS\_Thread\_Create → pthread\_create returned 1 for the stream thread (FMOD\_INIT, priority 0xFFFF7FFB) and the non-blocking loader thread (priority 0xFFFF7FFC), so System::init fails with 28 (FMOD\_ERR\_INTERNAL) unless we use FMOD\_INIT\_STREAM\_FROM\_UPDATE + blocking loads. PTHREAD\_POOL\_SIZE=32, pool not exhausted.

Are the 3.1.67-built html5 libs expected to work under emscripten 6.0.x, and is there (or when will there be) a build compiled against a current emscripten?

Thanks,  
Steven Behnke

---

<div class="post-metadata">

### Author: ![brett](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/brett/32/261_2.png) [@brett](https://qa.fmod.com/u/brett)
#### Post date: [July 27, 2026, 6:28am UTC](https://qa.fmod.com/t/emscripten-6-0-2-with-fmod-pthreads-not-creating-threads/24420/2 "2026-07-27T06:28:43Z")

</div>

Hello, i’ve tested 6.0.0 and verified it is using it with some logging. I am also using the public 2.03.14 logging lib fmodPL\_wasm.a

I updated simple\_c to load a file instead (using the --preload-file command), copied the .a and .mp3 from the media folder into the same folder as the example.

```auto
em++ simple_c.cpp -s WASM=1 -s ALLOW_MEMORY_GROWTH=1 -s EXPORTED_RUNTIME_METHODS=ccall,cwrap,setValue,getValue -pthread -s ASYNCIFY=1 -s PTHREAD_POOL_SIZE=5 -I../inc fmodPL_wasm.a -o simple_c_pthreads.html --preload-file wave.mp3@/wave.mp3

```

The file load lets me use FMOD\_NONBLOCKING and createStream to make it use 2 threads.

```cpp
 #if defined ( __EMSCRIPTEN_MAJOR__ )
    printf("EMSDK = %d.%d.%d\n", __EMSCRIPTEN_MAJOR__ , __EMSCRIPTEN_MINOR__ , __EMSCRIPTEN_TINY__ );
    #else
    printf("EMSDK = %d.%d.%d\n", __EMSCRIPTEN_major__ , __EMSCRIPTEN_minor__ , __EMSCRIPTEN_tiny__ );
    #endif

    // Optional. Set the window handle for FMOD internally.
    EM_ASM({
        console.log("Setting FMOD module window handle");
        Module.window = window;
    });

    /*
        Create a System object and initialize
    */
    result = FMOD::System_Create(&system);
    ERRCHECK(result);

    // Optional. Setting DSP Buffer size can affect latency and stability. Older browsers may require larger buffer sizes than default.
    result = system->setDSPBufferSize(2048, 2);
    ERRCHECK(result);

    result = system->init(32, FMOD_INIT_NORMAL, 0);
    ERRCHECK(result);

    FILE *fp = fopen("wave.mp3", "rb");
    fseek(fp, -1, SEEK_END);
    int len = ftell(fp);
    fseek(fp, 0, SEEK_SET);
    char *buff = (char *)calloc(len, 1);
    fread(buff, len, 1, fp);
    fclose(fp);

    FMOD_CREATESOUNDEXINFO exinfo = { 0 };
    exinfo.cbsize = sizeof(FMOD_CREATESOUNDEXINFO);
    exinfo.length = len;

    FMOD::Sound *sound;

    result = system->createStream(buff, FMOD_OPENMEMORY | FMOD_NONBLOCKING, &exinfo, &sound);
    ERRCHECK(result);

```

Output shows 6.0.0 for the example with the original lib built with 3.1.67

(by the way because of non blocking the playSound call was moved into the main loop)

```cpp
    /*
        Main loop
    */
    do
    {
        FMOD_OPENSTATE openstate;

        result = sound->getOpenState(&openstate, nullptr, nullptr, nullptr);

        if (!channel && openstate == FMOD_OPENSTATE_READY)
        {
            result = system->playSound(sound, 0, false, &channel);
            ERRCHECK(result);
        }

```

Output:

```auto
EMSDK = 6.0.0
simple_c_pthreads.js:6152 Setting FMOD module window handle
simple_c_pthreads.js:4767 [LOG] FMOD_System_Create : Header version = 2.03.15. Current version = 2.03.14.

simple_c_pthreads.js:4767 [LOG] FMOD_OS_Init : Module.window = YES

simple_c_pthreads.js:4767 [LOG] SystemI::init : Initialize version=20314 (164239), maxchannels=32, flags=0x00000000

simple_c_pthreads.js:4767 [LOG] FMOD_OS_Output_GetDefault : FMOD_OS_Output_GetDefault
simple_c_pthreads.js:4767 [LOG] SystemI::setOutputInternal : Setting output to 'FMOD AudioWorklet Output'

simple_c_pthreads.js:4767 [LOG] OutputAudioWorklet::init::init : initializing with channels = 6, buffer length = 2048, output rate 48000.

simple_c_pthreads.js:4767 [LOG] OutputAudioWorklet::init::init : SharedArrayBuffer: Yes. Fast code path.

simple_c_pthreads.js:4767 [LOG] Thread::initThread : Init FMOD stream thread. Affinity: 0x4000000000000003, Priority: 0xFFFF7FFB, Stack Size: 98304, Semaphore: No, Sleep Time: 10, Looping: Yes.

simple_c_pthreads.js:4767 [LOG] SystemI::DSPCodecPoolRegister : register codec pool for pool type 0

simple_c_pthreads.js:4767 [LOG] SystemI::createSound : memory = 0x1c1800 : mode 00010880

simple_c_pthreads.js:4767 [LOG] SystemI::createSound : FMOD_NONBLOCKING specified. Putting into queue to be opened asynchronously!

simple_c_pthreads.js:4767 [LOG] AsyncThread::getAsyncThread : index = 0 / 1

simple_c_pthreads.js:4767 [LOG] Thread::initThread : Init FMOD nonblocking thread (0). Affinity: 0x4000000000000003, Priority: 0xFFFF7FFC, Stack Size: 114688, Semaphore: Yes, Sleep Time: 0, Looping: Yes.

simple_c_pthreads.js:4767 [LOG] AsyncThread::add : add sound to async queue : soundi = 0x1c1368, queue head = 0x1c167c, queue count = 0

simple_c_pthreads.js:4767 [LOG] AsyncThread::threadFunc : Starting Asynchronous operation on sound 0x1c1368

```

It appears you might be using source so if you want , write to [support@fmod.com](mailto:support@fmod.com) if you are using different build flags to the one on the public release?

---

<div class="post-metadata">

### Author: ![brett](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/brett/32/261_2.png) [@brett](https://qa.fmod.com/u/brett)
#### Post date: [July 27, 2026, 6:29am UTC](https://qa.fmod.com/t/emscripten-6-0-2-with-fmod-pthreads-not-creating-threads/24420/3 "2026-07-27T06:29:51Z")

</div>

I am using a custom python server.py as well with certificate and CORS setup, just in case that is different to yours.

---

<div class="post-metadata">

### Author: ![brett](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/brett/32/261_2.png) [@brett](https://qa.fmod.com/u/brett)
#### Post date: [July 27, 2026, 6:34am UTC](https://qa.fmod.com/t/emscripten-6-0-2-with-fmod-pthreads-not-creating-threads/24420/4 "2026-07-27T06:34:57Z")

</div>

Also note while 2.3 has pthread support, Audioworklet is only using SharedMemory support and no pthread.

The upcoming re-vamped 2.4 release will have a fully pthread ‘AudioWorkletP’ which removes stuttering in some cases when stalling the browser.

---

<div class="post-metadata">

### Author: ![sbehnke-zynga](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/sbehnke-zynga/32/8834_2.png) [@sbehnke-zynga](https://qa.fmod.com/u/sbehnke-zynga)
#### Post date: [July 27, 2026, 6:34pm UTC](https://qa.fmod.com/t/emscripten-6-0-2-with-fmod-pthreads-not-creating-threads/24420/5 "2026-07-27T18:34:49Z")

</div>

Thanks for all of the feedback. I’m working on testing it out, but it sounds like we might want to wait for the 2.4 release. We cannot make this change in production until after September anyways, how does that align with the 2.4 release plans?

---

<div class="post-metadata">

### Author: ![brett](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/brett/32/261_2.png) [@brett](https://qa.fmod.com/u/brett)
#### Post date: [July 28, 2026, 4:53am UTC](https://qa.fmod.com/t/emscripten-6-0-2-with-fmod-pthreads-not-creating-threads/24420/6 "2026-07-28T04:53:26Z")

</div>

That should line up. If not contact us and we could give you a preview library.

---

<div class="post-metadata">

### Author: ![sbehnke-zynga](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/sbehnke-zynga/32/8834_2.png) [@sbehnke-zynga](https://qa.fmod.com/u/sbehnke-zynga)
#### Post date: [September 2, 2026, 3:44pm UTC](https://qa.fmod.com/t/emscripten-6-0-2-with-fmod-pthreads-not-creating-threads/24420/7 "2026-09-02T15:44:53Z")

</div>

Thanks, Brett. We’re ready to move forward with this, but I don’t see the 2.4 library publicly available. Do you want me to send an email in or some other way to get a copy?

Thanks,  
Steven Behnke

---

<div class="post-metadata">

### Author: ![brett](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/brett/32/261_2.png) [@brett](https://qa.fmod.com/u/brett)
#### Post date: [September 2, 2026, 11:47pm UTC](https://qa.fmod.com/t/emscripten-6-0-2-with-fmod-pthreads-not-creating-threads/24420/8 "2026-09-02T23:47:26Z")

</div>

Hi Steven,

If you email [sales@fmod.com](mailto:sales@fmod.com) i’ll connect you up with a preview installer.
