Description
I'm using the LiveKit Unity SDK to build a multi-peer voice chat application using the LiveKit SFU. I’ve tested the setup between Unity Editor and Android builds. The issue is that audio from Android clients is not heard by other participants.
What works:
Android devices connect to the room successfully.
Microphone permissions are requested and granted at runtime.
The microphone is selected from Microphone.devices and used to publish the audio track.
The track is successfully published on Android. Server logs confirm this.
The same logic works fine when both participants are running in the Unity Editor.
Android clients can hear other participants clearly.
What does not work:
When a participant joins from an Android device, their audio is not heard by any other participant (Android or Editor).
TrackSubscribed is triggered on other clients, and an AudioSource is created, but no sound is produced.
The AudioSource.clip appears to be empty or silent, even though the track is subscribed.
Audio is not heard from the Android user, but logs confirm that audio packets are received and RTP stats are logged on the server.
Debug information:
LiveKit server logs show the audio/red track is published correctly from Android.
AudioStream is created using RemoteAudioTrack, but playback is silent.
Only one microphone device appears on Android: Android audio input.
MicrophoneSource.Start() is called after publishing the track.
Setup:
LiveKit Unity SDK (1.2.4)
LiveKit Server v1.6.3 (self-hosted)
Unity 6000
Tested on Android 15,13
Microphone permission is granted and confirmed at runtime
Reproduction steps:
Run Unity Editor and Android builds simultaneously
Connect both to the same room using valid tokens
Publish microphone audio tracks from both clients
Observe that:
Editor can hear Editor
Android can hear Editor
Editor cannot hear Android
(also Android cannot hear Android)
Hypothesis:
The microphone input on Android is not properly captured or encoded by MicrophoneSource
Audio packets are sent but may contain silence or invalid frames
This issue could be platform-specific to Android's audio pipeline or Unity's microphone handling on Android
Please advise on how to further troubleshoot or resolve this. I can provide Unity project and full logs if needed.
Thank you.