-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Audio source RtcAudioSource stream does not work on some android devices #77
Comments
The issue you're facing seems to be related to compatibility problems between the Unity SDK for LiveKit and certain Android devices, particularly those running specific API levels or from certain manufacturers. Here are some steps you can take to diagnose and potentially resolve the issue: Diagnosis and Debugging Steps: Enable verbose logging in the Unity SDK and review logs on the affected devices. This might provide more insight into what is failing during the audio streaming process. Since the native Android SDK works on all devices, compare the configurations used in the native SDK with the Unity SDK. Look for differences in how the microphone is initialized or how audio data is handled. Ensure that all necessary permissions are correctly requested and granted on the affected devices. Review and compare the audio configuration settings (e.g., sample rate, audio format) between the native Android SDK and Unity SDK. Mismatches here could lead to compatibility issues. Look for any known issues or limitations with the affected devices, especially regarding audio handling in Unity. Since Bluestacks is not a physical device, its emulation of audio hardware may differ from real devices. Confirm that the same issue reproduces on the actual affected devices. Experiment with different audio input settings in Unity (e.g., different sample rates, buffer sizes) to find a configuration that works across all devices. Implement a custom audio processing pipeline within Unity that might bypass potential issues with the built-in Unity audio handling. Check if there are updates or patches available for the LiveKit Unity SDK that address this issue. Implement a fallback mechanism in the app to detect problematic devices and switch to an alternative method of audio handling, possibly using the native Android SDK for audio streaming on those devices. |
Problem
The app cannot stream audio from the microphone to the LiveKit server on certain Android devices, particularly older devices and some brands. This behavior is not related to microphone hardware, as i tried to set test audio on loop in the AudioSource and it works on most devices but fails on few devices i found listed below.
Affected Devices:
Motorola G20 API 30 (Firebase Test Lab)
moto g API 30 (Firebase Test Lab)
Vivo 1610 API 23 (Firebase Test Lab)
Huawei P20 Pro API 29 (Physical)
Embedded Devices Base Android API 30 (Physical)
This issue does not occur when using the native Android SDK—only with the Unity SDK.
Expected Behavior
Audio should stream properly from the microphone to the LiveKit server across all supported Android devices, regardless of brand or API level.
Actual Behavior
On some devices, audio streaming fails completely despite other devices working fine.
Steps to Reproduce
Findings and Tests Conducted
The issue reproduces on Bluestacks, mimicking behavior on the non working physical devices.
The Android SDK (https://github.com/livekit/client-sdk-android) works on all devices, including Bluestacks.
The Unity Android SDK fails on the affected devices.
Switching to a test audio loop instead of a microphone input does not fix the issue.
The text was updated successfully, but these errors were encountered: