0
0

I have a project in which I’m looking to create a music player to play MP3 and WAV files. Harnessing a bit of leverage with the DSP layers I’ve exposed to the user the Normalizer, Compressor, a 10-band Parametric EQ and ability for custom VST plugins – typically created with SynthMaker.

Another layer of complexity I’ve added to my issue, which I will get to, is that in the program the user can make use of multiple audio devices which internally is opening up a new System object for each new device. This sets it up for more of a DJ application where the user can play music out to a club/PA system but still have a personal listen back channel through headphones that are completely independent of the main System object out.

Now that I’ve got all this laid out – in testing I’ve found that when I turn on all 3 DSP layers and 1 custom VST if the user is playing something out of device 0 they can hear audible pops out of device 1 and vice versa. These pops seem to be small chunks of the audio playing on the actively playing device. At first I thought the issue was within my custom VST I created.

I have craeted a test VST that is nothing more than two INs and two OUTs with no processing in between – a simple pass through if you will – but my issues persist. If I turn off any one of the DSP layers or SetActive to 0 for the VST plugin the problem goes away.

It is worth noting that the DSP layers and VST plugin are active on each System object as they are built out of the same wrapper class but are unique and distinct of each other and verified by the LONG value pointers returned from FMOD. Any help or suggestions would be helpful and greatly appreciated.

If I’ve not included enough information please let me know. I would love to share code to better explain and show what I’m doing but my wrapper class alone for FMOD is a little over 2,500 lines not counting comments.

  • You must to post comments
0
0

Ok – so this is just to leave in the forum database for others that make a silly mistake as I did. I finally found my issue and have emailed support@fmod.org to let those guys know.

64bit – can you believe it? I wasn’t linking to the appropriate lib and dll files for 64bit operating systems! How stupid, I know! Thanks be to the guys at FMOD who have been trying their best to find where my issue was originating. Down and dirty – it was my issue. The guys at FMOD know what they’re doing a lot better than I and shouldn’t be doubted too often. Thanks guys!!

  • You must to post comments
0
0

I’ve now gone back in and changed that whatever is selected for the secondary device, typically device 1, I do not initialize the Compressor, Normalizer or EQ DSP layers. Hoping to round out some of the issues. After further testing it seems that any audio that would be "clipping" is being dumped to the secondary device that is not currently playing a track. The thing that is odd is that according to my VU meters the tracks are not close to clipping at all but somewhere in the range of -10dB to -20dB on average when this occurs although there is generally a spike in audio volume when this occurs.

  • You must to post comments
0
0

I continue my work today. My questions now has changed a bit as I’m looking for where this issue could be occurring.

  1. Is System::addDSP pretty much the same thing as going through all the steps of System::getDSPHead, DSP::getInput, DSP::disconnectFrom, DSP::addInput x2? It’s in the CHM file that it "is a wrapper function to insert a DSP unit at the top of the System DSP chain" but doesn’t say precisely what functions it wraps.

  2. Which method is preferred for adding a DSP created from System::createDSPByType?

  3. Is there a limit to the DSP objects you can add in between the DSPChannelMixer and the DSPHead?

  4. According to the DSP_EffectPerSpeaker sample I notice the levels of the DSPConnection are adjusted since it is explained that there are now two connections between the DSPChannelMixer and the DSPHead hence the sound will be twice as loud. In my project, using System:addDSP function right now I do not experience the same increase in volume for each DSP I add? Does the addDSP function add DSP objects in line of each other instead of creating new paths that directly connect to the DSPChannelMixer and DSPHead?

  5. Am I getting completely off topic here and heading in the wrong direction?

Again – any help is appreciated! Have a great weekend!

  • You must to post comments
0
0

[quote:529sicxo]1. Is System::addDSP pretty much the same thing as going through all the steps of System::getDSPHead, DSP::getInput, DSP::disconnectFrom, DSP::addInput x2? It’s in the CHM file that it "is a wrapper function to insert a DSP unit at the top of the System DSP chain" but doesn’t say precisely what functions it wraps. [/quote:529sicxo]
Yes, System::addDSP just adds the DSP unit to the master channel group.

