Repository navigation
Description
Search existing issues
- I have searched the existing issues
Describe the bug
Follow-up to #252 (closed as completed) — the stop hang still reproduces on 2.2.2,
and on this machine the stall point is different from what #306 fixed.
Every recording ends with: "Timed out waiting for native Windows capture to stop.
The recording could not be saved." The recording is discarded — no file is written.
From the Save Diagnostics traces (JSONs attached):
- The pull-based fix (fix(wgc): pull-based frame delivery to stop CopyResource wedging the stop path #306) is active and healthy: wgc-quiesce reports
drained=true mode=pull; video-writer-join completes in ~20 ms. - capture-adapter: sameAdapter=true (RX 9070 XT on both sides) — not cross-adapter.
- The stall is in encoder-finalize: full 50 s timeout, abandoned with
encode_stage=idle, audio_stage=idle — the D3D12 hardware encoder never completes
finalize even though its encode stage is idle. Helper reports: "The recorder
stalled while shutting down (encoder-finalize)." - With the software encoder on the same input path, finalize completes in ~47 ms
and the file saves — the pipeline around the encoder is fine; it is the hardware
encoder's finalize/flush that wedges.
Workarounds tested:
- OPENSCREEN_WGC_PREFER_SOFTWARE_ENCODER=1: recordings save reliably. Works.
- OPENSCREEN_WGC_ENABLE_DXGI_INPUT=1 (hardware encoder, dxgi-nv12 input): still hangs
at encoder-finalize; additionally "Allocate DXGI video sample failed (hr=0xc00d4a3e)"
during the run. Fails. - Default (cpu-rgb32 input + hardware encoder): hangs on every stop. Fails.
Hardware: AMD Radeon RX 9070 XT, driver 32.0.32015.7029 (Adrenalin 26.10.1 WHQL),
plus integrated AMD Radeon Graphics (Granite Ridge APU, no displays attached).
Both monitors are on the discrete card (2560x1440@165 DP + 1920x1080@72 HDMI).
Reproduces on a clean, up-to-date driver install.
Expected behavior
Stopping the recording finalizes the hardware encoder within a reasonable time and
saves the file, as it does with the software encoder (finalize ~47 ms).
To Reproduce
- Launch OpenScreen (default settings — hardware D3D12 encoder, cpu-rgb32 input).
- Start a recording (either a window or a full display source).
- Record for any length of time (tried ~1 s to ~1 min).
- Stop the recording.
- Observe the error "Timed out waiting for native Windows capture to stop. The
recording could not be saved."
Screenshots
No response
OS
Windows
OS Version
Windows 11 Pro 26H2 (build 26300)
Other OS
No response
Browser
None
Browser Version
No response
Other Browser
No response
Device Type
Desktop
Other Device
No response
Additional context
- Diagnostics JSONs from failing sessions attached (cpu-rgb32 + hardware encoder,
and dxgi-nv12 + hardware encoder). The software-encoder run (successful,
finalize ~47 ms) can be attached on request. - Issue reproduced on both the GitHub release (NSIS installer) and the Microsoft
Store build, both version 2.2.2.0. - Happy to run further diagnostics: specific builds, driver downgrade/upgrade,
registry experiments.
openscreen-diagnostic-1794619112962.json
openscreen-diagnostic-1794618665389_dxgi.json
Activity
EtienneLescot commentedon Nov 14, 2026
Thanks a lot for the detailed report and diagnostics! #1545 should help here: when the hardware encoder stalls on stop, the helper now gives up after 5 s instead of 50, and the following recordings on that GPU use the software encoder automatically. The take that stalls is still lost, since the encoder produced nothing for it. Once its CI build is ready, could you try it and share a diagnostic from a stop?
9-th commentedon Nov 14, 2026
Thanks for the quick turnaround! I'll test the CI build as soon as it's available
and post a Save Diagnostics export from a stop.
fix(windows): stop waiting on a hardware encoder that never drains
fix(windows): stop waiting on a hardware encoder that never drains
fix(windows): join the finalize worker and replace the adapter file a…
fix(windows): keep a failed adapter temp cleanup out of the stop result
fix(windows): keep a failed adapter temp cleanup out of the stop result
9-th commentedon Nov 14, 2026
Ran the diagnostic bundle from PR #1545 CI (standalone tool, full display, 10 s,
no audio). Confirmed: encoder-finalize is now abandoned after ~5 s with
reason=hardware-encoder-stalled, and the helper reports the adapter:
"hardware-encoder-stalled, adapter: AMD Radeon RX 9070 XT". All upstream stop
steps complete in 0-12 ms; the RX 9070 XT hardware H.264 encoder takes frames
and never produces one. JSON attached.
openscreen-diagnostic-1794690601474.json
fix(windows): stop waiting on a hardware encoder that never drains
fix(windows): join the finalize worker and replace the adapter file a…
fix(windows): keep a failed adapter temp cleanup out of the stop result
EtienneLescot commentedon Nov 15, 2026
Merged. The next build stops quickly on a stalled hardware encoder and records later takes on the software encoder for that GPU.
fix(windows): stop waiting on a hardware encoder that never drains
fix(windows): join the finalize worker and replace the adapter file a…
fix(windows): keep a failed adapter temp cleanup out of the stop result
EtienneLescot commentedon Nov 17, 2026
Fixed in v2.3.0: a stalled hardware encoder is now abandoned after about 5 s on stop, and later takes on that GPU use the software encoder. Thanks again for the diagnostics, @9-th! Feel free to reopen if a stop still hangs on this version.