<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: snowlyg</title>
    <description>The latest articles on Forem by snowlyg (@snowlyg).</description>
    <link>https://forem.com/snowlyg</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F643857%2F81265812-6cd6-4bed-9f4b-79f172b0d784.png</url>
      <title>Forem: snowlyg</title>
      <link>https://forem.com/snowlyg</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/snowlyg"/>
    <language>en</language>
    <item>
      <title>Debugging Android 14 WebRTC Disconnects on a coturn Relay Path</title>
      <dc:creator>snowlyg</dc:creator>
      <pubDate>Sat, 23 May 2026 09:14:29 +0000</pubDate>
      <link>https://forem.com/snowlyg/debugging-android-14-webrtc-disconnects-on-a-coturn-relay-path-1lbm</link>
      <guid>https://forem.com/snowlyg/debugging-android-14-webrtc-disconnects-on-a-coturn-relay-path-1lbm</guid>
      <description>&lt;p&gt;I recently wrote up a debugging case around Android WebRTC, coturn, TURN relay, and ICE failures. This is the anonymized version because the useful part is the debugging method, not the original environment.&lt;/p&gt;

&lt;h2&gt;
  
  
  Context
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Android WebRTC audio/video call.&lt;/li&gt;
&lt;li&gt;The service originally worked mostly on an internal network.&lt;/li&gt;
&lt;li&gt;A TURN relay path through &lt;code&gt;coturn&lt;/code&gt; was introduced for more complex network boundaries.&lt;/li&gt;
&lt;li&gt;Older Android devices were mostly stable.&lt;/li&gt;
&lt;li&gt;Android 14 devices often disconnected after 30-60 seconds.&lt;/li&gt;
&lt;li&gt;Forcing the media path through TURN relay made the failure much easier to reproduce.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  The Misleading Clue
&lt;/h2&gt;

&lt;p&gt;The first clue looked obvious: a repeated timeout around a local relay-related address. It appeared near the disconnect window, so it was tempting to treat it as the cause.&lt;/p&gt;

&lt;p&gt;That was not enough.&lt;/p&gt;

&lt;p&gt;In WebRTC debugging, a noisy log line can be real without being the root cause. The better starting point was the ICE state transition:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;IceConnectionChange -&amp;gt; DISCONNECTED / FAILED
StandardizedIceConnectionChange -&amp;gt; DISCONNECTED / FAILED
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That moved the investigation away from "why does this timeout appear?" and toward "why does the selected media path fail?"&lt;/p&gt;

&lt;h2&gt;
  
  
  What Helped Narrow It Down
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Force the path through &lt;code&gt;coturn&lt;/code&gt; so direct LAN candidates did not hide the issue.&lt;/li&gt;
&lt;li&gt;Test a newer WebRTC build to rule out a simple SDK version mismatch.&lt;/li&gt;
&lt;li&gt;Expand the device matrix until the issue narrowed around Android 14 behavior.&lt;/li&gt;
&lt;li&gt;Re-check TURN-side certificate/security settings and required port exposure.&lt;/li&gt;
&lt;li&gt;Re-test the same matrix after adjusting the TURN-side configuration.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;After the TURN-side changes, the 30-60s disconnect stopped reproducing in the same test matrix.&lt;/p&gt;

&lt;h2&gt;
  
  
  Takeaways
&lt;/h2&gt;

&lt;p&gt;For WebRTC production issues, I would rather start from:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;ICE state transitions.&lt;/li&gt;
&lt;li&gt;Selected candidate pair.&lt;/li&gt;
&lt;li&gt;Whether the call is using host, srflx, or relay candidates.&lt;/li&gt;
&lt;li&gt;TURN server logs and port exposure.&lt;/li&gt;
&lt;li&gt;Client-side network and app lifecycle events.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The loudest log line is useful, but it should not be allowed to define the investigation by itself.&lt;/p&gt;

&lt;p&gt;WebRTC reliability is usually a system problem: client version, network path, TURN configuration, device behavior, and application state handling all interact. Treating it as a single log-line problem can waste a lot of time.&lt;/p&gt;

&lt;p&gt;Full write-up:&lt;br&gt;
&lt;a href="https://snowlyg.github.io/posts/android14-coturn-webrtc-disconnect/" rel="noopener noreferrer"&gt;https://snowlyg.github.io/posts/android14-coturn-webrtc-disconnect/&lt;/a&gt;&lt;/p&gt;

</description>
      <category>webrtc</category>
    </item>
  </channel>
</rss>
