Issue Description:
Audio stops transmitting when the Android host app moves to the background. When the sending user minimizes the app, the receiving user can no longer hear the host’s voice or any audio mixing. The issue does not occur during foreground operation.
Platform/SDK:
Android 4.4.1.9, device model vivo V2511
Error Message:
Error code 1033 observed in logs during background operation
Solution and Root Cause:
This issue occurs because the app’s foreground service does not start or maintain correctly after the user sends the app to the background. When Android prevents the foreground service from running, the SDK loses its active audio capture session — shown by the log parameter nearin=0 — and audio transmission stops.
In most cases, the root cause is the lack of required notification permission for starting a foreground service. Without this permission, Android blocks or delays the service launch, especially when the app moves to the background.
To fix this issue:
1. Verify that your app explicitly requests and obtains notification permission (POST_NOTIFICATIONS for Android 13 and above). Without it, foreground services cannot be launched successfully.
2. Ensure that your app correctly calls startForegroundService() and displays an active notification as soon as it enters a live session or goes to the background.
3. Confirm that other running applications (such as WeChat or Instagram) are not capturing or reserving audio resources. Even if they are open in the background, ensure they are not actively using the microphone.
4. Test the fix using your app after granting all necessary permissions. Verify that the receiving end continues to hear the host’s voice and mixed audio even when the app is minimized.
Reference:
Android Official Documentation – Foreground Services