feat(ctm): natively supervise the CTM-USBIP bridge agent#282
Open
sh00bx wants to merge 1 commit into
Open
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 oldctmagentscheduled 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}— ajthreadsupervisor mirroring the existing display-helper watchdog. Whilectm_enableis true it (re)starts the agent viaProcessHandler(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.en.jsonstrings.cmake/packaging/windows.cmake— optional staging of a prebuilt agent dir intotools/ctmviaSUNSHINE_CTM_AGENT_DIR(no source vendored).docs/ctm_bridge.md— integration/maintenance notes.Windows-only; entirely inert unless
ctm_enableis set. Builds clean (MSYS2 UCRT64, WebRTC off) and linkssunshine.exe.🤖 Generated with Claude Code