[quote:529sicxo]2. Which method is preferred for adding a DSP created from System::createDSPByType? [/quote:529sicxo]
Just use addDSP unless you have a good reason not to. The other DSP functions are there to give you greater control over the DSP network but for most applications addDSP should be sufficient.

[quote:529sicxo]3. Is there a limit to the DSP objects you can add in between the DSPChannelMixer and the DSPHead? [/quote:529sicxo]
No you can add as many DSP units as you like at any point of the mixer.

[quote:529sicxo]4. …Does the addDSP function add DSP objects in line of each other instead of creating new paths that directly connect to the DSPChannelMixer and DSPHead? [/quote:529sicxo]
Correct.

-Pete

  • You must to post comments
0
0

Peter,

Thanks for the response. That does solidify in my mind a few assumptions I had made about how you were handling the DSP layers on your side. What I’ve done now is to recreate the issue in C++ by modifying the included MutlipleSoundCard demo project provided. I’m not a wiz at C++ but feel I’ve done everything as FMOD should expect and still been successful at recreating the same error. Can you please have a look at the code below to see if anything sticks out to you?

[code:2v372tfr]
// FMODMultipleSoundCard.cpp : main project file.

include "../inc/fmod.h"

include "../inc/fmod_errors.h"

include <windows.h>

include <stdio.h>

include <conio.h>

void ERRCHECK(FMOD_RESULT result)
{
if (result != FMOD_OK)
{
printf("FMOD error! (%d) %s\n", result, FMOD_ErrorString(result));
getch();
exit(-1);
}
}

