[libnice] State stuck to 'connected' and no nominated pair
lminiero at gmail.com
Tue Dec 23 08:49:41 PST 2014
I'm encountering some issues using libnice within my open source WebRTC
gateway. It mostly works great, but lately I've had some weird issues that
I can't seem to be abe to figure out. First of all, apologies if this may
have been addressed in the past already, but I couldn't find any related
discussion in the archive. I'm using libnice 0.1.4 as it's the one
available on most distributions I tried it on (ubuntu, fedora), so not sure
if this may be a bug fixed in the meanwhilw, but I looked at the changesets
and I couldn't find anything related there either.
As to what I'm getting, when I'm using it with Firefox stable, which does
not bundle media (that is, in WebRTC terms, there are different ICE
components for audio and video, while when bundling instead you have a
single ICE component for all of them, RTCP too if you're rtcp-muxing), I'm
often in a situation where the ICE state gets to 'connected' but it does
not move from there. I never get the 'new-selected-pair' callback, which
means that, although there should be at least a working pair (the
'connected' suggests so), none of them ever gets nominated/selected. I can
confirm, looking at Wireshark, that connectivity checks work in both
directions, and in fact from the browsers perspective the ICE setup has
been completed (candidate pair nominated and selected), but libnice doesn't
seem to think so and so nothing works anymore. The state never gets to
'failed' after that, it just stays 'connected' until I have to assume it's
over and I destroy the agent.
This is not easily replicable, as it never happens when I try it locally or
with servers more or less close to me. I can indeed replicate it on the the
remote server of a user who notified me about the issue, and he can as
well. To make things "weirder", I sometimes get a successful setup for the
first component (audio) but not the others (video, datachannels), and as a
matter of fact when I'm using browser that do support bundle (Chrome,
Firefox Nightly) which only make use of a single component things go fine.
These seem to suggest that it may be a timing issue or some kind of race
condition, but I'm not sure what I may be doing wrong: I do make use of
Trickle ICE, which means I add new remote candidates on the fly while the
library is working, but I remember discussing it on this list in the past
and it indeed works rellay well in general.
What may be the issue, and in particular, what may lead to a case where no
pair is ever nominated no matter what? Shouldn't the first pair that gets
you a 'connected' state be selected right away, to be replaced by a
different pair later on if its priority is higher, or is this not the
behaviour to expect?
Thanks, (and Merry Christmas now that we're at it!)
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the nice