i searched the forums seeing that some people have the same problem as me but no one turned up with a real solution yet.
I have the problem that FMOD captures exclusive access to my sound device. That means when i start my app that uses fmod, while there’s another application active that plays sound, i get an error with the initialization, and when i first start my app and the other, the other application cannot play sound anymore.
So how to initialize FMOD in a way that forces software mixing ?
I want this to be done by FMOD, i cannot force the users of my app to manually edit their .asoundrc files, or something (to make it worse, SUSE Linux doesn’t even have an asoundrc file, as this is handled by some system configuration and providing an asoundrc file can cause malfunctions).
I don’t need advanced features, i just want to play plainly stereo wav-files, no 3d spatial definition or something. Plain software emulation would do the trick. But i need this without forcing the user to change anything.
EDIT: Some code to illustrate what i mean. Works great on Windows and MacOSX
[code:3nqcehjn]Logger::log("FMCSounds: Using FMOD Library");
m_fmod_system = 0;
unsigned int fmod_version = 0;
MYASSERT(FMOD_System_Create(&m_fmod_system) == FMOD_OK);
MYASSERT(FMOD_System_GetVersion(m_fmod_system, &fmod_version) == FMOD_OK);
if (fmod_version < FMOD_VERSION)
Logger::log(QString("FMCSounds: You are using an old version of FMOD "
"%1. This program requires %2\n").arg(fmod_version).arg(FMOD_VERSION));
MYASSERT(FMOD_System_Init(m_fmod_system, 32, FMOD_INIT_NORMAL, NULL) == FMOD_OK); // App crashes here when i.e. skype is running or something
// For playing a sound i have the following fuctions:
// load the sound
MySound::MySound(const QString & filename, FMOD_SYSTEM *fmod_system) :
m_filename(filename), m_fmod_system(fmod_system), m_fmod_sound(0), m_fmod_channel(0),
MYASSERT(m_fmod_system != 0);
MYASSERT(FMOD_System_CreateSound(m_fmod_system, filename.toLatin1().data(), FMOD_HARDWARE, 0, &m_fmod_sound) == FMOD_OK);
// play the sound
m_has_played = true;
FMOD_System_PlaySound(m_fmod_system, FMOD_CHANNEL_FREE, m_fmod_sound, 0, &m_fmod_channel);
// unload the sound
MYASSERT(FMOD_Sound_Release(m_fmod_sound) == FMOD_OK);
Greetings from Germany,
- PhilippM asked 9 years ago
With the way ALSA works you are presented via FMOD a list of all the devices available to play sound on. It is up to the application to present this list and let the user choose what they want to play sound from.
In the case of requiring two applications to share the same device, one of two things must be in place. One is the hardware device supports multiple access, the other is a software mixer device is available.
If the user doesn’t have the hardware able to do the former (which they probably wont) then they will need to create a software mixer device via a .asoundrc. This is the nature of ALSA on Linux, other platforms such as Windows or MacOSX have their own software mixers that are always available so this isn’t a problem.
Okay, so i have to tell FMOD via my App to use software mixing. I think the most common ALSA plugin to do this is dmix, but it fails qith special solutions of e.g. SuSe, where i would like to resort to esd instead.
So where do i tell FMOD to use ALSA via dmix or ESD in the above code?
- PhilippM answered 8 years ago
To set whether to use ALSA or ESD, you can use System::setOutput() passing in either FMOD_OUTPUTTYPE_ALSA or FMOD_OUTPUTTYPE_ESD. You would do this before the call to System::init().
To choose "dmix" on Linux you need to enumerate the available drivers for ALSA, so after you do System::setOutput(FMOD_OUTPUTTYPE_ALSA), you can use System::getNumDrivers() and System::getDriverInfo() to get a list of them all. If you are only looking for "dmix" it would just be a matter of finding it in the list and calling System::setDriver() with the corresponding device ID.
Please login first to submit.