int main(int argc, char *argv[])
{
FMOD_SYSTEM *systemA, *systemB;
FMOD_SOUND *soundA, *soundB;
FMOD_CHANNEL *channelA = 0, *channelB = 0;
FMOD_DSP *dspNormalizerA, *dspCompressorA, *dspEqualizerA[10];
FMOD_DSP *dspNormalizerB, *dspCompressorB, *dspEqualizerB[10];
FMOD_DSP *dspVSTVUA, *dspVSTVUB;
unsigned int dspVSTVUHandleA, dspVSTVUHandleB;
FMOD_RESULT result;
int key, count, numdrivers, driver, intCounter;
unsigned int version;

/*
    Create Sound Card A
*/
result = FMOD_System_Create(&amp;systemA);
ERRCHECK(result);

result = FMOD_System_GetVersion(systemA, &amp;version);
ERRCHECK(result);

if (version &lt; FMOD_VERSION)
{
    printf(&quot;Error!  You are using an old version of FMOD %08x.  This program requires %08x\n&quot;, version, FMOD_VERSION);
    return 0;
}

result = FMOD_System_GetNumDrivers(systemA, &amp;numdrivers);
ERRCHECK(result);

printf(&quot;---------------------------------------------------------\n&quot;);    
printf(&quot;Select soundcard A\n&quot;);
printf(&quot;---------------------------------------------------------\n&quot;);    
for (count=0; count &lt; numdrivers; count++)
{
    char name[256];

    result = FMOD_System_GetDriverInfo(systemA, count, name, 256, 0);
    ERRCHECK(result);

    printf(&quot;%d : %s\n&quot;, count + 1, name);
}
printf(&quot;---------------------------------------------------------\n&quot;);
printf(&quot;Press a corresponding number or ESC to quit\n&quot;);

do
{
    key = getch();
    if (key == 27)
    {
        return 0;
    }
    driver = key - '1';
} while (driver &lt; 0 || driver &gt;= numdrivers);

printf(&quot;\n&quot;);

result = FMOD_System_SetDriver(systemA, driver);
ERRCHECK(result);

result = FMOD_System_Init(systemA, 32, FMOD_INIT_NORMAL, NULL);
ERRCHECK(result);

//Normalizer
result = FMOD_System_CreateDSPByType(systemA, FMOD_DSP_TYPE_NORMALIZE, &amp;dspNormalizerA);
ERRCHECK(result);

//Compressor
result = FMOD_System_CreateDSPByType(systemA, FMOD_DSP_TYPE_COMPRESSOR, &amp;dspCompressorA);
ERRCHECK(result);

//10-Band Equalizer
for (intCounter = 0; intCounter &lt; 10; intCounter++)
{
    result = FMOD_System_CreateDSPByType(systemA, FMOD_DSP_TYPE_PARAMEQ, &amp;dspEqualizerA[intCounter]);
    ERRCHECK(result);
}

//Custom VST plugin DLL
FMOD_System_LoadPlugin(systemA, &quot;c:\\vumeter.dll&quot;, &amp;dspVSTVUHandleA, 0);
ERRCHECK(result);

FMOD_System_CreateDSPByPlugin(systemA, dspVSTVUHandleA, &amp;dspVSTVUA);
ERRCHECK(result);

FMOD_System_AddDSP(systemA, dspVSTVUA, 0);
ERRCHECK(result);

result = FMOD_DSP_SetBypass(dspNormalizerA, FALSE);
result = FMOD_DSP_SetActive(dspNormalizerA, TRUE);
result = FMOD_DSP_SetBypass(dspCompressorA, FALSE);
result = FMOD_DSP_SetActive(dspCompressorA, TRUE);

for (intCounter = 0; intCounter &lt; 10; intCounter++)
{
    result = FMOD_DSP_SetBypass(dspEqualizerA[intCounter], FALSE);
    result = FMOD_DSP_SetActive(dspEqualizerA[intCounter], TRUE);
}

result = FMOD_DSP_SetBypass(dspVSTVUA, FALSE);
result = FMOD_DSP_SetActive(dspVSTVUA, TRUE);

/*
    Create Sound Card B
*/
result = FMOD_System_Create(&amp;systemB);
ERRCHECK(result);

result = FMOD_System_GetVersion(systemB, &amp;version);
ERRCHECK(result);

if (version &lt; FMOD_VERSION)
{
    printf(&quot;Error!  You are using an old version of FMOD %08x.  This program requires %08x\n&quot;, version, FMOD_VERSION);
    return 0;
}

result = FMOD_System_GetNumDrivers(systemB, &amp;numdrivers);
ERRCHECK(result);

printf(&quot;---------------------------------------------------------\n&quot;);    
printf(&quot;Select soundcard B\n&quot;);
printf(&quot;---------------------------------------------------------\n&quot;);    
for (count=0; count &lt; numdrivers; count++)
{
    char name[256];

    result = FMOD_System_GetDriverInfo(systemB, count, name, 256, 0);
    ERRCHECK(result);

    printf(&quot;%d : %s\n&quot;, count + 1, name);
}
printf(&quot;---------------------------------------------------------\n&quot;);
printf(&quot;Press a corresponding number or ESC to quit\n&quot;);

do
{
    key = getch();
    if (key == 27)
    {
        return 0;
    }
    driver = key - '1';
} while (driver &lt; 0 || driver &gt;= numdrivers);

printf(&quot;\n&quot;);

result = FMOD_System_SetDriver(systemB, driver);
ERRCHECK(result);

result = FMOD_System_Init(systemB, 32, FMOD_INIT_NORMAL, NULL);
ERRCHECK(result);

//Normalizer
result = FMOD_System_CreateDSPByType(systemB, FMOD_DSP_TYPE_NORMALIZE, &amp;dspNormalizerB);
ERRCHECK(result);

//Compressor
result = FMOD_System_CreateDSPByType(systemB, FMOD_DSP_TYPE_COMPRESSOR, &amp;dspCompressorB);
ERRCHECK(result);

//10-Band Equalizer
for (intCounter = 0; intCounter &lt; 10; intCounter++)
{
    result = FMOD_System_CreateDSPByType(systemB, FMOD_DSP_TYPE_PARAMEQ, &amp;dspEqualizerB[intCounter]);
    ERRCHECK(result);
}

//Custom VST plugin DLL
FMOD_System_LoadPlugin(systemB, &quot;c:\\vumeter.dll&quot;, &amp;dspVSTVUHandleB, 0);
ERRCHECK(result);

FMOD_System_CreateDSPByPlugin(systemB, dspVSTVUHandleB, &amp;dspVSTVUB);
ERRCHECK(result);

FMOD_System_AddDSP(systemB, dspVSTVUB, 0);
ERRCHECK(result);

result = FMOD_DSP_SetBypass(dspNormalizerB, FALSE);
result = FMOD_DSP_SetActive(dspNormalizerB, TRUE);
result = FMOD_DSP_SetBypass(dspCompressorB, FALSE);
result = FMOD_DSP_SetActive(dspCompressorB, TRUE);

for (intCounter = 0; intCounter &lt; 10; intCounter++)
{
    result = FMOD_DSP_SetBypass(dspEqualizerB[intCounter], FALSE);
    result = FMOD_DSP_SetActive(dspEqualizerB[intCounter], TRUE);
}

result = FMOD_DSP_SetBypass(dspVSTVUB, FALSE);
result = FMOD_DSP_SetActive(dspVSTVUB, TRUE);

/*
    Load 1 sample into each soundcard.
*/
result = FMOD_System_CreateSound(systemA, &quot;c:\\thats.mp3&quot;, FMOD_HARDWARE, 0, &amp;soundA);
ERRCHECK(result);
result = FMOD_Sound_SetMode(soundA, FMOD_LOOP_OFF);
ERRCHECK(result);

result = FMOD_System_CreateSound(systemB, &quot;c:\\thats.mp3&quot;, FMOD_HARDWARE, 0, &amp;soundB);
ERRCHECK(result);

printf(&quot;===========================================================================\n&quot;);
printf(&quot;MultipleSoundCard Example.  Copyright (c) Firelight Technologies 2004-2009.\n&quot;);
printf(&quot;===========================================================================\n&quot;);
printf(&quot;\n&quot;);
printf(&quot;Press '1' to play a sound on soundcard A\n&quot;);
printf(&quot;Press '2' to play a sound on soundcard B\n&quot;);
printf(&quot;Press 'Esc' to quit\n&quot;);
printf(&quot;\n&quot;);

/*
    Main loop.
*/
do
{
    int  channelsplayingA = 0;
    int  channelsplayingB = 0;

    if (kbhit())
    {
        key = getch();

        switch (key)
        {
            case '1' :
            {
                result = FMOD_System_PlaySound(systemA, FMOD_CHANNEL_FREE, soundA, 0, &amp;channelA);
                ERRCHECK(result);
                break;
            }
            case '2' :
            {
                result = FMOD_System_PlaySound(systemB, FMOD_CHANNEL_FREE, soundB, 0, &amp;channelB);
                ERRCHECK(result);
                break;
            }
        }
    }

    FMOD_System_Update(systemA);
    FMOD_System_Update(systemB);

    FMOD_System_GetChannelsPlaying(systemA, &amp;channelsplayingA);
    FMOD_System_GetChannelsPlaying(systemB, &amp;channelsplayingB);

    printf(&quot;Channels Playing on A %2d.   Channels Playing on B %2d.\r&quot;, channelsplayingA, channelsplayingB);

    Sleep(10);

} while (key != 27);

printf(&quot;\n&quot;);

/*
    Shut down
*/
result = FMOD_Sound_Release(soundA);
ERRCHECK(result);
result = FMOD_System_Close(systemA);
ERRCHECK(result);
result = FMOD_System_Release(systemA);
ERRCHECK(result);

result = FMOD_Sound_Release(soundB);
ERRCHECK(result);
result = FMOD_System_Close(systemB);
ERRCHECK(result);
result = FMOD_System_Release(systemB);
ERRCHECK(result);

return 0;

}
[/code:2v372tfr]

