9ea5eb31c1
Keep the avatar mounted while all connection, permission, privacy and diagnostic controls live in a settings sheet. Save the tested continuous-body renderer, safe transition driver and foreground HELLO/permission workflow from this session. Pin runtime03 for the code14 UI-only candidate; mouth deformation remains unresolved. Add source UI contracts, an optional sensor-free device probe, exact asset import and candidate packaging checks. Portrait binaries and diagnostics remain private and untracked.
68 lines
14 KiB
Markdown
68 lines
14 KiB
Markdown
# Android 0.6.0 / code11 — neutral avatar candidate MVP
|
||
|
||
This describes the retained released APK only. The later user requirement replaces dial/hangup with automatic foreground connection and sequential MIC/CAMERA requests, and replaces seated media with a standing full-body identity under review. That uncommitted development is documented in [AVATAR_UX_NEXT.md](AVATAR_UX_NEXT.md) and [AVATAR_SAFE_TRANSITIONS.md](AVATAR_SAFE_TRANSITIONS.md). It has not changed or replaced this0.6.0 artifact; the default-off camera-request policy below is historical release behavior.
|
||
|
||
This release replaces the debug home with a video-call style single page. Before dialing it displays the a01 waiting portrait, title “声伴” and Dial; no listen/start or microphone capture occurs until the user explicitly dials and grants microphone permission. WS/health preparation alone is not a call. Connecting has a cancel action, duplicate dialing is fenced, denial shows guidance. These labels describe an app conversation, not a real person's ringing/answering. The existing hello has no character display field consumed by this client, so no private persona name is embedded.
|
||
|
||
During a call the 480×848 portrait fits the available width/height without stretching. Bottom controls hang up, mute the microphone, or explicitly enable the camera. Status is short; actual requested role expression, previous reply, selected neutral asset/fallback, camera presence/cue, interruption and diagnostic upload live in the expandable details. Insets are respected; details have bounded scrolling and portrait shrinks for small/landscape screens. Physical small-screen/tablet rendering remains pending.
|
||
|
||
Mute stops AudioCapture and invalidates already queued capture callbacks while keeping listen/session and sequence allocation. Unmute restarts capture only in LISTENING; subsequent LISTEN/drained resumes respect mute. Mute does not stop the character's answer. Because no silence is sent while muted, a server speech endpoint already underway may remain waiting until unmute; this is not a new server mute protocol. Hangup cancels dial intent, stops capture, aborts/flushes local playback, closes WS, closes camera, cancels pending camera intent and clears face/share context. A new WS generation and existing turn/seq fences reject late old events. It preserves history/diagnostics. Camera/share default off. Normal background closes the call/audio/camera and releases video players. A one-shot system permission continuation may resume an explicitly requested call; it does not restart a background camera. Existing orientation configChanges and camera thresholds/10Hz/TTL/model are unchanged.
|
||
|
||
## PCM activity and video
|
||
|
||
`PlaybackActivity.kt` analyzes 48k mono PCM16 into 20ms windows (960 samples), carrying RMS/peak across network chunks. Default activity requires RMS≥180 and peak≥600 on the signed16 scale. It has a configurable80–150ms release, default120ms. These are approximate speech activity thresholds, not phoneme recognition. Metadata is consumed only when AudioTrack.playbackHeadPosition actually advances through accepted samples, capped to written samples. Partial writes, final partial windows, unsigned32 wrap and pause/flush resets are handled. Consumed windows are pruned, pending metadata is capped at1600; the pre-existing PCM queue stays capped at30s. Empty software queue still polls hardware every10ms so native buffered sound, sustained silence, underrun and resumed sound update the renderer. Native draining polls retain existing5ms behavior. TTS stop does not force idle while voiced PCM remains buffered; explicit drained, abort/error/disconnect/background/old turn reset does. No extra fixed200ms startup buffer/wait was added; native short-utterance silence tail remains.
|
||
|
||
Activity reaches the main coordinator through current turn/generation/block/drained guards. TTS start, network arrival, successful write and phase ANSWERING never directly select talk. requestedEmotion remains the original seven-state reply value. resolvedAssetEmotion is neutral0 for all seven inputs in this pack, displayed visibly as fallback for nonneutral requests. The previous label never resurrects a previous talk loop. The user camera cue cannot select avatar expression.
|
||
|
||
Platform MediaPlayer avoids new dependencies or compileSDK upgrades. Each call preloads two volume0 loops into separate TextureViews; both first-render callbacks are required before revealing video. They run continuously with one visible layer; switches change visibility without seeking, waiting for clip end, creating a player per syllable or delaying audio. There is no crossfade. Texture scaling preserves aspect ratio. Call/lifecycle release increments a renderer epoch; old prepared/info/error callbacks cannot reveal retired video. Any prepare/decoder failure releases both players and shows static neutral for that run, without affecting audio. No pack shows a generic waiting placeholder plus a details explanation while voice remains usable. Supplement failure falls back to base neutralPNG. Unsupported simultaneous decoders, dropped frames, black flashes and resource/thermal behavior require real-device testing. Both loops running continuously trades additional decoder usage for prompt visibility switches; not claimed universally supported.
|
||
|
||
First-frame times for both clips and bounded mode/requested/selected/decoder enums are recorded locally, at most once per second per summary source; no PCM, image, speech, video, raw decoder errors or camera coefficients are recorded. They are included only through the existing explicit diagnostic report path. Existing0.5.2 camera/transmission numeric summaries and failure enums remain. Face presence is now independently UNKNOWN/PRESENT/ABSENT from actual successful face results; only stable FACE_LOST displays “无脸”. No result is never fabricated as a face, and no stable cue reads “未见明显线索”. This is a display improvement, not evidence the algorithm has recovered. Face acceptance remains a separate user task.
|
||
|
||
## Offline pack and rights
|
||
|
||
Original authorized candidate directory: `.runtime/avatar-imports/a01-v1/` (directory0700/files0600). It is never overwritten or transcoded. Import with:
|
||
|
||
```bash
|
||
python3 scripts/import-avatar-pack.py /path/to/authorized/a01-v1
|
||
./scripts/check-avatar-regressions.sh
|
||
./scripts/build.sh
|
||
```
|
||
|
||
The importer validates pinned manifests, local relative paths, individual SHA256 and bounded file sizes before copying into ignored `app/src/main/assets/avatar/a01-v1/` with0700/0600. APK includes two MP4s, fallbackPNG, waitingPNG and both manifests. MP4 is uncompressed for asset file descriptors. Runtime checks hashes again. Missing pack may build but renders the generic placeholder; release packaging refuses missing or mismatched candidates. Binary portraits/videos, `.runtime`, APKs and real test evidence remain ignored. Git stores only code, documentation and exact text manifests in `docs/avatar/`. Cloning source alone does not provide the private portrait pack; obtain the authorized pack out of band and import before reproducing this APK.
|
||
|
||
| File | SHA256 |
|
||
|---|---|
|
||
| manifest.json | ca817f1e538a5933beac4f3f4cda6367bf87a2d428b3307622c98842ae8679d1 |
|
||
| call-avatar-manifest.json | 3b6918cdc955f6d51e8910cf7a0067f4dedb19d28accbb5525f15876e6ad4d8c |
|
||
| videos/neutral-idle-loop.mp4 | 5d6aa20392b2f6c33cc0af366bac0ac81d0a0dce60a9ed95703c8c6067046a00 |
|
||
| videos/neutral-talk-loop.mp4 | 8e410bb769b4fe5290b8e2de0df0236d4bc65d4212c9ea53f71be0ab40231208 |
|
||
| frames/neutral.png | af3cf393601548483ab60696d35e832679231845d498627ec4ffcdc2ec8d94b9 |
|
||
| frames/waiting-avatar.png | 778a1047ccd5cea2ddcda81b3856e6fcd0e17f1dec42fba57dada2e4c95d71e3 |
|
||
|
||
The waiting portrait is a768×768 crop/resize of the941×1672 original; no paid generation or new AI generation. Pack identitya01, all rightsStatus=unverified, review/device=pending. A user-provided source is not a verified portrait/copyright/commercial license. No old expressionPNG is mixed in; other emotions and one-shots are future extensions, not implemented in this neutral-only selector. Manifests are preserved byte-for-byte, including original untested metadata; new verification evidence is separate, not a false promotion to qualified assets.
|
||
|
||
## Verification and limitations
|
||
|
||
Original MP4s were decoded end-to-end using local FFmpeg7.0.2 with `-xerror -map 0:v:0 -f null -`; idle145 frames/6041.667ms, talk193 frames/8041.667ms. ffprobe8.0.1 and trace_headers verified H264avc1 HighL4.1,480×848/24fps, yuv420p/8-bit, SPS chroma_format_idc1 and both bit_depth_minus8=0, BT709 limited. Both containers have an MJPEG attached cover plus main H264, and no playable audio stream; possible orphan mdat audio payload is not erased. One sync sample per clip is retained. Initial/last-frame contact sheets and first14 talk mouth crops were inspected: mouth opening is visible by frame5≈208ms and visibly open by frame6≈250ms, a qualitative observation without a measured detection threshold. Thus this source cannot justify a200ms visual mouth response claim even before decoding/scheduling. Paused hidden loops resume visibility at their continuously running phase, not necessarily closed-mouth anchors. Initial/last stills look similar; temporal seam motion was not accepted by this still inspection. Safe closed-mouth cuts remain unknown and no seek points are invented.
|
||
|
||
Nine JVM entry points pass: existing session/playback/capture/protocol and four expression suites, plus avatar. New production-code tests cover RMS/peak/cross-chunk/partial writes/tail/no head activity/silence/underrun/resume/u32 wrap/reset/bounds; software queue empty with real playback worker doubles; downlink-stop vs drained; generation/turn/abort/hangup/late frames; dial/denial/cancel/permission/background; mute queued-frame discard/seq continuity; actual AvatarVideoView preparation/first-frame visibility/two muted loops/switch reuse/stale callbacks/static failure/missing pack/lifecycle. Synthetic audio is a public fixed tone/zero fixture; no user recordings/text were used. These are deterministic Android/media doubles, not measurements of speaker audibility or hardware decoding.
|
||
|
||
All74 gateway regression tests passed in an isolated temporary source tree using the existing server interpreter and checksum-verified read-only Silero artifact, including model state check. No backend source/provider/prompt/voice/VAD/ASR/environment changes, deployments, restarts or extra live inference were performed. The first attempt with local generic Python lacked dependencies; the complete existing server environment resolved that test-environment failure.
|
||
|
||
`scripts/package-avatar-release.sh` checks tested-source hashes, manifest/asset hashes, builds0.6.0/code11/arm64/min26/target34, verifies badging and apksigner certificate equality with retained0.5.1/0.5.2, exact APK asset bytes/uncompressedMP4, and HTTP APK plus checksum bytes. It refuses overwriting0.6.0 and preserves old APKs. Numeric release/test/decode evidence stays under ignored `logs/avatar-060/`.
|
||
|
||
Target alps p30_6771/API31 hardware decode, dual-decoder capability, real switching/loop-seam/first mouth motion, UI layouts/rotation, temperature/power, phone audibility and end-to-end timing are still pending. No claimed exact lip sync or≤200ms guarantee. No automatic recording/camera permission, ADB USB/wireless/USBIP/SSH setup, data clearing or app launching occurs. For an already authorized Windows USB device, the coordinator can run `scripts/install-avatar-windows.ps1 -Adb <existing-adb> -Serial <device> -Sha256 <release-sha>`; it verifies bytes, installs with`-r`, checks version, and leaves the app for manual launch. This script being available does not mean installation was executed.
|
||
|
||
## Manual acceptance
|
||
|
||
1. Install the candidate, open manually: waiting portrait + 声伴 + 拨通; verify no microphone/camera indicator before dialing. Cancel a connection and deny microphone once; return to waiting with clear guidance. Dial twice quickly and verify one connection/start.
|
||
2. Dial with permission: inspect portrait aspect ratio and actual idle motion in waiting/listening/thinking. During TTS, verify talk only follows sound consumption; let sustained pause/underrun close to idle and resumption return to talk. No camera is enabled automatically.
|
||
3. Mute during listening: indicator clears, no new uplink frames; unmute resumes. Mute while answering: reply continues. Downlink completion with buffered speech should remain animated until consumed. Drained returns idle/listening. Interrupt/hangup promptly stop speech and retired video state; hangup returns waiting portrait and closes camera/share. Redial cannot resurrect the old answer.
|
||
4. Expand details on public happy/sad/angry reply cases: actual requested label/intensity stays unchanged, selected asset says neutral fallback; previous reply remains a separate label. No claim that nonneutral visual clips exist.
|
||
5. Explicitly enable camera during a call only for the separate later face acceptance: off/start/presence unknown or present/no face/failure distinct from “未见明显线索” and role expression. Share remains opt-in. Hangup/background clears camera/share. Verify both permission callback orders; a canceled intent must not reopen camera.
|
||
6. Background/foreground, rotate, and exercise small portrait/landscape/tablet layouts. Verify no silent auto-call on return, no clipping of hangup, no black/ghost faces or retired callback switching. Explicitly send diagnostics for decoder first-frame enums/times; failure/static path must preserve voice.
|
||
|
||
## Candidate release artifact
|
||
|
||
APK: `artifacts/lan-voice-v060-arm64-debug.apk` (36105893bytes),0.6.0/code11. URL: http://192.168.31.124:8080/lan-voice-v060-arm64-debug.apk . SHA256 `37f789820e86ac1656bda546f47ece3e4533ff8fc54614b171fd8a42accaa52e`. Matching `.apk.sha256` HTTP bytes and signatures verified; retained0.5.1/0.5.2 unchanged. Installation/device acceptance pending.
|