Files
VoelinClient/crates/voelin-android/src/lib.rs
T
Claude f7ada91fcd android: keep EGL extension slots for Skia (the UI did not start on Waydroid)
On Waydroid the app ended right after start: "Could not create Skia Direct
Context from GL interface", after libEGL logged "no more slots for
eglGetProcAddress". Android's libEGL gives every GL function without a
built-in entry point one of 256 extension slots on its first lookup.
Slint's Skia OpenGL surface loads glow's whole function table (desktop GL
included) before Skia assembles its interface; Mesa returns an entry point
for every name, so the slots run out, Skia gets NULL for
glTextureBarrierNV (advertised through GL_NV_texture_barrier) and refuses
the interface.

Look up the 83 extension functions Skia's GLES interface can use (Skia
m153's GrGLAssembleGLESInterfaceAutogen.cpp) once per process before Slint
creates its surface, so they get slots first; glow's desktop-only lookups
are the ones that fail. Vendor drivers return NULL for desktop-only names
and were not affected. docs/android.md explains it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NJvYyRmTjKcb9i8eyYXK5G
2026-09-26 21:21:42 +00:00

35 lines
1.3 KiB
Rust

//! The Android app's native library (`libvoelin_android.so`).
//!
//! The APK (`android/`) starts a `NativeActivity` subclass that loads this
//! library; `android_main` then runs the shared Slint UI (`voelin_ui`) on
//! Slint's Android backend. The pieces around it:
//!
//! - [`host`]: one engine per process, so voice survives the activity being
//! destroyed and recreated; a new window gets the current state replayed
//! - [`foreground`]: when the voice foreground service must run (Android
//! only lets a service with a notification keep the microphone in the
//! background)
//! - `bridge` (Android): JNI calls into the Kotlin side (`Bridge`) and the
//! native methods it calls back (`Native`)
//! - `capture` (Android): screen and system-audio capture through
//! MediaProjection, registered as `voelin_media` capture providers
//! - `secrets` (Android): passwords encrypted with an Android Keystore key
//! - `egl` (Android): keeps EGL extension slots for Skia, without which the
//! UI cannot draw on Mesa-based Android (Waydroid)
//!
//! Only [`host`] and [`foreground`] build on other platforms, for tests.
pub mod foreground;
pub mod host;
#[cfg(target_os = "android")]
mod app;
#[cfg(target_os = "android")]
mod bridge;
#[cfg(target_os = "android")]
mod capture;
#[cfg(target_os = "android")]
mod egl;
#[cfg(target_os = "android")]
mod secrets;