Android AppRTC Example disconnects calls after random short periods of time, IceConnectionState 2=>5

1,721 views
Skip to first unread message

jsid...@sentons.com

unread,
Apr 4, 2016, 1:24:51 AM4/4/16
to discuss-webrtc
I can't get the AppRTC Android example app to keep a video connection alive between two AppRTC apps consistently. 

I'm using x86 emulators and real x86 hardware. The x86 emulators run SDK 22 and the x86 hardware SDK 22. I keep getting ICE Disconnected after random time. The devices are all on the same LAN. 

I've tried both the release libjingle libs and debug version. 

I would really appreciate any help with this, I've been working on it for weeks.

What steps will reproduce the problem?
1. Build android webrtc example from head source code from March 30th, 2016.
2. Connect two clients running x86 android (arm likely has same issue but untested)
3. Wait a few minutes leaving the video running.

What is the expected result?

The call should stay connected indefinitely. 

What do you see instead?

The call disconnects on its own after a few minutes, sometimes only one minute or less.

What version of the product are you using? On what operating system?

Android Marshmallow x86. Both using Genymotion, the Android Studio Emulator and real x86 native hardware (Intel NUC).

Please provide any additional information below.

The two devices are on the same LAN, so no TURN usage should be occurring. After a minute or two, the video disconnects. It appears there may be some ping timeouts, but ultimately the IceConnectionState goes from 2 => 5. 

I've been debugging this for days and don't understand why it's occurring. I would appreciate any help, hopefully I am just doing something wrong.

Here is the final log output before the disconnection:

I/libjingle(24433): (videoadapter.cc:313): VAdapt Frame: scaled 0 / out 1710 / in 1710 Changes: 0 Input: 640x480 i1000000000 Scale: 1 Output: 640x480 i1000000000 Changed: false
W/ActivityManager( 1950): getTasks: caller 10012 is using old GET_TASKS but privileged; allowing
I/VideoCapturerAndroid(24433): VideoCapturerAndroid: Camera fps: 29.
I/libjingle(24433): (port.cc:926): Jingle:Conn[0xe26fdd00:audio:5+E+C0XA:1:0:local:udp:10.150.150.x:43340->Wu7KE9yG:1:1853759231:prflx:udp:10.150.150.x:57247|CRxW|7961835276047629822|-]: Received STUN ping, id=657652515170354c50694579
I/libjingle(24433): (port.cc:584): Jingle:Port[0xe26f2880:audio:1:0::Net[wlan0:10.150.150.x/23:Wifi]]: Sent STUN ping response, to=10.150.150.x:57247, id=657652515170354c50694579
W/ActivityManager( 1950): getTasks: caller 10012 is using old GET_TASKS but privileged; allowing
W/ActivityManager( 1950): getTasks: caller 10012 is using old GET_TASKS but privileged; allowing
W/ActivityManager( 1950): getTasks: caller 10012 is using old GET_TASKS but privileged; allowing
W/ActivityManager( 1950): getTasks: caller 10012 is using old GET_TASKS but privileged; allowing
I/libjingle(24433): (port.cc:1283): Jingle:Conn[0xe26f2100:audio:5+E+C0XA:1:0:local:udp:10.150.150.x:43340->LBIlT5pI:1:1853824767:prflx:udp:10.150.150.x:60278|CRWI|7962116751024340478|730]: Timing-out STUN ping 6c6f426e357071685578686e after 5000 ms
V/WEBRTC  (24433): APICALL   ; (19:44:37: 43 |    1)        VOICE:    1    99;     24493; SetMinimumPlayoutDelay(channel=0, delayMs=604)
W/ActivityManager( 1950): getTasks: caller 10012 is using old GET_TASKS but privileged; allowing
W/ActivityManager( 1950): getTasks: caller 10012 is using old GET_TASKS but privileged; allowing
W/ActivityManager( 1950): getTasks: caller 10012 is using old GET_TASKS but privileged; allowing
D/wpa_supplicant( 2313): wlan0: Control interface command 'SIGNAL_POLL'
W/ActivityManager( 1950): getTasks: caller 10012 is using old GET_TASKS but privileged; allowing
I/libjingle(24433): (port.cc:1283): Jingle:Conn[0xe26f2100:audio:5+E+C0XA:1:0:local:udp:10.150.150.x:43340->LBIlT5pI:1:1853824767:prflx:udp:10.150.150.x:60278|CRWI|7962116751024340478|730]: Timing-out STUN ping 654a39696b5156724f4a7032 after 5001 ms
I/libjingle(24433): (port.cc:1076): Jingle:Conn[0xe26f2100:audio:5+E+C0XA:1:0:local:udp:10.150.150.x:43340->LBIlT5pI:1:1853824767:prflx:udp:10.150.150.x:60278|CRWI|7962116751024340478|730]: Unwritable after 5 ping failures and 5001 ms without a response, ms since last received ping=240 ms since last received data=14 rtt=1460
I/libjingle(24433): (p2ptransportchannel.cc:1546): Selecting connection for triggered check: Conn[0xe26fdd00:audio:5+E+C0XA:1:0:local:udp:10.150.150.x:43340->Wu7KE9yG:1:1853759231:prflx:udp:10.150.150.x:57247|CRxW|7961835276047629822|-]
I/libjingle(24433): (port.cc:1292): Jingle:Conn[0xe26fdd00:audio:5+E+C0XA:1:0:local:udp:10.150.150.x:43340->Wu7KE9yG:1:1853759231:prflx:udp:10.150.150.x:57247|CRxW|7961835276047629822|-]: Sent STUN ping, id=334e4d312b6c487864683431, use_candidate=0
I/libjingle(24433): (transportcontroller.cc:517): audio TransportChannel 1 writability changed to 0.
I/libjingle(24433): (channel.cc:978): Channel not writable (audio)
I/libjingle(24433): (channel.cc:1503): Changing voice state, recv=1 send=1
I/libjingle(24433): (channel.cc:978): Channel not writable (video)
I/libjingle(24433): (webrtcsession.cc:1466): Changing IceConnectionState 2 => 5
I/libjingle(24433): (channel.cc:1735): Changing video state, send=1
D/PCRTCClient(24433): IceConnectionState: DISCONNECTED
D/CallRTCClient(24433): ICE disconnected

