Max/android platformaudio register callback backfill#1257
Draft
MaxHeimbrock wants to merge 2 commits into
Draft
Conversation
…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>
Contributor
No changeset foundThis PR modifies versioned packages but doesn't include a changeset. The following packages require a version bump:
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 If this change doesn't require a version bump, add the |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Draft from investigation of livekit/client-sdk-unity#352
Parking it here. Ticket: https://linear.app/livekit/issue/CLT-3133/sdk-platform-audio-on-android-currently-needs-to-be-created-before