Commit Graph

6 Commits

Author SHA1 Message Date
Kazeia Team 7fffd3d9df feat(icons): nouvelles icônes adaptatives orbe (patient + admin)
Identité visuelle = l'orbe Kazeia (la « face » de l'app, cf. AudioVisualizerView).
100% vectoriel (net toutes densités, aucun PNG), monochrome (icônes thématisées 13+).

- Patient : orbe lavande lumineux (halo + reflet) sur dégradé violet profond.
  Remplace l'ancien adaptive-icon vide (fond uni, sans logo) mal placé en
  mipmap-hdpi (supprimé) → mipmap-anydpi-v26 + roundIcon.
- Admin : même orbe cerné d'un anneau d'engrenage 8 dents (signal console/contrôle)
  sur dégradé ardoise-violet sombre ; fond passé de couleur plate à dégradé.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-21 08:52:25 +02:00
Kazeia Team 66e81f0668 refactor(tts): bascule CosyVoice = seul TTS + purge legacy (≈322 Mo libs)
Bascule définitive vers CosyVoice (clonage vocal 9 langues, CPU-only) :
- ConfigStore défaut ttsEngine = "cosyvoice" ; KazeiaService dispatch CosyVoice
  uniquement ; chemins TTS-B/streaming Qwen3 retirés (CosyVoice = batch
  speakText qui streame en interne) ; KazeiaPipeline.speakText simplifié.

Purge du superseded (archivé /opt/Kazeia/archive/2026-06-18_cosyvoice-bascule/) :
- Kotlin tts/ : Qwen3TtsEngine, KazeiaTtsEngine, TtsEngine(lib), TtsPipeline,
  Qwen3TtsGgmlDecoder, TtsTalkerCpuJni, TtsCpCpuJni, NeonOps, BenchTtsHarness,
  Qwen3BpeTokenizer. (Gardés : CosyVoiceTtsEngine, SentenceStreamer, core.TtsEngine.)
- v2/ (rewrite abandonné) + entrées manifest ChatActivityV2/KazeiaServiceV2.
- Handlers d'intents dev Qwen3 (run_pipeline/stream_*/full_pipeline/decode_codes).
- jniLibs (-322 Mo) : libexecutorch_jni(185M), libexecutorch, libtts_pipeline(51M),
  libQnnGpu*(3), libkazeia_tts, libfbjni, libllama-common(74M).
- CMake : neon_ops/tts_talker_cpu/tts_cp_cpu/tts_decoder_ggml + ggml/llama IMPORTED
  (gardé : mel_extractor pour STT).
- Gradle : executorch.jar + fbjni + soloader.
- Manifest jniLibs re-figé (27→18 libs).

Survivants prod : LLM GGUF (kazeia_engine+llama+ggml) + LLM .pte (kazeia_pte+QnnHtp)
+ STT (kazeia_stt+ORT+mel_extractor) + TTS (cosyvoice). Build debug+release vert.

Bump 0.2.2 / versionCode 14.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-18 09:07:41 +02:00
Kazeia Team 6f45a75197 chore: snapshot migration moteur lib (préservation avant dégraissage)
Capture l'état courant de kazeia-android (migration vers le moteur lib unifié :
suppression des anciens AudioCaptureManager/VadEngine/SileroVad, WhisperJni/
WhisperLiteRt/WhisperNpu/AndroidStt, KazeiaLlmJni/LlamaCppLlmEngine,
AndroidTts/ChatterboxTts ; édits app/JNI/gradle associés). L'app construit et
tourne sur device dans cet état. Commit de préservation pour ne rien perdre
avant de restreindre le périmètre de suivi du dépôt.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-09 21:19:24 +02:00
Kazeia Team 6a958c1a10 Revert MemoryOptimizer — reclaim wasn't worth the footprint
The kill-background approach worked at startup (−1.6 GB) but respawns
pulled most of that back within 1–3 min, and the periodic sweep only
kept the first sweep's reclaim stable rather than going lower. Net
practical benefit over "just let Android manage it" is small, not
worth a custom optimizer + normal-perm + file maintenance.

