0037: An app nobody can see is frozen, not left running
- Status: Accepted (owner, 2026-11-24). Proposed (owner's ruling, 2026-11-21: "I don't mind freezing pausing downloads, better than having to keep track of which ones freeze")
- Date: 2026-11-21
Context
An app left behind the home keeps running: YouTube played on in the background, downloads went on, and nothing on the screen said so. Stopping it would lose the app's own state and cost a cold start; leaving it running costs memory, CPU, sound and bandwidth nobody asked for.
Decision
An app is seen when it is in front of a screen somebody sees: the TV's own screen always counts, a device screen counts while its device streams it, another device joined it or the TV views it. The runner freezes every app not seen for 10 s, Steam included, with no per-recipe exceptions. That covers every app behind a front, whoever looks, and the front of a device screen whose device disconnected. Coming back within 10 s costs nothing.
Freezing is Docker pause (the cgroup freezer, through dockerapi.py). The app is unfrozen before anything makes it seen or touches it: before it comes to front, before its device's stream opens (so it runs before the first frame), before a device joins its screen or the TV views it, before a join ends and the device sees its own screen again, and before it is stopped (Docker refuses remove and exec on a frozen container). An app being stopped is never frozen meanwhile, so its exit grace (config writes) runs. padd only execs into a screen's front, which is never frozen while somebody sees it. A runner restart reads the frozen state from Docker, and knows a device still streams from the server's 1 s source poll. Each freeze and unfreeze is one log line, and the home's tile badge says "Paused".
Consequences
Downloads and playback pause until wake. Memory, pads and network sessions stay, so waking is not a restart; a connection the app held may need to reconnect. Frozen apps still count against COUCHDOGS_MEM_BUDGET.