fix: allow selectAudioOutput on Android - #1121
Merged
hiroshihorie merged 2 commits intoJul 20, 2026
Merged
Conversation
flutter_webrtc's Helper.selectAudioOutput already routes audio on Android via device ID strings (speaker, earpiece, bluetooth, wired-headset). The desktop-only gate was silently swallowing the call and leaving room.setAudioOutputDevice() as a no-op on Android.
yash-garg
requested review from
cloudwebrtc,
hiroshihorie and
xianshijing-lk
as code owners
July 2, 2026 15:17
hiroshihorie
approved these changes
Jul 20, 2026
hiroshihorie
left a comment
Member
There was a problem hiding this comment.
Thanks for the fix! Verified the claim against flutter-webrtc 1.5.2, the version this SDK pins. Android's enumerateDevices reports audiooutput deviceIds that are exactly the AudioDeviceKind type names (speaker, earpiece, bluetooth, wired-headset), and the selectAudioOutput handler maps them back through AudioDeviceKind.fromTypeName into AudioSwitchManager, so the round trip works. Unknown ids are a safe no-op. Web keeps using setSinkId in room.dart and iOS routing stays with AudioManager, so warning on those two platforms is correct.
Pushed a small commit adding the .changes entry per repo convention.
rokk4
added a commit
to rokk4/client-sdk-flutter
that referenced
this pull request
Jul 28, 2026
Brings 18 upstream commits, notably 42f6b14 "fix: allow selectAudioOutput on Android" (livekit#1121) — without it Hardware.selectAudioOutput early-returned with "only supported on Desktop", so the in-call output picker was inert on Android. selectAudioOutput now refuses only on Web/iOS. Conflict resolution: - lib/src/options.dart — both sides added a RoomOptions field in the same place. Kept both: our pendingTrackQueueMaxSize and upstream's networkOptions. - lib/src/core/room.dart — kept our prefixed pending_queue.PendingTrackQueue construction (metadataTimeout, not upstream's ttl) and added upstream's RpcClientManager/RpcServerManager init from the RPC v2 work (livekit#1087). Dropped the VP9 patch (cffd8a7 "vp9 experiment"): web/e2ee.frame_cryptor.dart is restored to upstream. That patch made getUnencryptedBytes return 0 for VP9 — encrypt the whole frame, header included — while every other peer (native libwebrtc, the JS SDK) uses the standard key=10 / delta=3 prefix. Since the same function runs on both encrypt and decrypt, the mismatch means a VP9 frame from mobile cannot be decrypted on web and vice versa, and with failureTolerance: -1 it fails silently rather than surfacing an error. It is also redundant: upstream fixed VP9 E2EE properly in b835995 (livekit#953), which narrowed the frame-cryptor skip from isSVCCodec to isAV1Codec, and that fix is already in this branch. Our patch predates it by a month and targeted the same symptom via the wrong mechanism. Verified: flutter analyze clean, all 70 tests in test/core pass, and the three patches the fork exists for are intact (pending_track_queue rejoin hardening, pendingTrackQueueMaxSize, iOS podspec 16.0).
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.
Helper.selectAudioOutputalready routes audio on Android via device ID strings (speaker, earpiece, bluetooth, wired-headset). The desktop-only gate was silently swallowing the call and leavingroom.setAudioOutputDevice()as a no-op on Android.