mirror of
https://github.com/libretro/RetroArch.git
synced 2026-11-11 03:11:33 -10:00
AAudio is resolved from libaaudio.so at runtime, so the build needs no API 26 headers, the library gains no dependency on it, and the binary still runs on older releases. Below API 26 the frontend takes the driver out of the list at startup, before the configuration or the menu reads it; OpenSL stays the default. The stream is a low-latency callback stream at the device's own rate, fed from a mirrored retro_spsc ring the writer parks on through the eventcount. The device stage is two bursts and the ring holds the rest of the latency setting. The driver provides the lend pair, wait_writable, frames consumed on the device's clock and underruns. Layouts wider than stereo open as a channel mask on API 32 and as a count with Android's canonical positions before it. Outputs can be picked from AudioManager's list. A disconnect frees the writer and asks the frontend to reopen, and a late report from a closed stream is dropped. A wider layout whose output takes fewer PCM channels than asked, but lists AC-3 among its encodings, goes as AC-3 over IEC 61937 (API 34), encoded with rac3 as WASAPI does. Underruns are filled with pause bursts, and a burst is written whole or not at all. Android.mk gains HAVE_RAC3 for it. samples/audio/aaudio runs the driver against a scripted libaaudio behind dylib_load, on Linux and with mingw-w64.