Skip to content

Max/android platformaudio register callback backfill#1257

Draft
MaxHeimbrock wants to merge 2 commits into
mainfrom
max/android-platformaudio-register-callback-backfill
Draft

Max/android platformaudio register callback backfill#1257
MaxHeimbrock wants to merge 2 commits into
mainfrom
max/android-platformaudio-register-callback-backfill

Conversation

@MaxHeimbrock

Copy link
Copy Markdown
Contributor

MaxHeimbrock and others added 2 commits July 14, 2026 09:21
…xists

On Android the platform ADM is created lazily in EnsurePlatformAdmCreated(),
so it usually does not exist yet when WebRTC performs its one-time
AdmProxy::RegisterAudioCallback() registration. In that case the audio
transport is only wired to the synthetic ADM; if the app later constructs
PlatformAudio the platform ADM is created and started but never receives the
transport, running indefinitely while writing silence.

This failure mode is otherwise completely silent -- WebRTC, the Android audio
HAL, and dumpsys all report a healthy pipeline -- so add a warning log to make
it diagnosable from logs alone.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
AdmProxy::RegisterAudioCallback() is called once, early, by WebRTC's engine
and only forwards the real AudioTransport to ADMs that already exist. On
Android the platform ADM is created lazily in EnsurePlatformAdmCreated() on the
app's first AcquirePlatformAdm() (deferred for JNI readiness), which normally
happens after registration. The platform ADM was therefore created and started
successfully but with no transport wired up, running indefinitely while writing
silence -- total silence for both mic capture and remote playout, with a fully
healthy-looking pipeline everywhere (WebRTC, Android audio HAL, dumpsys).

Backfill the registration in EnsurePlatformAdmCreated() after Init() succeeds,
using the transport retained in audio_transport_. Also soften the diagnostic
added in the previous commit from a warning to an info log, since with the
backfill in place a null platform_adm_ at registration time is the normal,
handled path (and is always expected for synthetic-only usage).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
Contributor

No changeset found

This PR modifies versioned packages but doesn't include a changeset. The following packages require a version bump:

  • libwebrtc
  • livekit
  • livekit-ffi
  • webrtc-sys

A package must be bumped when its own files change, and whenever a package it depends on is bumped (so downstream consumers get a matching release).

Click here to create a changeset for the missing packages

The link pre-populates a changeset file with patch bumps for the missing packages. You can also add them to your existing changeset. Edit the bump types as needed before committing.

If this change doesn't require a version bump, add the internal label to this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant