startup-tools: save the title's window at a fixed interval during a run, not only at the end #2811

Closed
opened 2026-11-26 11:29:14 +00:00 by tedin7 · 1 comment
tedin7 commented 2026-11-26 11:29:14 +00:00 (Migrated from github.com)
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T11:29:14Z.


Part of #870

Problem. tools/startup/debug_launch.py saves the title's window (client area) once, as window.png, when the run ends (capture_window()). A run that passes several screens, or stops on one, leaves only the last picture. Testers who drive the title with X2W_INPUT_SCRIPT cannot tell which screen an input reached, when the picture changed, or whether a later screen ever appeared.

Proposal.

  • debug_launch.py --capture-every <seconds> (and run.ps1 -CaptureEvery, run.sh --capture-every): save the client area every N seconds as window_<sss>s.png next to the logs, plus the existing window.png at the end. Off by default (0).
  • Skip a frame identical to the previous one (same hash), so a static screen costs one file. Print one summary line, e.g. window captures: 12 saved, 7 unchanged skipped, first change at 74 s.
  • Bound the cost: a cap on the number of files (e.g. 120) and on resolution (the existing 1920x1080 clamp). The capture must not stall the debug event loop: run it off the loop thread, or make the pixel conversion fast enough that one capture stays well under the input script's step.
  • Reuse the existing PNG writer and refactor capture_window() into a helper that both the timer and the end-of-run capture call.

Tests. A Linux check of the pure parts (file naming, duplicate skip, file cap, summary line). A Windows check that launches the existing source-built windowed fixture with --capture-every 1, changes its picture at a known time, and asserts the saved files show the change and that unchanged frames were skipped.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6625691267 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/2819). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-26T11:29:14Z. --- Part of #870 **Problem.** `tools/startup/debug_launch.py` saves the title's window (client area) once, as `window.png`, when the run ends (`capture_window()`). A run that passes several screens, or stops on one, leaves only the last picture. Testers who drive the title with `X2W_INPUT_SCRIPT` cannot tell which screen an input reached, when the picture changed, or whether a later screen ever appeared. **Proposal.** - `debug_launch.py --capture-every <seconds>` (and `run.ps1 -CaptureEvery`, `run.sh --capture-every`): save the client area every N seconds as `window_<sss>s.png` next to the logs, plus the existing `window.png` at the end. Off by default (0). - Skip a frame identical to the previous one (same hash), so a static screen costs one file. Print one summary line, e.g. `window captures: 12 saved, 7 unchanged skipped, first change at 74 s`. - Bound the cost: a cap on the number of files (e.g. 120) and on resolution (the existing 1920x1080 clamp). The capture must not stall the debug event loop: run it off the loop thread, or make the pixel conversion fast enough that one capture stays well under the input script's step. - Reuse the existing PNG writer and refactor `capture_window()` into a helper that both the timer and the end-of-run capture call. **Tests.** A Linux check of the pure parts (file naming, duplicate skip, file cap, summary line). A Windows check that launches the existing source-built windowed fixture with `--capture-every 1`, changes its picture at a known time, and asserts the saved files show the change and that unchanged frames were skipped.
tedin7 commented 2026-11-26 12:04:56 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T11:29:18Z.


Taking this one; a Draft PR will follow.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7190791597 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/2819#issuecomment-7190791597). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-26T11:29:18Z. --- Taking this one; a Draft PR will follow.
Sign in to join this conversation.
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
R0Y00/Xbox2Windows#2811
No description provided.