0
0

About once every 2 days during testing we get a ” An invalid parameter was passed to this function”. Each time its a different sound but they are all 44.1 32bit mono ogg files converted to the same specs in a batch operation. I try looping over the various offending files and load them over and over again without fail using the same code path.

The exact call is:

FSOUND_SAMPLE* const pSample = FSOUND_Sample_Load( FSOUND_UNMANAGED, ansiName, sampleType, 0, 0 );
if( pSample == NULL )
{
Engine::Report::Error( _T(“AudioSystem: LoadSample Failure: %s : %s\n”), GetFModErrorString( FSOUND_GetError() ), fileName );
}

sampleType is guaranteed to be FSOUND_2D for 2d sounds or FSOUND_HW3D for 3d sounds. There seems to be no pattern – both sampleTypes could fail.

The audiosystem is started as follows:

bool
Engine::AudioSystem::StartUp( void* hWnd ) const
{
bool startUpOK = true;

FSOUND_SetMaxHardwareChannels( 0 );

if ( FSOUND_SetHWND( reinterpret_cast< HWND >( hWnd ) ) == FALSE )
{
    Report::Error( _T("AudioSystem SetHwnd Failure: %s\n"), GetFModErrorString( FSOUND_GetError() ) );
    startUpOK = false;
}

if ( FSOUND_Init( 44100, AudioSystem::Constants::MAX_NUM_SOFTWARE_CHANNELS, FSOUND_INIT_DSOUND_DEFERRED | FSOUND_INIT_GLOBALFOCUS ) == FALSE )
{
    Report::Error( _T("AudioSystem Init Failure: %s\n"), GetFModErrorString( FSOUND_GetError() ) );
    startUpOK = false;
}

FSOUND_3D_SetRolloffFactor( Constants::ROLLOFF );

if ( FSOUND_Stream_SetBufferSize( Constants::STREAM_BUFFER_SIZE ) == FALSE )
{
    Report::Error( _T("AudioSystem SetStreamBufferSize Failure: %s\n"), GetFModErrorString( FSOUND_GetError() ) );
    startUpOK = false;
}

return startUpOK;

}

MAX_NUM_SOFTWARE_CHANNELS is 32
STREAM_BUFFER_SIZE is 1000
ROLLOFF is 1

I’m at a loss to the cause. There seems to be no pattern and it doesn’t occur frequently enough to really nail down any neccessary conditions.

Any strategy for tracking this down would be much appreciated.

Thanks,
fyst

  • You must to post comments
0
0

Hi,

Thanks so much for the quick response. W/r to your comments:
1. Haha yes, my ‘random’ comment was not to suggest there isn’t a deterministic cause to this :)
2. There are no threads at all.
3. The hardwarecount to zero was vestigial from some earlier stress testing i was doing on machines to make sure it was runnable in software mode when the min hardware channels fell thru. Removal of it does not affect the results.

While i’m sure my testing in the engine successfully removed all other systems, i made a super stripped down version to 100% eliminate other factors. (shown below)

Notes relating to the following code:
-I cannot get sample loading to fail without loading at least one stream for up to ~500,000 tries. (it may fail but not for LONG time)
-With any number of streams loaded (below exceptions excluded) i can guarantee a failure on the sample load within ~100,000 tries (never a consistant number of times).
-I can get sample loading to fail on the first sample when i load 509 streams first.(probably unrelated)
-I can get stream loading to fail for 510 streams. (probably unrelated)
-Aside from the above cases there seems to be no relationship between number of streams loaded and the frequency of failure of sample loading.
It can occur anywhere from the 76th try to the 91,234 try.

I can’t hope to track this anymore without either reverse engineering your stuff (god help me) or access to your source code which is probably not in your best interest.

This is all the code but if you would like the ogg files i am using i would be more than happy to send them along for your testing dept to verify my results and help tracking this down. Ofcourse i’m willing to put the time in on this end before burdening you but i’m out of ideas.

Any suggestions?

Thanks,
fyst

//
// Test Code
//

include <stdio.h>

include <stdlib.h>

if defined(WIN32) || defined(_WIN64) || defined(WATCOMC)

#include &lt;windows.h&gt;
#include &lt;conio.h&gt;

else

#include "../../api/inc/wincompat.h"

endif

include “../../api/inc/fmod.h”

include “../../api/inc/fmod_errors.h”

int main()
{
FSOUND_Init( 44100, 32, FSOUND_INIT_DSOUND_DEFERRED | FSOUND_INIT_GLOBALFOCUS );
FSOUND_Stream_SetBufferSize( 1000.f );

int countStream = 0;
while( countStream &lt; 1 ) //try this at 509 to crash on first sample load //try at 510 to crash on the stream loading.
{
    countStream++;
    FSOUND_STREAM* const pStream = FSOUND_Stream_Open( "testmusic.ogg", FSOUND_2D | FSOUND_LOOP_NORMAL, 0 , 0 );
    if( pStream == NULL )
    {
        printf("%s\n", FMOD_ErrorString(FSOUND_GetError()));
        exit(1);
    }
}

int countSample = 0;
while( true )
{
    countSample++;
    FSOUND_SAMPLE* const pSample = FSOUND_Sample_Load( FSOUND_UNMANAGED, "testsound.ogg", FSOUND_2D, 0, 0 );
    if( pSample == NULL )
    {
        printf("%s\n", FMOD_ErrorString(FSOUND_GetError()));
        exit(1);
    }
    else
    {
        FSOUND_Sample_Free( pSample );
    }
}

return 0;

}

  • You must to post comments
0
0

I should have also mentionned that the loop mode does not seem to affect the results.

  • You must to post comments
0
0

Hi Brett,

I’ve done substantial testing with the new dll over the course of the day on multiple machines.

Here are the results:

  1. Minor point: the 509/510 issue still exists. There must be an internal amount of allocated memory for these fmod objects as this is invariant to the amount on various computers and the amount other applications consume.
  2. If i don’t load a single stream, and continuously load samples there is no crash for 1,000,000 tries. I assume for now it will not fail and has yet to with either dll for a combined total attempt count in excess of ~5,000,000.
  3. If i load but a single stream (or any number up to 509) it will fail to load a sample within 100,000 tries.
  4. I multiply verified that I was using the correct dll.

Summary: There is no change to the previous results.

Thanks,
fyst

  • You must to post comments
0
0

Any luck on this guys?

I’m approaching some final deadlines and we aren’t going to clear tester approval without this issue resolved. We had intended to purchase a license once we confirmed it performed as neccessary but I can’t pass it by the money men if its failing. Its a bit of a chicken and egg issue because I just read you will release the source code if we have a license, in which case i could track this myself but I can’t get the funds authorized if its deemed unstable.

thx for your time,
fyst

  • You must to post comments
0
0

Hey,

That’s sounds great. Hope your demo went well.

Thanks,
fyst

  • You must to post comments
Showing 5 results
Your Answer

Please first to submit.