Crash playing through DLSMusicDevice with large sound fonts
Crash playing through DLSMusicDevice with large sound fonts
- Subject: Crash playing through DLSMusicDevice with large sound fonts
- From: "Yasir Assam" <email@hidden>
- Date: Wed, 25 Jun 2003 18:58:44 +1000
Hi,
My code crashes when playing DLSMusicDevice using a particular large sound
font (the .sft2 in question is approximately 84MB). The same MIDI file
played through other OS X apps that use DLSMusicDevice don't crash when
played through this sound font, so I don't think the sound font is at fault.
Oddly, when I set the CPU load (using kAudioUnitProperty_CPULoad) to values
<= 0.7 the crash goes away, so it seems connected to how much CPU time the
DLSMusicDevice uses.
Rendering is pretty simple. After initialization I call:
AudioUnitSetRenderNotification(dev, RenderCallback, 0);
and then the render notification callback is:
OSStatus RenderCallback( void* ref,
AudioUnitRenderActionFlags flags,
const AudioTimeStamp*,
UInt32 bus,
UInt32 numFrames,
AudioBufferList* bufList)
{
if (ref && (flags & kAudioUnitRenderAction_PreRender)) {
// Loop through all events that need to be played now
while (moreEvents) {
MusicDeviceMIDIEvent(dev, status, byte1, byte2, 0);
//...code left out
}
}
return noErr;
}
(the code has been edited for clarity)
The crash happens somewhere inside the MusicDeviceMIDIEvent call, about 11
calls deep.
Is there a known issue with DLSMusicDevice and large sound fonts crashing
when the system is under strain? The crash could be due to a problem
elsewhere in my code of course, but I wanted to check to see if there's a
known issue.
Another problem is that the sound font does sound pretty bad (loads of
crackles. glitches etc.) I presume this is due to lack of CPU cycles and
there's not much I can do other than optimize my app generally. Is this is
the case?
Thanks,
Yasir Assam
_______________________________________________
coreaudio-api mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/coreaudio-api
Do not post admin requests to the list. They will be ignored.