Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Basic overview how CRC finds partners, connecting to a user, etc.
09-14-2010, 04:03 PM,
#1
Basic overview how CRC finds partners, connecting to a user, etc.
Hi, I purchased CRC (4.1) a while back and I really haven't seen it working as stable as I expected it would. I currently have it running on a Red5 server, after seeing it unstable on a Stratus setup, but that doesn't seem to solve anything.

The problem is, say 10 people are online, when 4 of us are the only ones clicking 'Next' and the other 6 just waits, 2 out of the 4 people looking for partners couldn't find any. Also, 'connect to a user' doesn't seem to work even if that user I want to connect to is online and just waiting. I've read in another thread that a more stable scenario is having more than 20 users online. The problem with that is I couldn't invite people to use my service if they couldn't connect to each other, and then think that it doesn't work.

I have some background in PHP-MySql programming, and I managed to wrap CRC in CodeIgniter Framework. Requests are going in and out smoothly (I compared those with the "unadulterized" version) What I could not grasp is what the queries are expected to output, and how they are supposed to work. So, if it's possible, I would like to see the flowchart/data flow of CRC. That would help me understand and make modifications wherever it's needed. I would gladly give back to the community and to your team whatever improvements I could make.

Many thanks in advance!
Reply
09-15-2010, 01:38 AM,
#2
RE: Basic overview how CRC finds partners, connecting to a user, etc.
The main problem is with the synchronization (Stratus). If it would be done in real time, it would create too many queries to the database and this would cause high load on most servers. First thing, we can do is to move the connection related settings to the configuration file so everyone can fine-tune the connection. The second is an additional, different approach to connection handling. Both will be included in version 4.3. About Red5, here everything should be OK. We also had problems (server going down and some times miss connection) but these are the results of Red5 (0.8). We (and some other hosting companies) did not find anything in the logs.
Reply
09-23-2010, 06:43 PM,
#3
RE: Basic overview how CRC finds partners, connecting to a user, etc.
(09-15-2010, 01:38 AM)JabberCam Wrote:  The main problem is with the synchronization (Stratus). If it would be done in real time, it would create too many queries to the database and this would cause high load on most servers. First thing, we can do is to move the connection related settings to the configuration file so everyone can fine-tune the connection. The second is an additional, different approach to connection handling. Both will be included in version 4.3. About Red5, here everything should be OK. We also had problems (server going down and some times miss connection) but these are the results of Red5 (0.8). We (and some other hosting companies) did not find anything in the logs.

Thanks. I wasn't able to respond promptly since I was away for weeks. Anyway, Is there any tool or just any thing I could do to monitor the performance of CRC on Red5? I want to compare the difference in performance between different setups (Stratus and Red5).

Also, when I looked at the Java source inside the Red5 application, I found SQL statements. I assume they are the same as with the php client. Does that mean that the Red5 server directly queries the database and that the CRC client no longer needs to send requests to the php client? Also, if I do update the SQL statements in the php client, do I also need to update the SQL statements inside the Red5 client?