The files referenced by hard coded paths are:

[b:2v372tfr]VUMeter.dll[/b:2v372tfr]: A simple VST plugin that is nothing more than a visual EQ with a bit of weighting on the VU. It does not represent a true VU level but instead is weighted so that the audio level returned is modifying allowing head room to signify a "clipping" signal even though the true signal may be at -5dB. The output is never modified. The signal comes into the VST object, is split and one split goes right to the output without modification while the other split goes to a graphical drawing of the VU meter. Can be supplied if necessary.

[b:2v372tfr]thats.mp3[/b:2v372tfr]: A simple test MP3 file of That’s What You Get from Paramore. I like drumloop.wav but it doesn’t have the range of this MP3.

This issue is quite a large issue in our current work. In some cases we’ve found that simply creating the DSP layers causes the issue. That is to say that SetActive TRUE and SetBypass FALSE is not necessarily required but it seems to do depend on the internal audio card of the system. Also – the issue seems to affect Windows 7 machines more frequent and with more velocity over XP. Vista testing has not been as extensive since we know the code works…

Again – any input or reply would prove most helpful in our situation and I look forward to see what improvements we could make to our existing build.[/b]

  • You must to post comments
0
0

Quick note: I dug into my build today to find that the current fmodex.dll I have being using was version 4.26.09. I’ve since upgraded to version 4.28.06 with no changes. I also tested the 4.29.06 development release and no changes. At least it’s consistent, right? :)

  • You must to post comments
