0
0

So this is really weard but here goes. We build or source on Mac / Linux / Windows but for some weird reason mac osx Lion gives us an Invalid Parameters passed to CreateSound error when trying to load any sounds.

This is the code thats being hit and causing the issue

    {
    const char* pChar((const char *)sPath.c_str()); // sPath.c_str() is const wchar_t*
    result = m_pFMODSystem->createSound(pChar, uiFlags, NULL, &pNewSound);
}

if (result != FMOD_OK)
{
    if (~iSoundFlags & SND_QUIETFAIL)
    {
        tstring sError;
        StrToTString(sError, FMOD_ErrorString(result));
        Console.Err << sError << newl; // this prints an error in our console 
    }
    return NULL;
}

FMOD_ERR_INVALID_PARAM is the error were getting and were only getting it on Lion. I tried to string convert wchar_t string to char string but had no luck and just recived a bad path error instead of Invalid Param. Any hints or suggestions would be nice =)

  • You must to post comments
0
0

I made the suggested changes, and removed some handling code from another mate, to make sure the resulting code comes from the API.

[code:5tyti3rh]
RESULT: ERR_CDDA_NODEVICES
[/code:5tyti3rh]

The game does not use the DVD drive in any way, it is installed to the local user’s library and applications folders. Although there is a DVD drive on this Mac, the drive is empty and unmounted.

  • You must to post comments
0
0

It sounds like something is going wrong with the filename still and FMOD thinks the path is a CD device. Can you link with the logging version of FMOD, it should drop a log file next to the executable ‘fmod.log’ that will give me an idea of what is going on.

  • You must to post comments
0
0

I tried using the utf8 format and again I got the invalid path. How could the os lion see w_char strings as an invalid parameter and snow leopard works just fine? Still trying random stuff I have to have a solution by next year =)

  • You must to post comments
0
0

I tried changing paths, etc.

One additional detail, this sound has some different layers, and we are loading as:

[code:3e7c9jjd]
Sound master = new Sound();

        RESULT result = RESULT.OK;
        AudioUtils.Errcheck(result = AudioCore.FmodSystem.createSound(path, mode, ref sndInfo, ref master));

        if (result == RESULT.OK)
            _soundLib.Add(master);
        else
            throw new Exception("Error creating sound " + path + " Result:" + result);   //<----------- thrown under OSX Lion only, with ERR_CDDA_NODEVICES

        AudioUtils.Errcheck(result = master.getSubSound(0, ref snd));

        if (result != RESULT.OK)
            throw new Exception("Error loading subsound " + path + " Result:" + result);

[/code:3e7c9jjd]

  • You must to post comments
0
0

What flags are you passing in uiFlags?

Also FMOD only supports wchar_t for paths on Windows when used with FMOD_UNICODE.

  • You must to post comments
0
0

[quote="mathew":1j8bxh8z]It sounds like something is going wrong with the filename still and FMOD thinks the path is a CD device. Can you link with the logging version of FMOD, it should drop a log file next to the executable ‘fmod.log’ that will give me an idea of what is going on.[/quote:1j8bxh8z]

The fmod log is attached. Thanks for the help!

  • You must to post comments
0
0

I have tried NULL and some static flags but defualt looks like this. FMOD_SOFTWARE | FMOD_LOWMEM | (FMOD_2D or FMOD_3D) | (FMOD_CREATECOMPRESSEDSAMPLE or FMOD_CREATESAMPLE)

  • You must to post comments
0
0

Thanks for the log, the default logging would have been sufficient as it’s a bit tricky to navigate the verbose output but thanks anyway for being thorough.

A few things I noticed in the log:

[code:2ycuhmhg]File::open: name / : length 0 : unicode YES[/code:2ycuhmhg]
This indicates FMOD_UNICODE is still being passed in, can you double check you have removed it.

[code:2ycuhmhg]SystemI::createSoundInternal : filename = /Users/render/Library/Application Support/projectx/client.app/Contents/../aud[/code:2ycuhmhg]
This doesn’t look like a complete path, it looks like a directory.

  • You must to post comments
0
0

The problem must be coming from the file path. FMOD doesn’t support wchar_t on Mac, does the path contain foreign characters? If so I would recommend trying UTF8 encoded strings, they should pass all the way through FMOD to the underlying file IO functions.

  • You must to post comments
0
0

Very thank you, Mathew.

There was indeed a remaining code setting Unicode, it should not be called at all, but you know, it was still there hidden in another place. The music is now playing like a charm, in all platforms.

Thanks again for your great help!

  • You must to post comments
0
0

Are you able to reproduce this error with the FMOD examples?
If so could you demonstrate so I can debug here?

  • You must to post comments
0
0

We are having the very same problem with createSound() in our project:

  • runs perfectly under Windows;
  • runs perfectly under OSX Leopard;
  • does not run under Lion (ERR_INVALID_PARAM).

Any tips about what is wrong? Thanks.

  • You must to post comments
0
0

Are you able to reproduce the problem in one of our examples? or modify the examples in a way to demonstrate your problem?

  • You must to post comments
0
0

[quote="mathew":u631u6md]Are you able to reproduce the problem in one of our examples? or modify the examples in a way to demonstrate your problem?[/quote:u631u6md]

Hello Mathew, thanks for replying.

The examples are working fine. I made some checking with one of the examples, the "playstream" and tried to reproduce the problem, for example making it load the fsb file from the game path, but it worked. I tried setting the same flags, but it worked.

I will continue trying to reproduce, but I have some details to add:

  • we are using fmod 44004;
  • our game is in C#;
  • our game uses CREATESOUNDEXINFO with cbsize set and suggestedsoundtype = SOUNT_TYPE.FSB to pass to the createSound() as it does not accept a null as parameter in the C# version (at least not ours version).

I noticed that in your examples you’re passing null in this parameter, could our problems be that one?

Thanks in advance.

EDIT: I just modified the playstream example with:

[code:u631u6md]
FMOD_CREATESOUNDEXINFO info;
info.cbsize = sizeof(FMOD_CREATESOUNDEXINFO);
info.suggestedsoundtype = FMOD_SOUND_TYPE_FSB;
[/code:u631u6md]

Then passed &info to createSound(), and it stopped working with a "(25) Unsupported file or audio format" error. So, I suspect this is the problem?!? But then, we have another problem here, as in C# this method wont accept a null for this parameter. Being it a ref parameter, I’ll try to pass a nulled variable to it, but I’m not sure from memory if this is going to work.

EDIT2: Please note that there are no Mac csharp examples, so the above test was done using the C examples/api.

I just found the alternative createSound() without that ref soundInfo, will be trying that in a few minutes.

EDIT3: Even with the alternative createSound() it does not work.

  • You must to post comments
0
0

The problem could be related to the FMOD_UNICODE flag which is only supported on Windows.

You will need to modify the C# wrapper for it to work on Mac. Firstly remove FMOD.MODE.UNICODE from the createSound function in fmod.cs. Next go to the DLLImport section, there is a line of code that imports the createSound function. You will notice that it has CharSet = CharSet.Unicode, you need to change this to CharSet.ANSI.

Hopefully that will solve your problem.

  • You must to post comments
Showing 15 results
Your Answer

Please first to submit.