Re: Crash playing through DLSMusicDevice with large sound fonts
Re: Crash playing through DLSMusicDevice with large sound fonts
- Subject: Re: Crash playing through DLSMusicDevice with large sound fonts
- From: Bill Stewart <email@hidden>
- Date: Mon, 30 Jun 2003 22:13:40 -0700
Actually...
This is the best place to schedule notes/events as you schedule for the
same slice that you are about to render and it is really the only place
where you can accurately, to the sample, schedule events...
I'd reiterate Chris' request for a bug report and if we can get access
to the sound font we'd certainly take a look at this...
The MusicPlayer schedules the same way as you are doing, so if you take
the PlaySequence code in the latest SDK, and just run a MIDI file
through it with this sound bank, that can be a good regression to see
if this is something in your scheduling code or elsewhere.. There's a
-b option for PlaySequence where you can specify the sound bank...
Then, if that reproduces the problem all you'd need to send us is a
MIDI file and some way we can get the bank from you...
Thanks
Bill
On Wednesday, June 25, 2003, at 07:36 AM, Robert Grant wrote:
Hi Yasir,
I'm guessing here but I don't think you should be submitting
MIDIEvents in the RenderCallback. The RenderNotification is happening
on the realtime thread and my guess is that the MIDIEvents are taking
too long... Why not submit the events from a non-render thread and
thus let the MusicDevice process them when it's ready?
Robert.
On Wednesday, June 25, 2003, at 04:58AM, Yasir Assam
<email@hidden> wrote:
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.
_______________________________________________
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.
--
mailto:email@hidden
tel: +1 408 974 4056
________________________________________________________________________
__
"Much human ingenuity has gone into finding the ultimate Before.
The current state of knowledge can be summarized thus:
In the beginning, there was nothing, which exploded" - Terry Pratchett
________________________________________________________________________
__
_______________________________________________
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.