Skip to content

feat(ctm): natively supervise the CTM-USBIP bridge agent#282

Open
sh00bx wants to merge 1 commit into
Nonary:masterfrom
sh00bx:pr/ctm-bridge-supervisor
Open

feat(ctm): natively supervise the CTM-USBIP bridge agent#282
sh00bx wants to merge 1 commit into
Nonary:masterfrom
sh00bx:pr/ctm-bridge-supervisor

Conversation

@sh00bx

@sh00bx sh00bx commented Jun 22, 2026

Copy link
Copy Markdown

Makes Vibepollo start and keep the upstream CTM-USBIP controller-passthrough agent (ctm-usbip.exe) alive for the whole service lifetime, so it no longer needs a separate Windows autostart (the old ctmagent scheduled task). The controller-passthrough feature becomes a seamless, web-UI-configurable part of Vibepollo.

Design (kept atomic against upstream)

The agent is treated as an opaque prebuilt binary — no CTM source is vendored (upstream has no license). All integration is confined to a small, self-contained surface, so upgrading CTM-USBIP is a drop-in exe replacement and the only coupling is the agent CLI agent <port> [--enet].

Changes

  • src/platform/windows/ctm_bridge.{h,cpp} — a jthread supervisor mirroring the existing display-helper watchdog. While ctm_enable is true it (re)starts the agent via ProcessHandler (idempotent: no-op while alive, relaunch after crash); while false it terminates it. Runs the agent with its own folder as the working dir and, under SYSTEM, into the active user session.
  • src/main.cpp — start near the Playnite integration, stop before CRT teardown.
  • config::ctm (src/config.{cpp,h}) — ctm_enable / ctm_path / ctm_port / ctm_enet. Default path <install>/tools/ctm/ctm-usbip.exe.
  • Web UI — CTM Bridge section on the Inputs tab (switch + path + port + enet), schema kinds, store defaults, en.json strings.
  • cmake/packaging/windows.cmake — optional staging of a prebuilt agent dir into tools/ctm via SUNSHINE_CTM_AGENT_DIR (no source vendored).
  • docs/ctm_bridge.md — integration/maintenance notes.

Windows-only; entirely inert unless ctm_enable is set. Builds clean (MSYS2 UCRT64, WebRTC off) and links sunshine.exe.

🤖 Generated with Claude Code

Vibepollo now starts and keeps the upstream CTM-USBIP agent alive for the whole
service lifetime, so it no longer needs a separate Windows autostart (the old
ctmagent scheduled task). The controller-passthrough feature becomes a seamless,
web-UI-configurable part of Vibepollo.

Design (atomic against upstream): the agent is treated as an opaque prebuilt
binary - no CTM source is vendored (upstream has no license). All integration is
confined to a small, self-contained surface, so upgrading CTM-USBIP is a drop-in
exe replacement and the only coupling is the agent CLI 'agent <port> [--enet]'.

- src/platform/windows/ctm_bridge.{h,cpp}: jthread supervisor mirroring the
  display-helper watchdog. While ctm_enable is true it (re)starts the agent via
  ProcessHandler (idempotent: no-op while alive, relaunch after crash); while
  false it terminates it. Runs the agent with its own folder as the working dir
  and, under SYSTEM, into the active user session.
- src/main.cpp: start near the Playnite integration, stop before CRT teardown.
- config::ctm (src/config.{h,cpp}): ctm_enable / ctm_path / ctm_port / ctm_enet.
  Default path <install>/tools/ctm/ctm-usbip.exe.
- Web UI: CTM Bridge section on the Inputs tab (switch + path + port + enet),
  schema kinds, store defaults, en.json strings.
- cmake/packaging/windows.cmake: optional staging of a prebuilt agent dir into
  tools/ctm via SUNSHINE_CTM_AGENT_DIR (no source vendored).
- docs/ctm_bridge.md: integration/maintenance notes.

Verified: builds clean (MSYS2 UCRT64, WebRTC off) and links sunshine.exe.
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