Strange sysex problems
Strange sysex problems
- Subject: Strange sysex problems
- From: "Peter Karlsson" <email@hidden>
- Date: Sat, 8 Jan 2005 15:06:33 +0100
Dear list!
My app waits for a Roland MKS-50 sysex tone dump (4256 bytes in 16 sysex
packages). I use this code to recieve the dump:
static void MyReadProc(const MIDIPacketList *pktlist, void *refCon, void
*connRefCon)
{
[myLock lock];
int i, j;
MIDIPacket *packet = (MIDIPacket *)pktlist->packet;
for (j=0 ; j < pktlist->numPackets; ++j)
{
for (i = 0; i < packet->length; ++i)
{
*sysex_ptr = packet->data[i];
sysex_ptr+=1;
sysexcounter+=1;
}
packet = MIDIPacketNext(packet);
}
[myLock unlockWithCondition:(sysexcounter < dumpSize ? STILL_TRANSFERRING :
TRANSFER_DONE)];
}
I wait for the dump to finish in a second thread like this:
[myLock lockWhenCondition:TRANSFER_DONE]; // This waits for the dump to
finish
[myLock unlockWithCondition:TRANSFER_DONE];
I tested this 20 times and sometimes I get the whole dump and the second
thread continues, sometimes I don't get the whole dump and the second
thread does not continue. About 50/50. When the app does not continue it
will if I send some more bytes from my Roland MKS-50 so it seems that some
bytes is lost somewhere.
Now for the funny part. I started Kurt Revis MIDI Monitor and made the same
20 tests. My app now recieves the whole dump every time, 20 times without
any problems at all.
Just to be sure I stopped MIDI Monitor and my app did the wrong thing again.
Can someone please explain this behavior?
Best regards Peter
_______________________________________________
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