0
0

Hi,

I found one strange case:
I try to create & use 2 System objects with same or different drivers and use one of them for recording and another one for playback.
If I create 2 System objects with same ASIO driver and create sound in each one (but even don’t play), and then try to release both, on second release I get crash inside FMOD library (all operations in ONE thread!!!).
If I don’t create sounds – everything is OK. If I use DirectSound – also OK.
What could it be ?

Here is log, but first chunk (until first close) is just device enumeration:
FMOD: OutputDSound::registerDLL : Register DLL
FMOD: OutputDSound::registerDLL : Detected DIRECTX 9
FMOD: FMOD_Output_DSound_RecordEnumProc : Enumerating "ProDigy 7.1 LT"
FMOD: FMOD_Output_DSound_RecordEnumProc : Enumerating "QVE 96-24"
FMOD: FMOD_Output_DSound_RecordEnumProc : Enumerating "FusionHDTV, AvStream Audio Capture"
FMOD: FMOD_Output_DSound_RecordEnumProc : Enumerating "PC Camera"
FMOD: FMOD_Output_DSound_EnumProc : Enumerating "ProDigy 7.1 LT"
FMOD: FMOD_Output_DSound_EnumProc : Enumerating "QVE 96-24"
FMOD: FMOD_Output_DSound_EnumProc : Enumerating "SRS Labs Audio Sandbox"
FMOD: OutputWASAPI::enumerate : Enumerating…
FMOD: OutputWASAPI::enumerate : CoInitialize.
FMOD: OutputWASAPI::enumerate : Enumeration Failed!
FMOD: OutputWASAPI::enumerate : Enumerating…
FMOD: OutputWASAPI::enumerate : Enumeration Failed!
FMOD: SystemI::init : FMOD Ex Version: 00042501
FMOD: SystemI::init : maxchannels = 8, flags = 00000000, extradriverdata = 00000000
FMOD: SystemI::close :
FMOD: SystemI::close : Stop all sounds
FMOD: SystemI::close : Shut down output.
FMOD: SystemI::close : Remove miscllaneous DSP stuff.
FMOD: SystemI::close : done.

FMOD: OutputASIO::init : Initializing.
FMOD: SystemI::init : Set up software engine
FMOD: SystemI::init : Set up emulated output
FMOD: SystemI::init : create the channel pool
FMOD: SystemI::init : Set up streamer
FMOD: Thread::initThread : Initializing FMOD stream thread. priority 2
FMOD: Thread::initThread : – Stacksize 49152. Stack pointer 00000000 : usesemaphore = 0 : sleeptime = 10
FMOD: Thread::callback : * FMOD stream thread started
FMOD: Thread::initThread : done.
FMOD: SystemI::init : done

FMOD: SystemI::createSoundInternal : filename = : mode 0000044a
FMOD: SystemI::createSoundInternal : exinfo->cbsize = 108
FMOD: SystemI::createSoundInternal : exinfo->length = 352800
FMOD: SystemI::createSoundInternal : exinfo->numchannels = 2
FMOD: SystemI::createSoundInternal : exinfo->defaultfrequency = 44100
FMOD: SystemI::createSoundInternal : exinfo->format = 2
FMOD: File::open : name (null) : length 352800 : unicode NO
FMOD: File::open : done. handle 00BD4E88. File size = 352800
FMOD: SystemI::createSoundInternal : 19 codecs found. Scan all until one succeeds
FMOD: CodecUser::openInternal : attempting to open user codec..
FMOD: File::seek : 00BD4E88 seek 0 bytes to 0
FMOD: CodecUser::openInternal : Done. format = 2, channels 2, frequency 44100, lengthpcm 88200, blockalign 4.
FMOD: SystemI::createSoundInternal : Format has 0 subsounds.
FMOD: SystemI::createSoundInternal : Create as FMOD_CREATESAMPLE
FMOD: SystemI::createSoundInternal : creating subsound 0/0
FMOD: SystemI::createSample : mode 0000044a length 88200 samples, lengthbytes 0
FMOD: SystemI::createSample : subsamples = 1, channels = 2
FMOD: SystemI::createSample : subsample 0. output = 0039D728
FMOD: SystemI::createSample : mSoftware = 0039D728
FMOD: OutputSoftware::createSample : lengthpcm 88200, lengthbytes 0, channels 2, format 2, mode 0000044a
FMOD: OutputSoftware::createSample : done
FMOD: SystemI::createSample : done
FMOD: File::close : handle 00BD4E88
FMOD: File::close : free mBuffer (mBuffer = 00BD5050, mBufferMemory = 00BD5050)
FMOD: File::close : handle 00BD4E88 done
FMOD: SystemI::createSoundInternal : No name found in file, use filename.
FMOD: SystemI::createSoundInternal : done. OpenState now = FMOD_OPENSTATE_READY.