Removes:
- MemoryOptimizer.kt
- KazeiaService.onCreate calls to freeRamForModels / startPeriodicOptimizer
- KILL_BACKGROUND_PROCESSES permission from the manifest

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-14 22:46:58 +02:00
Kazeia Team 39babcb158 TTS+audio+memory: ColorOS playback fixes + kill-background reclaim
Three unrelated fixes rolled into one so testing on the tablet stayed
coherent. All were driven by what the user was observing during live
audio tests, not by pre-planned refactors.

1. **Audio playback actually audible.** ColorOS's AudioFlinger
   silently muted our AudioTrack ~600 ms after play() every time
   (dumpsys audio showed `event:muted updated source:clientVolume`
   and playbackHeadPosition stuck at 0), regardless of USAGE_MEDIA /
   USAGE_ASSISTANT / USAGE_VOICE_COMMUNICATION, regardless of audio
   focus grant, regardless of FGS type including mediaPlayback. A
   MediaPlayer path using the SAME usage attributes works because it
   routes through a different AudioFlinger thread that isn't under
   the same background-hardening policy. `USE_MEDIAPLAYER_FALLBACK`
   in Qwen3TtsEngine.kt flips playback to a WAV-per-segment pipeline.
   Two MediaPlayer instances are chained via `setNextMediaPlayer()`
   so segments transition without re-arming the DAC (that re-arm was
   audible as "beg beg" pops between sentences). Synth of seg N+1
   runs in parallel with playback of seg N via a capacity-2 Channel,
   hiding synthesis latency behind playback for all but the first seg.

2. **Mic no longer loops TTS back into STT.** The continuous-
   listening VAD in KazeiaService already had a guard to drop frames
   while `pipelineState is Speaking`, but that state was never set by
   any caller — so the mic kept recording during playback and fed our
   own speaker output back to Whisper, creating the infinite
   "Kazeia talks to Kazeia" loop the user observed. Both the
   stream_llm intent path and the main `processLlmResponse` TTS path
   now wrap the TTS call with `Speaking → Idle/Listening`.

3. **Free 1.6 GB of RAM at service start.** The OnePlus Pad 3 with
   ColorOS keeps ~7 GB of Google + OPLUS background services
   resident at idle. With Qwen3-4B (3.2 GB) + Qwen3-TTS (1 GB) +
   Whisper (0.5 GB) on top, most of our model weights were going to
   ZRAM swap — "the NPU is stuck" reports were actually page faults
   paging 3 GB of LLM weights back in before each inference. New
   `MemoryOptimizer` kills 30-ish non-essential background packages
   (Google optional: YouTube, Wallet, Chromecast, Messaging, AICore,
   Quicksearchbox; OPLUS optional: smartsidebar, cosa, pantanal,
   nhs, midas, …) via `ActivityManager.killBackgroundProcesses`.
   Measured reclaim on first run: **avail RAM 8468 MB → 10112 MB,
   +1644 MB**. Uses KILL_BACKGROUND_PROCESSES (normal perm, no user
   prompt); system-critical packages and the launcher/systemui are
   explicitly excluded from the target list.

Collateral changes:
- Added FOREGROUND_SERVICE_MEDIA_PLAYBACK permission + fgsType flag
  (didn't fix the mute on its own, but it's correct per Android 14
  policy and leaving it without would be a latent compliance risk).
- Kept `USE_STREAMING_DECODE` + CP↔BigVGAN overlap code intact
  behind the MediaPlayer-fallback branch so reverting to the
  AudioTrack streaming path is a single-const flip if ColorOS ever
  lifts the hardening (or we move to a device without it).
- New AudioTrack path has a keep-alive silence watchdog and a
  playback-head drain wait on stop. Both were attempts to fix the
  mute that didn't pan out on their own; leaving them in so the
  streaming path stays usable on non-hardened devices.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-14 22:37:20 +02:00
Kazeia Team 389ffa7c61 Initial commit: Kazeia TTS pipeline on NPU via ExecuTorch
Full Qwen3-TTS-0.6B pipeline running on Snapdragon 8 Elite NPU:
  - Talker (28L) and Code Predictor (5L) as .pte on QNN HTP fp16
  - JNI integration, no root required
  - Validated audio quality: RTF 3.9

  Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-09 08:42:11 +02:00