google / oboe

Oboe is a C++ library that makes it easy to build high-performance audio apps on Android.
Apache License 2.0
3.64k stars 553 forks source link

System screen recorder doesn't capture audio in Oboe sample apps #1992

Open meteaurestudios opened 3 months ago

meteaurestudios commented 3 months ago

Android version(s): 14 Android device(s): Pixel 8, Pixel 4a 5G Oboe version: 1.8.1 App name used for testing: hello-oboe

Short description

Audio is not captured from the Android built-in screen recorder, despite having activated the option

Steps to reproduce

Expected behavior

Actual behavior

Device

Reproduced on:

Any additional context

Other Oboe samples apps feature the same issue. It's interesting to note that on Pixel 8, audio is captured in Koala Sampler, which uses Oboe.

philburk commented 2 weeks ago

This is being tracked internally at b/300121986 | P2 | AAudio MMAP not captured in Screen Recording

If AAudio is using Legacy then it can be captured.

meteaurestudios commented 2 weeks ago

Thanks for the update Phil. Any chance we can follow it from a ticket or something ?

philburk commented 4 days ago

There was a partial fix in Android 15. If Screen Recording is started, then an Oboe/AAudio stream is opened, then AAudio will use Legacy mode. So the audio will be recorded.

If the order is reversed, and the Oboe/AAudio stream is opened before the Screen Recording is started, then the stream is already MMAP and will not be recorded. We are working on fixing that for a future release.

meteaurestudios commented 3 days ago

Ok, thanks for the tip on the partial fix. I'll try that when I'll update to Android 15 :)