Skip to content

Wear OS charm: native PatchBay expression for Galaxy Watch6 Classic - #3

Draft
Platano78 wants to merge 27 commits into
mainfrom
feat/wearos-charm-client
Draft

Platano78 wants to merge 27 commits into
mainfrom
feat/wearos-charm-client

Conversation

@Platano78

@Platano78 Platano78 commented Oct 31, 2026 •

Copy link
Copy Markdown
Owner

Draft, do not merge. Native Wear OS thin client under clients/wearos/ for the Galaxy Watch6 Classic. It reuses the existing PatchBay voice, brain, persona, tools and TTS over the published WebSocket contract. No new agent and no server changes.

Summary

clients/wearos/
├── WatchScreen.kt       # round UI: Home / Last Reply / Settings, touch + bezel scroll, in-app IP keypad
├── WatchController.kt   # foreground session; reply ends on quiet + speaker drained + no tool pending
├── WatchAudio.kt        # VOICE_RECOGNITION capture, soft-clipped gain, 60 s bounded playback queue
├── PatchbaySocket.kt    # OkHttp WebSocket to the existing server
├── PatchbayProtocol.kt  # endpoint rules (bare LAN IP -> ws://ip:8765), event parser, CaptureStats
└── README.md, SPEC.md   # verified results, limitations, gate table (SPEC section 8)

Device-tested fixes since the source MVP (each found on the real watch):

- capture VOICE_COMMUNICATION            (near-silence on SM-R960; server VAD never fired)
+ capture VOICE_RECOGNITION + fixed +15.6 dB tanh gain
- reply ends 1.6 s after the last frame arrives   (TTS streams ~2x real time: tail flushed)
+ reply ends when quiet AND the AudioTrack has played out AND no tool call is pending
- playback queue capped at 40 chunks     (filled ~4 s into long replies; session torn down)
+ playback queue capped at 60 s of audio
- "Working" forever when no reply comes
+ back to Ready after 40 s
- Reply/Settings and Back/Save rows below the visible circle
+ every page scrolls (touch + bezel) with round-safe padding
- URL typed on the system keyboard        (impossible on the watch: QWERTY page switches,
+ in-app 0-9 / . / delete keypad            decimal pad allows one dot, phone pad has no dot)

Evidence

Measured on one 47 mm SM-R960 (Android 16) against a live PatchBay on 2026-11-01. Samples are small, so treat the numbers as preliminary. Full table: README "Verified on a Watch6 Classic"; gates: SPEC section 8.

  • Before: the server logged no speech on any watch turn; a 5.0 s reply stopped at 3.8 s; a 9.6 s reply died at 4.1 s (Audio playback queue is full); web-search answers were dropped after the filler.
    After: 30+ turns transcribed, 6/6 short quiet phrases on the final build; 17-20 s replies played to the last frame (frames delivered = frames received); web-search answers played through 3-6 s tool gaps.
  • Latency, second tap to first reply audio: median 1.31 s (0.87-1.62 s, n=6, no tools). Memory at idle: 86 MB PSS.
  • Unit tests 10/10 (protocol, bare-IP entry, mode choice, gain, capture stats); CI green on every pushed head.

Still open: battery over a 20-turn session, TalkBack and font scale, the 43 mm model, desktop + watch at the same time, and an owner hand test of the in-app keypad.

Merge Danger

Door: two-way

Everything lives under clients/wearos/ plus its CI workflow. Reverting the merge removes it cleanly.

Blast Radius: isolated

No server, protocol or existing-client code changes. PatchBay's WebSocket is still unauthenticated and broadcasts TTS to every client, so a watch turn is also spoken by any open desktop cockpit. Never expose port 8765 to the internet.

Note: this branch's history was rewritten on 2026-11-01 to remove real home network addresses from test fixtures (see the PR comment). Rebase any local copy onto the new head.

Platano78 and others added 25 commits October 31, 2026 14:58
Device testing on an SM-R960 (Android 16) found five defects:

- Mic: VOICE_COMMUNICATION delivered near-silence; the server VAD never
  fired. Capture now uses VOICE_RECOGNITION (CDD 5.4.2: no AGC/NS) with a
  fixed +15.6 dB tanh soft-clipped gain, since quiet wrist-distance speech
  fell under the VAD's 384 ms active-speech floor.
- Reply cutoff: the 1.6 s arrival-quiet timer flushed the unplayed tail,
  because TTS streams ~2x faster than real time (a 5.0 s reply stopped at
  3.8 s). A reply now also waits for the AudioTrack to play out.