-- Using DEBUG libjingle library ---

I/VideoCapturerAndroid( 1453): VideoCapturerAndroid: Camera fps: 11.
V/WEBRTC  ( 1453): APICALL   ; (15: 6:53:802 |   16)        VOICE:    1    99;      3051; SetMinimumPlayoutDelay(channel=1, delayMs=123)
I/libjingle( 1453): (port.cc:1076): Jingle:Conn[0xde6d7880:audio:M5NHBZyF:1:0:prflx:udp:10.150.150.65:64768->eYV5VLC8:1:2122260223:local:udp:10.150.150.72:60315|C-WI|7962116751024340478|207]: Unwritable after 5 ping failures and 6914 ms without a response, ms since last received ping=8265 ms since last received data=7808 rtt=414
V/WEBRTC  ( 1453): APICALL   ; (15: 6:54:890 |   88)        VOICE:    1    99;      3051; SetMinimumPlayoutDelay(channel=1, delayMs=43)
I/libjingle( 1453): (p2ptransportchannel.cc:1084): Switching best connection: Conn[0xde6d7600:audio:bKJdIMq6:1:0:prflx:udp:10.150.150.65:62874->eYV5VLC8:1:2122260223:local:udp:10.150.150.72:60315|C-WI|7961835276047629822|47]
I/libjingle( 1453): (p2ptransportchannel.cc:1161): Jingle:Channel[audio|1|_W]: Previous best connection: Conn[0xde6d7880:audio:M5NHBZyF:1:0:prflx:udp:10.150.150.65:64768->eYV5VLC8:1:2122260223:local:udp:10.150.150.72:60315|C-wI|7962116751024340478|207]
I/libjingle( 1453): (p2ptransportchannel.cc:1164): Jingle:Channel[audio|1|_W]: New best connection: Conn[0xde6d7600:audio:bKJdIMq6:1:0:prflx:udp:10.150.150.65:62874->eYV5VLC8:1:2122260223:local:udp:10.150.150.72:60315|C-WI|7961835276047629822|47]
I/libjingle( 1453): (call.cc:620): UpdateAggregateNetworkState: aggregate_state=up
I/libjingle( 1453): (call.cc:620): UpdateAggregateNetworkState: aggregate_state=up
I/libjingle( 1453): (port.cc:1292): Jingle:Conn[0xde6d7880:audio:M5NHBZyF:1:0:prflx:udp:10.150.150.65:64768->eYV5VLC8:1:2122260223:local:udp:10.150.150.72:60315|C-wI|7962116751024340478|207]: Sent STUN ping, id=4c5935437a5262436141704c, use_candidate=1
W/libjingle( 1453): (androidnetworkmonitor_jni.cc:316): Get adapter type for an unknown interface: eth0
I/libjingle( 1453): (network.cc:783): Connect failed with 101
I/libjingle( 1453): (vie_receiver.cc:206): Packet received on SSRC: 3273006610 with payload type: 116, timestamp: 708789734, sequence number: 31695, arrival time: 149153, abs send time: 13694665
I/libjingle( 1453): (remote_ntp_time_estimator.cc:66): RTP timestamp: 708789734 in NTP clock: 3668526410007 estimated time in receiver clock: 140701 converted to NTP clock: 3668526406828
I/libjingle( 1453): (port.cc:926): Jingle:Conn[0xde6d7880:audio:M5NHBZyF:1:0:prflx:udp:10.150.150.65:64768->eYV5VLC8:1:2122260223:local:udp:10.150.150.72:60315|CRwI|7962116751024340478|207]: Received STUN ping, id=4a70486a6443657441442b38
I/libjingle( 1453): (port.cc:584): Jingle:Port[0xe1e8de80:audio:1:0::Net[eth0:192.168.56.0/24:Unknown]]: Sent STUN ping response, to=10.150.150.72:60315, id=4a70486a6443657441442b38
I/VideoCapturerAndroid( 1453): VideoCapturerAndroid: Camera fps: 13.
W/libjingle( 1453): (rtp_rtcp_impl.cc:168): virtual void webrtc::ModuleRtpRtcpImpl::Process(): Timeout: No RTCP RR received.
W/libjingle( 1453): (rtp_rtcp_impl.cc:170): virtual void webrtc::ModuleRtpRtcpImpl::Process(): Timeout: No increase in RTCP RR extended highest sequence number.
V/WEBRTC  ( 1453): APICALL   ; (15: 6:55:891 |    1)        VOICE:    1    99;      3051; SetMinimumPlayoutDelay(channel=1, delayMs=43)
I/libjingle( 1453): (p2ptransportchannel.cc:1548): Selecting connection for triggered check: Conn[0xde6d7880:audio:M5NHBZyF:1:0:prflx:udp:10.150.150.65:64768->eYV5VLC8:1:2122260223:local:udp:10.150.150.72:60315|CRwI|7962116751024340478|207]
I/libjingle( 1453): (port.cc:1292): Jingle:Conn[0xde6d7880:audio:M5NHBZyF:1:0:prflx:udp:10.150.150.65:64768->eYV5VLC8:1:2122260223:local:udp:10.150.150.72:60315|CRwI|7962116751024340478|207]: Sent STUN ping, id=7653794e544f3854435a3262, use_candidate=1
W/art     ( 1453): Suspending all threads took: 48.731ms
V/WEBRTC  ( 1453): APICALL   ; (15: 6:56:898 |    7)        VOICE:    1    99;      3051; SetMinimumPlayoutDelay(channel=1, delayMs=43)
W/libjingle( 1453): (androidnetworkmonitor_jni.cc:316): Get adapter type for an unknown interface: eth0
I/libjingle( 1453): (network.cc:783): Connect failed with 101
W/art     ( 1453): Suspending all threads took: 70.985ms
I/libjingle( 1453): (port.cc:1292): Jingle:Conn[0xde6d7880:audio:M5NHBZyF:1:0:prflx:udp:10.150.150.65:64768->eYV5VLC8:1:2122260223:local:udp:10.150.150.72:60315|CRwI|7962116751024340478|207]: Sent STUN ping, id=385a69317668737a4646486d, use_candidate=1
I/VideoCapturerAndroid( 1453): VideoCapturerAndroid: Camera fps: 13.
V/WEBRTC  ( 1453): APICALL   ; (15: 6:57:905 |    7)        VOICE:    1    99;      3051; SetMinimumPlayoutDelay(channel=1, delayMs=43)
D/PCRTCClient( 1453): IceConnectionReceiving changed to false
I/libjingle( 1453): (port.cc:1292): Jingle:Conn[0xde6d7880:audio:M5NHBZyF:1:0:prflx:udp:10.150.150.65:64768->eYV5VLC8:1:2122260223:local:udp:10.150.150.72:60315|C-wI|7962116751024340478|207]: Sent STUN ping, id=772f356a4e74334542746a36, use_candidate=1
I/libjingle( 1453): (port.cc:1292): Jingle:Conn[0xde6d7880:audio:M5NHBZyF:1:0:prflx:udp:10.150.150.65:64768->eYV5VLC8:1:2122260223:local:udp:10.150.150.72:60315|C-wI|7962116751024340478|207]: Sent STUN ping, id=6949786a6d7955395647635a, use_candidate=1
W/libjingle( 1453): (rtp_rtcp_impl.cc:168): virtual void webrtc::ModuleRtpRtcpImpl::Process(): Timeout: No RTCP RR received.
W/libjingle( 1453): (rtp_rtcp_impl.cc:170): virtual void webrtc::ModuleRtpRtcpImpl::Process(): Timeout: No increase in RTCP RR extended highest sequence number.
I/libjingle( 1453): (port.cc:1076): Jingle:Conn[0xde6d7600:audio:bKJdIMq6:1:0:prflx:udp:10.150.150.65:62874->eYV5VLC8:1:2122260223:local:udp:10.150.150.72:60315|C-WI|7961835276047629822|47]: Unwritable after 5 ping failures and 5273 ms without a response, ms since last received ping=3318 ms since last received data=152503 rtt=100
I/libjingle( 1453): (port.cc:1292): Jingle:Conn[0xde6d7880:audio:M5NHBZyF:1:0:prflx:udp:10.150.150.65:64768->eYV5VLC8:1:2122260223:local:udp:10.150.150.72:60315|C-wI|7962116751024340478|207]: Sent STUN ping, id=4c6a5a45385436695756614b, use_candidate=1
I/libjingle( 1453): (videoadapter.cc:313): VAdapt Frame: scaled 92 / out 720 / in 720 Changes: 1 Input: 640x480 i33333333 Scale: 0.75 Output: 480x360 i33333333 Changed: false
I/libjingle( 1453): (p2ptransportchannel.cc:1084): Switching best connection: Conn[0xde6d7880:audio:M5NHBZyF:1:0:prflx:udp:10.150.150.65:64768->eYV5VLC8:1:2122260223:local:udp:10.150.150.72:60315|C-wI|7962116751024340478|207]
I/libjingle( 1453): (p2ptransportchannel.cc:1161): Jingle:Channel[audio|1|_W]: Previous best connection: Conn[0xde6d7600:audio:bKJdIMq6:1:0:prflx:udp:10.150.150.65:62874->eYV5VLC8:1:2122260223:local:udp:10.150.150.72:60315|C-wI|7961835276047629822|47]
I/libjingle( 1453): (p2ptransportchannel.cc:1164): Jingle:Channel[audio|1|_W]: New best connection: Conn[0xde6d7880:audio:M5NHBZyF:1:0:prflx:udp:10.150.150.65:64768->eYV5VLC8:1:2122260223:local:udp:10.150.150.72:60315|C-wI|7962116751024340478|207]
I/libjingle( 1453): (transportcontroller.cc:517): audio TransportChannel 1 writability changed to 0.
I/libjingle( 1453): (webrtcsession.cc:1466): Changing IceConnectionState 3 => 5
D/PCRTCClient( 1453): IceConnectionState: DISCONNECTED
I/libjingle( 1453): (channel.cc:980): Channel not writable (audio)
I/libjingle( 1453): (channel.cc:1505): Changing voice state, recv=1 send=1
I/libjingle( 1453): (channel.cc:980): Channel not writable (video)
I/libjingle( 1453): (channel.cc:1737): Changing video state, send=1
I/libjingle( 1453): (channel.cc:980): Channel not writable (data)
I/libjingle( 1453): (channel.cc:2112): Changing data state, recv=1 send=1
D/CallRTCClient( 1453): ICE disconnected

