[bug] `AudioPublishOptions.red` is inverted: the default `red: true` sends `disableRed: true`, disabling RED for every audio publish

Chiusa
#1,271 0 commenti 0 reazioni 1 assegnatario Vedi su GitHub

I maintainer di solito rispondono entro 2 giorni

@hiroshihorie ci sta già lavorando.

Dal 30/10/2026.

  • #1272 di @hiroshihorie — integrata

Valutazione

Questa issue non è ancora stata valutata.

Descrizione

Describe the bug

AudioPublishOptions.red (default true, documented as "red (Redundant Audio Data)") is passed into AddTrackRequest.disableRed without negation, so every audio publish with default options disables RED:

// lib/src/participant/local.dart
disableDtx: !publishOptions.dtx,                                           // negated — correct
disableRed: room.e2eeManager != null ? true : publishOptions.red ?? true,  // not negated

The JS SDK negates it (src/room/participant/LocalParticipant.ts):

disableRed: this.isE2EEEnabled || !(opts.red ?? true),

Evidence:

  • Introduced by 6323ff7 (#453, 2024-01-23); the inverted line is that commit's only change to lib/src/participant/local.dart. Before it the field was never set, and the protobuf default (false) left RED enabled — so RED has been off for Flutter publishers since v2.0.0.
  • The line is identical in 2.3.0–2.13.0, the v2.13.2 tag, and current main (checked 2026-10-30).
  • The docs recommend RED enabled and document red: false as the opt-out: "LiveKit recommends enabling this feature because audio glitches are so distracting that the tradeoff is almost always worth it" — https://docs.livekit.io/transport/media/advanced/
  • The E2EE force-disable branch matches the JS SDK; only the non-E2EE branch is inverted.

To Reproduce

Publish a microphone track with default options: the AddTrackRequest carries disableRed: true. Publish with red: false: it carries disableRed: false — inverted.

Expected behavior

red: true (the default) → disableRed: false. Proposed fix:

disableRed: room.e2eeManager != null || !(publishOptions.red ?? true),

Release-note caveat: apps that noticed and set red: false to force RED on will flip behavior when this is fixed.

Platform information

  • Flutter version: 3.47.6
  • Plugin version: 2.13.0
  • Flutter target OS: Web — but the field is set in shared Dart, so all platforms are affected
Lingua principale
Dart
Stelle
421
Fork
260
Merge medio
2g 10h
PR unite (30g)
22

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di livekit/client-sdk-flutter

Tutte le issue di livekit/client-sdk-flutter

Issue simili

Altre issue su Dart

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.