Closed PR #3 released in 1.9.64 bug report

pup surface: player window never opens (open reported as succeeded, or fails silently when adom-bridge is not on PATH) in 1.9.57

Drew Owens · ·closed by Colby Knox

Version: adom-tts 1.9.57 (adom-tts --version), checked 2026-11-11. Adom Bridge 2.1.185 on Windows, with three Bridge machines on the relay.

Summary: with surface = pup, the pup player window is never actually opened. In one case adom-tts reports the open as a success. In the other, the open fails but the CLI prints success. Either way the clip sits in "AUDIENCE OFFLINE" and buffers. Related to #2, but this happens with the target already pinned.

Setup (identical on all three workspaces)

adom-tts settings set surface pup
adom-tts settings set pup_session adom-tts-<workspace>   # a separate session per workspace
# ~/.adom/tts/env.json also carries "ADOM_BRIDGE_TARGET": "<the laptop's Bridge name>"

The player log confirms the pin was picked up: env_adopted vars=["ADOM_BRIDGE_TARGET"].

Case A: the open is reported as succeeded, but no window appears

This happened on a cloud container and on a local WSL workspace.

Steps: run adom-tts say "test" --out /tmp/t.mp3 --thread t --desc t --play from a normal shell.

Player log:

drain_start surface="pup"
audience_wait poll_age_ms=9223372036854775807
surface_open_skipped opened_ms_ago=1 reason="a surface open succeeded moments ago; one open per 10s (issue #7)" surface="pup"
surface_reoffer attempt=2 reason="page has not polled for 15s" surface="pup"
...
surface_reoffer attempt=11 reason="page has not polled for 168s" surface="pup"

What happened:

  • pup_list_windows on the Bridge machine shows no window with that sessionId.
  • The re-offers never produce a window.
  • say reports AUDIENCE OFFLINE ... BUFFERED, and the clip waits out the 10-minute buffer.

Case B: the player is spawned from a non-login ssh shell and adom-bridge is not on PATH

This happened on a second cloud container.

Steps:

  1. Over ssh <container> 'adom-tts restart', the shell's PATH lacks ~/.local/bin, where adom-bridge lives.
  2. The restart prints: restarted: ... spawned a fresh pup player. pinned to Bridge target: <name>

Player log:

open_surface_failed error="invoke adom-bridge pup_open_window" surface="pup"

What happened:

  • No warning reaches the caller.
  • The player stays up with no page until something else opens one.
  • Running export PATH=$HOME/.local/bin:$PATH before adom-tts restart avoids this case.

Workaround that works

  1. Open the player page yourself, in the background. Use the player port from ~/.adom/tts/player.json; the URL is the container's proxy URL for that port, or http://127.0.0.1:<port>/ for a WSL workspace.

    adom-bridge --target <laptop> --ai-thread "adom-tts player" pup_open_window \
      '{"sessionId":"adom-tts-<workspace>","url":"<player page>","profile":"adom-tts","background":true}'
    

    The page lands as "Adom TTS" (not a sign-in page) and starts polling within a few seconds.

  2. Unlock autoplay. A fresh pup page then holds the first clip because of Chrome's autoplay policy: pause_hold at_s=0.0.

    • The built-in force-play pup_eval (el.play() without a gesture) does not release it.
    • A DevTools evaluate that carries a user gesture does, and it lasts for the page's lifetime:
    adom-bridge --target <laptop> --ai-thread "adom-tts player" pup_devtools \
      '{"sessionId":"adom-tts-<workspace>","method":"Runtime.evaluate","params":{"expression":"document.querySelector(\"audio\").play()","userGesture":true,"awaitPromise":true}}'
    

After these two steps, clips play normally on all three workspaces: say --play --confirm returns CONFIRMED in a few seconds.

Suggested fixes

  1. Only report a surface as opened when it exists. Count the open as a success only once pup_open_window returns a window, and check pup_list_windows for the session. Otherwise log the CLI's real stdout and stderr in open_surface_failed.
  2. Find adom-bridge without relying on PATH. Resolve it by absolute path (for example ~/.local/bin/adom-bridge) or fall back to that path. When the open fails, make restart and say say so instead of printing success.
  3. Unlock autoplay after a pup open. Send the userGesture: true evaluate right after opening, so the first clip does not stall at pause_hold.

1 Reply

Colby Knox marked this in progress ·
Colby Knox ·

Thanks for the detailed report, Drew. Fixed in adom-tts 1.9.61 (the pup fix landed in 1.9.59).

What was wrong. The pup surface could not open a window for anyone. adom-tts called pup_open_window without a thread name (refused with caller_identity_required) and asked for foreground: true without a reason (refused with foreground_reason_required). Both refusals exit 0, and adom-tts only checked the exit code, so every refused open counted as a success. That is your case A: the next attempt was skipped as "succeeded moments ago" and no window ever appeared.

What changed

  • Every Adom Bridge call (open, the playback unlock, close) carries the thread name adom-tts player and the pinned machine.
  • adom-tts reads pup's JSON answer. An open counts only when pup says it worked and the player page actually loaded in the window.
  • The window opens in the background, behind your own windows, and adom-tts unlocks playback with pup_devtools Runtime.evaluate userGesture: true, as you suggested. Clips play without a click and without taking your screen.
  • adom-tts restart now ends with "the pup window is open" or "the pup window did NOT open: ". It also keeps a pup player on pup (before, it always came back as the default surface).
  • adom-tts finds adom-bridge in ~/.local/bin when a non-login shell (ssh, cron) has no such folder on PATH. That is your case B.

How it was tested. On a Windows test laptop with a Hydrogen workspace and pup on the same PC, a full-screen window in front:

  • 1.9.57 reproduced case A: no window, logged surface_open_skipped, silent re-offers.
  • With the fix, say --play --surface pup --confirm opened the window behind the others and reported CONFIRMED, played fully.
  • From env -i PATH=/usr/bin:/bin, restart opened the window and a clip played fully (case B).
  • restart with a wrong machine name printed did NOT open: ... target_not_found.

Not tested

  • The close at idle. While the player page is open and polling, the player stays alive by design, so the idle close did not run during the test. The same close call, sent by hand with the new thread name, succeeded.
  • A Mac desktop.

Upgrade: adom-wiki pkg install adom/adom-tts, then adom-tts restart. Check with adom-tts --version, which should print 1.9.61.

Colby Knox closed this ·
Drew Owens mentioned this in pull request #3 ·

Log in to reply.