Re: Stuck MIDI notes
Re: Stuck MIDI notes
- Subject: Re: Stuck MIDI notes
- From: Robert Grant <email@hidden>
- Date: Wed, 30 Oct 2002 14:35:20 -0500
It's funny you say that Kurt because I was just debugging a different
problem
and I got this stack trace:
#0 0x90844988 in _NSRaiseError ()
#1 0x90844810 in +[NSException raise:format:] ()
#2 0x907e1c64 in -[NSCFArray objectAtIndex:] ()
#3 0x00009b94 in -[Rack midiReceived:] (self=0x2335950, _cmd=0x1c1bc,
pktlist=0xf007f6b0) at Rack.m:164/Users/rgrant/cocoa/Rax/
#4 0x0000928c in MIDIInputProc (pktlist=0xf007f6b0, refCon=0x2335950,
connRefCon=0x0) at Rack.m:19/Users/rgrant/cocoa/Rax/
#5 0x954023b8 in LocalMIDIReceiverList::HandleMIDIIn(void*, void*,
MIDIPacketList*) ()
#6 0x953d1628 in ClientMIDIInMessagePort::ReceiveMessage(long,
__CFData const*) ()
#7 0x9016f8ac in CFMessagePortSendRequest ()
#8 0x9015c250 in CFStringEncodingByteLengthForCharacters ()
#9 0x90149354 in CFRunLoopRunInMode ()
#10 0x9018157c in CFRunLoopRunSpecific ()
#11 0x953d1578 in MIDIInPortThread::Run() ()
#12 0x953d54ec in XThread::RunHelper(void*) ()
#13 0x90021428 in _pthread_body ()
Which is in a separate thread from my UI code. So I think it is
multi-threaded... ?
Robert.
On Wednesday, October 30, 2002, at 02:15 PM, Kurt Revis wrote:
On Wednesday, October 30, 2002, at 10:01 AM, Robert Grant wrote:
I'm occasionally getting stuck notes with Rax and it's making me
wonder whether
I'm handling the incoming MIDI data properly. I'm basically following
the Echo.cpp
example and walking through the packets submitting them to the Music
Device.
I'm now wondering whether I'm taking too long in the handler and thus
the buffer
I was passed is getting diddled before I'm done and perhaps
overwriting my
note off messages.
I don't think there's any way that buffer could be overwritten while
you are using it. As I understand it: In your app, the code which
receives MIDI data from the MIDIServer runs entirely in the same
thread as your MIDI read proc. While your read proc is running,
there's no way to receive more data from the MIDIServer--it should be
queued up and handled when your read proc returns.
I suppose if you take a long time in your read proc and a lot of data
is coming in, this queue could overflow, but I've never encountered a
problem like that. For all I know CoreMIDI takes steps to stop this
from happening.
Anyway, it's easy to test your hypothesis: as the first thing in your
read proc, make a copy of the packet list, and then do your work using
the copy, not the original.
--
Kurt Revis
email@hidden
_______________________________________________
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.