Environment:
Wwise SDK Version: 2019.2.14
Wwise Build Number: 7616
Test Device: Samsung S23 Ultra (android 13), Samsung S24 Ultra (android 15)
Wwise Audio Backend: AAudio
Problem Summary:
When utilizing the AAudio backend with Wwise, audio output from our application is not captured by third-party screen recording applications (e.g., "CameraFi Live," "Droid Rec"). Audio playback within the application itself is unaffected and functions correctly.
The issue exhibits the following characteristics:
Audio is successfully captured when using the system's native screen recorder (e.g., Samsung's stock screen recorder).
Switching the Wwise audio backend to OpenSL ES resolves the problem; audio is then correctly captured by the same third-party recording applications.
Log Evidence (Playback Initialization):
The Android system log indicates playback is initialized as follows:
2025-05-27 11:57:24.839 2771-2771 AudioPlayerStateMonitor system_server D Found a new active media playback. AudioPlaybackConfiguration piid:1807 deviceId:3 type:AAudio u/pid:10550/13921 state:started attr:AudioAttributes: usage=USAGE_GAME content=CONTENT_TYPE_UNKNOWN flags=0x0 tags= bundle=null sessionId:-1
This log confirms the audio stream attributes are usage=USAGE_GAME and flags=0x0.
Troubleshooting Performed:
Manifest Configuration: Ensured the application manifest (AndroidManifest.xml) includes <application android:allowAudioPlaybackCapture="true" ... />. This attribute, available since Android 10 (API level 29), explicitly permits other apps to capture this app's audio output.
Audio Capture Policies (Defaults): Investigated Android's default audio capture policies. For streams with AudioAttributes.USAGE_GAME, the default capture policy is AudioAttributes.ALLOW_CAPTURE_BY_ALL for apps targeting Android 10 (API level 29) and higher.
Hypothesis:
Despite USAGE_GAME typically defaulting to ALLOW_CAPTURE_BY_ALL (when the manifest attribute android:allowAudioPlaybackCapture is true or not set for apps targeting < API 29, or explicitly true for API 29+), the AAudio implementation within this Wwise SDK version might not be fully aligning with the expected behavior for third-party capture on certain devices or Android OEM customizations. It's possible that Wwise needs to more explicitly assert AudioAttributes.Builder.setAllowedCapturePolicy(AudioAttributes.ALLOW_CAPTURE_BY_ALL) when creating the AAudio stream, or there's an interaction with the specific Android version/device that prevents the default from applying correctly to non-system recorders. System-level recorders may have privileged access that bypasses such nuanced restrictions.
Expected Behavior:
Audio output from applications utilizing Wwise with the AAudio backend, and having android:allowAudioPlaybackCapture="true" in their manifest, should be consistently capturable by standard third-party screen recording applications. This should mirror the behavior observed with the OpenSL ES backend and system-level recording tools.
Additional Information:
No errors are reported in logcat from Wwise or the Android audio system related to AAudio stream creation or playback during attempts to record with third-party applications.