0
0

I think what is happening is you’re using the same dll in 2 system objects, but windows has cached the dll, so it is not 2 instances of the VST plugin, it is 1. (I have verified the loadlibrary code does this)

Copy your dll to another name, like vumeter2.dll for the 2nd instance and see what happens.

  • You must to post comments
0
0

Brett –

Thanks for the reply. Unfortunately this is something I’ve already tested and had fail in my VB project. Sorry I did not include that information in previous posts. I did not attempt this routine in the C++ code that I’ve attached to the post I will today and get back with you. Hopefully we’ll find different results. I’m really confused as to where the issue is originating and look forward to finding the solution.

Jeff.

  • You must to post comments
0
0

Brett-

After testing the short end is that the same issue occurs during testing. No change. I’ve included the updated source below for testing. From this point what other information could I provide to assist in finding my solution? Hardware specifics? OS information? My VST dll with source – recalling that it is generated by Synthmaker? Anything I can give you to assist is open as I need to find a solution. We’ve found the capability within FMOD to do these extra bits for our software and now have a strong opinion that this will take our product to the next level so we’re not about to give up too easily. I understand our time differences being on opposite ends of the world don’t say much for communication so if need be I can stick around late one night for a discussion if that is even possible. Bottom line – I’m making myself and all resources available to see this through. Let me know what you need from our side to assist in your search no matter how little or how much. Thanks for the continued support.

[code:3f4n4ac4]// FMODMultipleSoundCard.cpp : main project file.

include "../inc/fmod.h"

include "../inc/fmod_errors.h"

include <windows.h>

include <stdio.h>

include <conio.h>

void ERRCHECK(FMOD_RESULT result)
{
if (result != FMOD_OK)
{
printf("FMOD error! (%d) %s\n", result, FMOD_ErrorString(result));
getch();
exit(-1);
}
}