FMOD: SystemI::init : FMOD Ex Version: 00042501
FMOD: SystemI::init : maxchannels = 8, flags = 00000000, extradriverdata = 00000000
FMOD: SystemI::close :
FMOD: SystemI::close : Stop all sounds
FMOD: SystemI::close : Shut down output.
FMOD: SystemI::close : Remove miscllaneous DSP stuff.
FMOD: SystemI::close : done.

FMOD: OutputASIO::init : Initializing.
FMOD: SystemI::init : Set up software engine
FMOD: SystemI::init : Set up emulated output
FMOD: SystemI::init : create the channel pool
FMOD: SystemI::init : Set up streamer
FMOD: Thread::initThread : Initializing FMOD stream thread. priority 2
FMOD: Thread::initThread : – Stacksize 49152. Stack pointer 00000000 : usesemaphore = 0 : sleeptime = 10
FMOD: Thread::callback : * FMOD stream thread started
FMOD: Thread::initThread : done.
FMOD: SystemI::init : done

FMOD: SystemI::createSoundInternal : filename = : mode 0000044a
FMOD: SystemI::createSoundInternal : exinfo->cbsize = 108
FMOD: SystemI::createSoundInternal : exinfo->length = 352800
FMOD: SystemI::createSoundInternal : exinfo->numchannels = 2
FMOD: SystemI::createSoundInternal : exinfo->defaultfrequency = 44100
FMOD: SystemI::createSoundInternal : exinfo->format = 2
FMOD: File::open : name (null) : length 352800 : unicode NO
FMOD: File::open : done. handle 00C64800. File size = 352800
FMOD: SystemI::createSoundInternal : 19 codecs found. Scan all until one succeeds
FMOD: CodecUser::openInternal : attempting to open user codec..
FMOD: File::seek : 00C64800 seek 0 bytes to 0
FMOD: CodecUser::openInternal : Done. format = 2, channels 2, frequency 44100, lengthpcm 88200, blockalign 4.
FMOD: SystemI::createSoundInternal : Format has 0 subsounds.
FMOD: SystemI::createSoundInternal : Create as FMOD_CREATESAMPLE
FMOD: SystemI::createSoundInternal : creating subsound 0/0
FMOD: SystemI::createSample : mode 0000044a length 88200 samples, lengthbytes 0
FMOD: SystemI::createSample : subsamples = 1, channels = 2
FMOD: SystemI::createSample : subsample 0. output = 00C39190
FMOD: SystemI::createSample : mSoftware = 00C39190
FMOD: OutputSoftware::createSample : lengthpcm 88200, lengthbytes 0, channels 2, format 2, mode 0000044a
FMOD: OutputSoftware::createSample : done
FMOD: SystemI::createSample : done
FMOD: File::close : handle 00C64800
FMOD: File::close : free mBuffer (mBuffer = 00C649C8, mBufferMemory = 00C649C8)
FMOD: File::close : handle 00C64800 done
FMOD: SystemI::createSoundInternal : No name found in file, use filename.
FMOD: SystemI::createSoundInternal : done. OpenState now = FMOD_OPENSTATE_READY.