Taylor Brandstetter

unread,
Apr 4, 2016, 2:03:56 PM4/4/16
to discuss...@googlegroups.com
It looks like the client stops seeing STUN ping responses after a while. Maybe the emulator just can't keep up? It may help if you attach a full log to the bug report you created.

--

---
You received this message because you are subscribed to the Google Groups "discuss-webrtc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to discuss-webrt...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/discuss-webrtc/027faa4c-6409-437c-be12-910efff6fdc2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

jsid...@sentons.com

unread,
Apr 4, 2016, 5:16:06 PM4/4/16
to discuss-webrtc
Taylor,

Thank you for the idea. Tomorrow, I will try testing between two physical x86 i7 CPU devices to rule out any processor speed issues. 

Today I will try testing between two physical ARM-7 CPU devices and see if that also works.

I'll report back either way and if it fails still, I'll be sure to attach the full log file from both devices. 

Jeff

jsid...@sentons.com

unread,
Apr 5, 2016, 5:42:32 PM4/5/16
to discuss-webrtc
Taylor Brandstetter,

My calls are stable now. It was due to a network issue here. Thank you for your help. I really appreciate it!

Now that both boxes can ping each other on their STUN address, the call is stable.

My best,

Jeff

Fatih Odaci

unread,
Apr 28, 2016, 10:05:35 AM4/28/16
to discuss-webrtc
Hi,