int main(int argc, char *argv[])
{
FMOD_SYSTEM *systemA, *systemB;
FMOD_SOUND *soundA, *soundB;
FMOD_CHANNEL *channelA = 0, *channelB = 0;
FMOD_DSP *dspNormalizerA, *dspCompressorA, *dspEqualizerA[10];
FMOD_DSP *dspNormalizerB, *dspCompressorB, *dspEqualizerB[10];
FMOD_DSP *dspVSTVUA, *dspVSTVUB;
unsigned int dspVSTVUHandleA, dspVSTVUHandleB;
FMOD_RESULT result;
int key, count, numdrivers, driver, intCounter, vstInstances;
unsigned int version;

/*
    Create Sound Card A
*/
result = FMOD_System_Create(&amp;systemA);
ERRCHECK(result);

result = FMOD_System_GetVersion(systemA, &amp;version);
ERRCHECK(result);

if (version &lt; FMOD_VERSION)
{
    printf(&quot;Error!  You are using an old version of FMOD %08x.  This program requires %08x\n&quot;, version, FMOD_VERSION);
    return 0;
}

result = FMOD_System_GetNumDrivers(systemA, &amp;numdrivers);
ERRCHECK(result);

printf(&quot;---------------------------------------------------------\n&quot;);    
printf(&quot;Select soundcard A\n&quot;);
printf(&quot;---------------------------------------------------------\n&quot;);    
for (count=0; count &lt; numdrivers; count++)
{
    char name[256];

    result = FMOD_System_GetDriverInfo(systemA, count, name, 256, 0);
    ERRCHECK(result);

    printf(&quot;%d : %s\n&quot;, count + 1, name);
}
printf(&quot;---------------------------------------------------------\n&quot;);
printf(&quot;Press a corresponding number or ESC to quit\n&quot;);

do
{
    key = getch();
    if (key == 27)
    {
        return 0;
    }
    driver = key - '1';
} while (driver &lt; 0 || driver &gt;= numdrivers);

printf(&quot;\n&quot;);

result = FMOD_System_SetDriver(systemA, driver);
ERRCHECK(result);

result = FMOD_System_Init(systemA, 32, FMOD_INIT_NORMAL, NULL);
ERRCHECK(result);

//Normalizer
result = FMOD_System_CreateDSPByType(systemA, FMOD_DSP_TYPE_NORMALIZE, &amp;dspNormalizerA);
ERRCHECK(result);

//Compressor
result = FMOD_System_CreateDSPByType(systemA, FMOD_DSP_TYPE_COMPRESSOR, &amp;dspCompressorA);
ERRCHECK(result);

//10-Band Equalizer
for (intCounter = 0; intCounter &lt; 10; intCounter++)
{
    result = FMOD_System_CreateDSPByType(systemA, FMOD_DSP_TYPE_PARAMEQ, &amp;dspEqualizerA[intCounter]);
    ERRCHECK(result);
}

//Custom VST plugin DLL
FMOD_System_LoadPlugin(systemA, &quot;c:\\vumeter.dll&quot;, &amp;dspVSTVUHandleA, 0);
ERRCHECK(result);

FMOD_System_CreateDSPByPlugin(systemA, dspVSTVUHandleA, &amp;dspVSTVUA);
ERRCHECK(result);

FMOD_System_AddDSP(systemA, dspVSTVUA, 0);
ERRCHECK(result);

result = FMOD_DSP_SetBypass(dspNormalizerA, FALSE);
result = FMOD_DSP_SetActive(dspNormalizerA, TRUE);
result = FMOD_DSP_SetBypass(dspCompressorA, FALSE);
result = FMOD_DSP_SetActive(dspCompressorA, TRUE);

for (intCounter = 0; intCounter &lt; 10; intCounter++)
{
    result = FMOD_DSP_SetBypass(dspEqualizerA[intCounter], FALSE);
    result = FMOD_DSP_SetActive(dspEqualizerA[intCounter], TRUE);
}

result = FMOD_DSP_SetBypass(dspVSTVUA, FALSE);
result = FMOD_DSP_SetActive(dspVSTVUA, TRUE);

/*
    Create Sound Card B
*/
result = FMOD_System_Create(&amp;systemB);
ERRCHECK(result);

result = FMOD_System_GetVersion(systemB, &amp;version);
ERRCHECK(result);

if (version &lt; FMOD_VERSION)
{
    printf(&quot;Error!  You are using an old version of FMOD %08x.  This program requires %08x\n&quot;, version, FMOD_VERSION);
    return 0;
}

result = FMOD_System_GetNumDrivers(systemB, &amp;numdrivers);
ERRCHECK(result);

printf(&quot;---------------------------------------------------------\n&quot;);    
printf(&quot;Select soundcard B\n&quot;);
printf(&quot;---------------------------------------------------------\n&quot;);    
for (count=0; count &lt; numdrivers; count++)
{
    char name[256];

    result = FMOD_System_GetDriverInfo(systemB, count, name, 256, 0);
    ERRCHECK(result);

    printf(&quot;%d : %s\n&quot;, count + 1, name);
}
printf(&quot;---------------------------------------------------------\n&quot;);
printf(&quot;Press a corresponding number or ESC to quit\n&quot;);

do
{
    key = getch();
    if (key == 27)
    {
        return 0;
    }
    driver = key - '1';
} while (driver &lt; 0 || driver &gt;= numdrivers);

printf(&quot;\n&quot;);

result = FMOD_System_SetDriver(systemB, driver);
ERRCHECK(result);

result = FMOD_System_Init(systemB, 32, FMOD_INIT_NORMAL, NULL);
ERRCHECK(result);

//Normalizer
result = FMOD_System_CreateDSPByType(systemB, FMOD_DSP_TYPE_NORMALIZE, &amp;dspNormalizerB);
ERRCHECK(result);

//Compressor
result = FMOD_System_CreateDSPByType(systemB, FMOD_DSP_TYPE_COMPRESSOR, &amp;dspCompressorB);
ERRCHECK(result);

//10-Band Equalizer
for (intCounter = 0; intCounter &lt; 10; intCounter++)
{
    result = FMOD_System_CreateDSPByType(systemB, FMOD_DSP_TYPE_PARAMEQ, &amp;dspEqualizerB[intCounter]);
    ERRCHECK(result);
}

printf(&quot;---------------------------------------------------------\n&quot;);    
printf(&quot;Select number of VST objects to use.\n&quot;);
printf(&quot;---------------------------------------------------------\n&quot;);
printf(&quot;1. Use only 1 instance of the VUMeter.dll file.\n&quot;);
printf(&quot;2. Use multiple instances of the VUMeter.dll to prevent caching.\n&quot;);
printf(&quot;---------------------------------------------------------\n&quot;);
printf(&quot;Press a corresponding number or ESC to quit\n&quot;);

do
{
    key = getch();
    if (key == 27)
    {
        return 0;
    }
    vstInstances = key;
} while (vstInstances &lt; 0);

printf(&quot;\n&quot;);

if (vstInstances == 1)
{
    //Custom VST plugin DLL
    FMOD_System_LoadPlugin(systemB, &quot;c:\\vumeter.dll&quot;, &amp;dspVSTVUHandleB, 0);
    ERRCHECK(result);
} else {
    //Custom VST plugin DLL
    FMOD_System_LoadPlugin(systemB, &quot;c:\\vumeter2.dll&quot;, &amp;dspVSTVUHandleB, 0);
    ERRCHECK(result);
}

FMOD_System_CreateDSPByPlugin(systemB, dspVSTVUHandleB, &amp;dspVSTVUB);
ERRCHECK(result);

FMOD_System_AddDSP(systemB, dspVSTVUB, 0);
ERRCHECK(result);

result = FMOD_DSP_SetBypass(dspNormalizerB, FALSE);
result = FMOD_DSP_SetActive(dspNormalizerB, TRUE);
result = FMOD_DSP_SetBypass(dspCompressorB, FALSE);
result = FMOD_DSP_SetActive(dspCompressorB, TRUE);

for (intCounter = 0; intCounter &lt; 10; intCounter++)
{
    result = FMOD_DSP_SetBypass(dspEqualizerB[intCounter], FALSE);
    result = FMOD_DSP_SetActive(dspEqualizerB[intCounter], TRUE);
}

result = FMOD_DSP_SetBypass(dspVSTVUB, FALSE);
result = FMOD_DSP_SetActive(dspVSTVUB, TRUE);

/*
    Load 1 sample into each soundcard.
*/
result = FMOD_System_CreateSound(systemA, &quot;c:\\thats.mp3&quot;, FMOD_HARDWARE, 0, &amp;soundA);
ERRCHECK(result);
result = FMOD_Sound_SetMode(soundA, FMOD_LOOP_OFF);
ERRCHECK(result);

result = FMOD_System_CreateSound(systemB, &quot;c:\\thats.mp3&quot;, FMOD_HARDWARE, 0, &amp;soundB);
ERRCHECK(result);

printf(&quot;===========================================================================\n&quot;);
printf(&quot;MultipleSoundCard Example.  Copyright (c) Firelight Technologies 2004-2009.\n&quot;);
printf(&quot;===========================================================================\n&quot;);
printf(&quot;\n&quot;);
printf(&quot;Press '1' to play a sound on soundcard A\n&quot;);
printf(&quot;Press '2' to play a sound on soundcard B\n&quot;);
printf(&quot;Press 'Esc' to quit\n&quot;);
printf(&quot;\n&quot;);

/*
    Main loop.
*/
do
{
    int  channelsplayingA = 0;
    int  channelsplayingB = 0;

    FMOD_BOOL channelAIsPlaying = FALSE;
    FMOD_BOOL channelBIsPlaying = FALSE;

    if (kbhit())
    {
        key = getch();

        switch (key)
        {
            case '1' :
            {
                if (channelA)
                {
                    result = FMOD_Channel_IsPlaying(channelA, &amp;channelAIsPlaying);
                    ERRCHECK(result);

                    if (channelAIsPlaying == TRUE)
                    {
                        result = FMOD_Channel_Stop(channelA);
                        ERRCHECK(result);
                        break;
                    } else {
                        result = FMOD_System_PlaySound(systemA, FMOD_CHANNEL_REUSE, soundA, 0, &amp;channelA);
                        ERRCHECK(result);
                        break;
                    }
                } else {
                    result = FMOD_System_PlaySound(systemA, FMOD_CHANNEL_REUSE, soundA, 0, &amp;channelA);
                    ERRCHECK(result);
                    break;
                }
            }
            case '2' :
            {
                if (channelB)
                {
                    result = FMOD_Channel_IsPlaying(channelB, &amp;channelBIsPlaying);
                    ERRCHECK(result);

                    if (channelBIsPlaying == TRUE)
                    {
                        result = FMOD_Channel_Stop(channelB);
                        ERRCHECK(result);
                        break;
                    } else {
                        result = FMOD_System_PlaySound(systemB, FMOD_CHANNEL_REUSE, soundA, 0, &amp;channelB);
                        ERRCHECK(result);
                        break;
                    }
                } else {
                    result = FMOD_System_PlaySound(systemB, FMOD_CHANNEL_REUSE, soundA, 0, &amp;channelB);
                    ERRCHECK(result);
                    break;
                }
            }
        }
    }

    FMOD_System_Update(systemA);
    FMOD_System_Update(systemB);

    FMOD_System_GetChannelsPlaying(systemA, &amp;channelsplayingA);
    FMOD_System_GetChannelsPlaying(systemB, &amp;channelsplayingB);

    printf(&quot;Channels Playing on A %2d.   Channels Playing on B %2d.\r&quot;, channelsplayingA, channelsplayingB);

    Sleep(10);

} while (key != 27);

printf(&quot;\n&quot;);

/*
    Shut down
*/
result = FMOD_Sound_Release(soundA);
ERRCHECK(result);
result = FMOD_System_Close(systemA);
ERRCHECK(result);
result = FMOD_System_Release(systemA);
ERRCHECK(result);

result = FMOD_Sound_Release(soundB);
ERRCHECK(result);
result = FMOD_System_Close(systemB);
ERRCHECK(result);
result = FMOD_System_Release(systemB);
ERRCHECK(result);

return 0;

}
[/code:3f4n4ac4]

  • You must to post comments
0
0

I think if you want us to reproduce the issue you should send us the dll and mp3 file you are using to support@fmod.org.

The code you sent didnt really do anything very interesting when I tried it here with a test dll and drumloop.wav

  • You must to post comments
0
0

So today after much testing again I finally found a work around. After all the changes I’ve made I went back and did tests on XP, Vista and 7 and found the issue to be related to only Vista and 7 at this time. Which of course then lead me to the FMOD_OUTPUTTYPE. After testing I found that this particular issue only exists within the WASAPI output type – you know, the one FMOD defaults to for Major versions of 6 on Windows. 😀

I tested DSOUND, WINMM and ASIO (on devices that ASIO is applicable to) and everything on the secondary audio device was silent as could be. So – for now we have a solution by forcing everything to DSOUND to continue our development. It wouldn’t be a long term solution but it does provide a way to keep moving in the interim.

Does this change the line of thinking at all for you guys over there to hear it’s only tied to WASAPI? I’d still be interesting in getting a patch or update to take care of this issue if at all possible. I’ll be sending along some test files for you ASAP.

  • You must to post comments
Showing 11 results
Your Answer

Please first to submit.