- Playback queue: the 40-chunk cap filled ~4 s into any reply longer than
  ~8 s and tore the session down. It is now bounded at 60 s of audio.
- Tool turns: a web search left a ~3 s silent gap after the filler and the
  answer was dropped. The empty-text assistant_text carrying `tools` is now
  parsed as ToolCall and holds the turn open until the answer frame.
- A turn the server never answered left the watch on "Working" forever; it
  now returns to Ready after 40 s. Also clears a stale subtitle.

Adds one per-turn capture-level log line (no audio) and logs fail() reasons.
README/SPEC updated with what was verified and what is still open.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014GgDaArX56kjRDb7s7efCi
…entry

Found on a Galaxy Watch6 Classic (226 dp round display):

- Home's Reply/Settings row and Settings' Back/Save row sat below the
  visible circle (home needed ~280 dp of height). Home, Settings and Last
  Reply now share one touch + rotating-bezel scroll column with padding
  scaled to the screen, so every control scrolls into the wide middle.
- Entering the server address on the watch failed with every system
  keyboard: QWERTY needs page switches for "ws://" and ":", the decimal
  pad allows one dot (it rewrote 192.168.0.20 to 1921680.20), and the
  phone pad has no dot key. Settings now opens an in-app 0-9 / . / delete
  keypad and accepts a bare private IPv4 (optionally :port), saved as
  ws://<ip>:8765. "Full URL" keeps the system keyboard for wss:// setups.
- needsFullUrl() decides the opening mode; its first inline version was
  inverted and always opened full-URL mode (regression test added).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014GgDaArX56kjRDb7s7efCi
@Platano78
Platano78 force-pushed the feat/wearos-charm-client branch from c463346 to dd21a4f Compare November 1, 2026 06:36
@Platano78

Copy link
Copy Markdown
Owner Author

Note for anyone writing code, tests, docs or commit messages on this PR

Do not use the owner's real network addresses anywhere in this repository. That includes the home server's IP, the home subnet, Tailscale (100.x) addresses, hostnames, device serials and file paths. This is a public repo with downstream users.

What happened: PatchbayProtocolTest.kt (added in "implement PatchBay wire contract and transport tests") used the owner's real home subnet and the PatchBay server's real address in its endpoint fixtures. The fixtures now use 192.168.77.x, and this branch's history was rewritten so those addresses no longer appear in any PR #3 commit. The handoff/wearos-device-validation-20261101 branch was rewritten the same way.

For examples and fixtures, use addresses that are private but obviously not anyone's real network:

  • 10.0.0.x (the repository's usual choice), or an unusual subnet such as 192.168.77.x
  • *.example / *.example.test for hostnames

If you have a local copy of either branch: the history changed. Don't push your old copy back; fetch and reset onto the new head (feat/wearos-charm-client is now dd21a4f), then re-apply any unpushed work on top.

Note: GitHub can still serve the old commits by SHA for a while after a force-push. This rewrite stops the addresses spreading further; it is not a guarantee they are gone from GitHub.

Platano78 and others added 2 commits November 1, 2026 02:16
… clipping

One logcat line per turn, numbers only (no audio): pre-gain RMS per 200 ms
window, speech peak/median with the last 400 ms excluded (the stop tap can
reach full scale on its own), raw samples at the int16 rail, and the share
of post-gain samples at saturation.

Watch6 Classic, 6 short/quiet phrases ("Thanks.", "Stop.", ...): all
transcribed; quietest speech peak window RMS 25 pre-gain; 0 raw clipped
samples and 0.00% post-gain saturation on every turn. The fixed gain stays.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014GgDaArX56kjRDb7s7efCi
…mited, what is next

README: new setup step for the in-app IP keypad; a "Verified on a Watch6
Classic" table with the measured numbers (latency median 1.31 s n=6, idle
memory, mic levels, long replies, web-search gaps); known limitations now
include the shared-session broadcast, PatchBay's 15 s remote-TTS cap, the
1 s release on exit and why it stays in onStop, home-network-only use and
the CI/local signing-key mismatch; future work listed separately.

SPEC: Settings and round-screen design updated; gate status rewritten as a
table separating pass, partial and not-done with evidence for each; the
outside-home backlog item records what was learned about phone VPNs and
Tailscale on Wear OS.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014GgDaArX56kjRDb7s7efCi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant