I have been using FMOD for a few days now and everything is running really smooth. We set up a test scene with alot of vehicles and aircraft, and it sounds great, beyond expectations.
The problem is that as soon as we add DSP’s (which is the biggest reason we tried out FMOD) it starts to sound bad, really bad. One sound that is far away and very low on volume suddenly kicks in at full volume, replacing one of the sources that are very close for a brief period, then switches back.
Here are our settings for initliazing FMOD:
system->setDSPBufferSize( 1024, 8 );
system->setSoftwareFormat( 48000, FMOD_SOUND_FORMAT_PCM16, 2, 2, FMOD_DSP_RESAMPLER_SPLINE );
system->init( 128, FMOD_INIT_NORMAL, 0 );
Min/Max distances are default, and we create the sounds with the following parameters:
As I said, as long as we skip any DSP effects the sound is perfect.
We have limited our FPS with vertical sync, we have tried different intervals of running update() and we have updated drivers for all three computers (SBLive!, Audigy, Xfi). FMOD CPU usage is peaking at 4-5 percent and we have tried to fiddle around with the DSP buffersize.
Is this to be expected with software mixing like this? Any suggestions?
- Stefan Lundmark asked 11 years ago
no that is per source.
FMOD already has a built in lowpass like this. You can use FMOD_INIT_OCCLUSION_LOWPASS i think it is called, then use setOcclusion function to change its level.
You can do it your way too, this way just works better with virtual voices and is built in so there is less code.
when you specify 2 outputchannels in setSoftwareFormat, you are telling it to go into FMOD_SPEAKERMODE_RAW which means 3d sound is ignored
You should leave it at 0, take a closer look at the documentation for that function.
I wouldnt recommend touching dsp size at all, and same with software format unless you really have the need to use spline interpolation instead of the default.
Thanks Brett, I appreciate it.
I am afraid none of that made it better, though. And how come it still works without DSP’s? The sounds that are far away behave like they have highest priority and kick out the sound which is closer, eventho I am still only using 4 voices.
I did as you asked me, and corrected some of my mistakes:
system->setDSPBufferSize ( 1024, 4 );
system->setSoftwareFormat ( 48000, FMOD_SOUND_FORMAT_PCM16, 0, 6, FMOD_DSP_RESAMPLER_LINEAR );
Here’s how I assign my DSP effects:
// When FMOD has initialized
system->createDSPByType ( FMOD_DSP_TYPE_LOWPASS, &lowpassFilter );
// Immediatly after the sound has been played
float cutoff = 5000 – ( distance * 6 );
lowpassFilter->setParameter ( FMOD_DSP_LOWPASS_CUTOFF, cutoff );
channel->addDSP ( lowpassFilter );
They all share this one:
FMOD::DSP * lowpassFilter;
Something just striked me. Do I need a seperate DSP for each channel?
You can still hear sounds far away for a brief millisecond after they are played, but I guess it’s no big deal. I got a new error with playing one DSP per channel, though – after playing 20 sounds per second for about 6 seconds.
FMOD error! (16) DSP connection error. Couldn’t find the DSP unit specified.[/quote:y1pm935j]
And it never goes away Just keeps popping up when I am trying to play a new sound, yet the sound is never heard.
Edit: Ok nevermind I found it. I was calling setDelay (of 1000!) after each sound had been played which obviously was the culprint there. I still think it’s harsch to not be able to play again at all, but it’s no big deal now that I have got around it
I am now playing 1000 sounds per second, with lowpass/normalize DSP’s attached to each one, and apart from that our game crawls at a mere 7 fps, (which is to be expected :D), no sound artifacts can be heard and the audio is really stable.
I think you guys will see a new customer soon. This evauluation has been very entertaining. Laters and thanks again.
hah ok that makes sense i suppose 😆
good to see you are going again. Note if you want to do an effect to lots of channels at once you can use ChannelGroups and it will improve the cpu usage a lot (thanks to submixing and the effect only being processed once, not for every voice)
Please login first to submit.