Skip to content

PlatformAudio: IsDeviceSelectionSupported capability#302

Open
MaxHeimbrock wants to merge 4 commits into
max/final-platform-audiofrom
max/platform-audio-device-selection
Open

PlatformAudio: IsDeviceSelectionSupported capability#302
MaxHeimbrock wants to merge 4 commits into
max/final-platform-audiofrom
max/platform-audio-device-selection

Conversation

@MaxHeimbrock

@MaxHeimbrock MaxHeimbrock commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Dependency

Based on #293

Summary

Surfaces the platform-audio device-selection capability to Unity clients, and consumes the explicit mobile no-op / desktop-strict behavior from the Rust side.

  • Bumps the client-sdk-rust~ submodule to the device-selection commit.
  • Regenerates Runtime/Scripts/Proto/AudioFrame.cs (adds PlatformAudioInfo.DeviceSelectionSupported).
  • PlatformAudio.IsDeviceSelectionSupportedfalse on iOS/Android (OS owns routing via AVAudioSession / AudioManager), true on desktop. Use it to hide device-picker UI where selection has no effect.
  • Meet sample guards SetRecordingDevice/SetPlayoutDevice behind the flag.
  • New PlayMode test asserts the flag is true on desktop (editor).

Stacking

Binaries

The committed FFI binaries are unchanged; CI rebuilds FFI from the submodule. The new field only carries a runtime value once native binaries are rebuilt from the merged Rust change.

Verification

Local (macOS, rebuilt FFI + livekit-server --dev): EditMode 3/3, PlayMode 10/10 — including the new IsDeviceSelectionSupported_TrueOnDesktop case, which confirms the field round-trips proto → Rust → FFI → C#.

On CI the tests sadly don't work, as no platform audio can be acquired:

Looking into your CI runs for the PR for linux-arm64 I see this:

ERROR livekit_ffi::server::platform_audio] [PLATFORM_AUDIO_FFI] PlatformAudio::new() failed: Failed to initialize platform audio.

or windows-x64 I see logs like this:

D:\a\client-sdk-cpp\client-sdk-cpp\src\tests\unit\test_platform_audio.cpp(168): Skipped
No audio devices with stable ids available to select

MaxHeimbrock and others added 4 commits June 10, 2026 15:52
Consumes the device-selection capability added in rust-sdks#1156.

- Bump client-sdk-rust~ to the device-selection commit (regen proto includes
  PlatformAudioInfo.device_selection_supported).
- Regenerate Runtime/Scripts/Proto/AudioFrame.cs.
- PlatformAudio.IsDeviceSelectionSupported — false on iOS/Android, true on
  desktop; lets clients hide device-picker UI where selection has no effect.
- Meet sample: guard SetRecordingDevice/SetPlayoutDevice behind the flag.
- Add a PlayMode test asserting the flag is true on desktop (editor).

Note: submodule points at the rust-sdks PR branch; re-point to the merged
SHA once that PR lands. Native binaries are produced by CI from the submodule.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Cross-link GetDevices(), the uint-index setters, and the GUID setters to
IsDeviceSelectionSupported so the mobile (iOS/Android) no-op behavior is
discoverable from every device-related member, not just the string overloads.
Doc-comment only.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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