On 24.11.2013 23:47, Open Music
Kontrollers INFO wrote:
On 24.11.2013 22:40, Scott Wilson
wrote:
I also started to look into this. There were some commits to deal with nested bundles IIRC, which I think might have been where it broke.
I have contributed this piece of code and just now rechecked that
dumpOSC worked after my commits.
https://github.com/supercollider/supercollider/commit/47707da6ff91393087710e0b00dae3bec3cb6e75
When looking at the history of the file the dumpOSC functions were
at the time of my commit, there were some more changes.
https://github.com/supercollider/supercollider/commits/master/server/scsynth/SC_ComPort.cpp
I've recompiled all commits that introduced changes to
SC_ComPort.cpp after mine and the first one that showed a broken
dumpOSC is this one here:
https://github.com/supercollider/supercollider/commit/8bb47dce5fe3b848110faca3789ce55140d6fd02
The previous commit to that in the real project line has a working
dumpOSC, too, So, I guess it's the latter that broke it.
I've not yet found what exactly broke it, though..., other eyes
might see it...
S.
On 24 Nov 2013, at 20:57, Julian Rohrhuber <julian.rohrhuber@xxxxxxxxxxxxxxxxxx> wrote:
as the broken dumpOSC is a little bit like having lost the last screwdriver, I have had a look if I can fix it with my limited means.
Trying to trace it down, using full text search, is this method that should be called, but apparently isn't:
SC_OscUtils.hpp:
static void dumpOSC(int mode, int size, char* inData)
{
printf("here I am: dumpOSC\n"); // I added this.
if (mode & 1)
{
int indent = 0;
bool contentPrinted;
if (strcmp(inData, "#bundle") == 0)
contentPrinted = dumpOSCbndl(indent, size, inData);
else
contentPrinted = dumpOSCmsg(size, inData);
if (contentPrinted)
scprintf("\n");
}
if (mode & 2) hexdump(size, inData);
}
I also added a debugging statement in SC_MiscCmds.cpp:
SCErr meth_dumpOSC(World *inWorld, int inSize, char *inData, ReplyAddress *inReply);
SCErr meth_dumpOSC(World *inWorld, int inSize, char *inData, ReplyAddress *inReply)
{
sc_msg_iter msg(inSize, inData);
inWorld->mDumpOSC = msg.geti();
printf("meth_dumpOSC: %i\n", inWorld->mDumpOSC);
return kSCErr_None;
}
Here I get a correct response.
It seems that the method is never called (in SC_ComPort.cpp)
SC_DLLEXPORT_C bool World_SendPacketWithContext(World *inWorld, int inSize, char *inData, ReplyFunc inFunc, void *inContext)
{
if (inSize > 0) {
printf("World_SendPacketWithContext\n");
//if (inWorld->mDumpOSC) dumpOSC(inWorld->mDumpOSC, inSize, inData);
dumpOSC(inWorld->mDumpOSC, inSize, inData);
OSC_Packet* packet = (OSC_Packet*)malloc(sizeof(OSC_Packet));
packet->mReplyAddr.mAddress = boost::asio::ip::address();
packet->mReplyAddr.mReplyFunc = inFunc;
packet->mReplyAddr.mReplyData = inContext;
packet->mReplyAddr.mSocket = 0;
if(!UnrollOSCPacket(inWorld, inSize, inData, packet)) {
free(packet);
return false;
}
}
return true;
}
SC_DLLEXPORT_C bool World_SendPacket(World *inWorld, int inSize, char *inData, ReplyFunc inFunc)
{
return World_SendPacketWithContext(inWorld, inSize, inData, inFunc, 0);
}
Any clues?
_______________________________________________
sc-dev mailing list
info (subscription, etc.): http://www.beast.bham.ac.uk/research/sc_mailing_lists.shtml
archive: https://listarc.bham.ac.uk/marchives/sc-dev/
search: https://listarc.bham.ac.uk/lists/sc-dev/search/
_______________________________________________
sc-dev mailing list
info (subscription, etc.): http://www.beast.bham.ac.uk/research/sc_mailing_lists.shtml
archive: https://listarc.bham.ac.uk/marchives/sc-dev/
search: https://listarc.bham.ac.uk/lists/sc-dev/search/
It seems that the function calls for dumpOSC were altogether removed
from the UDP and TCP listener callbacks.
Cannot figure out why, though, either it was by purpose or its a
bug.
In any case, the following patch adds them again and fixes the issue
on git HEAD.
diff --git a/server/scsynth/SC_ComPort.cpp
b/server/scsynth/SC_ComPort.cpp
index fbe91f6..d66fa9b 100644
--- a/server/scsynth/SC_ComPort.cpp
+++ b/server/scsynth/SC_ComPort.cpp
@@ -219,6 +219,8 @@ class SC_UdpInPort
return;
}
+ if (mWorld->mDumpOSC) dumpOSC(mWorld->mDumpOSC,
bytes_transferred, recvBuffer.data());
+
OSC_Packet * packet =
(OSC_Packet*)malloc(sizeof(OSC_Packet));
packet->mReplyAddr.mProtocol = kUDP;
@@ -368,6 +370,8 @@ private:
assert(bytes_transferred == OSCMsgLength);
+ if (mWorld->mDumpOSC) dumpOSC(mWorld->mDumpOSC,
bytes_transferred, data);
+
OSC_Packet * packet =
(OSC_Packet*)malloc(sizeof(OSC_Packet));
packet->mReplyAddr.mProtocol = kTCP;
|