Skip to content

Avatar fails to start in Firefox on Android — LiveKit PeerConnection cannot establish (mDNS-obfuscated host candidates) #99

Description

@trainexuspd

Summary

The LiveAvatar streaming session reliably fails to establish a media connection in Firefox on Android (tested with Firefox Stable 150.0 on a Pixel 7). The signaling WebSocket connects, the SDK fires SESSION_STREAM_READY, but no media frames arrive and the underlying LiveKit RTCPeerConnection enters an endless reconnect loop across regions.

Chrome on the same device, same network, same account works flawlessly.

Root Cause (verified)

Firefox enables media.peerconnection.ice.obfuscate_host_addresses = true by default (per draft-ietf-mmusic-mdns-ice-candidates). Local ICE host candidates are sent as random <uuid>.local mDNS hostnames instead of LAN IPs, as a privacy-preserving feature.

The LiveKit SFU you use does not appear to resolve these mDNS hostnames. As a result, no host-candidate pair becomes nominated. Because Firefox publishes only mDNS host candidates (no plain IPs), the SFU never sees a usable peer-reflexive or relay path that would replace them — the connection times out and the SDK rotates to the next region, failing identically there.

Reproduction

  1. Open any LiveAvatar-powered session in Firefox Stable on Android (Pixel 7, FF 150).
  2. Trigger session start.
  3. Observe console (via Firefox Remote Debugging over USB):
GET wss://heygen-feapbkvq.livekit.cloud/rtc?... [101 Switching Protocols]
Initial connection failed with ConnectionError: could not establish pc connection. Retrying with another region: https://heygen-feapbkvq.ofrankfurt1b.production.livekit.cloud
GET wss://...ofrankfurt1b... [101 Switching Protocols]
Initial connection failed with ConnectionError: could not establish pc connection. Retrying with another region: https://heygen-feapbkvq.omarseille1b...
GET wss://...omarseille1b... [101 Switching Protocols]
Initial connection failed with ConnectionError: could not establish pc connection. Retrying with another region: https://heygen-feapbkvq.olondon1b...

The pattern repeats indefinitely. Attempted regions in this session: frankfurt1b → marseille1b → london1b, all identical.

Verification of root cause

In Firefox Nightly for Android, set media.peerconnection.ice.obfuscate_host_addresses = false via about:config and reload — the avatar starts immediately and runs stably. This isolates the failure to mDNS handling.

This is not a fix path for end users: Firefox Stable on Android does not expose about:config, so users cannot toggle this themselves.

Why the application can't work around this

SessionConfig in @heygen/liveavatar-web-sdk (v0.0.10) currently exposes only voiceChat and apiUrl. There is no way to pass an RTCConfiguration (e.g. iceTransportPolicy: 'relay' to force TURN), no way to pass LiveKit RoomOptions, and no way to opt out of host candidates — all of which would mitigate the issue from the client side.

Suggested fixes (in order of preference)

  1. Server-side mDNS resolution in the LiveKit SFU. This is the canonical fix for the spec; many SFU vendors (e.g. mediasoup, Janus) have implemented it. Once mDNS candidates are resolved into IPs locally on the SFU side, ICE pairing succeeds normally for Firefox clients.
  2. Server-side TURN-only fallback when only mDNS host candidates are advertised. Detect Firefox-style ICE candidate sets and force the client through TURN as a backup.
  3. SDK-level escape hatch: allow the application to pass iceTransportPolicy: 'relay' (or full RTCConfiguration) into SessionConfig. This wouldn't fix the root cause but would let app developers ship their own mitigation.

Impact

In our user base (German higher education, oral exam practice), Firefox Mobile is a non-trivial slice of users. Currently we have to ship a UA-detected warning telling them to switch browsers — not great UX, and we'd much rather not have that warning at all.

Environment

  • @heygen/liveavatar-web-sdk 0.0.10
  • livekit-client 2.15.7 (bundled via the SDK)
  • Pixel 7, Android 14
  • Firefox Stable 150.0 (Android)
  • Confirmed cross-region: Frankfurt, Marseille, London
  • Confirmed network-independent: tested over WLAN, mobile hotspot, USB tether — same failure pattern

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions