Re: MIDI causing CoreAudio overload errors?
Re: MIDI causing CoreAudio overload errors?
- Subject: Re: MIDI causing CoreAudio overload errors?
- From: Doug Wyatt <email@hidden>
- Date: Mon, 4 Apr 2005 12:30:48 -0400
On Apr 4, 2005, at 11:31, Mark Cookson wrote:
I have a report that some applications are getting CoreAudio overload
messages when playing/recording audio and playing/recording MIDI
tracks.
They don't get the overload messages without the MIDI processing, so
directly or indirectly, MIDI is implicated.
I'm wondering what priority the MIDI server's threads run at.
Realtime.
Can they
interfere with CoreAudio's threads?
Yes, though in theory they shouldn't be doing enough work to be
putting large dents in the CPU time available for audio.
What's the suggested way of transferring MIDI data from a PCI
driver? The
current implementation is to use a mach message to send every byte
up to a
user client that hands the byte off to MIDI Services. This seems
like a bit
of overhead, but it does appear to give the best latency, which was
the
primary reason for the implementation choice.
To use a shared memory buffer would require polling, and to use
blocking
threads seems to be even more overhead than mach messages.
If you're sending each byte individually, you should be able to cut
your messaging overhead by a third by parsing MIDI messages on the
sending end and just sending full messages (or 3-byte sysex chunks).
You may find room for further improvement with a shared ring buffer
and tiny "ping" Mach messages to signify transitions from empty to
non-empty.
I've not had a chance to run Shark to profile the applications yet,
but
that's my next stop.
Doug
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden