From patrick at patricknet.net Wed Nov 7 16:21:53 2018 From: patrick at patricknet.net (Patrick Regnouf) Date: Wed, 07 Nov 2018 16:21:53 +0000 Subject: [libnice] libnice and Google chrome In-Reply-To: References: <1540844398.28805.7.camel@bodhi-dev> <2b8e553ccb51966f1b1acc515410fbf1c9c53fc0.camel@collabora.com> <1540902056.14675.0.camel@bodhi-dev> <1D1683B5-1C25-4906-82E7-48EC731473A4@patricknet.net> <1540917470.17723.0.camel@bodhi-dev> <4cf1d269c4659d26ccbfacb85097ee2dabd2aae0.camel@collabora.com> <43025c90801989077d02562c2d66b115b712529e.camel@collabora.com> <1540919316.17723.3.camel@bodhi-dev> <858cbb5bb44dca3fb9972c0f4527590edf5735c2.camel@collabora.com> <252CCC64-8749-45BD-A92E-02F4705070A5@patricknet.net> Message-ID: <1541607713.13759.7.camel@bodhi-dev> Dear mailing list Moving on from previous problem (STUN connection not completing in Chrome) which I believe was created by the fact that I did not DTLS handshake the browser, I have now created a thread, based on openssl which is responsible for completing the TLS handshake. This thread has its own socket and when I receive the Client Hello in cb_nice_recv() callback, I forward that packet to the TLS thread which responds with a Server Hello. When I attempt to forward that packet to the browser through nice_agent_send() it always return an error (Resource temporarily unavailable - EAGAIN) and does not transmit the packet. What would cause nice_agent_send() to fail like that? Should I use another API to send that DTLS Server Hello to the browser? Thanks /Patrick On Wed, 2018-10-31 at 13:38 +0000, Olivier Crête wrote: > Hi, > > The real question is why Chrome doesn't go from checking to connected. > This should happen as soon as it receives the first conncheck that > succeeds if it is the controlling agent. > > Olivier > > On Wed, 2018-10-31 at 13:29 +0000, Patrick Regnouf wrote: > > My own investigations led to the same piece of code. Unfortunately > > still haven’t got a clue why am not completing. I have been waiting > > even introduced a sleep in the code to give it time to complete. All > > to no avail. However when I close my relay, chrome fires a failure > > event which is normal behaviour. Any more idea where to look? > > > > /Patrick > > > > /Patrick > > > > > On 31 Oct 2018, at 11:40, Olivier Crête < > > > olivier.crete at collabora.com> wrote: > > > > > > Hi, > > > > > > I think I was on the wrong path in any case. > > > > > > The code that produces this is here in Chrome: > > > > > > > https://webrtc.googlesource.com/src/+/master/p2p/base/p2ptransportchannel.cc#376 > > > > > > And I wonder if this is jus tnormal, you just need to wait a little > > > longer to get completed. But you should be getting "connected" at > > > least, which is enbough to start exchanging data. > > > > > > Olivier > > > > > > > > > > > > > > > > On Tue, 2018-10-30 at 17:08 +0000, Patrick Regnouf wrote: > > > > As I said I cannot change a single character in the javascript > > > > (it's > > > > a > > > > janus client script) > > > > > > > > when I tried to change the role of my software I got a role > > > > conflict > > > > ;-) > > > > > > > > /Patrick > > > > > > > > > > > > > On Tue, 2018-10-30 at 16:54 +0000, Olivier Crête wrote: > > > > > Or trying to see if it works if the Chrome side is the > > > > > controller > > > > > and > > > > > libnice is controlled. > > > > > > > > > > > On Tue, 2018-10-30 at 16:53 +0000, Olivier Crête wrote: > > > > > > Hi, > > > > > > > > > > > > I wonder if it doesn't like aggressive nomination.. It's been > > > > > > removed > > > > > > from the latest RFC. Maybe you can try disabling that in > > > > > > libnice. > > > > > > > > > > > > Olivier > > > > > > > > > > > > > On Tue, 2018-10-30 at 16:37 +0000, Patrick Regnouf wrote: > > > > > > > a significant error message in the chrome debug: > > > > > > > > > > > > > > Ice not completed yet for this channel as > > > > > > > Net[any:0.0.0.x/0:Wildcard:id=0] has more than 1 > > > > > > > connection. > > > > > > > > > > > > > > ... > > > > > > > > > > > > > > Does that mean something to you? > > > > > > > > > > > > > > /Patrick > > > > > > > > > > > > > > > > > > > > > > > > > > > > > On Tue, 2018-10-30 at 16:06 +0000, Olivier Crête wrote: > > > > > > > > Hi, > > > > > > > > > > > > > > > > In wireshark, you can save a pcap file containing only > > > > > > > > the > > > > > > > > selected > > > > > > > > packets. For example, you can keep onlyt he packets with > > > > > > > > have > > > > > > > > a > > > > > > > > src&dest on your local machine. > > > > > > > > > > > > > > > > I took those commands from the internets, I actually > > > > > > > > don't > > > > > > > > have > > > > > > > > Chrome > > > > > > > > either. > > > > > > > > > > > > > > > > Olivier > > > > > > > > > > > > > > > > > On Tue, 2018-10-30 at 15:52 +0000, Patrick Regnouf > > > > > > > > > wrote: > > > > > > > > > I will open an issue shortly, in the meantime I should > > > > > > > > > have said > > > > > > > > > it’s all happening in Linux (Debian Jessie derived) > > > > > > > > > with > > > > > > > > > chrome > > > > > > > > > 70 > > > > > > > > > (latest build) > > > > > > > > > > > > > > > > > > So not sure about that command line also the logs will > > > > > > > > > be > > > > > > > > > somewhere > > > > > > > > > in the user directory. > > > > > > > > > > > > > > > > > > I will let you know more as soon as I get chrome to > > > > > > > > > give > > > > > > > > > me > > > > > > > > > something > > > > > > > > > > > > > > > > > > Thanks again for your ongoing help > > > > > > > > > > > > > > > > > > At the moment I can only give you screenshots of > > > > > > > > > wireshark > > > > > > > > > as > > > > > > > > > the > > > > > > > > > captures contain data from all over the network and I > > > > > > > > > can > > > > > > > > > not > > > > > > > > > guarantee that they do not contain confidential info > > > > > > > > > > > > > > > > > > Also the stream am trying to relay is video only, no > > > > > > > > > audio... > > > > > > > > > > > > > > > > > > As I said chrome and my relay software are meant to > > > > > > > > > work on > > > > > > > > > the > > > > > > > > > same > > > > > > > > > machine so the stream and the stun will all happen > > > > > > > > > between > > > > > > > > > localhost > > > > > > > > > and the stun server ) I have tried several of those > > > > > > > > > with > > > > > > > > > thee > > > > > > > > > same > > > > > > > > > result btw) > > > > > > > > > > > > > > > > > > We really need to get to the bottom of this > > > > > > > > > > > > > > > > > > Thanks again > > > > > > > > > > > > > > > > > > /Patrick > > > > > > > > > > > > > > > > > > > On 30 Oct 2018, at 14:31, Olivier Crête < > > > > > > > > > > olivier.crete at collabora.com> wrote: > > > > > > > > > > > > > > > > > > > > Hi, > > > > > > > > > > > > > > > > > > > > I saw, can you just send the message without the > > > > > > > > > > attachments. > > > > > > > > > > Can > > > > > > > > > > you > > > > > > > > > > save the pcap and the log on both sides and create an > > > > > > > > > > issue > > > > > > > > > > on > > > > > > > > > > gitlab.freedesktop.org/libnice/libnice and attach > > > > > > > > > > everything > > > > > > > > > > there. > > > > > > > > > > > > > > > > > > > > There must be a way to get more debug from Chrome. > > > > > > > > > > > > > > > > > > > > You can do something like: > > > > > > > > > > - chrome://webrtc-internals > > > > > > > > > > - chrome.exe --enable-logging --v=4 -- > > > > > > > > > > vmodule=*libjingle/source/talk/*=4 -- > > > > > > > > > > vmodule=*media/audio/*=4 > > > > > > > > > > - chrome_debug.log is here: > > > > > > > > > > > > > > > > > > > > C:\$USERDATA\AppData\Local\Google\Chrome\User Data > > > > > > > > > > > > > > > > > > > > Olivier > > > > > > > > > > > > > > > > > > > > > On Tue, 2018-10-30 at 12:20 +0000, Patrick Regnouf > > > > > > > > > > > wrote: > > > > > > > > > > > I have sent a mail with a couple of screenshots and > > > > > > > > > > > it > > > > > > > > > > > got > > > > > > > > > > > blocked as > > > > > > > > > > > too big for the list. > > > > > > > > > > > > > > > > > > > > > > I think it might be waiting for your approval > > > > > > > > > > > > > > > > > > > > > > Thanks > > > > > > > > > > > > > > > > > > > > > > /Patrick > > > > > > > > > > > > > > > > > > > > > > PS: Are you french? > > > > > > > > > > > > > > > > > > > > > > > On Tue, 2018-10-30 at 10:17 +0000, Olivier Crête > > > > > > > > > > > > wrote: > > > > > > > > > > > > Hi, > > > > > > > > > > > > > > > > > > > > > > > > In your Wireshark logs, do you see Chrome getting > > > > > > > > > > > > binding > > > > > > > > > > > > responses > > > > > > > > > > > > back from the libnice side? > > > > > > > > > > > > > > > > > > > > > > > > Olivier > > > > > > > > > > > > > > > > > > > > > > > > > On Mon, 2018-10-29 at 20:19 +0000, Patrick > > > > > > > > > > > > > Regnouf > > > > > > > > > > > > > wrote: > > > > > > > > > > > > > Hi, New to the mailing list so pologies iof > > > > > > > > > > > > > the > > > > > > > > > > > > > question > > > > > > > > > > > > > has > > > > > > > > > > > > > been > > > > > > > > > > > > > answered before. > > > > > > > > > > > > > > > > > > > > > > > > > > I am writing an RTP relay and am stumbling upon > > > > > > > > > > > > > a > > > > > > > > > > > > > problem. > > > > > > > > > > > > > > > > > > > > > > > > > > Based on the threaded example I have written > > > > > > > > > > > > > the > > > > > > > > > > > > > part > > > > > > > > > > > > > of > > > > > > > > > > > > > the > > > > > > > > > > > > > software > > > > > > > > > > > > > that uses a STUN server to connect to a > > > > > > > > > > > > > javascript > > > > > > > > > > > > > running in > > > > > > > > > > > > > chrome. > > > > > > > > > > > > > > > > > > > > > > > > > > Basically this is what happens on my software > > > > > > > > > > > > > side: > > > > > > > > > > > > > > > > > > > > > > > > > > waiting for state READY or FAILED > > > > > > > > > > > > > signal...SIGNAL: > > > > > > > > > > > > > state > > > > > > > > > > > > > changed > > > > > > > > > > > > > 1 1 > > > > > > > > > > > > > connected[3] > > > > > > > > > > > > > State is now connected > > > > > > > > > > > > > SIGNAL: state changed 1 1 ready[4] > > > > > > > > > > > > > State is now ready > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > so cleary libnice is firing my callback stating > > > > > > > > > > > > > that > > > > > > > > > > > > > the > > > > > > > > > > > > > connection > > > > > > > > > > > > > is > > > > > > > > > > > > > firmly established > > > > > > > > > > > > > > > > > > > > > > > > > > wireshark is showing binding indication packet > > > > > > > > > > > > > > > > > > > > > > > > > > but and that is the stumper > > > > > > > > > > > > > > > > > > > > > > > > > > Here is the log from chrome in webrtc > > > > > > > > > > > > > internals: > > > > > > > > > > > > > > > > > > > > > > > > > > Time Event > > > > > > > > > > > > > 29/10/2018, 19:59:11 setRemoteDescription > > > > > > > > > > > > > 29/10/2018, 19:59:11 signalingstatechange > > > > > > > > > > > > > 29/10/2018, 19:59:11 receiverAdded > > > > > > > > > > > > > 29/10/2018, > > > > > > > > > > > > > 19:59:11 setRemoteDescriptionOnSuccess > > > > > > > > > > > > > 29/10/2018, 19:59:11 createAnswer > > > > > > > > > > > > > 29/10/2018, 19:59:11 createAnswerOnSuccess > > > > > > > > > > > > > 29/10/2018, 19:59:11 setLocalDescription > > > > > > > > > > > > > 29/10/2018, > > > > > > > > > > > > > 19:59:11 iceconnectionstatechange > > > > > > > > > > > > > 29/10/2018, 19:59:11 signalingstatechange > > > > > > > > > > > > > 29/10/2018, > > > > > > > > > > > > > 19:59:11 setLocalDescriptionOnSuccess > > > > > > > > > > > > > 29/10/2018, 19:59:11 icegatheringstatechange > > > > > > > > > > > > > 29/10/2018, 19:59:11 icecandidate (host) > > > > > > > > > > > > > 29/10/2018, 19:59:11 icegatheringstatechange > > > > > > > > > > > > > > > > > > > > > > > > > > the iceconnectionstatechange with the firm > > > > > > > > > > > > > connection > > > > > > > > > > > > > is > > > > > > > > > > > > > never > > > > > > > > > > > > > fired. > > > > > > > > > > > > > which means that chrome never detected the > > > > > > > > > > > > > estblished > > > > > > > > > > > > > connection > > > > > > > > > > > > > after > > > > > > > > > > > > > the last trickle whereas my program does. > > > > > > > > > > > > > > > > > > > > > > > > > > The last iceconnectionstatechange fired in > > > > > > > > > > > > > chrome > > > > > > > > > > > > > is > > > > > > > > > > > > > "checking" > > > > > > > > > > > > > > > > > > > > > > > > > > how do i go about debugging that ??? > > > > > > > > > > > > > > > > > > > > > > > > > > Any help truly appreciated > > > > > > > > > > > > > > > > > > > > > > > > > > Thanks > > > > > > > > > > > > > > > > > > > > > > > > > > /Patrick > > > > > > > > > > > > > patrick at patricknet.net > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > > > > > > > > > > > > > nice mailing list > > > > > > > > > > > > > nice at lists.freedesktop.org > > > > > > > > > > > > > > https://lists.freedesktop.org/mailman/listinfo/nice > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > -- > > > > > > > > > > Olivier Crête > > > > > > > > > > olivier.crete at collabora.com > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > -- > > > Olivier Crête > > > olivier.crete at collabora.com > > > >