Reply
09-25-2010, 05:37 AM,
#4
RE: Basic overview how CRC finds partners, connecting to a user, etc.
Hi, the performance is obvious. Red5 is much faster (because you're the only one using it when Stratus is used by tens of thousands), Stratus is way better at the moment. The java application connects to the database, php is not needed (except config).
Reply
09-25-2010, 11:49 AM,
#5
RE: Basic overview how CRC finds partners, connecting to a user, etc.
(09-25-2010, 05:37 AM)JabberCam Wrote:  Hi, the performance is obvious. Red5 is much faster (because you're the only one using it when Stratus is used by tens of thousands), Stratus is way better at the moment. The java application connects to the database, php is not needed (except config).

Alright, that clears things up. Many thanks!
Reply
08-06-2011, 04:31 AM,
#6
RE: Basic overview how CRC finds partners, connecting to a user, etc.
this is weird
i got the rvc5.6
red5 is up and running
centos 5.5
2.8gh server with 2giga memry

when i conecto to someone i cussed randomly

when i succeed all is good but when i fail
he hears the conncetion beep the chat area goes blank he hears me but see the add instead
while i see and hear him

what could be the cause? server? memory? hardisk? madness?!


Attached Files Thumbnail(s)
   
Reply
08-06-2011, 05:12 AM,
#7
RE: Basic overview how CRC finds partners, connecting to a user, etc.
This could be a bug in the software but we could'n figure out the exact cause, yet. Seems like the connection is realized and user A is not sending video signal (or it doesn't go trough) while user B sends both audio and video. Since B does not receive signal he is "not connected" and chat is not available. This is one of the issues, we cannot figure out if it is the software or the server. Did you encounter the same issue with Cirrus?
Reply
08-06-2011, 07:43 AM, (This post was last modified: 08-06-2011, 08:24 AM by volchkov.)
#8
RE: Basic overview how CRC finds partners, connecting to a user, etc.
well it happens half of the time
more interesting things
user A and B is sending and recieving
the reason B sooesnt see a is the "add" if you remove it
you see clearly that both sound and video happy sent and recieved

also note that moving:
(userManager as Red5CCUserManager).connectToPeer(mOtherId);
in function connectToOther();

the upper you put it the more time it connects
however putting this line to delay of more than 1 miliseconds
results in failure to connect at all times while video is running

i suspect that it doesnt open the stream in time of the publishing
any idias on that?
so it seems to miss the sending of text data....
i sugest to let the red5 send data to the onpeerconnect function and go around the instream data sending
Ok here is your solution:

when the server send connection it creates stream
then it uses the stream to send data needed to recognize username sex etc
now sometimes it takes little bit more time to create that stream but since the program
doesnt really care for that it send the data anyway causing the data to float in to the unknown
after that stream created and then there is video and audio streaming on both ends
note that the jabbercam addvert simply stands over the video sometims

also to get max results from the server via video quality
instead of the default
camera.setMode(320, 240, 15);
camera.setQuality(0, something);
do this
camera.setMode(320, 240, 30);
camera.setQuality(0, 95);

will work wonders on the speed and delay
jabbercam developers....please see this to improve your program
for more info just leave a message or contact me directly via mail.

here is the altered function

this is the altered function connectToOther()
jabberCam.as line 1626

private function connectToOther():void
{
if (mOtherId == null || mOtherId.length != 64)
{
ccCallState = CCCallReady;
return;
}

ccCallState = CCCallCalling;
mAutoFindActive = false;

trace("connectToOther() line 624");
// caller subsrcibes to callee's listener stream
if(!serverIsRed5) {
gracefulDisconnect = false;
if(controlStream) {
controlStream.removeEventListener(NetStatusEvent.NET_STATUS, controlHandler);
try {
controlStream.close();
controlStream = null;
} catch(e : Error) {

}
}
controlStream = new NetStream(netConnection, mOtherId);
controlStream.addEventListener(NetStatusEvent.NET_STATUS, controlHandler);
controlStream.play("ChatRouletteClone");

// caller publishes media stream
if(outgoingStream) {
outgoingStream.removeEventListener(NetStatusEvent.NET_STATUS, outgoingStreamHandler);
try {
outgoingStream.close();
} catch(e : Error) {

}
}
outgoingStream = new NetStream(netConnection, NetStream.DIRECT_CONNECTIONS);
outgoingStream.addEventListener(NetStatusEvent.NET_STATUS, outgoingStreamHandler);
outgoingStream.publish("media-requester");

if(incomingStream) {
incomingStream.removeEventListener(NetStatusEvent.NET_STATUS, incomingStreamHandler);
try {
incomingStream.close();
} catch(e : Error) {

}
}
var o:Object = new Object
o.onPeerConnect = function(caller:NetStream):Boolean // called on the requester side
{
// if(ccCallState == CCCallEstablished || ccCallState == CCCallCalling)
// return false;

// caller subscribes to callee's media stream
incomingStream = new NetStream(netConnection, caller.farID);
incomingStream.addEventListener(NetStatusEvent.NET_STATUS, incomingStreamHandler);
incomingStream.play("media-responder");

// set volume for incoming stream
var st:SoundTransform = new SoundTransform(speakerVolumeSlider.value); // TODO: volume settings
incomingStream.soundTransform = st;

incomingStream.receiveAudio(true);
incomingStream.receiveVideo(true);

var i:Object = new Object;
i.onIm = onMessageReceived;
i.sendSex = function(sex:String):void
{
mOtherSex = sex;
}
i.sendAge = function(age:int): void {
// lookupAge.value = age;
}
i.gotBanned = gotBanned;
i.gracefullyDisconnect = function(id : String) : void {
trace('gracefullyDisconnect: '+id);
gracefulDisconnect = true;
};
i.sendUsername = partnerUsernameReceived;
i.gotReported = gotReported;
i.onPeerCameraAllowed = onPeerCameraAllowed;

incomingStream.client = i;

if(!remoteVideo) {
remoteVideo = new Video();
remoteVideo.width = 320;
remoteVideo.height = 240;
vidOther.addChild(remoteVideo);
}

remoteVideo.attachNetStream(incomingStream);

clearTaChat();
setConnectionSuccess();
setCallEstablished();
return true;
}
outgoingStream.client = o;

mConnectionTimeoutTimer = new Timer(1000 * CONNECTION_TIMEOUT_SECONDS, 1);
mConnectionTimeoutTimer.addEventListener(TimerEvent.TIMER, onConnectionTimeoutTimer);
mConnectionTimeoutTimer.start();
} else {
//**************************************************************
// i have moved the connectToPeer up simly to give it more time to do it's job nothing else

(userManager as Red5CCUserManager).connectToPeer(mOtherId);
//**************************************************************

if(outgoingStream) {
outgoingStream.removeEventListener(NetStatusEvent.NET_STATUS, outgoingStreamHandler);
try {
outgoingStream.close();
} catch(e : Error) {

}
}
outgoingStream = new NetStream(netConnection);
outgoingStream.addEventListener(NetStatusEvent.NET_STATUS, outgoingStreamHandler);
outgoingStream.publish(mId);

//**************************************************************
// moved it near the bottom \/\/\/
//**************************************************************
// set volume for incoming stream
var st:SoundTransform = new SoundTransform(speakerVolumeSlider.value); // TODO: volume settings
incomingStream.soundTransform = st;

incomingStream.receiveAudio(true);
incomingStream.receiveVideo(true);

var i:Object = new Object;
i.onIm = onMessageReceived;
i.sendSex = function(sex:String):void
{
mOtherSex = sex;
}
i.sendAge = function(age:int): void {
// lookupAge.value = age;
};
i.sendUsername = partnerUsernameReceived;
i.gotReported = gotReported;
i.onPeerCameraAllowed = onPeerCameraAllowed;

incomingStream.client = i;

if(!remoteVideo) {
remoteVideo = new Video();
remoteVideo.width = 320;
remoteVideo.height = 240;
vidOther.addChild(remoteVideo);
}

remoteVideo.attachNetStream(incomingStream);


//**************************************************************
//note that by movig the publish here i give it more time to establish stream before i use it

incomingStream = new NetStream(netConnection);
incomingStream.addEventListener(NetStatusEvent.NET_STATUS, incomingStreamHandler);
incomingStream.play(mOtherId);

//**************************************************************

clearTaChat();
setConnectionSuccess();
setCallEstablished();
}

startAudio();
startVideo();
}
Reply
08-06-2011, 10:09 AM,
#9
RE: Basic overview how CRC finds partners, connecting to a user, etc.
also if you could help e with red5 error
org.red5.server.net.rtmp.codec.RTMPProtocolDecoder - Unknown object type: 2
when it shows the next time i press next it failes and shows me bunch of weird decoder errors
red5 0.9rc1
centos[/align]
Reply
08-06-2011, 11:30 AM,
#10
RE: Basic overview how CRC finds partners, connecting to a user, etc.
- by "add" you mean the advertisement (ad)? try to remove the ad by simply emptying /media/ads/blankscreen
- moving pieces of code in order to be processed sooner (and later) doesn't seem like a solution at first sight, however, you may have right! Those fractures of milliseconds could end up in a much higher value (close to a second) in case a response is expected.
- about the quality settings and server-response coherence, someone, who is more into the media server connections and Red5 will take a look (did it work for you and with Red5 only or Cirrus as well?)
- the reason we gave up our own Red5 server was the time we spent on keeping it up and running these errors will give you a headache, did you try the Red5 1.0 RC Build?

*please send me a PM with your e-mail address
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)