FMOD: SoundI::release : (00BD5AD0)
FMOD: SoundI::release : release codec. (00BD5AD0)
FMOD: Codec::release :
FMOD: Plugin::release : (00BD5878)
FMOD: Plugin::release : done
FMOD: Codec::release : done
FMOD: SoundI::release : free this. (00BD5AD0)
FMOD: SoundI::release : done (00BD5AD0)
FMOD: SystemI::close :
FMOD: SystemI::recordStop :
FMOD: SystemI::recordStop : done
FMOD: SystemI::close : Stop all sounds
FMOD: Thread::callback : * FMOD stream thread finished
FMOD: Thread::close : FMOD stream thread thread destroyed
FMOD: SystemI::close : Stream thread destroyed
FMOD: SystemI::close : Free master channel group.
FMOD: SystemI::close : Remove ‘master’ sound group.
FMOD: SystemI::close : Shut down output.
FMOD: SystemI::close : Free software output.
FMOD: SystemI::close : Free emulated output.
FMOD: SystemI::close : Free channel pool.
FMOD: SystemI::close : Remove DSP Soundcard unit.
FMOD: SystemI::close : Remove miscllaneous DSP stuff.
FMOD: SystemI::close : done.

FMOD: SoundI::release : (00C65448)
FMOD: SoundI::release : release codec. (00C65448)
FMOD: Codec::release :
FMOD: Plugin::release : (00C651F0)
FMOD: Plugin::release : done
FMOD: Codec::release : done
FMOD: SoundI::release : free this. (00C65448)
FMOD: SoundI::release : done (00C65448)
FMOD: SystemI::close :
FMOD: SystemI::recordStop :
FMOD: SystemI::recordStop : done
FMOD: SystemI::close : Stop all sounds
FMOD: Thread::callback : * FMOD stream thread finished
FMOD: Thread::close : FMOD stream thread thread destroyed
FMOD: SystemI::close : Stream thread destroyed
FMOD: SystemI::close : Shut down streamer and FMOD_NONBLOCKING and FileSystem thread.
FMOD: File::shutDown :
FMOD: File::shutDown : done
FMOD: SystemI::close : Free master channel group.
FMOD: SystemI::close : Remove ‘master’ sound group.
FMOD: SystemI::close : Shut down output.

I guess release part should be same for both Systems…

  • You must to post comments
0
0

I can reproduce problem even with veeery simple code:

    unsigned int version;
    FMOD::System    *system1 = NULL, *system2 = NULL;
    if (FMOD::System_Create(&system1) == FMOD_OK && system1->getVersion(&version) == FMOD_OK && version >= FMOD_VERSION) {
        if (system1->setOutput(FMOD_OUTPUTTYPE_ASIO) == FMOD_OK) {
            if (system1->setDSPBufferSize(64,2) == FMOD_OK) {
                if (system1->init(8, FMOD_INIT_NORMAL, 0) == FMOD_OK) {
                    qDebug("First system is OK\n");
                }
            }
        }
    }
    if (FMOD::System_Create(&system2) == FMOD_OK && system2->getVersion(&version) == FMOD_OK && version >= FMOD_VERSION) {
        if (system2->setOutput(FMOD_OUTPUTTYPE_ASIO) == FMOD_OK) {
            if (system2->setDriver(0) == FMOD_OK) {
                if (system2->setDSPBufferSize(64,2) == FMOD_OK) {
                    if (system2->init(8, FMOD_INIT_NORMAL, 0) == FMOD_OK) {
                        qDebug("Second system is OK\n");
                    }
                }
            }
        }
    }
    if (system1) {
        system1->release();
    }
    if (system2) {
        system2->release();  // Here is crash inside FMOD dll
    }
  • You must to post comments
0
0

why do you need two fmod system objects?

  • You must to post comments
0
0

Actually I just test low latency capture->encode->transmit->decode->playback and for design reason I made 2 independent classes (recorder & player).
But now I discover another useful case: recording devices are related to sound subsystem (for example USB mike could be seen only in DirectSound or WSAPI output mode), but playback could be ASIO device.

Somehow I tested same case with another ASIO device & drivers and it works. So something wrong in FMOD<->ASIO drivers interaction. May be Prodigy LE ASIO driver doesn’t support multiple instances and FMOD doesn’t process this case well…

  • You must to post comments
Showing 3 results
Your Answer

Please first to submit.