Skip to content

Support encrypted RED/Opus audio simulcast for Firefox subscribers #1005

Description

@Yo-DDV

Description

When an Android publisher sends an E2EE audio track with RED enabled, a Firefox subscriber cannot receive that track because Firefox negotiates plain Opus and the SFU cannot unwrap an encrypted RED source.

LiveKit Server added audio codec simulcast and SubscribedAudioCodecUpdate for this case in livekit/livekit#3920. The current Android SDK (v2.28.0) exposes the protocol message but leaves SignalClient handling as TODO, and audio publication advertises only the selected upstream codec.

This differs from unencrypted media, where the SFU can translate RED/Opus, and from JS/Rust E2EE behavior, which avoids the incompatible RED source by disabling RED entirely. Disabling RED restores Firefox interoperability but removes RED resilience for every subscriber, so it is not an equivalent solution when compatible subscribers should retain RED.

Reproduction

  1. Publish microphone audio from LiveKit Android v2.27.0 or v2.28.0 with AudioTrackPublishOptions(red = true) and E2EE enabled.
  2. Subscribe from current Firefox, which offers plain Opus but not Opus RED.
  3. Observe connected ICE/DTLS but no inbound RTP on Firefox.
  4. LiveKit Server v1.13.5 logs can't determine receiver for codec, with codec audio/opus and reason encrypted source.
  5. Publish with red = false; Firefox immediately receives encrypted Opus audio.

Expected behavior

The Android SDK should support the server's audio simulcast contract for encrypted tracks:

  • advertise encrypted RED and encrypted plain Opus under the same track SID;
  • publish/enable only the codecs requested by SubscribedAudioCodecUpdate when dynacast is enabled;
  • keep RED active for compatible subscribers and Opus active for Firefox subscribers;
  • avoid disabling E2EE or requiring SFU payload transformation.

Relevant code

  • SignalClient.kt: SUBSCRIBED_AUDIO_CODEC_UPDATE is currently a TODO.
  • LocalParticipant.publishAudioTrack: sends disableRed = !options.red and has no audio multi-codec path.
  • Server design: Support simulcasting of audio livekit#3920 explicitly introduces audio simulcast because RED cannot be added or removed by the SFU for E2EE sources.

Versions

  • livekit-android: 2.27.0 and 2.28.0
  • livekit-server: 1.13.5
  • Firefox: current release on macOS; the limitation is codec negotiation rather than CoreAudio playback

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