I have the same problem as you describe. I'm working with two LG G3 Mobile Phones.


...
04-28 16:50:03.364 31347-2754/tr.com.netas.mgpandroidclient I/org.webrtc.Logging: VideoCapturerAndroid: Camera fps: 30.
04-28 16:50:04.185 31347-2743/tr.com.netas.mgpandroidclient I/libjingle: (port.cc:1257): Jingle:Conn[0xaf7d5100:audio:pNpNiAJZ:1:0:relay:udp:<turn_ip_addr>:64234->z/5quOcT:1:41885439:relay:udp:<turn_ip_addr>:63010|CRWI|179896590767373822|19]: Timing-out STUN ping 6f6770593436764a2b416b62 after 5001 ms
04-28 16:50:04.196 31347-2743/tr.com.netas.mgpandroidclient I/libjingle: (port.cc:1066): Jingle:Conn[0xaf7d5100:audio:pNpNiAJZ:1:0:relay:udp:<turn_ip_addr>:64234->z/5quOcT:1:41885439:relay:udp:<turn_ip_addr>:63010|CRWI|179896590767373822|19]: Unwritable after 5 ping failures and 5012 ms without a response, ms since last received ping=4478 ms since last received data=73 rtt=100
04-28 16:50:04.197 31347-2743/tr.com.netas.mgpandroidclient I/libjingle: (port.cc:1266): Jingle:Conn[0xaf7d5100:audio:pNpNiAJZ:1:0:relay:udp:<turn_ip_addr>:64234->z/5quOcT:1:41885439:relay:udp:<turn_ip_addr>:63010|CRwI|179896590767373822|19]: Sent STUN ping, id=436c677055694a3336755364, use_candidate=1
04-28 16:50:04.197 31347-2743/tr.com.netas.mgpandroidclient I/libjingle: (transportcontroller.cc:483): audio TransportChannel 1 writability changed to 0.
04-28 16:50:04.197 31347-2744/tr.com.netas.mgpandroidclient I/libjingle: (webrtcsession.cc:1522): Changing IceConnectionState 3 => 5
04-28 16:50:04.198 31347-2756/tr.com.netas.mgpandroidclient E/ice disconncet: true
04-28 16:50:04.198 31347-2743/tr.com.netas.mgpandroidclient I/libjingle: (channel.cc:1278): Channel not writable (audio)
04-28 16:50:04.198 31347-2743/tr.com.netas.mgpandroidclient I/libjingle: (channel.cc:1780): Changing voice state, recv=1 send=1
04-28 16:50:04.198 31347-2743/tr.com.netas.mgpandroidclient I/libjingle: (channel.cc:1278): Channel not writable (video)
04-28 16:50:04.198 31347-2743/tr.com.netas.mgpandroidclient I/libjingle: (channel.cc:2031): Changing video state, send=1
04-28 16:50:04.198 31347-2743/tr.com.netas.mgpandroidclient I/libjingle: (channel.cc:1278): Channel not writable (data)
04-28 16:50:04.199 31347-2743/tr.com.netas.mgpandroidclient I/libjingle: (channel.cc:2518): Changing data state, recv=1 send=1

Fatih Odaci

unread,
Apr 29, 2016, 3:06:54 AM4/29/16
to discuss-webrtc
I tried to call without turn server, but I got this problem again.
I'm in trouble with this problem :S 

28 Nisan 2016 Perşembe 17:05:35 UTC+3 tarihinde Fatih Odaci yazdı:

Christoffer Jansson

unread,
Apr 29, 2016, 3:08:53 AM4/29/16
to discuss-webrtc
If you are having network issues without a turn server, it's highly likely your network that's flaky.

--

---
You received this message because you are subscribed to the Google Groups "discuss-webrtc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to discuss-webrt...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.
--
/Chris

Fatih Odaci

unread,
Apr 29, 2016, 4:04:20 AM4/29/16
to discuss-webrtc
Yes Chris, I think so that, maybe I have a bad network.

When I tried to disable ICE Disconnection by failed STUN pinging from webrtc source code, audio/video communication is continuing.

But at this time call never ends :)  ... :(

Is there a way to calling with webrtc on flaky network?

/Fatih

Christoffer Jansson

unread,
May 10, 2016, 5:49:22 AM5/10/16
to discuss-webrtc
Yes WebRTC should work on flaky networks but it all depends on how "bad" the network and how robust signaling and stun/turn server are. Also we not have any iceRestart functionality in the AppRTCDemo app hence if it drops for too long you have to restart the call.

Remember, AppRTCDemo is not a production app, rather a demo app.

--

---
You received this message because you are subscribed to the Google Groups "discuss-webrtc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to discuss-webrt...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.
--
/Chris

lennart_...@msn.com

unread,
May 19, 2016, 2:28:33 AM5/19/16
to discuss-webrtc
Hello,

we have problems with disconnections on a flaky network as well. What's interesting is that we have these problems with our iOS app (uses the Objective-C WebRTC API provided by Google https://webrtc.org/native-code/ios/) and the Temasys WebRTC Plugin for IE but not with Google Chrome. We have about 2-3 disconnections in 10 minutes with our app and the plugin but no disconnections for hours with Google Chrome. The video/audio stops for a second but there is no disconnect in Google Chrome, with the app and plugin the ice connection state changes to "disconnected". Are there any differences in the implementation or some configurations we can set to make this more stable?

Lenne

Daniel

unread,
Jun 13, 2017, 11:32:33 PM6/13/17
to discuss-webrtc

Did anyone find the solution?

I've been working on it for two months.

I used  Samsung Phone.

and I use 
'io.pristine:libjingle:11139@aar' library

I already add stun & turn server.

I'm in trouble with this problem too .

thanks

Akash A

unread,
May 28, 2020, 4:13:24 PM5/28/20
to discuss-webrtc
Hey,

Did you got the solution for it.

Akash A

unread,
May 28, 2020, 4:13:26 PM5/28/20
to discuss-webrtc
Hello,

Did anyone find the solution of the above problem, I am also facing this issue as my android screen streaming from android device to web automatically stops after some time.
Reply all
Reply to author
Forward
0 new messages